Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented: New inventory cycle count feature. #322

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions applications/datamodel/data/seed/ProductSeedData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,21 @@ under the License.
<StatusValidChange statusId="IXF_SCHEDULED" statusIdTo="IXF_CANCELLED" transitionName="Scheduled Inventory Cancelled"/>
<StatusValidChange statusId="IXF_EN_ROUTE" statusIdTo="IXF_COMPLETE" transitionName="In Route Transfer Completed"/>

<!-- inventory cycle count status -->
<StatusType statusTypeId="INV_CNT_STTS" description="Inventory Count Status" hasTable="N"/>
<StatusItem description="Created" sequenceId="01" statusCode="CREATED" statusId="INV_COUNT_CREATED" statusTypeId="INV_CNT_STTS"/>
<StatusItem description="Pending For Review" sequenceId="02" statusCode="APPROVED" statusId="INV_COUNT_APPROVED" statusTypeId="INV_CNT_STTS"/>
<StatusItem description="Completed" sequenceId="03" statusCode="COMPLETED" statusId="INV_COUNT_COMPLETED" statusTypeId="INV_CNT_STTS"/>
<StatusItem description="Rejected" sequenceId="04" statusCode="REJECTED" statusId="INV_COUNT_REJECTED" statusTypeId="INV_CNT_STTS"/>
<StatusItem description="Closed" sequenceId="05" statusCode="CLOSED" statusId="INV_COUNT_CLOSED" statusTypeId="INV_CNT_STTS"/>

<StatusValidChange statusId="INV_COUNT_CREATED" statusIdTo="INV_COUNT_COMPLETED" transitionName="Complete Inventory Count"/>
<StatusValidChange statusId="INV_COUNT_CREATED" statusIdTo="INV_COUNT_REJECTED" transitionName="Reject Inventory Count"/>
<StatusValidChange statusId="INV_COUNT_CREATED" statusIdTo="INV_COUNT_APPROVED" transitionName="Approved Inventory Count"/>
<StatusValidChange statusId="INV_COUNT_APPROVED" statusIdTo="INV_COUNT_COMPLETED" transitionName="Complete Inventory Count"/>
<StatusValidChange statusId="INV_COUNT_APPROVED" statusIdTo="INV_COUNT_REJECTED" transitionName="Reject Inventory Count"/>
<StatusValidChange statusId="INV_COUNT_REJECTED" statusIdTo="INV_COUNT_CLOSED" transitionName="Closed Inventory Count"/>

