Iain,

Have you tried this out and checked other areas? My guess is that this would mess a few things up... The sourcePercentage is meant for information only and should already be accounted for an adjustment amount, which shouldn't be recalculated because this is not meant to represent all of the information that goes into that.

-David


On Oct 10, 2006, at 3:42 PM, Iain Fogg wrote:

All,

I think it's been well known that percentage discounts applied in the POS application don't work.

I hunted the problem down and it's pretty simple. The routine that calculates adjustments ignores anything except fixed amount adjustments. I added a snippet of code to calculate the percentage adjustment and it seems to work fine now.

Will try to post a JIRA and patch ASAP.

Posting this message just in case someone else was interested in the same bug.

In case your desparate, add the following snippet to calcItemAdjustmentBd in OrderReadHelper.java (after the if clause testing for "amount" adjustments):

       else if (itemAdjustment.get("sourcePercentage") != null) {
           adjustment =
               adjustment.add(setScaleByType(
"SALES_TAX".equals(itemAdjustment.get ("orderAdjustmentTypeId")), quantity.multiply(unitPrice).multiply (itemAdjustment.getBigDecimal("sourcePercentage"))));
       }

My testing seemed to indicate that all is well, but since I'm not terribly familiar with all the applications, I won't guarantee it is a benign addition.

Cheers, Iain


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.407 / Virus Database: 268.13.1/466 - Release Date: 7/10/2006


Reply via email to