Bug 28368 - Error when printing receipt of point of sale
Summary: Error when printing receipt of point of sale
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords:
Depends on: 26734
Blocks: 28374
  Show dependency treegraph
 
Reported: 2021-05-18 08:54 UTC by Victor Grousset/tuxayo
Modified: 2022-12-12 21:25 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Circulation function:


Attachments
Bug 28368: Add fallback language for anonymous payment receipts (1.31 KB, patch)
2021-05-18 15:02 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 28368: Add fallback language for anonymous payment receipts (1.37 KB, patch)
2021-05-18 21:39 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Grousset/tuxayo 2021-05-18 08:54:32 UTC
I likely made a mistake when improvising the use of the PoS. Nonetheless, it seems wrong that it can end up crashing.

==Test plan==
1. enable  EnablePointOfSale  and  UseCashRegisters
2. Add new cash register, like name "copier", Initial float: 0.30
     no idea if it semantically makes sense
3. New debit type, code: "Debittypecode", def amount: 0.30
   Description: black and white
     can be sold
     no idea if it semantically makes sense
4. add like 5 black and white items
5. Amount tendered: same as price
6. cash register: copier
7. confirm
8. print receipt
9. error/ISE: Can't call method "lang"
Comment 1 Martin Renvoize (ashimema) 2021-05-18 15:02:28 UTC
Created attachment 121114 [details] [review]
Bug 28368: Add fallback language for anonymous payment receipts

This adds a fallback for when a payment is made anonymously to allow
printing a receipt in the staff members current session language.

Test plan
1. Set `EnablePointOfSale` and `UseCashRegisters`
2. Add new cash register`
3. New debit type that 'can be sold'
4. Make a sale (via Point of Sale) using the above debit type.
5. Attempt to 'print receipt' from the subsequent prompt
6. Not the ISE: Can't call method "lang"
7. Apply patch
8. Attempt to 'print receipt' again, this time it should work.
Comment 2 Victor Grousset/tuxayo 2021-05-18 21:39:34 UTC
Created attachment 121136 [details] [review]
Bug 28368: Add fallback language for anonymous payment receipts

This adds a fallback for when a payment is made anonymously to allow
printing a receipt in the staff members current session language.

Test plan
1. Set `EnablePointOfSale` and `UseCashRegisters`
2. Add new cash register`
3. New debit type that 'can be sold'
4. Make a sale (via Point of Sale) using the above debit type.
5. Attempt to 'print receipt' from the subsequent prompt
6. Not the ISE: Can't call method "lang"
7. Apply patch
8. Attempt to 'print receipt' again, this time it should work.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 3 Victor Grousset/tuxayo 2021-05-18 21:43:18 UTC
It works, thanks :)
Comment 4 Victor Grousset/tuxayo 2021-05-18 21:45:56 UTC
Unrelated, while I'm at it likely for a follow-up ticket:

Is that expected that for free stuff where it's useful to track the "sales" like stock management; that an order with only free stuff just refreshes the page and does nothing? (including the Register details)
Comment 5 Victor Grousset/tuxayo 2021-05-26 18:37:52 UTC
comment 4: new ticket bug 28406
Comment 6 Jonathan Druart 2021-05-27 13:10:27 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 7 Fridolin Somers 2021-05-31 14:39:13 UTC
Depends on Bug 26734 not in 20.11.x