You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Divesh Dutta (Jira)" <ji...@apache.org> on 2026/07/03 11:44:00 UTC

[jira] [Commented] (OFBIZ-13451) Apache OFBiz MRP — Procurement Lead Time Not Applied to Purchase Requirements

    [ https://issues.apache.org/jira/browse/OFBIZ-13451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18093417#comment-18093417 ] 

Divesh Dutta commented on OFBIZ-13451:
--------------------------------------

Here is the high level details of the implementation  plan:


 * Update the MRP purchased-item flow in {{MrpServices}} so that proposed purchase requirements use supplier lead time when calculating {{{}requirementStartDate{}}}.

 * Add logic to fetch active {{SupplierProduct}} records for the product, filtered by the requirement date so expired supplier rows are ignored.

 * Prefer an active primary supplier when resolving {{{}standardLeadTimeDays{}}}. If no active primary supplier with lead time is available, fall back to any other active supplier with defined lead time.

 * Use the resolved {{SupplierProduct.standardLeadTimeDays}} to back-schedule the purchased requirement start date from {{{}requiredByDate{}}}.

 * If no active supplier lead time is found, preserve current behavior and keep {{{}requirementStartDate = requiredByDate{}}}.

 * Do not use {{ProductFacility.daysToShip}} as a fallback for procurement lead time.

 * Do not change the existing built-vs-bought decision logic in MRP. This fix should only affect dating of purchased requirements.

> Apache OFBiz MRP — Procurement Lead Time Not Applied to Purchase Requirements
> -----------------------------------------------------------------------------
>
>                 Key: OFBIZ-13451
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13451
>             Project: OFBiz
>          Issue Type: Task
>            Reporter: Swapnil Shah
>            Assignee: Divesh Dutta
>            Priority: Major
>         Attachments: 06_supplier_leadtime.png, tc1_baseline_requirements.png, tc3_finishedgood_requirements.png
>
>
> _Feature gap / enhancement request · verified on trunk (commit 18109c9fe7), Java 17, demo data_
> h3. Use case
> When MRP plans a purchased item, the proposed purchase requirement's start date should fall early enough for the component to arrive by the date it is needed — i.e. the supplier's procurement lead time should offset the requirement start date from its required-by date. This lets planners know when each PO must be placed.
> h3. Feature gap
> MRP currently does not factor procurement lead time into purchase requirements. Every proposed PRODUCT_REQUIREMENT is created with {*}requirementStartDate = requiredByDate{*}, so the "place the PO by" signal is lost. With any non-zero supplier lead time, a PO created from such a requirement is placed too late and the component arrives late by exactly the lead time.
>  * *SupplierProduct.standardLeadTimeDays* is not read by MRP (only by order-entry display screens).
>  * *ProductFacility.daysToShip* is honored only for demand originating from the confirmed sales order and is forced to 0 for purchased item demand, so setting it on components has no effect.
> h3. Verification (skateboard two-level BOM, 7 purchased leaf components, 15-day supplier lead time)
> ||Scenario||Purchase requirement dates||Result||
> |Baseline (no daysToShip)|start = required-by|No lead-time offset|
> |daysToShip = 15 on components|start = required-by|Setting ignored for components|
> |daysToShip = 15 on sales-order product|whole tree shifts as one block; start still = required-by|Still no procurement offset|
> Manufactured items are correctly back-scheduled through their routings; only purchased requirements lack the procurement offset. Example — Glue needed Jun 1: proposed start Jun 1, expected start ≈ May 17 (Jun 1 − 15 days).
> h3. Expected behavior
> {code:java}
> Requirement Start Date = Required-by date − procurement lead time{code}
> The procurement lead time should determine when a purchase requirement must be initiated so the component is available when needed.
> h3. Evidence
> !06_supplier_leadtime.png!
> _Supplier record for Glue — standardLeadTimeDays = 15. This value is configured but does not get factored/honored by MRP._
> !tc1_baseline_requirements.png!
> _Baseline MRP run — every purchased PRODUCT_REQUIREMENT has requirementStartDate equal to requiredByDate (no procurement offset); only manufactured items are back-scheduled._
> !tc3_finishedgood_requirements.png!
> _Even with delivery days set, the proposed purchase requirements still have requirementStartDate equal to requiredByDate — the supplier's delivery time is not factored into the dates._



--
This message was sent by Atlassian Jira
(v8.20.10#820010)