LOG0205 Create Warehouse Requisitions

Basic Information

Module Logistics.Inventory
Code LOG0205
Parent Document Store Order
Sub-document Warehouse Requisition
Full Name Create Warehouse Requisitions
Status NEW
Deterministic YES
Supports Transitional Documents NO
Supports Single Execution YES
Replaces -
Orphan Rows Ignore
Split Function -
Version Introduced: 2021.1
Date of Suspension -

Business Logic

This Generation is used to create Warehouse Requisitions from Store Orders. Thе generation is a link between the Inventory and Warehouse Management (WMS) Module. It creates the requisition to Warehouse Management (WMS) Module which needs to be executed by it in order to be fulfilled the needs of the particular Store Order.

The Warehouse Requisition’s header is created based on the Store Order’s header as follows:

WarehouseRequisition.DocumentDate = StoreOrder.DocumentDate

WarehouseRequisition.ManagedWarehouse = StoreOrder.Store.ManagedWarehouse

WarehouseRequisition.RequisitionType = if( StoreOrder.MovementType = Receipt) 

                                   , then Transaction.RequisitionType = Inbound

                                   , else Transaction.RequisitionType = Outbound

WarehouseRequisition.ExpectedDate = ISNULL(StoreOrder.PlannedReleaseDate, StoreOrder.DocumentDate)

WarehouseRequisition.ExpectedTime = null
Note

The attributes which are not specified here are filled in as described in Standard Document Attributes

If StoreOrder.Store.ManagedWarehouse = NULL, throw an error:

No Managed Warehouse is specified for store '{Store.StoreName}'.
Please check if the store is correct and if the field 'Managed Warehouse' in its definition has a value.
Note

The new Warehouse Requisition is saved then and only when there is at least one line in it.

Fulfillments

Fulfilment Name StoreOrderLineToWarehouseRequisitionLine
Fulfilment Tracking Type Fulfilment Table
Parent Entity StoreOrderLine
Fulfilment Table DocumentFulfillment
Parent Entity/ Fulfilment Table Relationship StoreOrderLineId = DocumentFulfillment.DocumentLineId

Metrics

Fulfilment Name Metric Name Measurement Unit Parent Value Fulfilment Table Value New Record
StoreOrderLineToWarehouseRequisitionLine MQuantityBase StoreOrderLine.Product.BaseMeasurementUnit StoreOrderLine.QuantityBase DocumentFulfillment.QuantityBase NO
StoreOrderLineToWarehouseRequisitionLine MStandardQuantity StoreOrderLine.Product.BaseMeasurementUnit StoreOrderLine.StandardQuantityBase DocumentFulfillment.StandardQuantity YES



The lines of the new document are created based on the data of the Planned records in the Document Fulfillments table. The table contains the information for the Fulfilled Part of quantities by the Warehouse Requisitions which have already been created.

Note

Note that for the calculation of the Fulfilled Part are taken into account only the recods whoose Fulfillment Type is Planned.


The new Warehouse Requisition Line is created as follows:

WarehouseRequisitionLine.LineNo = StoreOrderLine.LineNo

WarehouseRequisitionLine.Product = StoreOrderLine.Product

WarehouseRequisitionLine.Lot = StoreOrderLine.Lot

WarehouseRequisitionLine.SerialNumber = StoreOrderLine.SerialNumber

WarehouseRequisitionLine.ProductVariant = StoreOrderLine.ProductVariant

WarehouseRequisitionLine.QuantityBase = StoreOrderLine.REMAINING(MQuantityBase)

WarehouseRequisitionLine.StandardQuantity = StoreOrderLine.REMAINING(MStandardQuantity)

WarehouseRequisitionLine.QuantityUnit = StoreOrderLine.QuantityUnit

WarehouseRequisitionLine.Quantity = If there are no records in the Document Fulfillment table for the current StoreOrderLine

                                , then WarehouseRequisitionLine.Quantity = StoreOrderLine.Quantity

                                , else CONVERT(WarehouseRequisitionLine.StandardQuantity, WarehouseRequisitionLine.QuantityUnit)

WarehouseRequisitionLine.Notes = StoreOrderLine.Notes

WarehouseRequisitionLine.ParentDocument = StoreOrder

WarehouseRequisitionLine.ParentLineNo = StoreOrderLine.LineNo

After the line is created, the generation generates records in the Document Fulfillment table. These records reflect the quantities fulfilled by the current iteration of the generation procedure and are needed to determine the quantities for subsequent generation iterations.

The new Document Fulfillment is created as follows:

DocumentFulfillment.Document = StoreOrder

DocumentFulfillment.DocumentLineId = StoreOrderLineId

DocumentFulfillment.LineNo = StoreOrderLine.LineNo

DocumentFulfillment.FulfillmentType = Planned

DocumentFulfillment.IsFinal = If (WarehouseRequisition.DocumentType.GenerateSingleDocument = true)

                          , then DocumentFulfillment.IsFinal = true

                          , else DocumentFulfillment.IsFinal = false

DocumentFulfillment.LineType = Line

DocumentFulfillment.QuantityBase = WarehouseRequisitionLine.QuantityBase

DocumentFulfillment.StandardQuantity = WarehouseRequisitionLine.StandardQuantity

DocumentFulfillment.Product = WarehouseRequisitionLine.Product

DocumentFulfillment.Lot = WarehouseRequisitionLine.Lot

DocumentFulfillment.SerialNumber = WarehouseRequisitionLine.SerialNumber

DocumentFulfillment.ProductVariant = WarehouseRequisitionLine.ProductVariant

DocumentFulfillment.DestinationEntityName = Wms_Warehouse_Requisition_Lines