POS - Adding Tag-Along Items
With the help of Jeff Breeden and Mikel Irurita, I created a script for OpenbravoPOS to allow tag-along items like "crv". Below will describe how to set that up.
First, for the product that needs the tag-along item we add a property:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <entry key="CRV">0.05</entry> </properties>
Next, under Maintenance>>Resources>>Ticket.Buttons, we added:
<event key="ticket.change" code="event.change.crv" />
And created a script called "event.change.crv" with:
import com.openbravo.pos.ticket.TicketLineInfo; index = sales.getSelectedIndex(); if (index >= 0) { line = ticket.getLine(index); double crv = Double.parseDouble(line.getProperty("CRV", "0")); if (crv > 0) { ticket.insertLine(index + 1, new TicketLineInfo( "CRV", "000", line.getMultiply(), crv, line.getTaxInfo())); sales.setSelectedIndex(index + 1); } }