We are using 4.12.3 and find that includes/GetPrice.inc returns a 0.00 price for items if the customer price list is not the default. The Discount Matrix is properly set-up, but ignored. We have restored the version of GetPrice from /* $Id: GetPrice.inc 6714 2014-05-17 03:09:03Z daintree $*/ removing the ,$db, and everything works as expected.
Discount Matrix with information for each of the sales types, using discount categories, quantity break and discount rate.
We have customers setup with customer type and sales type code.
When a quote is prepared the Sales Type should cause prices to be generated based on the Discount Matrix. In the base 4.12.3 code when creating a quotation the only prices available are the Default. In our system Default is the End User price. The price should be calculated by applying the Sales Type Discount Matric against the Default price (in our case End User).
We have reverted to the prior release code that correctly calculates the prices:
Would you like to post your reworked copy?
I cannot find what goes wrong. The latest version and the version (6714) what you said OK has no big difference except $db. The previous version only removed two lines of debug messages.
It's not a bug. It's the design of the file.
It's not a general requirement for this feature. When I asked if someone need this, so we can make it a choice, there is no feedback. I've got a feedback from webERP chinese community. But what he want is current discount matrix. Because it's quite tedious to modify the prices if lots of prices changed.
The file I changed last time can be used. But it'll not be merged to the trunk.
We did not change what we were doing and it is per the documentation and file design. The behavior of GetPrice.php changed, breaking something that worked per the documentation.
We have been studying the code. It is not obvious why Get Price.inc is not finding the price. The order of inquiries has changed possibly causing the problem.
We have a number of sales types. When we change the default price, the pricing in all of the other sales types properly reflect the change. We will try to see where in GetPrice the error was introduced and post a correction to the community such that no other pricing structures are disturbed.
As your finding, the order of the sql inquiry is the problem you entered. The sql order reflects the sales type priority. The version of the price matrix as the first priority exists very short time in the trunk and it has never been released publicly.
If it's not a generally used feature, it's not suitable to merge to trunk. At least currently, there are little feedback about this.
We have made modifications to GetPrice.inc so that it works properly using Sales Type, Discount Matrix and Default Price List. The modifications consist of:
1) Adding a second check against the pricematrix for an end date of "0000-00-00", that was missing from the original script.
2) Adding the inclusive check of the pricematrix.
3) Removing the code that fetches a row, preventing proper completion of the script.