Page 1 of 1

Debtor or Debtor Class price rounding

PostPosted: Wed Jun 01, 2016 3:37 pm
by DannyC
In inventory maintenance, the Debtor Pricing and Debtor Class Pricing New Price is a calculated field.

I've been posed the question, is it possible to round it to the nearest, say dollar, or 50c? As the New Price isn't saved in a database field, I'm not sure it is possible. It if was, I'd probs just write a SQL query to round it.

So I guess the question is twofold:
1. A plugin would work on Inventory.ReadEnd to change the visual display of the New Price to the rounded value?
2. When applying the price to sales orders, I am suspecting I might be able to modify the stored procs which work out the end price, correct?

Am I on the right path, and are there other things to watch out for?

Cheers

Danny

Re: Debtor or Debtor Class price rounding  Topic is solved

PostPosted: Sat Jun 04, 2016 5:19 pm
by Mike.Sheen
DannyC wrote:In inventory maintenance, the Debtor Pricing and Debtor Class Pricing New Price is a calculated field.

I've been posed the question, is it possible to round it to the nearest, say dollar, or 50c? As the New Price isn't saved in a database field, I'm not sure it is possible. It if was, I'd probs just write a SQL query to round it.

So I guess the question is twofold:
1. A plugin would work on Inventory.ReadEnd to change the visual display of the New Price to the rounded value?
2. When applying the price to sales orders, I am suspecting I might be able to modify the stored procs which work out the end price, correct?

Am I on the right path, and are there other things to watch out for?

Cheers

Danny


Danny,

Yes - just copy the stored procedure used to calculate debtor specific pricing and debtor classification pricing, have that round to the desired degree, and then modify your price schemes to use your stored proc instead of the standard one.

The display of the new price in inventory maintenance doesn't call the stored procedure, so as you've already asserted you'd need a plugin to replicate the rounding and present the user with the new price rounded in the same fashion. There's probably some twists and turns there, but I'm sure it's do-able.

Mike