Lead Time

The Lead Time Calculation is used to compute projected lead times for requisition processing and vendor response. The two lead times are used to determine how far in advance an order or request should be placed. If an order is placed too far in advance, the stock items will have to be stored in inventory before they are ready for use. This will lead to an increase in inventory costs. Also, if an order is placed too late, the stock items may not arrive on time, thus causing stock outs. The Requisition Processing Lead Time is the amount of time it takes for an item to be ordered once it has been requested. The vendor response lead time is the amount of time it takes between placing an order and receiving the stock items. These figures are computed using historical data of transactions found in the Commodity Journal.

The Lead Time Calculation batch job is primarily run at the end of the month before Reorder Quantity Calculation is run. It calculates the lead time for requisition processing and vendor response based on the dates of the requisition (RQ) and related purchase order (PO) and receiving (RC) transactions. The batch reads the Commodity Journal and calculates the lead time of each stock item based on the specified parameters. The Requisition and Vendor lead time fields are updated on the Inventory Table.

The Lead Time Calculation program will calculate the requisition and vendor lead times for all stock items with procurement activity. It searches the Commodity Journal for RQ, PO, and RC transactions that fall within a specified time frame. The amount of time between the RQ and PO is the Requisition Lead Time, and the amount of time between the PO and RC is the Vendor Lead Time. Once calculated, the lead times will be updated on the Inventory Table.  Also, an Exception Report will be used to show all transactions not selected due to the number of transactions processed being greater than the Number of Alternate Orders field on the Warehouse.

The Requisition and Vendor Lead Times will be calculated for each stock item with a fully referenced RQ or PO found on the Commodity Journal. The same stock item found in different warehouses will have different calculations. If an item has not been requested, ordered, or received in the given time frame, these calculations will not be computed.   

Requisition Lead Time CalculationRequisition Lead Time Calculation

The requisition lead time is calculated for each stock item. The calculation takes into account the quantity requested and the time between Requisition and Purchasing.  

The Lead Time Calculation job will search the Commodity Journal for records with transaction type 'RQ', with a Warehouse and a Transaction Date greater than or equal to the From Date Parameter.  It will sort the records on Warehouse, Commodity, Stock Item Suffix, Transaction Code, Transaction Department Code, Transaction ID, Transaction Version Number, Vendor Line, and Commodity Line.

For each RQ Commodity Line found that meets the parameter, the version of the transaction will be evaluated. If the Transaction Function of the initial version is a Modification or Cancellation transaction, all versions of the transaction are skipped. If the initial version of the transaction is ‘New’, the Transaction Date is stored. This is the date to be used in the lead time calculation. The last final version of the same RQ Commodity Line must be found to determine the quantity to use. The quantity found on the Commodity Journal represents the total quantity.  If the Transaction Function of the last final version is New or Modification, then the transaction is selected for calculation, and the quantity stored.  If the last final version is a Cancellation, the transaction will be skipped and no calculations will be made.

In order to limit the calculation performed for a wide range of time, there is a limit to the number of transactions to perform the calculation on.  If the Number of Alternate Orders field on the Warehouse (WHSE) is filled in, it will be the maximum number of transactions that should be selected for calculation. The transactions to select are the first records that meet the criteria that are fully referenced, meaning the total reference transaction Received Quantity is equal to the Ordered Quantity. Different versions of the same transaction will only count once. If the number of transactions processed is greater than the Number of Alternate Orders field, then an exception line will be output to the Exception Report.

The Commodity Journal is then searched again for all PO Commodity Lines that reference the Requisition Commodity Line.  Search for PO Commodity Lines where the RQ Transaction Code is equal to Reference Transaction Code, RQ Transaction Department Code is equal to Reference Transaction Department Code, RQ Transaction ID is equal to Reference Transaction ID, RQ Vendor Line is equal to Reference Vendor Line, and the RQ Commodity Line Number is equal to Reference Transaction Line. All selected records will be sorted on Transaction Code, Transaction Department Code, Transaction ID, Transaction Version Number, Vendor Line Number, and Commodity Line Number.

