Skip to content

Commit

Permalink
Improved: Added a flag computeQOH to control QOH computation in GET i…
Browse files Browse the repository at this point in the history
…nventory count import items API (#52).
  • Loading branch information
ravilodhi committed Jan 21, 2025
1 parent 70a7208 commit 0769451
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions service/co/hotwax/cycleCount/InventoryCountServices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
<parameter name="importItemSeqId"/>
<parameter name="statusId"/>
<parameter name="facilityId" type="List"/>
<parameter name="computeQOH" default-value="Y"/>
<parameter name="orderBy" default-value="-inventoryCountImportId, importItemSeqId"/>
<parameter name="pageIndex" type="Integer" default-value="0">
<description>The current page index to get the inventory count import items.</description>
Expand Down Expand Up @@ -118,13 +119,15 @@
<if condition="countImportVariance">
<set field="qtyOnHand" from="countImportVariance.systemQuantityOnHand" default-value="0"/>
<else>
<if condition="computeQOH == 'Y'">
<entity-find entity-name="org.apache.ofbiz.product.inventory.InventoryItem" list="inventoryItems">
<econdition field-name="productId" from="invCountImpItem.productId"/>
<econdition field-name="facilityId" from="invCountImpItem.facilityId"/>
</entity-find>
<iterate list="inventoryItems" entry="inventoryItem">
<set field="qtyOnHand" from="qtyOnHand + (inventoryItem.quantityOnHandTotal ?:0)" type="BigDecimal"/>
</iterate>
</if>
</else>
</if>
<set field="itemDetail.qoh" from="qtyOnHand" default-value="0"/>
Expand Down

0 comments on commit 0769451

Please sign in to comment.