This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch release18.12
in repository
https://gitbox.apache.org/repos/asf/ofbiz-framework.gitThe following commit(s) were added to refs/heads/release18.12 by this push:
new 466e426 Improved: BigDecimal casting in Groovy (OFBIZ-11862)
466e426 is described below
commit 466e426f8b35655d80ce45276218f3693c528a7c
Author: Jacques Le Roux <
[hidden email]>
AuthorDate: Tue Jun 30 15:06:51 2020 +0200
Improved: BigDecimal casting in Groovy (OFBIZ-11862)
It's not a bug here, but casting is not necessary, better keep things simple
---
.../groovyScripts/product/promo/ProductPromoCondServices.groovy | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/applications/product/groovyScripts/product/promo/ProductPromoCondServices.groovy b/applications/product/groovyScripts/product/promo/ProductPromoCondServices.groovy
index 2e3e681..c1f2230 100644
--- a/applications/product/groovyScripts/product/promo/ProductPromoCondServices.groovy
+++ b/applications/product/groovyScripts/product/promo/ProductPromoCondServices.groovy
@@ -401,7 +401,7 @@ def productOrderHist() {
Debug.logError("Error calling getOrderedSummaryInformation service for the PPIP_ORST_HIST ProductPromo condition input value: " + ServiceUtil.getErrorMessage(result), module)
return serviceResult
} else {
- BigDecimal orderSubTotal = (BigDecimal) serviceResult.get("totalSubRemainingAmount")
+ BigDecimal orderSubTotal = serviceResult.get("totalSubRemainingAmount")
BigDecimal orderSubTotalAndCartSubTotal = orderSubTotal.add(cart.getSubTotal())
if (Debug.verboseOn()) Debug.logVerbose("Doing order history sub-total compare: orderSubTotal=" + orderSubTotal + ", for the last " + monthsToInclude + " months.", module)
compareBase = orderSubTotalAndCartSubTotal.compareTo(new BigDecimal(condValue))
@@ -447,7 +447,7 @@ def productOrderYear() {
Debug.logError("Error calling getOrderedSummaryInformation service for the PPIP_ORST_YEAR ProductPromo condition input value: " + ServiceUtil.getErrorMessage(result), module)
return serviceResult
} else {
- BigDecimal orderSubTotal = (BigDecimal) result.get("totalSubRemainingAmount")
+ BigDecimal orderSubTotal = result.get("totalSubRemainingAmount")
if (Debug.verboseOn()) Debug.logVerbose("Doing order history sub-total compare: orderSubTotal=" + orderSubTotal + ", for the last " + monthsToInclude + " months.", module)
compareBase = orderSubTotal.compareTo(new BigDecimal((condValue)))