|
Hi Guys
I am trying to create a view entity of Product and InventoryItem where the
sum of ATP and QOH for all InventoryItem are shown for Product. I have
tried what looked right:
<view-entity entity-name="ProductInventoryItemAndFacility"
package-name="org.ofbiz.product.location"
title="ProductInventoryItemAndLocation View Entity showing
Product, InventoryItem total and location">
<member-entity entity-alias="PR" entity-name="Product"/>
<member-entity entity-alias="II" entity-name="InventoryItem"/>
<alias entity-alias="PR" name="productId" group-by="true"/>
<alias entity-alias="PR" name="description" group-by="true"/>
<alias entity-alias="II" name="facilityId" group-by="true"/>
<alias entity-alias="II" name="availableToPromiseTotal"
function="sum"/>
<alias entity-alias="II" name="quantityOnHandTotal" function="sum"/>
<view-link entity-alias="PR" rel-entity-alias="II">
<key-map field-name="productId"/>
</view-link>
</view-entity>
But I end up with a single row in the result set pressing the "All" button
in webtools. This works just fine:
<view-entity entity-name="ProductInventoryItemAndFacility"
package-name="org.ofbiz.product.location"
title="ProductInventoryItemAndLocation View Entity showing
Product, InventoryItem total and location">
<member-entity entity-alias="PR" entity-name="Product"/>
<member-entity entity-alias="II" entity-name="InventoryItem"/>
<alias entity-alias="PR" name="productId" />
<alias entity-alias="PR" name="productTypeId" />
<alias entity-alias="PR" name="description" group-by="false"/>
<alias entity-alias="PR" name="internalName" group-by="false"/>
<alias entity-alias="II" name="facilityId" group-by="false"/>
<alias entity-alias="II" name="availableToPromiseTotal"/>
<alias entity-alias="II" name="quantityOnHandTotal"/>
<view-link entity-alias="PR" rel-entity-alias="II">
<key-map field-name="productId"/>
</view-link>
</view-entity>
but there is no summing and multiple rows of InventoryItem are shown for
each product. I would like a single row for each productId/facility with a
sum of the ATP and QOH.
I have run into this problem before and solved it with a custom service that
returned a list. I would much rather do it with the database manager.
Can anyone offer me some guidance, especially generic guidance. I have
looked at hundreds of other view-entity examples and the above looks right,
but just does not work.
Skip
No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.24.4/1478 - Release Date: 6/2/2008
7:12 AM
|