]> wagnertech.de Git - mfinanz.git/blobdiff - SL/IS.pm
Auslagern über Rechnung: Dienstleistungen wirklich ignorieren, falls konfiguriert
[mfinanz.git] / SL / IS.pm
index a41ec014bfb418e0c17b9c48c7f54b077e54faa7..30570c059e8e31007f7c9980851e1549cdac6af7 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -375,7 +375,7 @@ sub invoice_details {
 
       CVar->get_non_editable_ic_cvars(form               => $form,
                                       dbh                => $dbh,
-                                      row                => $i, 
+                                      row                => $i,
                                       sub_module         => 'invoice',
                                       may_converted_from => ['delivery_order_items', 'orderitems', 'invoice']);
 
@@ -761,7 +761,7 @@ sub post_invoice {
 
       CVar->get_non_editable_ic_cvars(form               => $form,
                                       dbh                => $dbh,
-                                      row                => $i, 
+                                      row                => $i,
                                       sub_module         => 'invoice',
                                       may_converted_from => ['delivery_order_items', 'orderitems', 'invoice']);
 
@@ -1298,7 +1298,7 @@ SQL
 sub transfer_out {
   $::lxdebug->enter_sub;
 
-  my ($self, $form, $dbh) = @_; 
+  my ($self, $form, $dbh) = @_;
 
   my (@errors, @transfers);
 
@@ -1316,7 +1316,7 @@ sub transfer_out {
                                                        $form->{"id_$i"},
                                                        $form->{"qty_$i"},
                                                        $form->{"unit_$i"});
-
+    next if ($err eq 'ignore service');
     if (!@{ $err } && $wh_id && $bin_id) {
       push @transfers, {
         'parts_id'         => $form->{"id_$i"},
@@ -1327,6 +1327,7 @@ sub transfer_out {
         'src_bin_id'       => $bin_id,
         'project_id'       => $form->{"project_id_$i"},
         'invoice_id'       => $form->{"invoice_id_$i"},
+        'comment'          => $::locale->text("Default transfer invoice"),
       };
     }
 
@@ -1352,7 +1353,7 @@ sub _determine_wh_and_bin {
   # ignore service if they are not configured to be transfered
   if ($part->is_service && !$conf->get_transfer_default_services) {
     $::lxdebug->leave_sub(2);
-    return;
+    return 'ignore service';
   }
 
   # test negative qty
@@ -1384,7 +1385,7 @@ sub _determine_wh_and_bin {
     my $diff_qty      = $max_qty - $part_unit_qty;
     if (!@errors && $diff_qty < 0) {
       push @errors, $::locale->text("For part \"#1\" there are missing #2 #3 in the default warehouse/bin \"#4/#5\"",
-                                    $part->description, 
+                                    $part->description,
                                     $::form->format_amount(\%::myconfig, -1*$diff_qty),
                                     $part->unit_obj->name,
                                     SL::DB::Warehouse->new(id => $wh_id)->load->description,