View Categories

Calculating quantity from amount

< 1 min read

For scaled items, at times customers ask for products for an amount, like cashew nuts for 5 dollars or fish for 20 dollars, etc.,

Here is the script to determine item weight from an amount.

Go to Maintenance>Resources and add a text resource with name Script.Price. Add below lines into it.

value=sales.readNumber(“Enter amount:”);
if (value!=null)
{
Double newPrice=new Double(value);
index=sales.getSelectedIndex();
line=ticket.getLine(index);
line.setMultiply(newPrice/line.getPrice());
line.setSalePrice(line.getPrice());
}

In the resource Ticket.Button add a new button with the below code:

<button key="button.print" titlekey="Amt" code="Script.Price"></button>

Now Save and Restart Saleculator.

You can see a button “Amt” on top right side of the sales screen. Add an item to the bill, then press Amt button and enter total amount of the item. It will calculate and set quantity of the item.

0 Comments

Leave a Reply

Arrow-up