MES Production Completion → SAP B1 Receipt/Issue from Production
MES completion event posts back to SAP Business One: receipt of finished goods via InventoryGenEntries (BaseEntry = production order), component issue via InventoryGenExits (or backflush), then closes the production order with a PATCH. Idempotent on the MES event id.
Steps in this flow
- MES: Completion Event Webhook
- Guard: MES Completion Event
- SL Login (401→relogin, retry once)
- SL: POST /InventoryGenEntries (receipt)
- Backflush BOM?
- SL: POST /InventoryGenExits (component issue)
- Order Complete? (final or qty reached)
- SL: PATCH /ProductionOrders (close)
- Notify: Production Posted