Closed (fixed)
Project:
Commerce Point of Sale (POS)
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jan 2018 at 11:55 UTC
Updated:
6 Feb 2018 at 17:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alexpottThis is because we shouldn't be able to print receipts for orders that are not yet placed.
Comment #3
alexpottHere's a test and fix for what happens when the jQuery.print library is not available.
Comment #4
alexpottlol forgot to commit the changes. Ignore #3.
Comment #5
alexpottI've got a major concern about this code thats in commerce_pos_receipt.
The code in modules/receipt/js/commerce_pos_receipt.js overrides the default submit behaviour and stops the order being completed until the receipt is printed. This feels super wrong. We should only be printing the receipt once the order has been placed and that happens when you press the button click that this is deferring. This means that if something in browser goes wrong or the user never closes the receipt screen the order is never placed.
Comment #6
subhojit777Comment #7
shabana.navas commentedTested locally and with simplytest.me. The patch works as expected where the 'Show Receipt' option doesn't display on orders in the 'Draft' state and displays for orders in the 'Completed' state.
Comment #8
alexpottLet's postpone this on #2935465: Receipt flow potential leaves order unplaced. That issue results in this one being fixed. Once that it done we should add the tests from this one.
Comment #9
alexpottActually having this in before #2935465: Receipt flow potential leaves order unplaced would make it simpler to write good tests for that one. Back to rtbc.
Comment #10
alexpottComment #12
alexpottI credited @shabana.navas for the review.