#### Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

# Applying Discount To The Unit Price, Not Line Value

Member Posts: 552
edited 2007-06-11
Hi,

I have a customer who for marketing reasons wants to have the line discount % applied to the unit price instead of the line value. I have suggested I just show this as the 'Net Price' using a formula field on the sales order report to give an indicative price but they insist on having it shown, calculated and posted using 2 decimal places. For example :

Current Method (Standard Navision)
```Qty      Price       Disc %     Line Value After Disc
6        72.66        25            326.97
```

New Method
```Qty      Disc %      Net Price  Line Value
6         25          54.50         327.00
```

Here the Net Price is actually 54.495 rounded to 2 decimal places which has the effect of increasing the line value.

Unless I'm missing something it seems to me that to do this I would have to re-write all the unit price/discount/VAT line value calculations in Navision to work under this method which I'm really not keen to do.

Has anybody else done this as a modification or has any suggestions?

Any help appreciated,

Jonathan

• Member Posts: 7,142
they want this to show on the sales line or in some report?

how about something like this

if Qty = 0
then "Net Price" := 0
else "Net Price" := "Line Value" / Qty

**edit**
I see you mentioned a formula already..where do they want this shown?
• Member Posts: 344
The rounding should not have impact on the line amount. Then you can keep standard functionality and you can update your net price field in the end of the updateamounts function.
• Member Posts: 95
Why not using 3 decimal places for the Unit Price, and only 2 decimals for the line amount? That way, you are going to have the same amount in both cases.
• Member Posts: 552
Hi,

Thanks for the replies, I've decided to add code to recalculate the Unit Price column to 4/5 decimal places so that it gives the same line value when the discount is applied to the line as it does if the discount is applied to the unit price.

Jonathan
• Member Posts: 95
Please be very careful if you intend to change the Unit Price calculation on the Sales Line. You are going to change Navision logic. I would recomend you to leave it as is, only changing the number of decimals, and to change the Unit Price calculation only on the reports (Order Confirmation, Invoice, Credit Memo).

In my country we are using for the discount calculation exactly the same logic as you want to implement. In the beginning I was tempted to change the logic, but after looking in more depth at the possible consequences, I have decided the safest way is to avoid changing the logic.
• Member Posts: 344
Nothing wrong with changing the logic of the codeunit if you do it right.
• Member Posts: 95
Right Mbad. But, if I have to choose between making a major change in the logic of Navision (and it is not only one codeunit to change), and making some minor changes in three reports, I would always choose the latest option. Which is also the safest solution. Or maybe I am a lazy person.
• Member Posts: 344
Yup i would just change the reports too. Guess your not lazy after all :-)
• Member Posts: 235
This has caused us many, many problems in the past as well.

We have added far too many fixed 'Sales Prices' to counteract this calculation.

What I have done is increase the decimal places so that the calculation of the line value will be consistant with that of the (virtual) 'Unit Price'.

I am ready to make the changes in our production database but I have one remaining problem ... is Navision rounding down??

For example:
```Qty      Price       Disc %     Line Value After Disc
2         4.15        35            5.39
```

Why is this not \$5.40 ?? ](*,)

(2 * 4.15) * ((100-35)/100) = 5.395
8.30 * 0.65 = 5.395

Thanks for your help,