<!-- product review status -->
<StatusType description="Product Review" hasTable="N" statusTypeId="PRODUCT_REVIEW_STTS"/>
<StatusItem description="Pending" sequenceId="01" statusCode="PENDING" statusId="PRR_PENDING" statusTypeId="PRODUCT_REVIEW_STTS"/>
Expand Down
132 changes: 130 additions & 2 deletions applications/datamodel/entitydef/product-entitymodel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,10 @@ under the License.
<field name="sectionId" type="id"></field>
<field name="levelId" type="id"></field>
<field name="positionId" type="id"></field>
<field name="geoPointId" type="id"></field>
<field name="geoPointId" type="id"></field>
<field name="locked" type="indicator"/>
<field name="lastCountDate" type="date"/>
<field name="nextCountDate" type="date"/>
<prim-key field="facilityId"/>
<prim-key field="locationSeqId"/>
<relation type="one" fk-name="FACILITY_LOC_FAC" rel-entity-name="Facility">
Expand All @@ -1299,7 +1302,10 @@ under the License.
</relation>
<relation type="one" fk-name="FACILITY_LOC_GEOPT" rel-entity-name="GeoPoint">
<key-map field-name="geoPointId"/>
</relation>
</relation>
<index name="FAC_LOC_SEQ_IDX">
<index-field name="locationSeqId"/>
</index>
</entity>
<entity entity-name="FacilityLocationGeoPoint" package-name="org.apache.ofbiz.product.facility" title="Facility Location Geo Location with history">
<field name="facilityId" type="id"></field>
Expand Down Expand Up @@ -5009,4 +5015,126 @@ under the License.
<key-map field-name="telecomCustomMethodId" rel-field-name="customMethodId"/>
</relation>
</entity>
<entity entity-name="InventoryCount"
package-name="org.apache.ofbiz.product.inventory"
title="Inventory Count">
<field name="inventoryCountId" type="id"/>
<field name="createdByUserLogin" type="id-vlong"/>
<field name="facilityId" type="id"/>
<field name="linkedSessionId" type="id"/>
<field name="statusId" type="id"/>
<field name="createdDate" type="date-time"/>
<prim-key field="inventoryCountId"/>
<relation type="one" fk-name="INV_CNT_STTS" rel-entity-name="StatusItem">
<key-map field-name="statusId"/>
</relation>
<relation type="one" fk-name="INV_CNT_FAC" rel-entity-name="Facility">
<key-map field-name="facilityId"/>
</relation>
</entity>
<entity entity-name="InventoryCountStatus"
package-name="org.apache.ofbiz.product.inventory"
title="Inventory Count Status">
<field name="inventoryCountId" type="id"></field>
<field name="statusId" type="id"></field>
<field name="statusDatetime" type="date-time"></field>
<field name="setByUserLoginId" type="id-vlong"></field>
<prim-key field="inventoryCountId"/>
<prim-key field="statusId"/>
<prim-key field="statusDatetime"/>
<relation type="one" fk-name="INV_CNT_STTS" rel-entity-name="InventoryCount">
<key-map field-name="inventoryCountId"/>
</relation>
<relation type="one" fk-name="INV_CNT_STTS_STTS" rel-entity-name="StatusItem">
<key-map field-name="statusId"/>
</relation>
<relation type="one" fk-name="INV_CNT_STTS_SB_UL" title="SetBy" rel-entity-name="UserLogin">
<key-map field-name="setByUserLogin" rel-field-name="userLoginId"/>
</relation>
</entity>
<entity entity-name="InventoryCountItem"
package-name="org.apache.ofbiz.product.inventory"
title="Inventory Count Item" >
<field name="inventoryCountId" type="id"/>
<field name="inventoryCountItemSeqId" type="id"/>
<field name="inventoryItemId" type="id"/>
<field name="itemStatusId" type="id"/>
<field name="locationSeqId" type="id-long"/>
<field name="productId" type="id"/>
<field name="productIdentifier" type="id-long"/>
<field name="quantity" type="fixed-point"/>
<prim-key field="inventoryCountId"/>
<prim-key field="inventoryCountItemSeqId"/>
<relation type="one" fk-name="INV_ITM_CNT_IMP" rel-entity-name="InventoryCount">
<key-map field-name="inventoryCountId"/>
</relation>
<relation type="many" fk-name="INV_CNT_INV_ITM" rel-entity-name="InventoryItem">
<key-map field-name="inventoryItemId"/>
</relation>
<relation type="one" fk-name="INV_CNT_STTS_ITM" rel-entity-name="StatusItem">
<key-map field-name="itemStatusId" rel-field-name="statusId"/>
</relation>
<relation type="many" fk-name="INV_CNT_FAC_LOC" rel-entity-name="FacilityLocation">
<key-map field-name="locationSeqId"/>
</relation>
</entity>
<entity entity-name="InventoryCountVariance"
package-name="org.apache.ofbiz.product.inventory"
title="Inventory Count Variance" >
<field name="inventoryCountId" type="id"/>
<field name="inventoryCountItemSeqId" type="id"/>
<field name="inventoryItemId" type="id"/>
<field name="productId" type="id"/>
<field name="productIdentifier" type="id-long"/>
<field name="locationSeqId" type="id"/>
<field name="systemQuantityOnHand" type="fixed-point"/>
<field name="actualQuantityOnHand" type="fixed-point"/>
<field name="varianceQuantityOnHand" type="fixed-point"/>
<field name="unitCost" type="fixed-point"/>
<field name="totalCost" type="fixed-point"/>
<field name="actualCost" type="fixed-point"/>
<field name="costVariance" type="fixed-point"/>
<field name="actualValue" type="fixed-point"/>
<field name="totalValue" type="fixed-point"/>
<field name="valueVariance" type="fixed-point"/>
<prim-key field="inventoryCountId"/>
<prim-key field="inventoryCountItemSeqId"/>
<relation type="one" fk-name="INV_COUNT_IMP" rel-entity-name="InventoryCount">
<key-map field-name="inventoryCountId"/>
</relation>
<relation type="one" fk-name="INV_COUNT_IMP_ITM" rel-entity-name="InventoryCountItem">
<key-map field-name="inventoryCountId"/>
<key-map field-name="inventoryCountItemSeqId"/>
</relation>
<relation type="many" fk-name="INV_COUNT_INV_ITM" rel-entity-name="InventoryItem">
<key-map field-name="inventoryItemId"/>
</relation>
<relation type="many" fk-name="INV_COUNT_FAC_LOC" rel-entity-name="FacilityLocation">
<key-map field-name="locationSeqId"/>
</relation>
</entity>
<view-entity entity-name="InventoryCountAndItems" package-name="org.apache.ofbiz.product.inventory">
<member-entity entity-alias="IC" entity-name="InventoryCount"/>
<member-entity entity-alias="ICI" entity-name="InventoryCountItem"/>
<alias-all entity-alias="IC"/>
<alias-all entity-alias="ICI"/>
<view-link rel-entity-alias="ICI" entity-alias="IC" rel-optional="true">
<key-map field-name="inventoryCountId"/>
</view-link>
</view-entity>
<view-entity entity-name="InventoryCountItemsAndVariance" package-name="org.apache.ofbiz.product.inventory">
<member-entity entity-alias="IC" entity-name="InventoryCount"/>
<member-entity entity-alias="ICI" entity-name="InventoryCountItem"/>
<member-entity entity-alias="ICV" entity-name="InventoryCountVariance"/>
<alias-all entity-alias="IC"/>
<alias-all entity-alias="ICI"/>
<alias-all entity-alias="ICV"/>
<view-link rel-entity-alias="IC" entity-alias="ICI" rel-optional="true">
<key-map field-name="inventoryCountId"/>
</view-link>
<view-link rel-entity-alias="ICV" entity-alias="ICI" rel-optional="true">
<key-map field-name="inventoryCountId"/>
<key-map field-name="inventoryCountItemSeqId"/>
</view-link>
</view-entity>
</entitymodel>
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ def issueProductionRunTaskComponentInline(Map parameters,
GenericValue inventoryItem,
GenericValue lastNonSerInventoryItem) {

facilityLocations = from("FacilityLocation").where("facilityId", inventoryItem?.facilityId, "locationSeqId", inventoryItem?.locationSeqId, "locked", "Y").queryList()
if (facilityLocations) {
return error("The affected LTN# " + inventoryItem.inventoryItemId + " belong to the locked locations under active counting session to prevent any inbound and outbound inventory movement. Please choose different LTN from any free location or wait till lock is released.")
}

if (parameters.quantityNotIssued > 0) {
if ("SERIALIZED_INV_ITEM" == inventoryItem.inventoryItemTypeId &&
"INV_AVAILABLE" == inventoryItem.statusId) {
Expand Down
2 changes: 1 addition & 1 deletion applications/order/template/order/OrderList.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ under the License.
if (jQuery('#allcheck').is(':checked')) {
jQuery('.statuscheck').attr ('checked', true);
} else {
jQuery('.statuscheck').attr ('checked', false );
jQuery('.statuscheck').attr ('checked', false);
}
}
function setAllCheckbox() {
Expand Down
79 changes: 78 additions & 1 deletion applications/product/config/ProductUiLabels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,20 @@
<value xml:lang="zh">网站分析类型</value>
<value xml:lang="zh-TW">網站分析型態</value>
</property>
<property key="CreateCountSession">
<value xml:lang="en">Create Session</value>
</property>
<property key="CreateSalesAgreement">
<value xml:lang="en">Create Sales Agreement</value>
<value xml:lang="es">Crear Acuerdo de Ventas</value>
<value xml:lang="nl">Contract aanmaken</value>
</property>
<property key="CountedInventoryItems">
<value xml:lang="en">Counted Inventory Items</value>
</property>
<property key="CountProgress">
<value xml:lang="en">Count Progress</value>
</property>
<property key="FacilityActualShippingCharges">
<value xml:lang="de">Aktuelle Lieferkosten</value>
<value xml:lang="en">Actual shipping charges</value>
Expand Down Expand Up @@ -409,6 +418,9 @@
<value xml:lang="zh">尝试接收一个已经序列化的库存明细,序列号(serialNumber)${parameters.serialNumber}或者传入的库存明细标识(inventoryItemId)${parameters.currentInventoryItemId},并且已接受数量 ${parameters.quantityAccepted} 大于1;我们不知道要做什么!</value>
<value xml:lang="zh-TW">嘗試接收一個已經序列化的庫存細項,序號(serialNumber)${parameters.serialNumber}或者傳入的庫存細項標識(inventoryItemId)${parameters.currentInventoryItemId},並且已接受數量 ${parameters.quantityAccepted} 大於1;我們不知道要做什麼!</value>
</property>
<property key="FacilityRecordCount">
<value xml:lang="en">Record Count</value>
</property>
<property key="FacilityReturnHeaderTypeNotSupported">
<value xml:lang="de">${returnHeader.returnHeaderTypeId} wird nicht unterstützt</value>
<value xml:lang="en">${returnHeader.returnHeaderTypeId} is not supported</value>
Expand Down Expand Up @@ -3676,6 +3688,9 @@
<value xml:lang="zh">送货费差异太大</value>
<value xml:lang="zh-TW">送貨費差異太大</value>
</property>
<property key="FindSession">
<value xml:lang="en">Find Session</value>
</property>
<property key="FormFieldTitle_abbrev">
<value xml:lang="de">Abkürzung</value>
<value xml:lang="en">Abbrev</value>
Expand Down Expand Up @@ -9167,7 +9182,12 @@
<value xml:lang="es">"Identificación de la instalación de inventario requerida"</value>
<value xml:lang="zh">必须有库存场所标识</value>
</property>

<property key="InventoryItemsCounted">
<value xml:lang="en">Inventory Items Counted</value>
</property>
<property key="ItemVariance">
<value xml:lang="en">Item Variance</value>
</property>
<property key="lotIdFilledInAllowed">
<value xml:lang="de">Erlaubt</value>
<value xml:lang="en">Allowed</value>
Expand Down Expand Up @@ -9198,6 +9218,15 @@
<value xml:lang="zh">必须</value>
<value xml:lang="zh-TW">必須</value>
</property>
<property key="LocationCounted">
<value xml:lang="en">Location Counted</value>
</property>
<property key="LocationNotScanned">
<value xml:lang="en">Locations not scanned in last</value>
</property>
<property key="LocationScheduledForScanning">
<value xml:lang="en">Location scheduled for scanning in next</value>
</property>
<property key="MetaDescription">
<value xml:lang="de">Meta Beschreibung</value>
<value xml:lang="en">Meta Description</value>
Expand Down Expand Up @@ -13338,6 +13367,12 @@
<value xml:lang="zh">合同</value>
<value xml:lang="zh-TW">合約</value>
</property>
<property key="FindPendingLocations">
<value xml:lang="en">Find Pending Locations</value>
</property>
<property key="PendingLocations">
<value xml:lang="en">Pending Locations</value>
</property>
<property key="ProductAgreements">
<value xml:lang="de">Verträge</value>
<value xml:lang="en">Agreements</value>
Expand Down Expand Up @@ -16138,6 +16173,9 @@
<value xml:lang="zh">没有找到货运——标识</value>
<value xml:lang="zh-TW">沒有找到貨運識別</value>
</property>
<property key="ProductCountReport">
<value xml:lang="en">Count Report</value>
</property>
<property key="ProductCountryOfOrigin">
<value xml:lang="en">Country of Origin</value>
<value xml:lang="es">País de Origen</value>
Expand Down Expand Up @@ -16712,6 +16750,9 @@
<value xml:lang="zh">客户评级</value>
<value xml:lang="zh-TW">客戶評級</value>
</property>
<property key="ProductCycleCount">
<value xml:lang="en">Cycle Count</value>
</property>
<property key="ProductDL">
<value xml:lang="en">DL</value>
<value xml:lang="es">DL</value>
Expand Down Expand Up @@ -16756,6 +16797,12 @@
<value xml:lang="zh">接收日期</value>
<value xml:lang="zh-TW">接收日期</value>
</property>
<property key="ProductDaysSinceLastCount">
<value xml:lang="en">Days since last count</value>
</property>
<property key="ProductDaysToNextCount">
<value xml:lang="en">Days to next count</value>
</property>
<property key="ProductDaysToShip">
<value xml:lang="de">Tage bis zur Lieferung</value>
<value xml:lang="en">Days To Ship</value>
Expand Down Expand Up @@ -21101,6 +21148,9 @@
<value xml:lang="zh">大图</value>
<value xml:lang="zh-TW">大圖</value>
</property>
<property key="ProductLastCountedOn">
<value xml:lang="en">Last counted on</value>
</property>
<property key="ProductLastCreatedBy">
<value xml:lang="de">Letzte Erstellung von</value>
<value xml:lang="en">Last Created By</value>
Expand Down Expand Up @@ -22802,6 +22852,9 @@
<value xml:lang="zh">新建方法</value>
<value xml:lang="zh-TW">新建方法</value>
</property>
<property key="ProductNextCountDate">
<value xml:lang="en">Next count date</value>
</property>
<property key="ProductNextPackage">
<value xml:lang="de">Nächstes Paket</value>
<value xml:lang="en">Next Package</value>
Expand Down Expand Up @@ -27241,6 +27294,9 @@
<value xml:lang="zh">现货数量</value>
<value xml:lang="zh-TW">現貨數量</value>
</property>
<property key="ProductQtyCounted">
<value xml:lang="en">Qty Counted</value>
</property>
<property key="ProductQtyOffset">
<value xml:lang="de">Vorhandene Menge minus Minimalbestand</value>
<value xml:lang="en">Qty Offset</value>
Expand Down Expand Up @@ -27341,6 +27397,9 @@
<value xml:lang="zh">已拒绝的数量</value>
<value xml:lang="zh-TW">已拒絕的數量</value>
</property>
<property key="ProductQtyVariance">
<value xml:lang="en">Qty Variance</value>
</property>
<property key="ProductQuantity">
<value xml:lang="de">Menge</value>
<value xml:lang="en">Quantity</value>
Expand Down Expand Up @@ -28628,6 +28687,9 @@
<value xml:lang="zh">评价这个产品!</value>
<value xml:lang="zh-TW">評論這個產品!</value>
</property>
<property key="ProductReviewCountSession">
<value xml:lang="en">Review Count Session</value>
</property>
<property key="ProductReviews">
<value xml:lang="de">Bewertungen</value>
<value xml:lang="en">Reviews</value>
Expand Down Expand Up @@ -28828,6 +28890,9 @@
<value xml:lang="zh">搜索</value>
<value xml:lang="zh-TW">搜尋</value>
</property>
<property key="ProductSessionId">
<value xml:lang="en">Session ID</value>
</property>
<property key="ProductST">
<value xml:lang="en">ST</value>
<value xml:lang="es">ST</value>
Expand Down Expand Up @@ -33186,6 +33251,12 @@
<value xml:lang="zh">搜索结果</value>
<value xml:lang="zh-TW">搜尋結果</value>
</property>
<property key="Results">
<value xml:lang="en">Results</value>
</property>
<property key="ReviewSession">
<value xml:lang="en">Review Session</value>
</property>
<property key="SearchTracking">
<value xml:lang="de">Suche Lieferverfolgung</value>
<value xml:lang="en">Search of a tracking</value>
Expand All @@ -33195,6 +33266,12 @@
<value xml:lang="zh">搜索一个跟踪</value>
<value xml:lang="zh-TW">搜尋一個追蹤</value>
</property>
<property key="ToDate">
<value xml:lang="en">To Date</value>
</property>
<property key="TotalProjectedCounts">
<value xml:lang="en">Total Projected Counts</value>
</property>
<property key="Tracking">
<value xml:lang="de">Lieferverfolgung</value>
<value xml:lang="en">Tracking</value>
Expand Down
Loading