From c301c2b3be223fe384bea2d899c6a08de54c21de Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 1 Mar 2019 14:52:48 +0100 Subject: [PATCH] BankTransaction new method not_assigned_amount returns the current open amount of this bank transaction. Added to POD --- SL/DB/BankTransaction.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 -- 2.20.1