dodil/erp-method
modules/ar/signoff/ar/history/ar_schedule.v5.bpmn
<?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_ar_v6" name="Invoicing processes" targetNamespace="https://git.dodil.io/dodil/erp-platform/processes" exporter="erp-platform erp-compose bpmn" exporterVersion="1">
<bpmn:collaboration id="Collaboration_ar_v6">
<bpmn:documentation>Invoicing: one pool per entity lifecycle, generated from module.yaml.</bpmn:documentation>
<bpmn:participant id="Participant_ar_schedule" name="Schedule" processRef="Process_ar_schedule_v6" />
</bpmn:collaboration>
<bpmn:process id="Process_ar_schedule_v6" name="Schedule" isExecutable="false">
<bpmn:documentation>Lifecycle of the schedule, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: active, finished, stopped. Note: which period is due, how many are billed and what remains are DERIVED from starts_on, periods and the invoices raised; nothing increments a counter</bpmn:documentation>
<bpmn:laneSet id="LaneSet_schedule">
<bpmn:lane id="Lane_schedule_system" name="The system">
<bpmn:flowNodeRef>Start_schedule</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_plan_billing</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_finish_schedule</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_stop_billing</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_schedule_none__if</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_schedule_active__if</bpmn:flowNodeRef>
<bpmn:flowNodeRef>End_schedule_finished</bpmn:flowNodeRef>
<bpmn:flowNodeRef>End_schedule_stopped</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_schedule_biller" name="Whoever sends the invoices (office, bookkeeper)">
<bpmn:flowNodeRef>Task_plan_manual_schedule</bpmn:flowNodeRef>
</bpmn:lane>
</bpmn:laneSet>
<bpmn:startEvent id="Start_schedule" name="Schedule needed">
<bpmn:outgoing>Flow_Start_schedule__Gateway_schedule_none__if</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:serviceTask id="Task_plan_billing" name="Create a schedule for the sold line" dodil:step="plan_billing" implementation="##unspecified">
<bpmn:documentation>By: The system. From none to active. When: a source confirmed a recurring, instalment or usage line. Effect: one schedule per line, keyed <source_id>|<line_id>.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_schedule_none__if__Task_plan_billing</bpmn:incoming>
<bpmn:outgoing>Flow_Task_plan_billing__Gateway_schedule_active__if</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:userTask id="Task_plan_manual_schedule" name="Set up a recurring invoice by hand (v4)" dodil:step="plan_manual_schedule">
<bpmn:documentation>By: Whoever sends the invoices (office, bookkeeper). From none to active. When: a customer with a billing profile; starts_on today or later. Effect: a schedule keyed man:<uuid>|1, source_kind manual, on the same engine (AR-42).</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_schedule_none__if__Task_plan_manual_schedule</bpmn:incoming>
<bpmn:outgoing>Flow_Task_plan_manual_schedule__Gateway_schedule_active__if</bpmn:outgoing>
</bpmn:userTask>
<bpmn:serviceTask id="Task_finish_schedule" name="Finish the schedule" dodil:step="finish_schedule" implementation="##unspecified">
<bpmn:documentation>By: The system. From active to finished. When: every period raised.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_schedule_active__if__Task_finish_schedule</bpmn:incoming>
<bpmn:outgoing>Flow_Task_finish_schedule__End_schedule_finished</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="Task_stop_billing" name="Stop billing after the current period" dodil:step="stop_billing" implementation="##unspecified">
<bpmn:documentation>By: The system. From active to stopped. When: the source ended early (AR-28); the stop is dated today, never earlier. Effect: issued invoices are untouched; money owed back is a credit note.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_schedule_active__if__Task_stop_billing</bpmn:incoming>
<bpmn:outgoing>Flow_Task_stop_billing__End_schedule_stopped</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:exclusiveGateway id="Gateway_schedule_none__if" name="New schedule?">
<bpmn:incoming>Flow_Start_schedule__Gateway_schedule_none__if</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_schedule_none__if__Task_plan_billing</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_schedule_none__if__Task_plan_manual_schedule</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:exclusiveGateway id="Gateway_schedule_active__if" name="Schedule active: what next?">
<bpmn:incoming>Flow_Task_plan_billing__Gateway_schedule_active__if</bpmn:incoming>
<bpmn:incoming>Flow_Task_plan_manual_schedule__Gateway_schedule_active__if</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_schedule_active__if__Task_finish_schedule</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_schedule_active__if__Task_stop_billing</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:endEvent id="End_schedule_finished" name="Schedule finished">
<bpmn:incoming>Flow_Task_finish_schedule__End_schedule_finished</bpmn:incoming>
</bpmn:endEvent>
<bpmn:endEvent id="End_schedule_stopped" name="Schedule stopped">
<bpmn:incoming>Flow_Task_stop_billing__End_schedule_stopped</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_Gateway_schedule_none__if__Task_plan_billing" sourceRef="Gateway_schedule_none__if" targetRef="Task_plan_billing" />
<bpmn:sequenceFlow id="Flow_Gateway_schedule_none__if__Task_plan_manual_schedule" sourceRef="Gateway_schedule_none__if" targetRef="Task_plan_manual_schedule" />
<bpmn:sequenceFlow id="Flow_Start_schedule__Gateway_schedule_none__if" sourceRef="Start_schedule" targetRef="Gateway_schedule_none__if" />
<bpmn:sequenceFlow id="Flow_Gateway_schedule_active__if__Task_finish_schedule" sourceRef="Gateway_schedule_active__if" targetRef="Task_finish_schedule" />
<bpmn:sequenceFlow id="Flow_Gateway_schedule_active__if__Task_stop_billing" sourceRef="Gateway_schedule_active__if" targetRef="Task_stop_billing" />
<bpmn:sequenceFlow id="Flow_Task_plan_billing__Gateway_schedule_active__if" sourceRef="Task_plan_billing" targetRef="Gateway_schedule_active__if" />
<bpmn:sequenceFlow id="Flow_Task_plan_manual_schedule__Gateway_schedule_active__if" sourceRef="Task_plan_manual_schedule" targetRef="Gateway_schedule_active__if" />
<bpmn:sequenceFlow id="Flow_Task_finish_schedule__End_schedule_finished" sourceRef="Task_finish_schedule" targetRef="End_schedule_finished" />
<bpmn:sequenceFlow id="Flow_Task_stop_billing__End_schedule_stopped" sourceRef="Task_stop_billing" targetRef="End_schedule_stopped" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_ar_v6">
<bpmndi:BPMNPlane id="BPMNPlane_ar_v6" bpmnElement="Collaboration_ar_v6">
<bpmndi:BPMNShape id="Participant_ar_schedule_di" bpmnElement="Participant_ar_schedule" isHorizontal="true">
<dc:Bounds x="0" y="0" width="1130" height="400" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_schedule_system_di" bpmnElement="Lane_schedule_system" isHorizontal="true">
<dc:Bounds x="30" y="0" width="1100" height="260" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_schedule_biller_di" bpmnElement="Lane_schedule_biller" isHorizontal="true">
<dc:Bounds x="30" y="260" width="1100" height="140" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Start_schedule_di" bpmnElement="Start_schedule">
<dc:Bounds x="157" y="42" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_plan_billing_di" bpmnElement="Task_plan_billing">
<dc:Bounds x="465" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_plan_manual_schedule_di" bpmnElement="Task_plan_manual_schedule">
<dc:Bounds x="465" y="280" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_finish_schedule_di" bpmnElement="Task_finish_schedule">
<dc:Bounds x="805" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_stop_billing_di" bpmnElement="Task_stop_billing">
<dc:Bounds x="805" y="140" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_schedule_none__if_di" bpmnElement="Gateway_schedule_none__if">
<dc:Bounds x="320" y="35" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_schedule_active__if_di" bpmnElement="Gateway_schedule_active__if">
<dc:Bounds x="660" y="35" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="End_schedule_finished_di" bpmnElement="End_schedule_finished">
<dc:Bounds x="1007" y="42" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="End_schedule_stopped_di" bpmnElement="End_schedule_stopped">
<dc:Bounds x="1007" y="162" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_Gateway_schedule_none__if__Task_plan_billing_di" bpmnElement="Flow_Gateway_schedule_none__if__Task_plan_billing">
<di:waypoint x="370" y="60" />
<di:waypoint x="465" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_schedule_none__if__Task_plan_manual_schedule_di" bpmnElement="Flow_Gateway_schedule_none__if__Task_plan_manual_schedule">
<di:waypoint x="370" y="60" />
<di:waypoint x="440" y="60" />
<di:waypoint x="440" y="320" />
<di:waypoint x="465" y="320" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Start_schedule__Gateway_schedule_none__if_di" bpmnElement="Flow_Start_schedule__Gateway_schedule_none__if">
<di:waypoint x="193" y="60" />
<di:waypoint x="320" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_schedule_active__if__Task_finish_schedule_di" bpmnElement="Flow_Gateway_schedule_active__if__Task_finish_schedule">
<di:waypoint x="710" y="60" />
<di:waypoint x="805" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_schedule_active__if__Task_stop_billing_di" bpmnElement="Flow_Gateway_schedule_active__if__Task_stop_billing">
<di:waypoint x="710" y="60" />
<di:waypoint x="780" y="60" />
<di:waypoint x="780" y="180" />
<di:waypoint x="805" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_plan_billing__Gateway_schedule_active__if_di" bpmnElement="Flow_Task_plan_billing__Gateway_schedule_active__if">
<di:waypoint x="565" y="60" />
<di:waypoint x="660" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_plan_manual_schedule__Gateway_schedule_active__if_di" bpmnElement="Flow_Task_plan_manual_schedule__Gateway_schedule_active__if">
<di:waypoint x="565" y="320" />
<di:waypoint x="635" y="320" />
<di:waypoint x="635" y="60" />
<di:waypoint x="660" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_finish_schedule__End_schedule_finished_di" bpmnElement="Flow_Task_finish_schedule__End_schedule_finished">
<di:waypoint x="905" y="60" />
<di:waypoint x="1007" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_stop_billing__End_schedule_stopped_di" bpmnElement="Flow_Task_stop_billing__End_schedule_stopped">
<di:waypoint x="905" y="180" />
<di:waypoint x="1007" y="180" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>