Bug 15746 - A random library is used to record an individual payment
Summary: A random library is used to record an individual payment
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 15758
  Show dependency treegraph
 
Reported: 2016-02-05 10:45 UTC by Jonathan Druart
Modified: 2017-06-14 22:10 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15746: Do not record individual payments with randomly picked libraries (1.79 KB, patch)
2016-02-05 10:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15746: Same fix for "write off" (870 bytes, patch)
2016-02-05 10:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15746: Do not record individual payments with randomly picked libraries (1.88 KB, patch)
2016-02-05 15:34 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15746: Same fix for "write off" (946 bytes, patch)
2016-02-05 15:34 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15746: Do not record individual payments with randomly picked libraries (1.92 KB, patch)
2016-02-12 13:42 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 15746: Same fix for "write off" (984 bytes, patch)
2016-02-12 13:42 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-02-05 10:45:48 UTC

    
Comment 1 Jonathan Druart 2016-02-05 10:53:03 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2016-02-05 10:59:33 UTC Comment hidden (obsolete)
Comment 3 Héctor Eduardo Castro Avalos 2016-02-05 15:34:44 UTC Comment hidden (obsolete)
Comment 4 Héctor Eduardo Castro Avalos 2016-02-05 15:34:52 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2016-02-12 13:42:04 UTC
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>
Comment 6 Kyle M Hall 2016-02-12 13:42:11 UTC
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>
Comment 7 Brendan Gallagher 2016-02-23 21:18:44 UTC
Pushed to Master - Should be in the May 2016 Release.  Thanks
Comment 8 Julian Maurice 2016-02-26 14:46:15 UTC
Patches pushed to 3.22.x, will be in 3.22.4
Comment 9 Frédéric Demians 2016-03-01 16:53:52 UTC
This patch has been pushed to 3.20.x, will be in 3.20.9.