You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Arun Patidar (Jira)" <ji...@apache.org> on 2026/07/10 10:06:00 UTC
[jira] [Closed] (OFBIZ-13448) Type mismatch exception in FixedAssetMaintServices.java (assetmaint plugin)
[ https://issues.apache.org/jira/browse/OFBIZ-13448?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Arun Patidar closed OFBIZ-13448.
--------------------------------
Fix Version/s: Upcoming Branch
Resolution: Fixed
PR has been merged.
Closing this issue now.
Thanks [~tomek] for analyses and reporting issue. Thanks [~aditipatel] for providing PR.
> Type mismatch exception in FixedAssetMaintServices.java (assetmaint plugin)
> ---------------------------------------------------------------------------
>
> Key: OFBIZ-13448
> URL: https://issues.apache.org/jira/browse/OFBIZ-13448
> Project: OFBiz
> Issue Type: Bug
> Components: assetmaint
> Reporter: Tomek
> Assignee: Arun Patidar
> Priority: Minor
> Fix For: Upcoming Branch
>
>
> I have found a bug in the assetmaint plugin, specifically in the following file:
> assetmaint/src/main/java/org/apache/ofbiz/assetmaint/FixedAssetMaintServices.java
> Problematic code fragment:
> EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(UtilMisc.toList(
> EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId),
> EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId),
> EntityCondition.makeCondition("availableToPromiseTotal", EntityOperator.GREATER_THAN, "0")), // Here is the bug
> EntityOperator.AND);
> Proposed fix:
> EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(UtilMisc.toList(
> EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId),
> EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId),
> EntityCondition.makeCondition("availableToPromiseTotal", EntityOperator.GREATER_THAN, BigDecimal.Zero)),
> EntityOperator.AND);
> Rationale:
> The availableToPromiseTotal field represents a numerical value (defined as a fixed-point number in the entity model), not a String. Passing the string "0" causes a type mismatch exception or a database parsing failure at runtime. Replacing it with BigDecimal.ZERO resolves the issue.
> Best regards,
> Tomek
--
This message was sent by Atlassian Jira
(v8.20.10#820010)