View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Add page
Show collection (0 pages)
Collections help

Search

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

Retrieved from "http://wiki.openbravo.com/wiki/POS_-_Force_Customer_Selection"

This page has been accessed 8,664 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.