Created attachment 47684 [details] [review] Bug 15746: Do not record individual payments with randomly picked libraries When a payment is made individualy, the library used to record this payment is randomly picked from the library list. This is because C4::Branch::GetBranch looks at 1. the $branch variable sent by the template, wich does not exist, then 2. the branchname cookie, which does not exist neither, then 3. get the first branchcode from a list of keys (non ordered). To reproduce: - Create a manual invoice for a patron (members/maninvoice.pl?borrowernumber=XXXX) - Pay this fine using the "Pay" button of the corresponding line from the members/pay.pl?borrowernumber=XXXX page Look at the statistics table: select * from statistics order by datetime desc limit 10; The branch value of the first line might not correspond to the library you were using to pay the payment. Test plan: Apply this patch, repeat the steps above and confirm that the library picked is now the one used to pay.
Created attachment 47685 [details] [review] Bug 15746: Same fix for "write off" Same fix as before for the "Write off" button next to the "Pay" button.
Created attachment 47702 [details] [review] [SIGNED-OFF]Bug 15746: Do not record individual payments with randomly picked libraries When a payment is made individualy, the library used to record this payment is randomly picked from the library list. This is because C4::Branch::GetBranch looks at 1. the $branch variable sent by the template, wich does not exist, then 2. the branchname cookie, which does not exist neither, then 3. get the first branchcode from a list of keys (non ordered). To reproduce: - Create a manual invoice for a patron (members/maninvoice.pl?borrowernumber=XXXX) - Pay this fine using the "Pay" button of the corresponding line from the members/pay.pl?borrowernumber=XXXX page Look at the statistics table: select * from statistics order by datetime desc limit 10; The branch value of the first line might not correspond to the library you were using to pay the payment. Test plan: Apply this patch, repeat the steps above and confirm that the library picked is now the one used to pay. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised
Created attachment 47703 [details] [review] [SIGNED-OFF]Bug 15746: Same fix for "write off" Same fix as before for the "Write off" button next to the "Pay" button. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Created attachment 47974 [details] [review] Bug 15746: Do not record individual payments with randomly picked libraries When a payment is made individualy, the library used to record this payment is randomly picked from the library list. This is because C4::Branch::GetBranch looks at 1. the $branch variable sent by the template, wich does not exist, then 2. the branchname cookie, which does not exist neither, then 3. get the first branchcode from a list of keys (non ordered). To reproduce: - Create a manual invoice for a patron (members/maninvoice.pl?borrowernumber=XXXX) - Pay this fine using the "Pay" button of the corresponding line from the members/pay.pl?borrowernumber=XXXX page Look at the statistics table: select * from statistics order by datetime desc limit 10; The branch value of the first line might not correspond to the library you were using to pay the payment. Test plan: Apply this patch, repeat the steps above and confirm that the library picked is now the one used to pay. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 47975 [details] [review] Bug 15746: Same fix for "write off" Same fix as before for the "Write off" button next to the "Pay" button. Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to Master - Should be in the May 2016 Release. Thanks
Patches pushed to 3.22.x, will be in 3.22.4
This patch has been pushed to 3.20.x, will be in 3.20.9.