Bug 34331 - Point of sale transaction history is showing the wrong register information
Summary: Point of sale transaction history is showing the wrong register information
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Fines and fees (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-20 17:41 UTC by Laura Escamilla
Modified: 2023-12-28 20:47 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.04,22.11.10
Circulation function:


Attachments
Bug 34331: Use register from userenv if parameter not passed (918 bytes, patch)
2023-08-24 12:23 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 34331: Use register from userenv if parameter not passed (968 bytes, patch)
2023-08-24 13:12 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 34331: Use register from userenv if parameter not passed (2.30 KB, patch)
2023-08-24 20:00 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Laura Escamilla 2023-07-20 17:41:58 UTC
To recreate: 
1. Enable the "EnablePointofSale" syspref. 
2. Set the "UseCashRegisters" syspref to use. 
3. Create 3 new registers (Register A, B and C) with a float amount of $25. 
4. Under POS, configure 3 new debit types (i.e. Copies, Earbuds, Friends Donation)
-- You can leave the default amounts blank, or add an amount if desired.
-- Set "Can be manually invoiced?" and "Can be sold?"
5. Under point of sale make a $5 sale of copies under Register A. 
6. Under point of sale make a $10 sale of earbuds under Register B.
7. Under point of sale make a $100 sale of Friends Donation under Register C.
8. At circ/set-library.pl set your register to Register A. 
9. Go back to POS and view the "Transaction history for Register A" - it shows the correct amount of $5 sold in copies. 
10. Go back to circ/set-library.pl and change your register to Register B.
11. Go back to POS and view the "Transaction history for Register B" - it shows the incorrect transaction history. It is showing the transaction history for Register A. 
12. Go back to circ/set-library.pl and change your register to Register C.
13. Go back to POS and view the "Transaction history for Register C" - it shows the incorrect transaction history. It is showing the transaction history for Register A.  

Setting a register as Default ensures that the correct transaction history is shown.
Comment 1 Nick Clemens (kidclamp) 2023-08-24 12:23:16 UTC
Created attachment 154730 [details] [review]
Bug 34331: Use register from userenv if parameter not passed
Comment 2 Owen Leonard 2023-08-24 13:12:22 UTC
Created attachment 154736 [details] [review]
Bug 34331: Use register from userenv if parameter not passed

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Katrin Fischer 2023-08-24 19:58:31 UTC
What an odd bug, thanks for the fix!
Comment 4 Katrin Fischer 2023-08-24 19:58:54 UTC
Please remember that the test plan needs to be part of the commit message!
Comment 5 Katrin Fischer 2023-08-24 20:00:49 UTC
Created attachment 154749 [details] [review]
Bug 34331: Use register from userenv if parameter not passed

To recreate:
1. Enable the "EnablePointofSale" syspref.
2. Set the "UseCashRegisters" syspref to use.
3. Create 3 new registers (Register A, B and C) with a float amount of $25.
4. Under POS, configure 3 new debit types (i.e. Copies, Earbuds, Friends Donation)
-- You can leave the default amounts blank, or add an amount if desired.
-- Set "Can be manually invoiced?" and "Can be sold?"
5. Under point of sale make a $5 sale of copies under Register A.
6. Under point of sale make a $10 sale of earbuds under Register B.
7. Under point of sale make a $100 sale of Friends Donation under Register C.
8. At circ/set-library.pl set your register to Register A.
9. Go back to POS and view the "Transaction history for Register A" - it shows the correct amount of $5 sold in copies.
10. Go back to circ/set-library.pl and change your register to Register B.
11. Go back to POS and view the "Transaction history for Register B" - it shows the incorrect transaction history. It is showing the transaction history for Register A.
12. Go back to circ/set-library.pl and change your register to Register C.
13. Go back to POS and view the "Transaction history for Register C" - it shows the incorrect transaction history. It is showing the transaction history for Register A.
14. Apply patch, repeat. The correct transactions should now show.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Tomás Cohen Arazi (tcohen) 2023-08-29 17:36:25 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 7 Fridolin Somers 2023-08-30 06:50:55 UTC
Pushed to 23.05.x for 23.05.04
Comment 8 Matt Blenkinsop 2023-08-31 10:24:15 UTC
Nice work everyone!

Pushed to oldstable for 22.11.x