INFORMIX-SQL 7.3 Perform Screen:
Suppose I have a customer who wants to pay a $100 (7% tax included), what logic can I use
so that when the cashier clerk enters $100 in the tax included sale amount, it will
calculate the sale price and tax so that it adds up to $100.
I have the following 3 field tags in my Perform screen:
sprice = transaction.sale_price;
stax = transaction.sale_tax;
stotal = transaction.sale_total;
after editadd of transaction.sale_price
?...what goes here...?
If your problem is the formula then sprice = stotal * 100 / (100 + stax).
For example
$12345 * 100 / (100 + 7) = $11537.38
and adding 7% to $11537.38 gives you $12345.
Note of course that it may be impossible to find an exact amount of pennies that after adding a tax will give you a prescribed total.