From 8009a8f462b05c2885fa4126dcba2ef0185f54f2 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 Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens --- C4/Circulation.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 0a0680ef5a..a544bc22c4 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3841,15 +3841,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.39.5