Skip to content
This repository was archived by the owner on May 9, 2020. It is now read-only.

Commit 3e82cc5

Browse files
Applied fix from trunk r1148180.
Applied patch from jira issue - OFBIZ-4343. When user tries to apply the specified promotion then following problem occurs; 1) Promotion is not applying for the customer, that means customer do not get the discount even if any promotion of such kind exists for the user. 1.1) To fix the above will need to add group-by clause to 2 more fields orderTypeId and statusId of view entity OrderHeaderAndRoleSummary as these fields do not have any values to check the condition, as group-by clause do not allow to show them if values are different. 2) After fixing the issue explained in #1, if user pass the other_value as 12 (month) and condVlaue as $ 1000.00, then after $ 1000 if user order history is of $ 900. Then it will pass the check and then user is allow to get discount on any number on the last order. 3) That means even if the limit is 1000 user is able to purchase in discount of 900 + 300 >> 1200 amount with complete discount. So before checking for the total amount on order history now system will check for "order history + cart sub total". Thanks Rishi for the contribution! git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/release10.04@1148182 13f79535-47bb-0310-9956-ffa450edef68
1 parent 15f23a8 commit 3e82cc5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

applications/order/entitydef/entitymodel_view.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ under the License.
148148
<alias entity-alias="ORLE" name="partyId" group-by="true"/>
149149
<alias entity-alias="ORLE" name="roleTypeId" group-by="true"/>
150150
<alias entity-alias="OH" name="orderId"/>
151-
<alias entity-alias="OH" name="orderTypeId"/>
151+
<alias entity-alias="OH" name="orderTypeId" group-by="true"/>
152152
<alias entity-alias="OH" name="orderDate"/>
153-
<alias entity-alias="OH" name="statusId"/>
153+
<alias entity-alias="OH" name="statusId" group-by="true"/>
154154
<alias entity-alias="OH" name="totalGrandAmount" field="grandTotal" function="sum"/>
155155
<alias entity-alias="OH" name="totalSubRemainingAmount" field="remainingSubTotal" function="sum"/>
156156
<alias entity-alias="OH" name="totalOrders" field="orderId" function="count"/>

applications/order/src/org/ofbiz/order/shoppingcart/product/ProductPromoWorker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,8 +1120,9 @@ protected static boolean checkCondition(GenericValue productPromoCond, ShoppingC
11201120
return false;
11211121
} else {
11221122
BigDecimal orderSubTotal = (BigDecimal) result.get("totalSubRemainingAmount");
1123+
BigDecimal orderSubTotalAndCartSubTotal = orderSubTotal.add(cart.getSubTotal());
11231124
if (Debug.verboseOn()) Debug.logVerbose("Doing order history sub-total compare: orderSubTotal=" + orderSubTotal + ", for the last " + monthsToInclude + " months.", module);
1124-
compareBase = Integer.valueOf(orderSubTotal.compareTo(new BigDecimal(condValue)));
1125+
compareBase = Integer.valueOf(orderSubTotalAndCartSubTotal.compareTo(new BigDecimal(condValue)));
11251126
}
11261127
} catch (GenericServiceException e) {
11271128
Debug.logError(e, "Error getting order history sub-total in the getOrderedSummaryInformation service, evaluating condition to false.", module);

0 commit comments

Comments
 (0)