Revision bd906dbe
Von Jan Büren vor fast 2 Jahren hinzugefügt
SL/Dev/Payment.pm | ||
---|---|---|
70 | 70 |
my $record = delete $params{record}; |
71 | 71 |
die "bank_transactions can only be created for invoices" unless ref($record) eq 'SL::DB::Invoice' or ref($record) eq 'SL::DB::PurchaseInvoice'; |
72 | 72 |
|
73 |
my $multiplier = $record->is_sales ? 1 : -1; |
|
73 |
my $multiplier = $record->invoice_type =~ m/^purchase_invoice$|^ap_transaction$|^credit_note$/ ? -1 |
|
74 |
: $record->invoice_type =~ m/invoice|ar_transaction|^purchase_credit_note$/ ? 1 |
|
75 |
: die "invalid state"; |
|
74 | 76 |
my $amount = (delete $params{amount} || $record->amount) * $multiplier; |
75 | 77 |
|
76 | 78 |
my $bank_chart; |
Auch abrufbar als: Unified diff
Vorzeichen für create_bank_transaction logisch richtiger setzen
Entsprechend müssen bei den Testfällen absolute Werte übergeben werden.