Skip to content

Commit 268ed0a

Browse files
Implemented foundational Data Model and Services for Inventory Cycle Count
1 parent daa1fb8 commit 268ed0a

3 files changed

Lines changed: 173 additions & 0 deletions

File tree

applications/datamodel/data/seed/ProductSeedData.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,4 +783,12 @@ under the License.
783783
<CustomMethod customMethodId="SHIP_EST_USPS_INT" customMethodTypeId="SHIP_EST" customMethodName="uspsInternationalRateInquire" description="USPS rate estimate international"/>
784784

785785
<Enumeration description="Direct Store Delivery" enumCode="DIRECT_STORE_DELIVRY" enumId="DIRECT_STORE_DELIVRY" sequenceId="01"/>
786+
787+
<!-- InventoryCount Status -->
788+
<StatusType description="Inventory Count Status" hasTable="N" statusTypeId="INV_COUNT_STATUS"/>
789+
<StatusItem description="In Progress" sequenceId="01" statusCode="IN_PROGRESS" statusId="INV_COUNT_INPROG" statusTypeId="INV_COUNT_STATUS"/>
790+
<StatusItem description="Completed" sequenceId="02" statusCode="COMPLETED" statusId="INV_COUNT_COMPLETED" statusTypeId="INV_COUNT_STATUS"/>
791+
<StatusItem description="Cancelled" sequenceId="03" statusCode="CANCELLED" statusId="INV_COUNT_CANCELLED" statusTypeId="INV_COUNT_STATUS"/>
792+
<StatusValidChange statusId="INV_COUNT_INPROG" statusIdTo="INV_COUNT_COMPLETED" transitionName="Complete"/>
793+
<StatusValidChange statusId="INV_COUNT_INPROG" statusIdTo="INV_COUNT_CANCELLED" transitionName="Cancel"/>
786794
</entity-engine-xml>