For each PO Commodity Line returned, the transaction date of the initial version is stored.  The last final version of the transaction will determine the quantity to use in the calculation. If the last final version is not a Cancellation, the transaction will be used. If the last final version is a Cancellation, the PO is skipped, no calculations are performed, and the next RQ Commodity Line is selected. The Requisition Lead Time is calculated by multiplying the number of items purchased by the number of days between the initial RQ and the initial PO. This calculation is done for each PO Commodity Line found referencing the Requisition. If the total number of items requested is equal to the number of items purchased, then the quantities calculated above will be summed up and divided by the total number of items requested. If the quantities are not equal, the RQ is skipped, and no calculations are performed. This is the Requisition lead time for one RQ Commodity Line.

If more than one RQ Commodity Line is found, then this process is repeated until all RQ’s have requisition lead time calculations.  These are then averaged to produce one lead time calculation for each warehouse stock item. This value should be rounded up and is the Requisition Lead time.

If no RQ or referencing PO transactions are found in the Commodity Journal, the Requisition Lead Time will not be computed. In this case, the Requisition Lead Time on the Inventory Table for the stock item will not be updated. If calculated, the Requisition Lead Time Field on the Inventory Table will be updated for each stock item.

Vendor Lead Time CalculationVendor Lead Time Calculation

The vendor lead time is calculated for each stock item.  The calculation takes into account the quantity purchased, and the time between Purchasing and Receiving.  

This part of the Lead Time Calculation job will search the Commodity Journal for records with a transaction type ‘PO’, with a warehouse and a Transaction Date greater than or equal to the From Date Parameter.  It will sort the records on Warehouse, Commodity, Stock Item Suffix, Transaction Code, Transaction Department Code, Transaction ID, Transaction Version Number, Vendor Line, and Commodity Line.

For each PO Commodity Line found that meets the parameter, the version of the transaction will be evaluated. If the Transaction Function of the initial version is a Modification or Cancellation transaction, all versions of the transaction are skipped. If the initial version of the transaction is New, the transaction date is stored. This is the date to be used in the lead time calculation. The last final version of the same PO Commodity Line must be found to determine the quantity to use. The quantity found on the Commodity Journal represents the total quantity, not just the difference of the quantity.  If the transaction function of the last final version is New or Modification, then the transaction is selected for calculation, and the quantity stored.  If the last final version is Cancellation, the transaction will be skipped and no calculations will be made.

In order to limit the calculation performed for a wide range of time, there is a limit to the number of transactions to perform the calculation on. If the Number of Alternate Orders field on the Warehouse (WHSE) is filled in, it is the maximum number of transactions that should be selected for calculation. The transactions to select are the first records that meet the criteria that are fully referenced, meaning the total reference transaction Received Quantity is equal to the Ordered Quantity. Different versions of the same transaction will only count once. If the number of transactions processed is greater than the Number of Alternate Orders field, then an exception line will be output to the Exception Report.

The Commodity Journal is then searched again for all RC Commodity Lines that reference the Purchase Order Commodity Line.  The Lead Time Calculation will search for RC Commodity Lines where the PO Transaction Code is equal to Reference Transaction Code, PO Transaction Department Code is equal to Reference Transaction Department Code, PO Transaction ID is equal to Reference Transaction ID, PO Vendor Line Number is equal to Ref Transaction Vendor Line, and PO Commodity Line Number is equal to Reference Commodity Line. All selected records will be sorted on Transaction Code, Transaction Department Code, Transaction ID, Transaction Version Number, Vendor Line number, and Commodity Line Number.

For each RC Commodity Line selected, the transaction date of the initial version is stored. The last final version of the transaction will determine the quantity to use in the calculation. If the last final version is not a Cancellation, the transaction will be used. If it is a Cancellation, the RC will be skipped, and the next one selected. The Vendor lead time is calculated by multiplying the number of items received by the number of days between the initial PO and the initial RC. This calculation is done for each RC transaction found referencing the Purchase Order. If the total number of items received is equal to the number of items purchased, then the quantities calculated above are summed up and divided by the total number of items purchased. This is the Vendor Lead Time for one PO transaction.  If the quantities do not equal, the lead time is not calculated, and the next PO Commodity Line is selected.    

If more than one PO Commodity Line is found, then this process is repeated until all PO’s Commodity Lines have vendor lead time calculations. These are then averaged to produce one lead time calculation for each warehouse stock item.  This value should be rounded up and is the Vendor Lead time.

If no PO Commodity Line or referencing RC Commodity Lines are found in the Commodity Journal, the Vendor Lead Time will not be computed. After each calculation, the Vendor Lead Time Field on the Inventory Table will be updated for each stock item.