Summary: | paycollect.pl should pass library_id when adding accountlines | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Architecture, internals, and plumbing | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Josef Moravec <josef.moravec> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, josef.moravec, martin.renvoize, mtompset |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.11.00
|
|
Circulation function: | |||
Bug Depends on: | 19066 | ||
Bug Blocks: | |||
Attachments: |
Bug 21801: Make paycollect.pl pass library_id when calling ->pay
Bug 21801: (follow-up) Use ->account Bug 21801: Make paycollect.pl pass library_id when calling ->pay Bug 21801: (follow-up) Use ->account Bug 21801: Make paycollect.pl pass library_id when calling ->pay Bug 21801: (follow-up) Use ->account |
Description
Tomás Cohen Arazi (tcohen)
2018-11-09 14:33:06 UTC
Created attachment 82172 [details] [review] Bug 21801: Make paycollect.pl pass library_id when calling ->pay This patch makes paycollect store the branchcode of the current library when payments are done. - Try all the possible options, specially selecting things to pay for (not using the individual buttons). - Check on the DB, that the accountlines for the patron you're playin with have the branchcode stored correctly in all cases: $ sudo koha-mysql kohadev > SELECT * FROM accountlines WHERE borrowernumber=<the_bn>; => SUCCESS: Things are as expected - SIgn off :-D Created attachment 82173 [details] [review] Bug 21801: (follow-up) Use ->account This patch is a minor refactoring, that reuses the $account object we already get from $patron, instead of creating new ones all over the place. Code gets simpler to read too. (In reply to Tomás Cohen Arazi from comment #2) > Created attachment 82173 [details] [review] [review] > Bug 21801: (follow-up) Use ->account > > This patch is a minor refactoring, that reuses the $account object we > already get from $patron, instead of creating new ones all over the > place. Code gets simpler to read too. And given the use of the variable, probably is faster too. Nice. :) Comment on attachment 82173 [details] [review] Bug 21801: (follow-up) Use ->account Review of attachment 82173 [details] [review]: ----------------------------------------------------------------- ::: members/paycollect.pl @@ +59,4 @@ > my $category = $patron->category; > my $user = $input->remote_user; > > +my $library_id = C4::Context->userenv->{'branch'}; Just had to rename $branch to library_id to fit the _id structure of thinking. :) Comment on attachment 82172 [details] [review] Bug 21801: Make paycollect.pl pass library_id when calling ->pay Review of attachment 82172 [details] [review]: ----------------------------------------------------------------- ::: members/paycollect.pl @@ +168,4 @@ > Koha::Account->new( { patron_id => $borrowernumber } )->pay( > { > amount => $total_paid, > + library_id => $branch, Strange how, it was passed in a place above, but not these two changes. Created attachment 91199 [details] [review] Bug 21801: Make paycollect.pl pass library_id when calling ->pay This patch makes paycollect store the branchcode of the current library when payments are done. - Try all the possible options, specially selecting things to pay for (not using the individual buttons). - Check on the DB, that the accountlines for the patron you're playin with have the branchcode stored correctly in all cases: $ sudo koha-mysql kohadev > SELECT * FROM accountlines WHERE borrowernumber=<the_bn>; => SUCCESS: Things are as expected - SIgn off :-D Created attachment 91200 [details] [review] Bug 21801: (follow-up) Use ->account This patch is a minor refactoring, that reuses the $account object we already get from $patron, instead of creating new ones all over the place. Code gets simpler to read too. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 91248 [details] [review] Bug 21801: Make paycollect.pl pass library_id when calling ->pay This patch makes paycollect store the branchcode of the current library when payments are done. - Try all the possible options, specially selecting things to pay for (not using the individual buttons). - Check on the DB, that the accountlines for the patron you're playin with have the branchcode stored correctly in all cases: $ sudo koha-mysql kohadev > SELECT * FROM accountlines WHERE borrowernumber=<the_bn>; => SUCCESS: Things are as expected - SIgn off :-D Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Created attachment 91249 [details] [review] Bug 21801: (follow-up) Use ->account This patch is a minor refactoring, that reuses the $account object we already get from $patron, instead of creating new ones all over the place. Code gets simpler to read too. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Nice work! Pushed to master for 19.11.00 Enhancement not pushed to 19.05.x |