applications/datamodel/entitydef/product-entitymodel.xml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,6 +2475,108 @@ under the License.
24752475
<field name="description" type="description"></field>
24762476
<prim-key field="varianceReasonId"/>
24772477
</entity>
2478+
<entity entity-name="InventoryCount"
2479+
package-name="org.apache.ofbiz.product.inventory"
2480+
title="Inventory Count">
2481+
<field name="inventoryCountId" type="id"></field>
2482+
<field name="countName" type="name"></field>
2483+
<field name="statusId" type="id"></field>
2484+
<field name="facilityId" type="id"></field>
2485+
<field name="workEffortId" type="id"></field>
2486+
<field name="assignedUserLoginId" type="id-vlong"></field>
2487+
<field name="parentInventoryCountId" type="id"></field>
2488+
<field name="createdDate" type="date-time"></field>
2489+
<field name="dueDate" type="date-time"></field>
2490+
<field name="approvedDate" type="date-time"></field>
2491+
<prim-key field="inventoryCountId"/>
2492+
<relation type="one" rel-entity-name="StatusItem" fk-name="INV_CNT_STTS">
2493+
<key-map field-name="statusId"/>
2494+
</relation>
2495+
<relation type="one" rel-entity-name="Facility" fk-name="INV_CNT_FAC">
2496+
<key-map field-name="facilityId"/>
2497+
</relation>
2498+
<relation type="one-nofk" rel-entity-name="UserLogin" fk-name="INV_CNT_ULGN">
2499+
<key-map field-name="assignedUserLoginId" rel-field-name="userLoginId"/>
2500+
</relation>
2501+
<relation type="one-nofk" rel-entity-name="WorkEffort" fk-name="INV_CNT_WEFF">
2502+
<key-map field-name="workEffortId"/>
2503+
</relation>
2504+
<relation type="one-nofk" rel-entity-name="InventoryCount" title="Parent" fk-name="INV_CNT_PAR">
2505+
<key-map field-name="parentInventoryCountId" rel-field-name="inventoryCountId"/>
2506+
</relation>
2507+
</entity>
2508+
<entity entity-name="InventoryCountItem"
2509+
package-name="org.apache.ofbiz.product.inventory"
2510+
title="Inventory Count Item">
2511+
<field name="inventoryCountId" type="id"></field>
2512+
<field name="countItemSeqId" type="id"></field>
2513+
<field name="productId" type="id"></field>
2514+
<field name="inventoryItemId" type="id"></field>
2515+
<field name="productIdentifier" type="short-varchar"></field>
2516+
<field name="locationSeqId" type="id"></field>
2517+
<field name="quantity" type="fixed-point"></field>
2518+
<field name="systemQuantity" type="fixed-point"></field>
2519+
<field name="statusId" type="id"></field>
2520+
<field name="isRequested" type="indicator"></field>
2521+
<field name="countedByUserLoginId" type="id-vlong"></field>
2522+
<field name="createdDate" type="date-time"></field>
2523+
<field name="createdByUserLoginId" type="id-vlong"></field>
2524+
<prim-key field="inventoryCountId"/>
2525+
<prim-key field="countItemSeqId"/>
2526+
<relation type="one" rel-entity-name="InventoryCount" fk-name="INV_CNT_ITM_HDR">
2527+
<key-map field-name="inventoryCountId"/>
2528+
</relation>
2529+
<relation type="one-nofk" rel-entity-name="Product" fk-name="INV_CNT_ITM_PROD">
2530+
<key-map field-name="productId"/>
2531+
</relation>
2532+
<relation type="one-nofk" rel-entity-name="InventoryItem" fk-name="INV_CNT_ITM_II">
2533+
<key-map field-name="inventoryItemId"/>
2534+
</relation>
2535+
<relation type="one" rel-entity-name="StatusItem" fk-name="INV_CNT_ITM_STTS">
2536+
<key-map field-name="statusId"/>
2537+
</relation>
2538+
</entity>
2539+
<entity entity-name="InventoryCountVariance"
2540+
package-name="org.apache.ofbiz.product.inventory"
2541+
title="Inventory Count Variance">
2542+
<field name="inventoryCountId" type="id"></field>
2543+
<field name="countItemSeqId" type="id"></field>
2544+
<field name="varianceSeqId" type="id"></field>
2545+
<field name="varianceQty" type="fixed-point"></field>
2546+
<field name="varianceReasonId" type="id"></field>
2547+
<field name="createdDate" type="date-time"></field>
2548+
<field name="createdByUserLoginId" type="id-vlong"></field>
2549+
<prim-key field="inventoryCountId"/>
2550+
<prim-key field="countItemSeqId"/>
2551+
<prim-key field="varianceSeqId"/>
2552+
<relation type="one" rel-entity-name="InventoryCountItem" fk-name="INV_CNT_VAR_ITM">
2553+
<key-map field-name="inventoryCountId"/>
2554+
<key-map field-name="countItemSeqId"/>
2555+
</relation>
2556+
<relation type="one" rel-entity-name="VarianceReason" fk-name="INV_CNT_VAR_RSN">
2557+
<key-map field-name="varianceReasonId"/>
2558+
</relation>
2559+
</entity>
2560+
<entity entity-name="InventoryCountStatus"
2561+
package-name="org.apache.ofbiz.product.inventory"
2562+
title="Inventory Count Status History">
2563+
<field name="inventoryCountId" type="id"></field>
2564+
<field name="statusId" type="id"></field>
2565+
<field name="statusDate" type="date-time"></field>
2566+
<field name="changeByUserLoginId" type="id-vlong"></field>
2567+
<prim-key field="inventoryCountId"/>
2568+
<prim-key field="statusId"/>
2569+
<prim-key field="statusDate"/>
2570+
<relation type="one" rel-entity-name="InventoryCount" fk-name="INV_CNT_ST_HDR">
2571+
<key-map field-name="inventoryCountId"/>
2572+
</relation>
2573+
<relation type="one" rel-entity-name="StatusItem" fk-name="INV_CNT_ST_STTS">
2574+
<key-map field-name="statusId"/>
2575+
</relation>
2576+
<relation type="one-nofk" rel-entity-name="UserLogin" fk-name="INV_CNT_ST_ULGN">
2577+
<key-map field-name="changeByUserLoginId" rel-field-name="userLoginId"/>
2578+
</relation>
2579+
</entity>
24782580

24792581
<!-- ========================================================= -->
24802582
<!-- org.apache.ofbiz.product.price -->

applications/product/servicedef/services_inventory.xml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,67 @@ under the License.
8484
<auto-attributes include="pk" mode="IN" optional="false"/>
8585
</service>
8686

