From 8756b9e2c08700300d6973df70869bd87dd93601 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 7 Jan 2019 14:06:01 -0300 Subject: [PATCH] Bug 22066: Record library_id for manual credits On creating manual credits, the (newly introduced) branchcode should be set now. This trivial patch makes it work. To test: - Create a manual credit for a known patron - Using MySQL check the result: $ sudo mysql > SELECT * FROM accountlines WHERE borrowernumber=; => FAIL: The created accountline row has NULL for the branchcode - Apply this patch - Create a manual credit for the patron - Run: > SELECT * FROM accountlines WHERE borrowernumber=; => SUCCESS: branchcode is set correctly -Sign off :-D Signed-off-by: Owen Leonard Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens (cherry picked from commit 094a1cb0703b22d18c061cdc4879c1fc3c76ea80) Signed-off-by: Martin Renvoize --- members/mancredit.pl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/members/mancredit.pl b/members/mancredit.pl index 6da0fe256f..014d822486 100755 --- a/members/mancredit.pl +++ b/members/mancredit.pl @@ -81,10 +81,13 @@ if ($add){ my $amount = $input->param('amount') || 0; my $type = $input->param('type'); + my $library_id = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; + $patron->account->add_credit({ amount => $amount, description => $description, item_id => $item_id, + library_id => $library_id, note => $note, type => $type, user_id => $logged_in_user->id -- 2.39.5