From 61ee312837354cef6777a0eb116e3ca0a0c34dd9 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 8 Nov 2018 12:34:17 -0300 Subject: [PATCH] Bug 21788: Make ProcessOfflinePayment pass the library_id parameter To test: - Run: $ kshell k$ prove t/db_dependent/Circulation.t => FAIL: branchcode is not set - Apply this patch - Run: $ kshell k$ prove t/db_dependent/Circulation.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Kyle M Hall --- C4/Circulation.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 951f65f662..2a2bcab255 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3837,15 +3837,13 @@ sub ProcessOfflineIssue { sub ProcessOfflinePayment { my $operation = shift; - my $patron = Koha::Patrons->find( { cardnumber => $operation->{cardnumber} }); - my $amount = $operation->{amount}; + my $patron = Koha::Patrons->find({ cardnumber => $operation->{cardnumber} }); - Koha::Account->new( { patron_id => $patron->id } )->pay( { amount => $amount } ); + $patron->account->pay({ amount => $operation->{amount}, library_id => $operation->{branchcode} }); - return "Success." + return "Success."; } - =head2 TransferSlip TransferSlip($user_branch, $itemnumber, $barcode, $to_branch) -- 2.17.2 (Apple Git-113)