]> git.koha-community.org Git - koha.git/commit
Bug 15746: Do not record individual payments with randomly picked libraries
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 5 Feb 2016 10:46:28 +0000 (10:46 +0000)
committerFrédéric Demians <f.demians@tamil.fr>
Tue, 1 Mar 2016 14:36:44 +0000 (15:36 +0100)
commit7212c515ac9d620123c5aa6445072599710b1621
tree462e2e6f3bdb8d04b269a58a95874bab79957f87
parent841642e77c60d2775378827e802f426cf4236915
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>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
(cherry picked from commit 80a690588ceac464891dcb2956c3b148433a253c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit f2c6d5ad4f042ddcbf7127bc5d440cd8032cc8f4)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
members/paycollect.pl