]> wagnertech.de Git - mfinanz.git/commitdiff
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
authorJan Büren <jan@kivitendo-premium.de>
Fri, 26 Jun 2015 09:36:45 +0000 (11:36 +0200)
committerJan Büren <jan@kivitendo-premium.de>
Fri, 26 Jun 2015 09:36:45 +0000 (11:36 +0200)
SL/DB/DeliveryOrder.pm
SL/DB/Invoice.pm
bin/mozilla/io.pl

index 3afd591626ad6e3fcc5043b8d7830960575b5e38..94725a8d02c54f42bde1393e1f5f2349cb6b4928 100644 (file)
@@ -160,6 +160,7 @@ sub new_from {
 
   } @{ $items };
 
+  @items = grep { $params{item_filter}->($_) } @items if $params{item_filter};
   @items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty};
   @items = grep { $_->qty >=0 } @items if $params{skip_items_negative_qty};
 
@@ -245,6 +246,12 @@ a quantity of 0 are not affected by this option.
 
 If trueish then items with a quantity of 0 are skipped.
 
+=item C<item_filter>
+
+An optional code reference that is called for each item with the item
+as its sole parameter. Items for which the code reference returns a
+falsish value will be skipped.
+
 =item C<attributes>
 
 An optional hash reference. If it exists then it is passed to C<new>
index 82cf66b5e2ce00de33ef6422443ec79016b4820b..8bfc918e83bc6bb239ffd58cf2b1823c138f7327 100644 (file)
@@ -203,6 +203,7 @@ sub new_from {
     $current_invoice_item;
   } @{ $items };
 
+  @items = grep { $params{item_filter}->($_) } @items if $params{item_filter};
   @items = grep { $_->qty * 1 } @items if $params{skip_items_zero_qty};
   @items = grep { $_->qty >=0 } @items if $params{skip_items_negative_qty};
 
@@ -411,6 +412,12 @@ a quantity of 0 are not affected by this option.
 
 If trueish then items with a quantity of 0 are skipped.
 
+=item C<item_filter>
+
+An optional code reference that is called for each item with the item
+as its sole parameter. Items for which the code reference returns a
+falsish value will be skipped.
+
 =item C<attributes>
 
 An optional hash reference. If it exists then it is passed to C<new>
index 2ef7319e7f14c230c82e17f8cc4f5ecf35da0a19..6b4cad7a6f5ebca10f72d04802fb0a4f17823f28 100644 (file)
@@ -762,15 +762,6 @@ sub check_form {
     $form->{creditremaining} -= &invoicetotal;
   }
 
-  #sk
-  # if pricegroups
-  if (   $form->{type} =~ (/sales_quotation/)
-      or (($form->{level} =~ /Sales/) and ($form->{type} =~ /invoice/))
-      or (($form->{level} eq undef) and ($form->{type} =~ /invoice/))
-      or ($form->{type} =~ /sales_order/)) {
-
-  }
-
   &display_form;
 
   $main::lxdebug->leave_sub();