FANDOM


Add a product Edit

Add a product with as name "Start Poel"

Pool tebel timer

set the price per menuut

Assigning Attributes Edit

Add this code to the Product > Properties

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="Poel">Yes</entry>
<entry key="PoelTime">Run</entry>
</properties>

Add a button.poelstop how Edit

http://wiki.openbravo.com/wiki/POS_-_Backup_MySQL_Database

Allow the button in the user profile Edit

Go to - Admin - Maintanaince - Roles. Choose your role and add this in under buttons

<class name="button.poelstop"/>

Edit Ticket.Buttons Edit

Make sure the following permissions are allowed in Ticket.Buttons

<button key="button.poelstop" image="img.PoelTabel" code="Script.TimerStop"/>
<event key="ticket.addline" title="Stop Pool Table" code="script.Event.Addline"/>

Create a script called "script.Event.Addline" and this as content. Edit

// script.Event.Addline
// Bestel Uur toevogen aan artikel Begin
// set Poel parameters begin
import java.text.*;
// ----------------------------------------------------------
// Bestel Uur toevogen aan artikel Begin
Calendar cal = Calendar.getInstance();
cal.getTime();
// SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss dd/MM");
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd/MM");
// -----------------------------------------------------------------------------------------------------
line.setProperty("BestelTime", sdf.format(cal.getTime()));
// -----------------------------------------------------------------------------------------------------
// set Poel parameters begin
if (line.getProperty("Poel") != null && line.getProperty("Poel").equals("Yes")) {
// Geef het poel tafel nummer in
valueonbeart = javax.swing.JOptionPane.showInputDialog("poel tafel nummer Invoegen","");
line.setProperty("product.name", line.getProperty("product.name") + " " + valueonbeart + " at " + line.getProperty("BestelTime").substring(0,6));
}
// set Poel parameters einde
// -----------------------------------------------------------------------------------------------------

Create a script called "Script.TimerStop" and this as content. Edit

// Script.PoelTimerStop
import java.text.*;
index = sales.getSelectedIndex();
line = ticket.getLine(index);
if (line.getProperty("Poel") != null && line.getProperty("Poel").equals("Yes")) {
Calendar now = Calendar.getInstance();
now.getTime();
// SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss dd/MM");
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm dd/MM");
eindtijd = sdf.format(now.getTime());
starttijd = line.getProperty("BestelTime");
Date start = (Date)sdf.parse(starttijd);
Date eind = (Date)sdf.parse(eindtijd);
diff = (((eind.getTime() - start.getTime())/1000)/60);
line.setMultiply(diff);
line.setProperty("MDealTime", eindtijd);
line.setProperty("Poel", "Stopped");
line.setProperty("product.name", line.getProperty("product.name") + " Stopped " + " at " + eindtijd.substring(0,5));
} else {
if (line.getProperty("Poel")==("Stopped")) {
javax.swing.JOptionPane.showMessageDialog(null, "end time is already set. \n Billiard table is already stopped");
return "Cancel";
} else {
javax.swing.JOptionPane.showMessageDialog(null, "This is no Billiard table to Stop");
}
}

restart unicenta.

at the start of the game. press start pool and give it the pool table number.

at the end of the game you go to the customer's table and then you sellek the pool table

press the poel stop button.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.