This is an automated email from the ASF dual-hosted git repository.
nmalin pushed a commit to branch release18.12
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release18.12 by this push:
new ffdf1b1 Fixed: Explode items not handling tax and adjustments
properly (OFBIZ-11928)
ffdf1b1 is described below
commit ffdf1b1da84bce5874f7bda812d02b8e618413ef
Author: Nicolas Malin <[email protected]>
AuthorDate: Mon Sep 27 18:31:32 2021 +0200
Fixed: Explode items not handling tax and adjustments properly (OFBIZ-11928)
If you set explodeItems to true on your productStore, tax and adjustment
wasn't correctly calculate when you ordered some finish goods.
Thanks: Suraj Khurana and Ankush Upadhyay
---
.../java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
index b12411b..bda4714 100644
---
a/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
+++
b/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCart.java
@@ -3773,6 +3773,16 @@ public class ShoppingCart implements
Iterable<ShoppingCartItem>, Serializable {
result.add(orderItem);
// don't do anything with adjustments here, those will be
added below in makeAllAdjustments
}
+ // Recalculate tax only if items are exploded.
+ if (explodeItems) {
+ // calc the sales tax
+ CheckOutHelper coh = new CheckOutHelper(dispatcher, delegator,
this);
+ try {
+ coh.calcAndAddTax();
+ } catch (GeneralException e) {
+ Debug.logError(e, module);
+ }
+ }
return result;
}
}