LOG0207 Create Store transaction (for the completed warehouse operations)
Basic Information
Module | Logistics.Inventory |
---|---|
Code | LOG0207 |
Parent Document | StoreOrder |
Sub-document | StoreTransaction |
Full Name | Create Store transaction (for the completed warehouse operations) |
Status | ACTIVE |
Deterministic | YES |
Supports Transitional Documents | NO |
Replaces | - |
Orphan Rows | Ignore |
Version | Introduced: 2022 |
Date of Suspension | - |
Business Logic
The generation is used to create Store transactions from Store orders, when the WMS module is used for their execution. When the Store order is executed by the WMS module, the generation of the Store transactions is based on the data from this execution. This includes the data about the executed quantity, lot, serial number and i.e. For a complete document flow diagram of the WMS execution, you can see topic
The Store Transaction’s header is created based on the Store Order’s header as follows:
Transaction.DocumentDate = Today
Transaction.ParentStoreOrder = StoreOrder
Transaction.Store = StoreOrder.Store
Transaction.MovementType = StoreOrder.MovementType
Transaction.DocumentCurrency = StoreOrder.DocumentCurrency
Note
The attributes which are not specified here are filled in as described in Standard Document Attributes
Note
The new store transaction is saved then and only when there is at least one line in it.
Fulfillments
Fulfilment Name | StoreOrderFulfillmentToStoreTransactionLine |
---|---|
Fulfilment Tracking Type | Fulfilment Table |
Parent | DocumentFulfillments(where 'DocumentLineId = StoreOrderLineId' AND 'FulfillmentType = Completed' AND 'DestinationEntityName = Wms_Warehouse_Requisition_Lines') |
Child | DocumentFulfillments(where 'DocumentLineId = StoreOrderLineId' AND 'FulfillmentType = Planned' AND 'DestinationEntityName = Inv_Transaction_Lines') |
Parent / Child Relationship | ChildDocumentFulfillment.ParentFulfillment = the Parent Document Fulfillment |
Metrics
Fulfilment Name | Metric Name | Measurement Unit | Parent Value | Child Value | New Record |
---|---|---|---|---|---|
StoreOrderFulfillmentToStoreTransactionLine | MQuantityBase | ParentDocumentFulfillment.Product.BaseMeasurementUnit | ParentDocumentFulfillment.QuantityBase | ChildDocumentFulfillment.QuantityBase | NO |
StoreOrderFulfillmentToStoreTransactionLine | MStandardQuantity | ParentDocumentFulfillment.Product.BaseMeasurementUnit | ParentDocumentFulfillment.StandardQuantity | ChildDocumentFulfillment.StandardQuantity | YES |
The lines of the new document are created based on the data of the Document Fulfillments of the Lines of the Store Order. The table contains information about:
- the Completed execution of Store Order Line by the WMS module. For better understanding we will call these fulfillments Parent Document Fulfillments.
AND - the Planned part of quantities by the Store Transactions which have already been created (if any). For better understanding we will call these fulfillments Child Document Fulfillments.
A separate Store Transaction Lines is created for each Parent Document Fulfillment which was created from the WMS module. This is necessary because it is possible that the different Parent Document Fulfillments contain a breakdown of the executed lots, serial numbers, etc which have to be recorded into the Store Transaction as well.
The new StoreTransactionLine is created as follows:
StoreTransactionLine.LineNo = autonumber (10, 20, 30...)
StoreTransactionLine.ParentStoreOrderLine = StoreOrderLine
StoreTransactionLine.StoreBin = StoreOrderLine.StoreBin
StoreTransactionLine.OriginalProduct = StoreOrderLine.Product
StoreTransactionLine.Product = ParentDocumentFulfillments.Product
StoreTransactionLine.ProductVariant = ParentDocumentFulfillments.ProductVariant
StoreTransactionLine.Lot = ParentDocumentFulfillments.Lot
StoreTransactionLine.SerialNumber = ParentDocumentFulfillments.SerialNumber
StoreTransactionLine.QuantityUnit = StoreOrderLine.QuantityUnit
StoreTransactionLine.Quantity = CONVERT(REMAINING(MStandardQuantity), StoreTransactionLine.QuantityUnit)
StoreTransactionLine.QuantityBase = REMAINING(MQuantityBase)
StoreTransactionLine.StandardQuantityBase = REMAINING(MStandardQuantity)
StoreTransactionLine.UnitCost = if (StoreOrderLine.UnitCost != null),
then StoreTransactionLine.UnitCost = StoreOrderLine.UnitCost,
else StoreTransactionLine.UnitCost = 0.00
StoreTransactionLine.LineCost = if (StoreOrder.MovementType == Receipt) {StoreTransactionLine.LineCost = (StoreOrderLine.LineCost/StoreOrderLine.StandardQuantityBase)* StoreTransactionLine.StandardQuantityBase}, else {StoreTransactionLine.LineCost = 0.00}
StoreTransactionLine.GuaranteePeriodDays = StoreOrderLine.GuaranteePeriodDays
StoreTransactionLine.ParentLineId = StoreOrderLine.ParentLineId
StoreTransactionLine.ParentLineNo = StoreOrderLine.LineNo
StoreTransactionLine.TransactionTimestamp = null
StoreTransactionLine.Notes = StoreOrderLine.Notes
StoreTransactionLine.AllowOverExecution = If (StoreOrderLine.StandardQuantityBase < SUM(DocumentFulfillments.StandartQuantityBase, where
'DocumentLineId = StoreOrderLineId' AND
'FulfillmentType = Completed' AND
'DestinationEntityName = Wms_Warehouse_Requisition_Lines')),
then AllowOverExecution = True,
else AllowOverExecution = False
The new (Child) Document Fulfillment is created as follows:
DocumentFulfillment.Document = StoreOrder
DocumentFulfillment.DocumentLineId = StoreOrderLineId
DocumentFulfillment.LineNo = StoreOrderLine.LineNo
DocumentFulfillment.FulfillmentType = Planned
DocumentFulfillment.IsFinal = If (StoreTransaction.DocumentType.GenerateSingleDocument = true)
, then DocumentFulfillment.IsFinal = true
, else DocumentFulfillment.IsFinal = false
DocumentFulfillment.LineType = Line
DocumentFulfillment.QuantityBase = StoreTransactionLine.QuantityBase
DocumentFulfillment.StandardQuantity = StoreTransactionLine.StandardQuantity
DocumentFulfillment.Product = StoreTransactionLine.Product
DocumentFulfillment.Lot = StoreTransactionLine.Lot
DocumentFulfillment.SerialNumber = StoreTransactionLine.SerialNumber
DocumentFulfillment.ProductVariant = StoreTransactionLine.ProductVariant
DocumentFulfillment.ParentFulfillment = the Parent Document Fulfillment
DocumentFulfillment.DestinationEntityName = Inv_Transaction_Lines