X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FBankTransaction.pm;h=e91651a98bcb5373f6c9fd9a593e132da70102bb;hb=f5df17caa4a22bcb8abe4910b837ec86a84ba9f0;hp=053abb4105b43293e29104ad2b5c9273aaa0312c;hpb=68ccd089c525fd41d00266fe493cd52a9dbb6513;p=kivitendo-erp.git diff --git a/SL/DB/BankTransaction.pm b/SL/DB/BankTransaction.pm index 053abb410..e91651a98 100644 --- a/SL/DB/BankTransaction.pm +++ b/SL/DB/BankTransaction.pm @@ -112,6 +112,7 @@ sub get_agreement_with_invoice { if ( $invoice->skonto_date && abs(abs($invoice->amount_less_skonto) - abs($self->amount)) < 0.01) { $agreement += $points{skonto_exact_amount}; $rule_matches .= 'skonto_exact_amount(' . $points{'skonto_exact_amount'} . ') '; + $invoice->{skonto_type} = 'with_skonto_pt'; }; #search invoice number in purpose @@ -208,27 +209,27 @@ sub get_agreement_with_invoice { }; }; - # if there is exactly one non-executed sepa_export_item for the invoice - if ( my $seis = $invoice->find_sepa_export_items({ executed => 0 }) ) { - if ( scalar @$seis == 1 ) { - my $sei = $seis->[0]; - - # test for amount and id matching only, sepa transfer date and bank - # transaction date needn't match - my $arap = $invoice->is_sales ? 'ar' : 'ap'; - if ( abs($self->amount) == ($sei->amount) - && $invoice->id == $sei->arap_id - ) { - $agreement += $points{sepa_export_item}; - $rule_matches .= 'sepa_export_item(' . $points{'sepa_export_item'} . ') '; - }; - } else { - # zero or more than one sepa_export_item, do nothing for this invoice - # zero: do nothing, no sepa_export_item exists, no match - # more than one: does this ever apply? Currently you can't create sepa - # exports for invoices that already have a non-executed sepa_export - }; - }; +# # if there is exactly one non-executed sepa_export_item for the invoice +# if ( my $seis = $invoice->find_sepa_export_items({ executed => 0 }) ) { +# if ( scalar @$seis == 1 ) { +# my $sei = $seis->[0]; +# +# # test for amount and id matching only, sepa transfer date and bank +# # transaction date needn't match +# my $arap = $invoice->is_sales ? 'ar' : 'ap'; +# if ( abs($self->amount) == ($sei->amount) +# && $invoice->id == $sei->arap_id +# ) { +# $agreement += $points{sepa_export_item}; +# $rule_matches .= 'sepa_export_item(' . $points{'sepa_export_item'} . ') '; +# }; +# } else { +# # zero or more than one sepa_export_item, do nothing for this invoice +# # zero: do nothing, no sepa_export_item exists, no match +# # more than one: does this ever apply? Currently you can't create sepa +# # exports for invoices that already have a non-executed sepa_export +# }; +# }; return ($agreement,$rule_matches); };