dodil/erp-method
modules/timesheets/signoff/timesheets/history/timesheets_billing_run.v1.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_timesheets_v1" name="Timesheets processes" targetNamespace="https://git.dodil.io/dodil/erp-platform/processes" exporter="erp-platform erp-compose bpmn" exporterVersion="1">
<bpmn:collaboration id="Collaboration_timesheets_v1">
<bpmn:documentation>Timesheets: one pool per entity lifecycle, generated from module.yaml.</bpmn:documentation>
<bpmn:participant id="Participant_timesheets_billing_run" name="Billing run" processRef="Process_timesheets_billing_run_v1" />
</bpmn:collaboration>
<bpmn:process id="Process_timesheets_billing_run_v1" name="Billing run" isExecutable="false">
<bpmn:documentation>Lifecycle of the billing run, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: draft, released, held, cancelled.</bpmn:documentation>
<bpmn:laneSet id="LaneSet_billing_run">
<bpmn:lane id="Lane_billing_run_system" name="The system">
<bpmn:flowNodeRef>Start_billing_run</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_create_time_billing_run</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_billing_run_finance" name="Finance / the biller">
<bpmn:flowNodeRef>Task_release_time_billing_run</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_hold_time_billing_run</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_cancel_time_billing_run</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_billing_run_draft__if</bpmn:flowNodeRef>
<bpmn:flowNodeRef>End_billing_run_released</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_billing_run_held__if</bpmn:flowNodeRef>
<bpmn:flowNodeRef>End_billing_run_cancelled</bpmn:flowNodeRef>
</bpmn:lane>
</bpmn:laneSet>
<bpmn:startEvent id="Start_billing_run" name="Billing run needed">
<bpmn:outgoing>Flow_Start_billing_run__Task_create_time_billing_run</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:serviceTask id="Task_create_time_billing_run" name="Gather the month's billable hours" dodil:step="create_time_billing_run" implementation="##unspecified">
<bpmn:documentation>By: The system. From none to draft. When: the project's terms bill via ar; approved billable lines not claimed by another run. Effect: run_id tsbill:<project_id>:<period_id>; a ts_billing_claim row per line (plain INSERT).</bpmn:documentation>
<bpmn:incoming>Flow_Start_billing_run__Task_create_time_billing_run</bpmn:incoming>
<bpmn:outgoing>Flow_Task_create_time_billing_run__Gateway_billing_run_draft__if</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:userTask id="Task_release_time_billing_run" name="Release to invoicing" dodil:step="release_time_billing_run">
<bpmn:documentation>By: Finance / the biller. From draft / held to released. When: the total not negative; the releaser is not a person whose hours are in it (email AND sub). Effect: ar POST /invoices/raise from a pending row after commit.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_billing_run_draft__if__Task_release_time_billing_run</bpmn:incoming>
<bpmn:incoming>Flow_Gateway_billing_run_held__if__Task_release_time_billing_run</bpmn:incoming>
<bpmn:outgoing>Flow_Task_release_time_billing_run__End_billing_run_released</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="Task_hold_time_billing_run" name="Hold the run" dodil:step="hold_time_billing_run">
<bpmn:documentation>By: Finance / the biller. From draft to held. Requires: reason.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_billing_run_draft__if__Task_hold_time_billing_run</bpmn:incoming>
<bpmn:outgoing>Flow_Task_hold_time_billing_run__Gateway_billing_run_held__if</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="Task_cancel_time_billing_run" name="Cancel the run" dodil:step="cancel_time_billing_run">
<bpmn:documentation>By: Finance / the biller. From draft / held to cancelled. Requires: reason. Effect: the claims released, so the lines fall into the next run.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_billing_run_draft__if__Task_cancel_time_billing_run</bpmn:incoming>
<bpmn:incoming>Flow_Gateway_billing_run_held__if__Task_cancel_time_billing_run</bpmn:incoming>
<bpmn:outgoing>Flow_Task_cancel_time_billing_run__End_billing_run_cancelled</bpmn:outgoing>
</bpmn:userTask>
<bpmn:exclusiveGateway id="Gateway_billing_run_draft__if" name="Billing run draft: what next?">
<bpmn:incoming>Flow_Task_create_time_billing_run__Gateway_billing_run_draft__if</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_billing_run_draft__if__Task_release_time_billing_run</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_billing_run_draft__if__Task_hold_time_billing_run</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_billing_run_draft__if__Task_cancel_time_billing_run</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:endEvent id="End_billing_run_released" name="Billing run released">
<bpmn:incoming>Flow_Task_release_time_billing_run__End_billing_run_released</bpmn:incoming>
</bpmn:endEvent>
<bpmn:exclusiveGateway id="Gateway_billing_run_held__if" name="Billing run held: what next?">
<bpmn:incoming>Flow_Task_hold_time_billing_run__Gateway_billing_run_held__if</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_billing_run_held__if__Task_release_time_billing_run</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_billing_run_held__if__Task_cancel_time_billing_run</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:endEvent id="End_billing_run_cancelled" name="Billing run cancelled">
<bpmn:incoming>Flow_Task_cancel_time_billing_run__End_billing_run_cancelled</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_Start_billing_run__Task_create_time_billing_run" sourceRef="Start_billing_run" targetRef="Task_create_time_billing_run" />
<bpmn:sequenceFlow id="Flow_Gateway_billing_run_draft__if__Task_release_time_billing_run" sourceRef="Gateway_billing_run_draft__if" targetRef="Task_release_time_billing_run" />
<bpmn:sequenceFlow id="Flow_Gateway_billing_run_draft__if__Task_hold_time_billing_run" sourceRef="Gateway_billing_run_draft__if" targetRef="Task_hold_time_billing_run" />
<bpmn:sequenceFlow id="Flow_Gateway_billing_run_draft__if__Task_cancel_time_billing_run" sourceRef="Gateway_billing_run_draft__if" targetRef="Task_cancel_time_billing_run" />
<bpmn:sequenceFlow id="Flow_Task_create_time_billing_run__Gateway_billing_run_draft__if" sourceRef="Task_create_time_billing_run" targetRef="Gateway_billing_run_draft__if" />
<bpmn:sequenceFlow id="Flow_Task_release_time_billing_run__End_billing_run_released" sourceRef="Task_release_time_billing_run" targetRef="End_billing_run_released" />
<bpmn:sequenceFlow id="Flow_Gateway_billing_run_held__if__Task_release_time_billing_run" sourceRef="Gateway_billing_run_held__if" targetRef="Task_release_time_billing_run" />
<bpmn:sequenceFlow id="Flow_Gateway_billing_run_held__if__Task_cancel_time_billing_run" sourceRef="Gateway_billing_run_held__if" targetRef="Task_cancel_time_billing_run" />
<bpmn:sequenceFlow id="Flow_Task_hold_time_billing_run__Gateway_billing_run_held__if" sourceRef="Task_hold_time_billing_run" targetRef="Gateway_billing_run_held__if" />
<bpmn:sequenceFlow id="Flow_Task_cancel_time_billing_run__End_billing_run_cancelled" sourceRef="Task_cancel_time_billing_run" targetRef="End_billing_run_cancelled" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_timesheets_v1">
<bpmndi:BPMNPlane id="BPMNPlane_timesheets_v1" bpmnElement="Collaboration_timesheets_v1">
<bpmndi:BPMNShape id="Participant_timesheets_billing_run_di" bpmnElement="Participant_timesheets_billing_run" isHorizontal="true">
<dc:Bounds x="0" y="0" width="960" height="520" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_billing_run_system_di" bpmnElement="Lane_billing_run_system" isHorizontal="true">
<dc:Bounds x="30" y="0" width="930" height="140" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_billing_run_finance_di" bpmnElement="Lane_billing_run_finance" isHorizontal="true">
<dc:Bounds x="30" y="140" width="930" height="380" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Start_billing_run_di" bpmnElement="Start_billing_run">
<dc:Bounds x="157" y="42" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_create_time_billing_run_di" bpmnElement="Task_create_time_billing_run">
<dc:Bounds x="295" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_release_time_billing_run_di" bpmnElement="Task_release_time_billing_run">
<dc:Bounds x="635" y="160" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_hold_time_billing_run_di" bpmnElement="Task_hold_time_billing_run">
<dc:Bounds x="635" y="280" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_cancel_time_billing_run_di" bpmnElement="Task_cancel_time_billing_run">
<dc:Bounds x="635" y="400" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_billing_run_draft__if_di" bpmnElement="Gateway_billing_run_draft__if">
<dc:Bounds x="490" y="175" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="End_billing_run_released_di" bpmnElement="End_billing_run_released">
<dc:Bounds x="837" y="182" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_billing_run_held__if_di" bpmnElement="Gateway_billing_run_held__if">
<dc:Bounds x="830" y="295" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="End_billing_run_cancelled_di" bpmnElement="End_billing_run_cancelled">
<dc:Bounds x="837" y="422" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_Start_billing_run__Task_create_time_billing_run_di" bpmnElement="Flow_Start_billing_run__Task_create_time_billing_run">
<di:waypoint x="193" y="60" />
<di:waypoint x="295" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_billing_run_draft__if__Task_release_time_billing_run_di" bpmnElement="Flow_Gateway_billing_run_draft__if__Task_release_time_billing_run">
<di:waypoint x="540" y="200" />
<di:waypoint x="635" y="200" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_billing_run_draft__if__Task_hold_time_billing_run_di" bpmnElement="Flow_Gateway_billing_run_draft__if__Task_hold_time_billing_run">
<di:waypoint x="540" y="200" />
<di:waypoint x="610" y="200" />
<di:waypoint x="610" y="320" />
<di:waypoint x="635" y="320" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_billing_run_draft__if__Task_cancel_time_billing_run_di" bpmnElement="Flow_Gateway_billing_run_draft__if__Task_cancel_time_billing_run">
<di:waypoint x="540" y="200" />
<di:waypoint x="610" y="200" />
<di:waypoint x="610" y="440" />
<di:waypoint x="635" y="440" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_create_time_billing_run__Gateway_billing_run_draft__if_di" bpmnElement="Flow_Task_create_time_billing_run__Gateway_billing_run_draft__if">
<di:waypoint x="395" y="60" />
<di:waypoint x="465" y="60" />
<di:waypoint x="465" y="200" />
<di:waypoint x="490" y="200" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_release_time_billing_run__End_billing_run_released_di" bpmnElement="Flow_Task_release_time_billing_run__End_billing_run_released">
<di:waypoint x="735" y="200" />
<di:waypoint x="837" y="200" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_billing_run_held__if__Task_release_time_billing_run_di" bpmnElement="Flow_Gateway_billing_run_held__if__Task_release_time_billing_run">
<di:waypoint x="855" y="345" />
<di:waypoint x="855" y="360" />
<di:waypoint x="685" y="360" />
<di:waypoint x="685" y="240" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_billing_run_held__if__Task_cancel_time_billing_run_di" bpmnElement="Flow_Gateway_billing_run_held__if__Task_cancel_time_billing_run">
<di:waypoint x="855" y="345" />
<di:waypoint x="855" y="501" />
<di:waypoint x="685" y="501" />
<di:waypoint x="685" y="480" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_hold_time_billing_run__Gateway_billing_run_held__if_di" bpmnElement="Flow_Task_hold_time_billing_run__Gateway_billing_run_held__if">
<di:waypoint x="735" y="320" />
<di:waypoint x="830" y="320" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_cancel_time_billing_run__End_billing_run_cancelled_di" bpmnElement="Flow_Task_cancel_time_billing_run__End_billing_run_cancelled">
<di:waypoint x="735" y="440" />
<di:waypoint x="837" y="440" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>