Skip to content

Commit 562723c

Browse files
AustinMRookephillipuniverse
authored andcommitted
(cherry picked from commit 5faaef7)
1 parent cc69083 commit 562723c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/pricing/service/workflow/FulfillmentItemPricingActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ protected void fixOrderSavingsRoundingIssues(Order order, Money totalOrderAdjust
199199
}
200200

201201
Money orderAdjustmentTotal = order.getOrderAdjustmentsValue();
202-
Money amountDiff = totalOrderAdjustmentDistributed.subtract(orderAdjustmentTotal);
202+
Money amountDiff = orderAdjustmentTotal.subtract(totalOrderAdjustmentDistributed);
203203

204204
if (!(amountDiff.getAmount().compareTo(BigDecimal.ZERO) == 0)) {
205205
long numApplicationsNeeded = countNumberOfUnits(amountDiff);
@@ -258,7 +258,7 @@ protected Money sumTaxAmount(List<FulfillmentGroupItem> items, Order order) {
258258

259259
public long countNumberOfUnits(Money difference) {
260260
double numUnits = difference.multiply(Math.pow(10, difference.getCurrency().getDefaultFractionDigits())).doubleValue();
261-
return Math.round(numUnits);
261+
return Math.round(Math.abs(numUnits));
262262
}
263263

264264
/**

0 commit comments

Comments
 (0)