From: Jan Büren Date: Fri, 1 Mar 2019 13:52:48 +0000 (+0100) Subject: BankTransaction new method not_assigned_amount X-Git-Tag: release-3.5.4~121 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c301c2b3be223fe384bea2d899c6a08de54c21de;p=kivitendo-erp.git BankTransaction new method not_assigned_amount returns the current open amount of this bank transaction. Added to POD --- diff --git a/SL/DB/BankTransaction.pm b/SL/DB/BankTransaction.pm index cdc181881..9c5b56056 100644 --- a/SL/DB/BankTransaction.pm +++ b/SL/DB/BankTransaction.pm @@ -287,6 +287,16 @@ sub _check_string { return $match; }; + +sub not_assigned_amount { + my ($self) = @_; + + my $not_assigned_amount = $self->amount - $self->invoice_amount; + die ("undefined state") if (abs($not_assigned_amount) > abs($self->amount)); + + return $not_assigned_amount; + +} 1; __END__ @@ -339,6 +349,11 @@ Usage: croak("No linked records at all") unless @{ $bt->linked_invoices() }; +=item C + +Returns the not open amount of this bank transaction. +Dies if the return amount is higher than the original amount. + =back =head1 AUTHOR