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

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);
    }
}

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

This page has been accessed 7,759 times. This page was last modified on 25 October 2009, at 00:24. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.