Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calculating line item discounts for extended line price 1

Status
Not open for further replies.

Robin99

Technical User
Apr 8, 2004
19
0
0
US
Hi,

I'm writing an invoice report (Crystal 7.0) and I'm running into problems calculating the line item discount and arriving at the correct extended amount.
My discount field returns a value of "60.00" for a 60% discount - and I think that's one of my problems.

Formula Example:
if {SORDETAIL.MDiscPct1} = 100 then 0
else
{SORDETAIL.MPrice} - {SORDETAIL.MDiscPct1} * {SORDETAIL.MOrderQty} + {@LineTax}

Field Values:
Qty is: 1
Unit price is: $285,000.00
Unit Discount is: 60% (field returns a value of 60.00)
Tax is: 0.00

My report keeps returning a total of: $284,940.00
(that's the unit price minus 60 dollars, not 60%)

I know this is an elementary question, but I'm at my wits end.
Can someone help me write a formula that gives me the correct extended line item total?

Thanks in advance!
 
Try:

(({SORDETAIL.MPrice} * ({SORDETAIL.MDiscPct1}*.01)) * {SORDETAIL.MOrderQty}) + ({@LineTax}*{SORDETAIL.MOrderQty})

This assumes that the tax is per line item as well, so I multiplied it by the qty, and I also assumed that the tax is already correctly determined based on the discounted line item cost.

If it isn't, then you might discount the tax by the same amount:

(({SORDETAIL.MPrice} * ({SORDETAIL.MDiscPct1}*.01)) * {SORDETAIL.MOrderQty}) + ({@LineTax}*({SORDETAIL.MDiscPct1}*.01))*{SORDETAIL.MOrderQty})

Not sure why you returned zero if the price was 100% of the price, I eliminated it.

Might have a paren off or something, as I didn't test it, but the theory seems sound.

-k
 
Hi K,

Thanks for taking the time to respond to my question - the first formula you provided worked like a charm!

- RRR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top