Bug 28368

Summary: Error when printing receipt of point of sale
Product: Koha Reporter: Victor Grousset/tuxayo <victor>
Component: Staff interfaceAssignee: Martin Renvoize <martin.renvoize>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: critical    
Priority: P5 - low CC: fridolin.somers, gmcharlt, jonathan.druart, lucas, martin.renvoize, sally.healey
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Bug Depends on: 26734    
Bug Blocks: 28374    
Attachments: Bug 28368: Add fallback language for anonymous payment receipts
Bug 28368: Add fallback language for anonymous payment receipts

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 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