projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cae9317
)
BankTransaction::get_agreement_with_invoice - sepa_export_items optional übergeben
author
Sven Schöling
<s.schoeling@linet-services.de>
Wed, 28 Mar 2018 09:31:22 +0000
(11:31 +0200)
committer
Jan Büren
<jan@kivitendo-premium.de>
Mon, 9 Jul 2018 09:54:05 +0000
(11:54 +0200)
SL/DB/BankTransaction.pm
patch
|
blob
|
history
diff --git
a/SL/DB/BankTransaction.pm
b/SL/DB/BankTransaction.pm
index
e4cf67c
..
511c15f
100644
(file)
--- a/
SL/DB/BankTransaction.pm
+++ b/
SL/DB/BankTransaction.pm
@@
-53,7
+53,7
@@
sub is_batch_transaction {
sub get_agreement_with_invoice {
sub get_agreement_with_invoice {
- my ($self, $invoice) = @_;
+ my ($self, $invoice
, %params
) = @_;
carp "get_agreement_with_invoice needs an invoice object as its first argument"
unless ref($invoice) eq 'SL::DB::Invoice' or ref($invoice) eq 'SL::DB::PurchaseInvoice';
carp "get_agreement_with_invoice needs an invoice object as its first argument"
unless ref($invoice) eq 'SL::DB::Invoice' or ref($invoice) eq 'SL::DB::PurchaseInvoice';
@@
-221,7
+221,10
@@
sub get_agreement_with_invoice {
}
# if there is exactly one non-executed sepa_export_item for the invoice
}
# if there is exactly one non-executed sepa_export_item for the invoice
- if ( my $seis = $invoice->find_sepa_export_items({ executed => 0 }) ) {
+ my $seis = $params{sepa_export_items}
+ ? [ grep { $invoice->id == ($invoice->is_sales ? $_->ar_id : $_->ap_id) } @{ $params{sepa_export_items} } ]
+ : $invoice->find_sepa_export_items({ executed => 0 });
+ if ($seis) {
if (scalar @$seis == 1) {
my $sei = $seis->[0];
if (scalar @$seis == 1) {
my $sei = $seis->[0];