This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release24.09 by this push:
new e7aea9c6a8 Fixed: Two regressions in the minilang-to-Groovy conversion
of PriceServicesScript.groovy (OFBIZ-13616)
e7aea9c6a8 is described below
commit e7aea9c6a83dbf2917b579d0860ba88e5bdf80ae
Author: Mridul Pathak <[email protected]>
AuthorDate: Sun Sep 27 12:43:01 2026 +0530
Fixed: Two regressions in the minilang-to-Groovy conversion of
PriceServicesScript.groovy (OFBIZ-13616)
inlineHandlePriceWithTaxIncluded() used truthy checks that treat a valid 0%
tax percentage as missing (BigDecimal zero is falsy in Groovy); switched to
explicit null checks matching mini-lang's <if-empty> semantics.
getAssociatedPriceRulesConds() populated the PRIP_CURRENCY_UOMID dropdown
from all Uom rows instead of currency units only; added a uomTypeId:
'CURRENCY_MEASURE' filter.
---
.../apache/ofbiz/product/product/price/PriceServicesScript.groovy | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/applications/product/src/main/groovy/org/apache/ofbiz/product/product/price/PriceServicesScript.groovy
b/applications/product/src/main/groovy/org/apache/ofbiz/product/product/price/PriceServicesScript.groovy
index e746a2c301..83ae70f8bc 100644
---
a/applications/product/src/main/groovy/org/apache/ofbiz/product/product/price/PriceServicesScript.groovy
+++
b/applications/product/src/main/groovy/org/apache/ofbiz/product/product/price/PriceServicesScript.groovy
@@ -97,7 +97,7 @@ Map inlineHandlePriceWithTaxIncluded() {
parameters.priceWithTax = parameters.price
// if taxPercentage not passed in look it up based on taxAuthGeoId and
taxAuthPartyId
- if (!parameters.taxPercentage) {
+ if (parameters.taxPercentage == null) {
// we only have basic data to constrain by here, so assume that if
it is a VAT tax setup it should be pretty simple
EntityCondition condition = EntityCondition.makeCondition([
EntityCondition.makeCondition('taxAuthGeoId',
parameters.taxAuthGeoId),
@@ -107,7 +107,7 @@ Map inlineHandlePriceWithTaxIncluded() {
GenericValue taxAuthorityRateProduct =
from('TaxAuthorityRateProduct').where(condition).filterByDate().queryFirst()
parameters.taxPercentage = taxAuthorityRateProduct?.taxPercentage
}
- if (!parameters.taxPercentage) {
+ if (parameters.taxPercentage == null) {
return error(UtilProperties.getMessage('ProductUiLabels',
'ProductPriceTaxPercentageNotFound', locale))
}
// in short the formula is: taxAmount = priceWithTax -
(priceWithTax/(1+taxPercentage/100))
@@ -241,7 +241,7 @@ Map getAssociatedPriceRulesConds() {
break
case 'PRIP_CURRENCY_UOMID':
- from('Uom').limit(sizeLimit).queryList()?.each {
+ from('Uom').where(uomTypeId:
'CURRENCY_MEASURE').limit(sizeLimit).queryList()?.each {
productPriceRulesCondValues << [key: it.uomId,
description: it.abbreviation
?: '[' + it.uomId + ']']
}