87+
<service name="createInventoryCount" default-entity-name="InventoryCount" engine="entity-auto" invoke="create" auth="true">
88+
<description>Create a InventoryCount</description>
89+
<auto-attributes include="pk" mode="INOUT" optional="true"/>
90+
<auto-attributes include="nonpk" mode="IN" optional="true"/>
91+
</service>
92+
<service name="updateInventoryCount" default-entity-name="InventoryCount" engine="entity-auto" invoke="update" auth="true">
93+
<description>Update a InventoryCount</description>
94+
<auto-attributes include="pk" mode="IN"/>
95+
<auto-attributes include="nonpk" mode="IN" optional="true"/>
96+
</service>
97+
<service name="deleteInventoryCount" default-entity-name="InventoryCount" engine="entity-auto" invoke="delete" auth="true">
98+
<description>Delete a InventoryCount</description>
99+
<auto-attributes include="pk" mode="IN"/>
100+
</service>
101+
102+
<service name="createInventoryCountItem" default-entity-name="InventoryCountItem" engine="entity-auto" invoke="create" auth="true">
103+
<description>Create a InventoryCountItem</description>
104+
<auto-attributes include="pk" mode="INOUT" optional="true"/>
105+
<auto-attributes include="nonpk" mode="IN" optional="true"/>
106+
<override name="inventoryCountId" optional="false"/>
107+
</service>
108+
<service name="updateInventoryCountItem" default-entity-name="InventoryCountItem" engine="entity-auto" invoke="update" auth="true">
109+
<description>Update a InventoryCountItem</description>
110+
<auto-attributes include="pk" mode="IN"/>
111+
<auto-attributes include="nonpk" mode="IN" optional="true"/>
112+
</service>
113+
<service name="deleteInventoryCountItem" default-entity-name="InventoryCountItem" engine="entity-auto" invoke="delete" auth="true">
114+
<description>Delete a InventoryCountItem</description>
115+
<auto-attributes include="pk" mode="IN"/>
116+
</service>
117+
118+
<service name="createInventoryCountVariance" default-entity-name="InventoryCountVariance" engine="entity-auto" invoke="create" auth="true">
119+
<description>Create a InventoryCountVariance</description>
120+
<auto-attributes include="pk" mode="INOUT" optional="true"/>
121+
<auto-attributes include="nonpk" mode="IN" optional="true"/>
122+
<override name="inventoryCountId" optional="false"/>
123+
<override name="countItemSeqId" optional="false"/>
124+
</service>
125+
<service name="updateInventoryCountVariance" default-entity-name="InventoryCountVariance" engine="entity-auto" invoke="update" auth="true">
126+
<description>Update a InventoryCountVariance</description>
127+
<auto-attributes include="pk" mode="IN"/>
128+
<auto-attributes include="nonpk" mode="IN" optional="true"/>
129+
</service>
130+
<service name="deleteInventoryCountVariance" default-entity-name="InventoryCountVariance" engine="entity-auto" invoke="delete" auth="true">
131+
<description>Delete a InventoryCountVariance</description>
132+
<auto-attributes include="pk" mode="IN"/>
133+
</service>
134+
135+
<service name="createInventoryCountStatus" default-entity-name="InventoryCountStatus" engine="entity-auto" invoke="create" auth="true">
136+
<description>Create a InventoryCountStatus</description>
137+
<auto-attributes include="pk" mode="INOUT" optional="true"/>
138+
<auto-attributes include="nonpk" mode="IN" optional="true"/>
139+
</service>
140+
<service name="updateInventoryCountStatus" default-entity-name="InventoryCountStatus" engine="entity-auto" invoke="update" auth="true">
141+
<description>Update a InventoryCountStatus</description>
142+
<auto-attributes include="pk" mode="IN"/>
143+
<auto-attributes include="nonpk" mode="IN" optional="true"/>
144+
</service>
145+
<service name="deleteInventoryCountStatus" default-entity-name="InventoryCountStatus" engine="entity-auto" invoke="delete" auth="true">
146+
<description>Delete a InventoryCountStatus</description>
147+
<auto-attributes include="pk" mode="IN"/>
148+
</service>
149+
87150
</services>

0 commit comments

Comments
 (0)