View source | Discuss this page | Page history | Printable version   

POS - Force Customer Selection

Code snippet

Name: POS - Force Customer Selection
Version: POS/2.20 & 2.30 Beta
Author: ronny_g

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="" code=""/>

2) Create the Resource

Create a text resource called 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";
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

Retrieved from ""

This page has been accessed 10,905 times. This page was last modified on 19 April 2010, at 22:22. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.