Sales Order Discount Percentage
Not sure how to describe this scenario but here goes. I can't duplicate it in Jiwa demo data.
When I enter a discount percentage on a sales order line say, 15% then save the sales order, the discount percentage changes to 15.01.
The line.DefaultPrice = 25.45 which is SellPriceExGST too.
The system setting DiscountPercentDecimalPlaces = 2
In the client database upon saving the disc% changes to 15.01 and is also written to the database SO_Lines.DiscountPercentage as 15.01.
The thing is, when you do the maths it doesn't really matter if the discount percent is 15.00 or 15.01. The line.DiscountedPrice ends up as $21.63 for both.
But in my JiwaDemo database if I set the Default Price of an item to 25.45 and add it to a sales order, then set the disc% to 15, when I save it stays as 15.00. That's is what is expected but doesn't happen like that in the client database.
I've written a plugin to see if the line.DiscountedPrice is different whether the discount percent has no decimals or some. If it'll be the same anyway and therefore makes diddly squat difference to the invoice value, I am writing to the database the ROUND(DiscountPercentage, 0) value, so in this case I'm writing 15.00 to the database.
So now, the SO_Lines.DiscountPercentage value = 15.00
But refreshing the sales order in Jiwa, the Discount Percentage still displays as 15.01.
Q1. What else might be a factor in understanding why the client behaviour is different to my Jiwa demo? I doubt there are any other plugins affecting - I am thinking it's some thing else.
Q2. Why would the sales order display the discount percentage as 15.01 even though the database value is 15.00? At a guess it's because 1-(21.63/25.45) =0.15009823 and that will round to 15.01 but that brings me to Q1 - why wouldn't 15.01 show in my Jiwa demo?
The end result which the client wants is not to have the hundredths but just the whole number as entered.
Both versions are 7.2.1 SR4.
When I enter a discount percentage on a sales order line say, 15% then save the sales order, the discount percentage changes to 15.01.
The line.DefaultPrice = 25.45 which is SellPriceExGST too.
The system setting DiscountPercentDecimalPlaces = 2
In the client database upon saving the disc% changes to 15.01 and is also written to the database SO_Lines.DiscountPercentage as 15.01.
The thing is, when you do the maths it doesn't really matter if the discount percent is 15.00 or 15.01. The line.DiscountedPrice ends up as $21.63 for both.
But in my JiwaDemo database if I set the Default Price of an item to 25.45 and add it to a sales order, then set the disc% to 15, when I save it stays as 15.00. That's is what is expected but doesn't happen like that in the client database.
I've written a plugin to see if the line.DiscountedPrice is different whether the discount percent has no decimals or some. If it'll be the same anyway and therefore makes diddly squat difference to the invoice value, I am writing to the database the ROUND(DiscountPercentage, 0) value, so in this case I'm writing 15.00 to the database.
So now, the SO_Lines.DiscountPercentage value = 15.00
But refreshing the sales order in Jiwa, the Discount Percentage still displays as 15.01.
Q1. What else might be a factor in understanding why the client behaviour is different to my Jiwa demo? I doubt there are any other plugins affecting - I am thinking it's some thing else.
Q2. Why would the sales order display the discount percentage as 15.01 even though the database value is 15.00? At a guess it's because 1-(21.63/25.45) =0.15009823 and that will round to 15.01 but that brings me to Q1 - why wouldn't 15.01 show in my Jiwa demo?
The end result which the client wants is not to have the hundredths but just the whole number as entered.
Both versions are 7.2.1 SR4.