UnicentaPOS Help Wiki

THIS MY EDITED VERSION OF ANOTHER SCRIPT POSTED HERE[]

It is available under the Creative Commons Share and Share Alike Licence

This code snippet is intented to implement a way to enter the price manually when selecting any product.

1.Login as Administrator and go to Maintenance-->Resources and select Ticket.Buttons resource.[]

2.Add a new line:[]

<event key="ticket.addline" code="event.addline"/>

3.Create new resource event.addline with this content:[]

 import javax.swing.JOptionPane;
 
 value = javax.swing.JOptionPane.showInputDialog("Price", "");
 
 try {
  Double newPrice = new Double(value);
  line.setPrice(newPrice);
 
 } catch (NumberFormatException e) {
  JOptionPane.showMessageDialog(null, "Not valid number: " + value, "Error", JOptionPane.PLAIN_MESSAGE);
 
 }

4. Save changes and restart the application.[]