]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/Manager/Invoice.pm
kivitendo 3.9.2-0.2
[mfinanz.git] / SL / DB / Manager / Invoice.pm
index 5dc943f85dd39355d610718ae79f9a62de4838d8..39836dd6b53c9041b98db13ff3870eb7f2c9256b 100644 (file)
@@ -16,11 +16,14 @@ sub type_filter {
   my $type  = lc(shift || '');
 
   return (or  => [ invoice => 0, invoice => undef                                               ]) if $type eq 'ar_transaction';
+  return (type => 'invoice_for_advance_payment'                                                  ) if $type eq 'invoice_for_advance_payment';
+  return (and => [ type => 'invoice_for_advance_payment', amount => { lt => 0 }                 ]) if $type eq 'invoice_for_advance_payment_storno';
+  return (type => 'final_invoice'                                                                ) if $type eq 'final_invoice';
   return (and => [ invoice => 1, amount  => { ge => 0 }, or => [ storno => 0, storno => undef ] ]) if $type =~ m/^(?:sales_)?invoice$/;
   return (and => [ invoice => 1, amount  => { lt => 0 }, or => [ storno => 0, storno => undef ] ]) if $type eq 'credit_note';
   return (and => [ invoice => 1, amount  => { lt => 0 },         storno => 1                    ]) if $type =~ m/(?:invoice_)?storno/;
   return (and => [ invoice => 1, amount  => { ge => 0 },         storno => 1                    ]) if $type eq 'credit_note_storno';
-  return (amount => {gt => 'paid'}) if $type eq 'open';
+  return (amount => {gt => \'paid'}) if $type eq 'open';
 
   die "Unknown type $type";
 }