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

ASF subversion and git services commented on OFBIZ-13262:
---------------------------------------------------------

Commit d850c17b6f4ed2b78ba5e59dabbfc7dd06d468f5 in ofbiz-framework's branch 
refs/heads/trunk from Divesh Dutta
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=d850c17b6f ]

OFBIZ-13262: Added inventory reservation logic for production run tasks in 
manufacturing and also improved inventory issuance feature that works with 
reservations (#1168)

(OFBIZ-13262)

This PR introduces formal Inventory Reservation capabilities to the
Manufacturing module. Previously, production components were largely
tracked via direct issuance; this enhancement allows the system to
reserve components ahead of physical issuance, bringing manufacturing
parity with Sales Order fulfillment workflows.

**User Workflow & UI Journey**

1. Creation & Planning: A Production Run is created with estimated
component requirements.

2. Formal Commitment (Approval): Upon changing the status to Printed or
Approved, the system automatically triggers the reservation engine (if
setting is enabled)

3. UI Impact: The "Components" screen now displays a "Reserved" column
and a "Backordered" field for shortages.

4. Seamless Issuance: When the user clicks "Issue Component," the system
automatically consumes the existing reservations first, ensuring that
reserved lots or batches are accurately tracked through the issuance
process. If no reservations are available, then system issues inventory.

5. "Force Issue" (Break-Glass Logic): In cases where reservations are
not available (e.g., emergency jobs or stock discrepancies), the user
can still perform a "Force Issue." This allows physical issuance to
proceed regardless of the reservation state, ensuring that the
production line never stops due to administrative blockers.

6. Automated Recovery: Any remaining backorders in the reservation
ledger are automatically satisfied as soon as new stock is received in
the warehouse.


**New Data Model: WorkEffortInvRes**

A new table, **WorkEffortInvRes** (Inventory Reservation for
WorkEffort), has been introduced as the core ledger for this feature.

- Purpose: It tracks "soft" commitments of materials to production
tasks.

- Backorder Support: Through the quantityNotAvailable field, it
explicitly tracks "Global Debt" or backordered units, allowing the
system to know exactly what is owed to the production line.

- Auditability: It stores reservation timestamps and strategy enums
(FIFO/LIFO), providing a full audit trail of how and when materials were
committed.

**New Policy Controls (Facility Settings)**

To support diverse warehouse operations, three new flags have been
introduced to the Facility entity:

1. autoReservePrun (Y/N): Controls the entry point of the reservation
lifecycle. If enabled, the system automatically invokes
autoReserveWorkEffortInventory whenever a production run reaches the
Approved or Printed status.

7. allowInventoryTheft (Y/N): Determines if a production task can
"claim" reservations currently held by another task. Essential for
high-priority production in fluid environments.

8. reconcilePrunBackorders (Y/N): Enables real-time backorder
fulfillment. When inventory is received, the system proactively reserves
it for pending production tasks.

**Core Services Added:**

1. autoReserveWorkEffortInventory: Triggers when autoReservePrun in
Facility is set to Y. Provides high-level automation by orchestrating
the reservation of all components required for a production run. It
evaluates current facility inventory levels and automatically generates
WorkEffortInvRes records to secure materials.

2. reserveWorkEffortInventoryItem: Allows for granular, item-specific
commitments. Users can explicitly reserve a particular InventoryItem
(e.g., a specific batch or lot) against a production task, bypassing the
automated selection logic.

3. reallocateAndIssueInventory: The primary engine for transition. It
manages the logic of converting existing reservations into physical
issuance. It also handles "Move-Then-Issue" strategies, allowing
reservations to be reallocated between tasks if required by the
facility's fluidity policies. Depends on allowInventoryTheft flag of
Facility.

9. releaseProductionRunTaskComponent: Handles the cleanup of
commitments. When a task is cancelled or a component is no longer
needed, this service releases the reservation and ensures that the ATP
(Available to Promise) balance is immediately restored across the
facility.

10. reassignWorkEffortInventoryReservations: The Backorder Satisfier:
Automatically fulfills backordered production tasks
(quantityNotAvailable in WorkEffortInvRes) when new inventory is
received or released.

11. reconcileGlobalReservations: The Public Auditor: The top-level
service used to audit and reconcile inventory state. It ensures that any
"Global Debt" (reservations without an item ID) is correctly localized
to physical stock as soon as it becomes available.

12. trinitySync: The Integrity Guard: Performs real-time recalculation
of availableToPromiseTotal by comparing physical stock against active
reservations in WorkEffortInvRes and OrderItemShipGrpInvRes.


**Real-time Automation (SECA)**

To ensure a seamless user experience, several Service ECA (SECA)
triggers have been introduced:

- Approval Trigger: Automatically invokes autoReserveWorkEffortInventory
when a production run status changes to Printed/Approved, ensuring stock
is secured the moment a job is confirmed.

- Receipt Satisfaction: Automatically invokes
reassignWorkEffortInventoryReservations whenever inventory levels
increase (via balanceInventoryItems), immediately satisfying any pending
production backorders.

The primary objective is to allow production tasks to commit inventory
early in the production lifecycle. This ensures that critical materials
are "locked" for specific jobs, preventing stockouts and enabling more
accurate Material Requirements Planning (MRP) and Available-to-Promise
(ATP) calculations.


**Business Impact**

- Accurate Material Planning: MRP and ATP calculations now reflect true
manufacturing commitments, preventing component "hoarding" and
stockouts.

- Zero-Touch Fulfillment: Production backorders are satisfied
automatically upon stock receipt, reducing manual intervention from
warehouse managers.

- Policy Flexibility: Facility managers can choose between strict
reservation models or fluid environments where high-priority jobs can
"steal" stock from others.


At a high level, this new inventory reservation framework delivers five
critical business benefits:

1. Guaranteed Material Availability: By formally "locking" components
for specific production tasks, the system prevents stockouts and ensures
that materials are physically waiting for the production line when
needed.

2. Reduced Production Lead Times: The automated backorder fulfillment
logic removes manual intervention from the warehouse. As soon as missing
stock arrives, it is instantly committed to the waiting production job,
accelerating the entire manufacturing cycle.

3. Physical-to-Ledger Integrity: The "Trinity of Truth" synchronization
ensures that your warehouse floor always matches your financial books.
This eliminates "ghost inventory" and significantly reduces the time
spent on manual inventory audits and corrections.

4. Strategic Operational Agility: New facility-level policies allow
management to prioritize critical production runs. High-priority jobs
can automatically secure materials from lower-priority tasks, ensuring
that key customer deadlines are always met.

5. Proactive Shortage Visibility: Floor managers gain real-time
visibility into material blockers. By identifying backorders at the
planning stage rather than the issuance stage, the organization can
proactively resolve shortages before they stop the production line.

In essence, these features move the organization from reactive inventory
tracking to proactive material commitment, directly increasing
manufacturing reliability and throughput.

> Implement Inventory Reservation Flow for Work Orders in Manufacturing
> ---------------------------------------------------------------------
>
>                 Key: OFBIZ-13262
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13262
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: manufacturing
>    Affects Versions: Upcoming Branch
>            Reporter: Yashwant Dhakad
>            Assignee: Divesh Dutta
>            Priority: Minor
>             Fix For: Upcoming Branch
>
>         Attachments: OFBIZ-13262.patch, image-2025-06-19-08-57-41-245.png
>
>
> Introduce a robust inventory reservation flow for work orders in the 
> manufacturing module. Currently, inventory is not reserved at the time of 
> production run approval, leading to the risk of overcommitting stock across 
> multiple runs. This enhancement will enable both manual lot selection by 
> users and automatic reservation based on configured logic (like FIFO/LIFO). 
> The goal is to prevent material conflicts, improve inventory accuracy, and 
> align with real-world production control needs.



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

Reply via email to