From: Bill Erickson Date: Fri, 4 May 2012 13:18:10 +0000 (-0400) Subject: Check if transaction needs closing after adding billings X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=36e85252445dba320d965b4338adc2405094fdfb;p=contrib%2FConifer.git Check if transaction needs closing after adding billings This addresses the issue where issuing refunds results in a negative ballance and it is then impossible to close the transaction by creating new billings. https://bugs.launchpad.net/evergreen/+bug/758982 Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm index 1058e8c342..6ef33f7db4 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm @@ -702,6 +702,10 @@ sub billing_items_create { $e->create_money_billing($billing) or return $e->die_event; my $evt = OpenILS::Utils::Penalty->calculate_penalties($e, $xact->usr, $U->xact_org($xact->id,$e)); return $evt if $evt; + + $evt = _check_open_xact($e, $xact->id, $xact); + return $evt if $evt; + $e->commit; return $billing->id;