<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dodil="https://git.dodil.io/dodil/erp-platform/bpmn/1" id="Definitions_inventory_v4" name="Stock & warehouses processes" targetNamespace="https://git.dodil.io/dodil/erp-platform/processes" exporter="erp-platform erp-compose bpmn" exporterVersion="1">
<bpmn:collaboration id="Collaboration_inventory_v4">
<bpmn:documentation>Stock & warehouses: one pool per entity lifecycle, generated from module.yaml.</bpmn:documentation>
<bpmn:participant id="Participant_inventory_receipt" name="Receipt" processRef="Process_inventory_receipt_v4" />
</bpmn:collaboration>
<bpmn:process id="Process_inventory_receipt_v4" name="Receipt" isExecutable="false">
<bpmn:documentation>Lifecycle of the receipt, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: scanned, done. Note: v3: a receipt lands in WH1/IN when receipt_steps is two and a putaway transfer follows (put_away_stock); a supplier-consignment line carries the owner and no value; a subcontract receipt consumes the components at the subcontractor (INV-47). What is still to arrive is purchasing's (its outstanding quantities), never an inventory document; a return to the supplier is purchasing's return row posted through POST /returns-to-supplier (INV-28), valued at the receipt's cost; a return from a customer is a receipt from CUSTOMER naming the delivery it reverses (INV-14), valued at the cost it left at</bpmn:documentation>
<bpmn:laneSet id="LaneSet_receipt">
<bpmn:lane id="Lane_receipt_stock_operator" name="The person on the floor (picker, packer, goods-in)">
<bpmn:flowNodeRef>Start_receipt</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_scan_delivery</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_receive_customer_return</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_inspect_return</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_receipt_none__if</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_inspect_return__if</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_inspect_return__if_end</bpmn:flowNodeRef>
<bpmn:flowNodeRef>End_receipt_done</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_receipt_system" name="The system">
<bpmn:flowNodeRef>Task_post_receipt</bpmn:flowNodeRef>
</bpmn:lane>
</bpmn:laneSet>
<bpmn:startEvent id="Start_receipt" name="Receipt needed">
<bpmn:outgoing>Flow_Start_receipt__Gateway_receipt_none__if</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:userTask id="Task_scan_delivery" name="Scan what arrived" dodil:step="scan_delivery">
<bpmn:documentation>By: The person on the floor (picker, packer, goods-in). From none to scanned. When: readiness: on_order (purchasing's GET /purchase-orders/{purchase_order_id}/expected), units_exact, tracking_complete, within_tolerance; the bin is internal and not archived. Effect: purchasing's POST /purchase-orders/{purchase_order_id}/receipts called once, keyed by the delivery note: the ONE way a receipt is recorded; nothing in stock until purchasing posts each line back.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_receipt_none__if__Task_scan_delivery</bpmn:incoming>
<bpmn:outgoing>Flow_Task_scan_delivery__Task_post_receipt</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="Task_receive_customer_return" name="Receive a customer return against its RMA" dodil:step="receive_customer_return">
<bpmn:documentation>By: The person on the floor (picker, packer, goods-in). From none to done. When: readiness: rma_open (sales-order's expected return for that customer and product), within_rma, serial_was_delivered (a serial delivered to that customer). Effect: numbered {warehouse}/RET/{seq:5}; a move CUSTOMER -> the return location in stock type quality where the reason inspects, valued at the cost it left at; record_delivery on the returns order (v3).</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_receipt_none__if__Task_receive_customer_return</bpmn:incoming>
<bpmn:outgoing>Flow_Task_receive_customer_return__Gateway_inspect_return__if</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="Task_inspect_return" name="Inspect the returned goods" dodil:step="inspect_return">
<bpmn:documentation>By: The person on the floor (picker, packer, goods-in). From done to done. When: the return is in quality stock; every unit decided. Effect: restock (a type change to unrestricted, or a putaway), scrap (a goods issue, purpose scrap) or back to the customer at the value it came in; accepted and rejected reported to sales-order once (POST /sales-orders/{sales_order_id}/return-inspections).</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_inspect_return__if__Task_inspect_return</bpmn:incoming>
<bpmn:outgoing>Flow_Task_inspect_return__Gateway_inspect_return__if_end</bpmn:outgoing>
</bpmn:userTask>
<bpmn:serviceTask id="Task_post_receipt" name="Post the received stock" dodil:step="post_receipt" implementation="##unspecified">
<bpmn:documentation>By: The system. From scanned to done. When: purchasing calls POST /receipts per line, keyed move_ref pur:<receipt_id>:<line_no> (a receipt recorded on purchasing's own screen starts here). Effect: numbered {warehouse}/IN/{seq:5}; a move SUPPLIER -> location per line, converted exactly, valued at quantity_priced x unit_cost / pricing_quantity rounded once (v2: purchasing's pricing unit and quantity); the unit's weights and volume copied onto the line (v2); average cost appended; scanned lots and serials attached; the valuation posted; {move_id, quantity_base} answered.</bpmn:documentation>
<bpmn:incoming>Flow_Task_scan_delivery__Task_post_receipt</bpmn:incoming>
<bpmn:outgoing>Flow_Task_post_receipt__Gateway_inspect_return__if</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:exclusiveGateway id="Gateway_receipt_none__if" name="New receipt?">
<bpmn:incoming>Flow_Start_receipt__Gateway_receipt_none__if</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_receipt_none__if__Task_scan_delivery</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_receipt_none__if__Task_receive_customer_return</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:exclusiveGateway id="Gateway_inspect_return__if" name="the return is in quality stock; every unit decided?">
<bpmn:incoming>Flow_Task_receive_customer_return__Gateway_inspect_return__if</bpmn:incoming>
<bpmn:incoming>Flow_Task_post_receipt__Gateway_inspect_return__if</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_inspect_return__if__Task_inspect_return</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_inspect_return__if__Gateway_inspect_return__if_end</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:exclusiveGateway id="Gateway_inspect_return__if_end">
<bpmn:incoming>Flow_Gateway_inspect_return__if__Gateway_inspect_return__if_end</bpmn:incoming>
<bpmn:incoming>Flow_Task_inspect_return__Gateway_inspect_return__if_end</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_inspect_return__if_end__End_receipt_done</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:endEvent id="End_receipt_done" name="Receipt done">
<bpmn:incoming>Flow_Gateway_inspect_return__if_end__End_receipt_done</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_Gateway_receipt_none__if__Task_scan_delivery" sourceRef="Gateway_receipt_none__if" targetRef="Task_scan_delivery" />
<bpmn:sequenceFlow id="Flow_Gateway_receipt_none__if__Task_receive_customer_return" sourceRef="Gateway_receipt_none__if" targetRef="Task_receive_customer_return" />
<bpmn:sequenceFlow id="Flow_Start_receipt__Gateway_receipt_none__if" sourceRef="Start_receipt" targetRef="Gateway_receipt_none__if" />
<bpmn:sequenceFlow id="Flow_Task_scan_delivery__Task_post_receipt" sourceRef="Task_scan_delivery" targetRef="Task_post_receipt" />
<bpmn:sequenceFlow id="Flow_Gateway_inspect_return__if__Task_inspect_return" name="the return is in quality stock; every unit decided" sourceRef="Gateway_inspect_return__if" targetRef="Task_inspect_return" />
<bpmn:sequenceFlow id="Flow_Gateway_inspect_return__if__Gateway_inspect_return__if_end" name="otherwise" sourceRef="Gateway_inspect_return__if" targetRef="Gateway_inspect_return__if_end" />
<bpmn:sequenceFlow id="Flow_Task_inspect_return__Gateway_inspect_return__if_end" sourceRef="Task_inspect_return" targetRef="Gateway_inspect_return__if_end" />
<bpmn:sequenceFlow id="Flow_Gateway_inspect_return__if_end__End_receipt_done" sourceRef="Gateway_inspect_return__if_end" targetRef="End_receipt_done" />
<bpmn:sequenceFlow id="Flow_Task_receive_customer_return__Gateway_inspect_return__if" sourceRef="Task_receive_customer_return" targetRef="Gateway_inspect_return__if" />
<bpmn:sequenceFlow id="Flow_Task_post_receipt__Gateway_inspect_return__if" sourceRef="Task_post_receipt" targetRef="Gateway_inspect_return__if" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_inventory_v4">
<bpmndi:BPMNPlane id="BPMNPlane_inventory_v4" bpmnElement="Collaboration_inventory_v4">
<bpmndi:BPMNShape id="Participant_inventory_receipt_di" bpmnElement="Participant_inventory_receipt" isHorizontal="true">
<dc:Bounds x="0" y="0" width="1130" height="400" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_receipt_stock_operator_di" bpmnElement="Lane_receipt_stock_operator" isHorizontal="true">
<dc:Bounds x="30" y="0" width="1100" height="260" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_receipt_system_di" bpmnElement="Lane_receipt_system" isHorizontal="true">
<dc:Bounds x="30" y="260" width="1100" height="140" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Start_receipt_di" bpmnElement="Start_receipt">
<dc:Bounds x="157" y="42" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_scan_delivery_di" bpmnElement="Task_scan_delivery">
<dc:Bounds x="465" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_receive_customer_return_di" bpmnElement="Task_receive_customer_return">
<dc:Bounds x="465" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_inspect_return_di" bpmnElement="Task_inspect_return">
<dc:Bounds x="805" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_post_receipt_di" bpmnElement="Task_post_receipt">
<dc:Bounds x="635" y="280" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_receipt_none__if_di" bpmnElement="Gateway_receipt_none__if">
<dc:Bounds x="320" y="35" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_inspect_return__if_di" bpmnElement="Gateway_inspect_return__if">
<dc:Bounds x="660" y="35" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_inspect_return__if_end_di" bpmnElement="Gateway_inspect_return__if_end">
<dc:Bounds x="830" y="155" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="End_receipt_done_di" bpmnElement="End_receipt_done">
<dc:Bounds x="1007" y="42" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_Gateway_receipt_none__if__Task_scan_delivery_di" bpmnElement="Flow_Gateway_receipt_none__if__Task_scan_delivery">
<di:waypoint x="370" y="60" />
<di:waypoint x="465" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_receipt_none__if__Task_receive_customer_return_di" bpmnElement="Flow_Gateway_receipt_none__if__Task_receive_customer_return">
<di:waypoint x="370" y="60" />
<di:waypoint x="440" y="60" />
<di:waypoint x="440" y="180" />
<di:waypoint x="465" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Start_receipt__Gateway_receipt_none__if_di" bpmnElement="Flow_Start_receipt__Gateway_receipt_none__if">
<di:waypoint x="193" y="60" />
<di:waypoint x="320" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_scan_delivery__Task_post_receipt_di" bpmnElement="Flow_Task_scan_delivery__Task_post_receipt">
<di:waypoint x="565" y="60" />
<di:waypoint x="610" y="60" />
<di:waypoint x="610" y="320" />
<di:waypoint x="635" y="320" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_inspect_return__if__Task_inspect_return_di" bpmnElement="Flow_Gateway_inspect_return__if__Task_inspect_return">
<di:waypoint x="710" y="60" />
<di:waypoint x="805" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_inspect_return__if__Gateway_inspect_return__if_end_di" bpmnElement="Flow_Gateway_inspect_return__if__Gateway_inspect_return__if_end">
<di:waypoint x="710" y="60" />
<di:waypoint x="805" y="60" />
<di:waypoint x="805" y="180" />
<di:waypoint x="830" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_inspect_return__Gateway_inspect_return__if_end_di" bpmnElement="Flow_Task_inspect_return__Gateway_inspect_return__if_end">
<di:waypoint x="855" y="100" />
<di:waypoint x="855" y="220" />
<di:waypoint x="855" y="220" />
<di:waypoint x="855" y="205" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_inspect_return__if_end__End_receipt_done_di" bpmnElement="Flow_Gateway_inspect_return__if_end__End_receipt_done">
<di:waypoint x="880" y="180" />
<di:waypoint x="982" y="180" />
<di:waypoint x="982" y="60" />
<di:waypoint x="1007" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_receive_customer_return__Gateway_inspect_return__if_di" bpmnElement="Flow_Task_receive_customer_return__Gateway_inspect_return__if">
<di:waypoint x="565" y="180" />
<di:waypoint x="635" y="180" />
<di:waypoint x="635" y="60" />
<di:waypoint x="660" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_post_receipt__Gateway_inspect_return__if_di" bpmnElement="Flow_Task_post_receipt__Gateway_inspect_return__if">
<di:waypoint x="685" y="360" />
<di:waypoint x="685" y="381" />
<di:waypoint x="685" y="381" />
<di:waypoint x="685" y="85" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>