flowchart LR accTitle: One inquiry for four missing units accDescr: A €160 discrepancy triggers a request for one internal receiving inquiry. The gateway checks the mandate. A task ID confirms creation. After a lost reply, look up the operation key in the destination. A matching record leads to waiting for receiving. Confirmed absence permits a safe retry under the same key. An inconclusive lookup goes to the reconciliation owner. A separate permission lets the service close only when a posted receipt brings the same order line into agreement with the invoice. Only the case owner may close for another authorized reason, such as a formally approved adjustment, and must attach the evidence. %% org-invoice (en) %% https://www.thebsq.com/ai-organizations subgraph g1 ["Accounts payable"] %% n_mismatch — The order and invoice cover 100 brackets at €40 each. Receiving has booked 96. The service attaches the record versions and calculates the €160 difference. n_mismatch["Quantity mismatch"] %% n_submit — Record one instruction and its operation key. Recheck the live mandate, legal entity and receipt revision before the connector submits the internal receiving inquiry. n_submit["Open one internal inquiry"] %% n_waiting — A receipt or an authoritative lookup has identified the existing inquiry for this invoice line. Attach its ID, set the due time and wait for evidence from receiving. n_waiting["Awaiting receiving"] end subgraph g2 ["Reconciliation"] %% n_lookup — The ERP may have accepted the write before its reply was lost. Query the destination by the original business reference. An empty result from a lagging index leaves the outcome unresolved. n_lookup["Reconcile the write"] %% n_owner — A named operator takes over if the destination remains inconclusive, the retry window has expired or a safe retry cannot be established. Further submissions wait for verification. n_owner["Reconciliation owner"] end subgraph g3 ["Business disposition"] %% n_buyer — A confirmed short shipment goes to the buyer. An arranged redelivery goes back to waiting for a posted receipt. A formally approved adjustment goes to the case owner, who checks the evidence and alone may close for that reason. n_buyer["Buyer review"] %% n_closed — The service can use its separate close permission only after a posted receipt resolves the mismatch for the same order line. For other authorized reasons, including an approved adjustment, the case owner records the evidence and closes the inquiry personally. n_closed["Inquiry closed"] end n_mismatch -->|"Mandate and evidence checked"| n_submit n_submit -->|"ERP returns the task ID"| n_waiting n_submit -->|"Reply lost"| n_lookup n_lookup -->|"Matching inquiry found"| n_waiting n_lookup -->|"Definitely absent Safe retry Same key"| n_submit n_lookup -->|"Inconclusive or retry unsafe"| n_owner n_waiting -->|"Service closes on matching posted receipt"| n_closed n_waiting -->|"Short shipment"| n_buyer n_buyer -->|"Redelivery arranged"| n_waiting n_buyer -->|"Case owner closes on approved adjustment"| n_closed %% Confirmed inquiry and receipt — n_mismatch → n_submit → n_waiting → n_closed %% Recovered inquiry with an approved adjustment — n_submit → n_lookup → n_waiting → n_buyer → n_closed %% A buyer arranges redelivery — n_waiting → n_buyer → n_waiting → n_closed %% Confirmed absence and safe retry — n_submit → n_lookup → n_submit → n_waiting %% Uncertain result needs an owner — n_submit → n_lookup → n_owner