Bugzilla – Attachment 83744 Details for
Bug 22066
branchcode should be recorded for manual credits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22066: Record library_id for manual credits
Bug-22066-Record-libraryid-for-manual-credits.patch (text/plain), 1.55 KB, created by
Josef Moravec
on 2019-01-09 14:48:50 UTC
(
hide
)
Description:
Bug 22066: Record library_id for manual credits
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2019-01-09 14:48:50 UTC
Size:
1.55 KB
patch
obsolete
>From 9ddb9603c3c56316ee75a711a71b49fe984ec674 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >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=<known_id>; >=> 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=<known_id>; >=> SUCCESS: branchcode is set correctly >-Sign off :-D > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > members/mancredit.pl | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/members/mancredit.pl b/members/mancredit.pl >index 7c5ec3c603..c38f63ff7b 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.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22066
:
83699
|
83742
| 83744