This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new ea4a99f35a Fixed: Two regressions in the minilang-to-Groovy conversion
of PriceServicesScript.groovy (OFBIZ-13616)
ea4a99f35a is described below
commit ea4a99f35a710d5fa4de6c9638795152e875524a
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 052a219da6..ed9377cf76 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
@@ -94,7 +94,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),
@@ -104,7 +104,7 @@ Map inlineHandlePriceWithTaxIncluded() {
GenericValue taxAuthorityRateProduct =
from('TaxAuthorityRateProduct').where(condition).filterByDate().queryFirst()
parameters.taxPercentage = taxAuthorityRateProduct?.taxPercentage
}
- if (!parameters.taxPercentage) {
+ if (parameters.taxPercentage == null) {
return error('ProductUiLabels',
'ProductPriceTaxPercentageNotFound')
}
// in short the formula is: taxAmount = priceWithTax -
(priceWithTax/(1+taxPercentage/100))
@@ -232,7 +232,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 + ']']
}