Merge branch 'master' of ssh://lx-office/~/lx-office-erp
[kivitendo-erp.git] / bin / mozilla / do.pl
index 1c546e4..4ae7f45 100644 (file)
@@ -359,7 +359,7 @@ sub update_delivery_order {
     my $rows = scalar @{ $form->{item_list} };
 
     if ($rows) {
-      $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
+      $form->{"qty_$i"} = 1 unless $form->parse_amount(\%myconfig, $form->{"qty_$i"});
 
       if ($rows > 1) {
 
@@ -477,7 +477,7 @@ sub orders {
     'donumber'                => { 'text' => $locale->text('Delivery Order'), },
     'ordnumber'               => { 'text' => $locale->text('Order'), },
     'name'                    => { 'text' => $form->{vc} eq 'customer' ? $locale->text('Customer') : $locale->text('Vendor'), },
-    'employee'                => { 'text' => $locale->text('Salesperson'), },
+    'employee'                => { 'text' => $locale->text('Employee'), },
     'shipvia'                 => { 'text' => $locale->text('Ship via'), },
     'globalprojectnumber'     => { 'text' => $locale->text('Project Number'), },
     'transaction_description' => { 'text' => $locale->text('Transaction description'), },
@@ -872,6 +872,7 @@ sub save_as_new {
   $form->{closed}    = 0;
   $form->{delivered} = 0;
   map { delete $form->{$_} } qw(printed emailed queued);
+  delete @{ $form }{ grep { m/^stock_(?:in|out)_\d+/ } keys %{ $form } };
 
   # Let Lx-Office assign a new order number if the user hasn't changed the
   # previous one. If it has been changed manually then use it as-is.
@@ -1206,10 +1207,10 @@ sub transfer_in {
 
       my $do_base_qty = $form->parse_amount(\%myconfig, $form->{"qty_$i"}) * $units->{$form->{"unit_$i"}}->{factor} / $base_unit_factor;
 
-      if ($do_base_qty != $row_sum_base_qty) {
-        push @{ $form->{ERRORS} }, $locale->text('Error in position #1: You must either assign no stock at all or the full quantity of #2 #3.',
-                                                 $i, $form->{"qty_$i"}, $form->{"unit_$i"});
-      }
+#      if ($do_base_qty != $row_sum_base_qty) {
+#        push @{ $form->{ERRORS} }, $locale->text('Error in position #1: You must either assign no stock at all or the full quantity of #2 #3.',
+#                                                 $i, $form->{"qty_$i"}, $form->{"unit_$i"});
+#      }
     }
 
     if (@{ $form->{ERRORS} }) {
@@ -1277,10 +1278,10 @@ sub transfer_out {
 
       my $do_base_qty = $form->parse_amount(\%myconfig, $form->{"qty_$i"}) * $units->{$form->{"unit_$i"}}->{factor} / $base_unit_factor;
 
-      if ($do_base_qty != $row_sum_base_qty) {
-        push @{ $form->{ERRORS} }, $locale->text('Error in position #1: You must either assign no transfer at all or the full quantity of #2 #3.',
-                                                 $i, $form->{"qty_$i"}, $form->{"unit_$i"});
-      }
+#      if ($do_base_qty != $row_sum_base_qty) {
+#        push @{ $form->{ERRORS} }, $locale->text('Error in position #1: You must either assign no transfer at all or the full quantity of #2 #3.',
+#                                                 $i, $form->{"qty_$i"}, $form->{"unit_$i"});
+#      }
     }
 
     if (%request_map) {