Bug 24637

Summary: Pay selected & Pay amount does not log branchcode in 19.05
Product: Koha Reporter: Lucas Gass <lucas>
Component: Fines and feesAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: kelly, martin.renvoize
Version: 19.05   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.08
Attachments: Bug 24637: Add brancode in all pay circumstances
Bug 24637: Add brancode in all pay circumstances
Bug 24637: Add brancode in all pay circumstances

Description Lucas Gass 2020-02-11 22:37:44 UTC
When paying a fine (in 19.05.x) and lower branchcode is not properly logged. 

I believe this is fixed in 19.11.x by bz23321

To Recreate:
1. Have some fines. Pay them using the Pay Amount or Pay Selected buttons.
2. SELECT branchcode FROM accountlines where borrowernumber = '{borrowernumber}';
3. See that branchcode is NULL
Comment 1 Lucas Gass 2020-02-11 22:59:06 UTC
Created attachment 98734 [details] [review]
Bug 24637: Add brancode in all pay circumstances

To TEST:
1. Have some fines. Pay them using the Pay Amount or Pay Selected buttons.
2. SELECT branchcode FROM accountlines where borrowernumber = '{borrowernumber}';
3. See that branchcode is NULL
4. Apply patch and restart_all
5. Make a partial payment using both the Pay select and Pay amount buttons.
6. SELECT branchcode FROM accountlines where borrowernumber = '{borrowernumber}';
7. Now you should see the branchcodes in the table and no NULL values.
Comment 2 Kelly McElligott 2020-02-12 10:56:42 UTC
Lucas, I am getting this error:
Could not compile /kohadevbox/koha/members/paycollect.pl: Global symbol "@acc" requires explicit package name (did you forget to declare "my @acc"?) at /kohadevbox/koha/members/paycollect.pl line 214.
Global symbol "$select" requires explicit package name (did you forget to declare "my $select"?) at /kohadevbox/koha/members/paycollect.pl line 214.
Global symbol "$note" requires explicit package name (did you forget to declare "my $note"?) at /kohadevbox/koha/members/paycollect.pl line 215.
Global symbol "@lines" requires explicit package name (did you forget to declare "my @lines"?) at /kohadevbox/koha/members/paycollect.pl line 217.
Global symbol "$branch" requires explicit package name (did you forget to declare "my $branch"?) at /kohadevbox/koha/members/paycollect.pl line 234.
Global symbol "@lines" requires explicit package name (did you forget to declare "my @lines"?) at /kohadevbox/koha/members/paycollect.pl line 235.
Global symbol "$note" requires explicit package name (did you forget to declare "my $note"?) at /kohadevbox/koha/members/paycollect.pl line 236.
syntax error at /kohadevbox/koha/members/paycollect.pl line 241, near ">>"
Global symbol "$branch" requires explicit package name (did you forget to declare "my $branch"?) at /kohadevbox/koha/members/paycollect.pl line 251.
syntax error at /kohadevbox/koha/members/paycollect.pl line 271, near "if"
/kohadevbox/koha/members/paycollect.pl has too many errors.
 at /usr/share/perl5/CGI/Compile.pm line 132
Comment 3 Lucas Gass 2020-02-12 15:01:16 UTC
Kelly,

I think this is because this patch is intended for 19.05.x, and maybe you're attempting to apply it to master?
Comment 4 Benjamin Daeuber 2020-02-19 21:08:59 UTC
Created attachment 99279 [details] [review]
Bug 24637: Add brancode in all pay circumstances

Signed-off-by: Benjamin Daeuber <bdaeuber@fargolibrary.org>
Comment 5 Martin Renvoize 2020-02-19 21:49:40 UTC
Created attachment 99285 [details] [review]
Bug 24637: Add brancode in all pay circumstances

To TEST:
1. Have some fines. Pay them using the Pay Amount or Pay Selected buttons.
2. SELECT branchcode FROM accountlines where borrowernumber = '{borrowernumber}';
3. See that branchcode is NULL
4. Apply patch and restart_all
5. Make a partial payment using both the Pay select and Pay amount buttons.
6. SELECT branchcode FROM accountlines where borrowernumber = '{borrowernumber}';
7. Now you should see the branchcodes in the table and no NULL values.

Signed-off-by: Benjamin Daeuber <bdaeuber@fargolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2020-02-19 21:50:08 UTC
Works as expected.. Passing QA
Comment 7 Lucas Gass 2020-02-20 15:46:48 UTC
backported to 19.05.x for 19.05.08