POS - Force Customer Selection
Code snippetName: POS - Force Customer Selection
|
This code was created using mySQL in Windows.
This script will not allow a user to complete a sale until a customer has been selected. It was requested in this forum post by easkey1.
1) Add Event to the Ticket.Buttons Resource
Add the following event to the Ticket.Buttons resource:
<event key="ticket.total" code="event.total"/>
2) Create the event.total Resource
Create a text resource called event.total and add the following to it:
if (ticket.getCustomer()== null){ javax.swing.JOptionPane.showMessageDialog(null, "You must select a customer", "Customer Warning", JOptionPane.WARNING_MESSAGE); return "Cancel"; }else{ return null; }
That should be it. You can obviously change anything you wish to suite your setup. Let me know if something is not working or something can be bone better.
Good Luck, Ronny G