LOG0211 Create receipt Store order for the issued products
Basic Information
Module | Logistics.Inventory |
---|---|
Code | LOG0211 |
Parent Document | Transfer Order |
Sub-document | Store Order |
Full Name | Create receipt Store order for the issued products |
Status | ACTIVE |
Deterministic | NO |
Supports Transitional Documents | NO |
Supports Single Execution | YES |
Replaces | GenerateSeparateReceiptStoreOrders |
Orphan Rows | Forbid |
Split Function | |
Introduced In Version | 2024 SP2 |
Date of Suspension | - |
Business Logic
This generation procedure is used to create receipt Store Orders (SO) from Transfer Orders (TO).
It is used in sequential execution flows, meaning that it waits for the actual stock to be issued from the originating Store before proceeding with the creation of the receipt SOs. This ensures that no receiving SO is generated until the goods have physically left the sending warehouse, ensuring accurate stock movement and synchronization between the warehouses.
In other words, this generation procedure specifically creates receipt SOs only for products that have already been issued from the other store, meaning there are created, released, and non-voided Store Transactions for these lines.
The SO lines contain detailed information about the execution of the issued lines, including the actual issued quantity, lot number, serial number, cost, and other relevant data.
This generation procedure is typically configured in combination with a second procedure, LOG0212, which creates SOs for products that have not yet been issued. While LOG0211 provides details about what has already been issued and is currently expected, LOG0212 indicates what remains to be issued and is planned to be received in the future.
Note
IMPORTANT: Note that document routes for both generation procedures must be set up to create different Document Types otherwise, they won’t function correctly.
The new SO's header is created as follows:
StoreOrder.DocumentDate = Today
StoreOrder.PlanningOnly = False
StoreOrder.Store = TransferOrder.ToStore
StoreOrder.MovementType = Receipt
StoreOrder.DueDate = TransferOrder.DefaultDueDateIn
StoreOrder.PlannedReleaseDate = TransferOrder.DefaultDueDateIn
StoreOrder.PlannedCompletionDate = TransferOrder.DefaultDueDateIn
StoreOrder.CurrencyDirectory = TransferOrder.CurrencyDirectory
StoreOrder.DocumentCurrency =
if (TransferOrder.ToStore.Currency != null)
, then TransferOrder.ToStore.Currency
, else Error "The field 'Document Currency' in the Store Order cannot be filled because currency for the receipt store is not specified."
StoreOrder.FromParty = TransferOrder.FromParty
StoreOrder.ToParty = TransferOrder.FromStore
Fulfillments
Name | IssueStoreTransactionLineToStoreOrderLine |
---|---|
Parent Entity | StoreTransactionLines (where "StoreTransactionLine.ParentStoreOrderLine.ParentLineId = Id of any TransferOrderLine of the generating TransferOrder" AND "StoreTransactionLine.StoreTransaction.MovementType = Issue" AND "StoreTransactionLine.Document.State = RELEASE" AND "StoreTransactionLine.Document.Void = False") |
Child Entity | StoreOrderLine |
Parent / Child Relationship | StoreOrderLine.ParentDocument = StoreTransaction; StoreOrderLine.ParentLineNo = StoreTransaction.LineNo |
Metrics
Fulfillment Name | Metric Name | Measurement Unit | Parent Value | Child Value | New Record |
---|---|---|---|---|---|
IssueStoreTransactionLineToStoreOrderLine | MStandardQuantityBase | StoreTransactionLine.Product.BaseMeasurementUnit | StoreTransactionLine.StandardQuantityBase | StoreOrderLine.StandardQuantityBase | YES |
IssueStoreTransactionLineToStoreOrderLine | MQuantity | StoreTransactionLine.QuantityUnit | StoreTransactionLine.Quantity | StoreOrderLine.Quantity | NO |
IssueStoreTransactionLineToStoreOrderLine | MQuantityBase | StoreTransactionLine.Product.BaseMeasurementUnit | StoreTransactionLine.QuantityBase | StoreOrderLine.QuantityBase | NO |
IssueStoreTransactionLineToStoreOrderLine | MLineCost | StoreTransactionLine.Document.EnterpriseCompany.BaseCurrency | StoreTransactionLine.LineBaseCost | StoreOrderLine.LineCost | NO |
The lines of the new SO are created as follows:
StoreOrderLine.LineNo = autonumber 10, 20, 30
StoreOrderLine.Product = StoreTransactionLine.Product
StoreOrderLine.ProductVariant = StoreTransactionLine.ProductVariant
StoreOrderLine.StoreBin = CAST(StoreTransactionLine.ParentStoreOrderLine.ParentLineId, TransferOrderLines).ToStoreBin
StoreOrderLine.SerialNumber = StoreTransactionLine.SerialNumber
StoreOrderLine.Quantity = StoreTransactionLine.REMAINING(MQuantity)
StoreOrderLine.QuantityUnit = StoreTransactionLine.QuantityUnit
StoreOrderLine.QuantityBase = StoreTransactionLine.REMAINING(MQuantityBase)
StoreOrderLine.StandardQuantityBase = StoreTransactionLine.REMAINING(MStandardQuantityBase)
StoreOrderLine.LineCost = CONVERT(StoreOrderLine.Document.DocumentCurrency, StoreTransactionLine.REMAINING(MUnitCost)
StoreOrderLine.UnitCost =
if (StoreOrderLine.LineCost != 0.00), then StoreOrderLine.CONVERT(StoreOrderLine.Document.DocumentCurrency, StoreTransactionLine.REMAINING(MUnitCost)/Quantity
else 0.00
StoreOrderLine.Lot = StoreTransactionLine.Lot
StoreOrderLine.GuaranteePeriodDays =
if(StoreTransactionLine.GuaranteePeriodDays != null), then StoreTransactionLine.GuaranteePeriodDays
else Product.GuaranteePeriodDays
StoreOrderLine.SalesOrderLine = null
StoreOrderLine.Notes = CAST(StoreTransactionLine.ParentStoreOrderLine.ParentLineId, TransferOrderLines).Notes
StoreOrderLine.PersistLot = false
StoreOrderLine.ParentDocument = StoreTransaction
StoreOrderLine.ParentLineNo = StoreTransactionLine.LineNo
StoreOrderLine.ParentLineId = StoreTransactionLine.ParentStoreOrderLine.ParentLineId
StoreOrderLine.TransactionTimestamp = null
StoreOrderLine.ForOrdering = false
Note
WARNING: Any of the Store Orders created according to the description above is saved then and only when there is at least one line in it.