dodil/erp-method
modules/tax/signoff/tax/history/tax_cis_return.v4.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_tax_v7" name="Tax (VAT) processes" targetNamespace="https://git.dodil.io/dodil/erp-platform/processes" exporter="erp-platform erp-compose bpmn" exporterVersion="1">
<bpmn:collaboration id="Collaboration_tax_v7">
<bpmn:documentation>Tax (VAT): one pool per entity lifecycle, generated from module.yaml.</bpmn:documentation>
<bpmn:participant id="Participant_tax_cis_return" name="Cis return" processRef="Process_tax_cis_return_v7" />
</bpmn:collaboration>
<bpmn:process id="Process_tax_cis_return_v7" name="Cis return" isExecutable="false">
<bpmn:documentation>Lifecycle of the cis return, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: open, prepared, submitted.</bpmn:documentation>
<bpmn:laneSet id="LaneSet_cis_return">
<bpmn:lane id="Lane_cis_return_system" name="The system">
<bpmn:flowNodeRef>Start_cis_return</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_compute_cis_deduction</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_reverse_cis_deduction</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_compute_cis_deduction__if</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_compute_cis_deduction__if_end</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_reverse_cis_deduction__if</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_reverse_cis_deduction__if_end</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_cis_return_tax_admin" name="Whoever is responsible for VAT (the owner, the bookkeeper, the accountant)">
<bpmn:flowNodeRef>Task_prepare_cis_return</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_submit_cis_return</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_send_cis_statements</bpmn:flowNodeRef>
<bpmn:flowNodeRef>End_cis_return_submitted</bpmn:flowNodeRef>
</bpmn:lane>
</bpmn:laneSet>
<bpmn:startEvent id="Start_cis_return" name="Cis return open">
<bpmn:outgoing>Flow_Start_cis_return__Gateway_compute_cis_deduction__if</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:serviceTask id="Task_compute_cis_deduction" name="Compute the deduction on a subcontractor's payment" dodil:step="compute_cis_deduction" implementation="##unspecified">
<bpmn:documentation>By: The system. From open to open. When: the subcontractor is verified, or was paid in this or the last two tax years. Effect: a deduction row keyed [payment_ref, bp_id] in the payment's tax month (TAX-39).</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_compute_cis_deduction__if__Task_compute_cis_deduction</bpmn:incoming>
<bpmn:outgoing>Flow_Task_compute_cis_deduction__Gateway_compute_cis_deduction__if_end</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:serviceTask id="Task_reverse_cis_deduction" name="Reverse a deduction when the payment is rejected (v4)" dodil:step="reverse_cis_deduction" implementation="##unspecified">
<bpmn:documentation>By: The system. From open to open. When: the deduction's tax month is not submitted (cis_return_open); a repeat answers the same. Effect: a reversing deduction row keyed [payment_ref, bp_id]; the month's return and the subcontractor's statement no longer count it.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_reverse_cis_deduction__if__Task_reverse_cis_deduction</bpmn:incoming>
<bpmn:outgoing>Flow_Task_reverse_cis_deduction__Gateway_reverse_cis_deduction__if_end</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:userTask id="Task_prepare_cis_return" name="Prepare the monthly CIS return" dodil:step="prepare_cis_return">
<bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From open to prepared. When: the tax month (6th to 5th) has ended. Effect: the CIS300 lines per subcontractor, or a nil return.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_reverse_cis_deduction__if_end__Task_prepare_cis_return</bpmn:incoming>
<bpmn:outgoing>Flow_Task_prepare_cis_return__Task_submit_cis_return</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="Task_submit_cis_return" name="Submit the CIS return" dodil:step="submit_cis_return" dodil:approval="true">
<bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From prepared to submitted. When: the employment-status and verification declarations confirmed by a person; an HMRC connection. Requires: declaration. Effect: HMRC's receipt kept (TAX-40). An approval.</bpmn:documentation>
<bpmn:incoming>Flow_Task_prepare_cis_return__Task_submit_cis_return</bpmn:incoming>
<bpmn:outgoing>Flow_Task_submit_cis_return__Task_send_cis_statements</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="Task_send_cis_statements" name="Send each subcontractor its statement" dodil:step="send_cis_statements">
<bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From submitted to submitted. Effect: a payment and deduction statement per subcontractor, the send recorded.</bpmn:documentation>
<bpmn:incoming>Flow_Task_submit_cis_return__Task_send_cis_statements</bpmn:incoming>
<bpmn:outgoing>Flow_Task_send_cis_statements__End_cis_return_submitted</bpmn:outgoing>
</bpmn:userTask>
<bpmn:exclusiveGateway id="Gateway_compute_cis_deduction__if" name="the subcontractor is verified, or was paid in this or the last two tax years?">
<bpmn:incoming>Flow_Start_cis_return__Gateway_compute_cis_deduction__if</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_compute_cis_deduction__if__Task_compute_cis_deduction</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_compute_cis_deduction__if__Gateway_compute_cis_deduction__if_end</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:exclusiveGateway id="Gateway_compute_cis_deduction__if_end">
<bpmn:incoming>Flow_Gateway_compute_cis_deduction__if__Gateway_compute_cis_deduction__if_end</bpmn:incoming>
<bpmn:incoming>Flow_Task_compute_cis_deduction__Gateway_compute_cis_deduction__if_end</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_compute_cis_deduction__if_end__Gateway_reverse_cis_deduction__if</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:exclusiveGateway id="Gateway_reverse_cis_deduction__if" name="the deduction's tax month is not submitted (cis_return_open); a repeat answers the same?">
<bpmn:incoming>Flow_Gateway_compute_cis_deduction__if_end__Gateway_reverse_cis_deduction__if</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_reverse_cis_deduction__if__Task_reverse_cis_deduction</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_reverse_cis_deduction__if__Gateway_reverse_cis_deduction__if_end</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:exclusiveGateway id="Gateway_reverse_cis_deduction__if_end">
<bpmn:incoming>Flow_Gateway_reverse_cis_deduction__if__Gateway_reverse_cis_deduction__if_end</bpmn:incoming>
<bpmn:incoming>Flow_Task_reverse_cis_deduction__Gateway_reverse_cis_deduction__if_end</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_reverse_cis_deduction__if_end__Task_prepare_cis_return</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:endEvent id="End_cis_return_submitted" name="Cis return submitted">
<bpmn:incoming>Flow_Task_send_cis_statements__End_cis_return_submitted</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_Gateway_compute_cis_deduction__if__Task_compute_cis_deduction" name="the subcontractor is verified, or was paid in this or the last two tax years" sourceRef="Gateway_compute_cis_deduction__if" targetRef="Task_compute_cis_deduction" />
<bpmn:sequenceFlow id="Flow_Gateway_compute_cis_deduction__if__Gateway_compute_cis_deduction__if_end" name="otherwise" sourceRef="Gateway_compute_cis_deduction__if" targetRef="Gateway_compute_cis_deduction__if_end" />
<bpmn:sequenceFlow id="Flow_Task_compute_cis_deduction__Gateway_compute_cis_deduction__if_end" sourceRef="Task_compute_cis_deduction" targetRef="Gateway_compute_cis_deduction__if_end" />
<bpmn:sequenceFlow id="Flow_Gateway_reverse_cis_deduction__if__Task_reverse_cis_deduction" name="the deduction's tax month is not submitted (cis_return_open); a repeat answers the same" sourceRef="Gateway_reverse_cis_deduction__if" targetRef="Task_reverse_cis_deduction" />
<bpmn:sequenceFlow id="Flow_Gateway_reverse_cis_deduction__if__Gateway_reverse_cis_deduction__if_end" name="otherwise" sourceRef="Gateway_reverse_cis_deduction__if" targetRef="Gateway_reverse_cis_deduction__if_end" />
<bpmn:sequenceFlow id="Flow_Task_reverse_cis_deduction__Gateway_reverse_cis_deduction__if_end" sourceRef="Task_reverse_cis_deduction" targetRef="Gateway_reverse_cis_deduction__if_end" />
<bpmn:sequenceFlow id="Flow_Gateway_compute_cis_deduction__if_end__Gateway_reverse_cis_deduction__if" sourceRef="Gateway_compute_cis_deduction__if_end" targetRef="Gateway_reverse_cis_deduction__if" />
<bpmn:sequenceFlow id="Flow_Gateway_reverse_cis_deduction__if_end__Task_prepare_cis_return" sourceRef="Gateway_reverse_cis_deduction__if_end" targetRef="Task_prepare_cis_return" />
<bpmn:sequenceFlow id="Flow_Start_cis_return__Gateway_compute_cis_deduction__if" sourceRef="Start_cis_return" targetRef="Gateway_compute_cis_deduction__if" />
<bpmn:sequenceFlow id="Flow_Task_prepare_cis_return__Task_submit_cis_return" sourceRef="Task_prepare_cis_return" targetRef="Task_submit_cis_return" />
<bpmn:sequenceFlow id="Flow_Task_send_cis_statements__End_cis_return_submitted" sourceRef="Task_send_cis_statements" targetRef="End_cis_return_submitted" />
<bpmn:sequenceFlow id="Flow_Task_submit_cis_return__Task_send_cis_statements" sourceRef="Task_submit_cis_return" targetRef="Task_send_cis_statements" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_tax_v7">
<bpmndi:BPMNPlane id="BPMNPlane_tax_v7" bpmnElement="Collaboration_tax_v7">
<bpmndi:BPMNShape id="Participant_tax_cis_return_di" bpmnElement="Participant_tax_cis_return" isHorizontal="true">
<dc:Bounds x="0" y="0" width="1640" height="400" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_cis_return_system_di" bpmnElement="Lane_cis_return_system" isHorizontal="true">
<dc:Bounds x="30" y="0" width="1610" height="260" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_cis_return_tax_admin_di" bpmnElement="Lane_cis_return_tax_admin" isHorizontal="true">
<dc:Bounds x="30" y="260" width="1610" height="140" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Start_cis_return_di" bpmnElement="Start_cis_return">
<dc:Bounds x="157" y="42" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_compute_cis_deduction_di" bpmnElement="Task_compute_cis_deduction">
<dc:Bounds x="465" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_reverse_cis_deduction_di" bpmnElement="Task_reverse_cis_deduction">
<dc:Bounds x="805" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_prepare_cis_return_di" bpmnElement="Task_prepare_cis_return">
<dc:Bounds x="975" y="280" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_submit_cis_return_di" bpmnElement="Task_submit_cis_return">
<dc:Bounds x="1145" y="280" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_send_cis_statements_di" bpmnElement="Task_send_cis_statements">
<dc:Bounds x="1315" y="280" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_compute_cis_deduction__if_di" bpmnElement="Gateway_compute_cis_deduction__if">
<dc:Bounds x="320" y="35" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_compute_cis_deduction__if_end_di" bpmnElement="Gateway_compute_cis_deduction__if_end">
<dc:Bounds x="490" y="155" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_reverse_cis_deduction__if_di" bpmnElement="Gateway_reverse_cis_deduction__if">
<dc:Bounds x="660" y="35" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_reverse_cis_deduction__if_end_di" bpmnElement="Gateway_reverse_cis_deduction__if_end">
<dc:Bounds x="830" y="155" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="End_cis_return_submitted_di" bpmnElement="End_cis_return_submitted">
<dc:Bounds x="1517" y="302" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_Gateway_compute_cis_deduction__if__Task_compute_cis_deduction_di" bpmnElement="Flow_Gateway_compute_cis_deduction__if__Task_compute_cis_deduction">
<di:waypoint x="370" y="60" />
<di:waypoint x="465" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_compute_cis_deduction__if__Gateway_compute_cis_deduction__if_end_di" bpmnElement="Flow_Gateway_compute_cis_deduction__if__Gateway_compute_cis_deduction__if_end">
<di:waypoint x="370" y="60" />
<di:waypoint x="465" y="60" />
<di:waypoint x="465" y="180" />
<di:waypoint x="490" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_compute_cis_deduction__Gateway_compute_cis_deduction__if_end_di" bpmnElement="Flow_Task_compute_cis_deduction__Gateway_compute_cis_deduction__if_end">
<di:waypoint x="515" y="100" />
<di:waypoint x="515" y="220" />
<di:waypoint x="515" y="220" />
<di:waypoint x="515" y="205" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_reverse_cis_deduction__if__Task_reverse_cis_deduction_di" bpmnElement="Flow_Gateway_reverse_cis_deduction__if__Task_reverse_cis_deduction">
<di:waypoint x="710" y="60" />
<di:waypoint x="805" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_reverse_cis_deduction__if__Gateway_reverse_cis_deduction__if_end_di" bpmnElement="Flow_Gateway_reverse_cis_deduction__if__Gateway_reverse_cis_deduction__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_reverse_cis_deduction__Gateway_reverse_cis_deduction__if_end_di" bpmnElement="Flow_Task_reverse_cis_deduction__Gateway_reverse_cis_deduction__if_end">
<di:waypoint x="855" y="100" />
<di:waypoint x="855" y="226" />
<di:waypoint x="855" y="226" />
<di:waypoint x="855" y="205" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_compute_cis_deduction__if_end__Gateway_reverse_cis_deduction__if_di" bpmnElement="Flow_Gateway_compute_cis_deduction__if_end__Gateway_reverse_cis_deduction__if">
<di:waypoint x="540" 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_Gateway_reverse_cis_deduction__if_end__Task_prepare_cis_return_di" bpmnElement="Flow_Gateway_reverse_cis_deduction__if_end__Task_prepare_cis_return">
<di:waypoint x="880" y="180" />
<di:waypoint x="950" y="180" />
<di:waypoint x="950" y="320" />
<di:waypoint x="975" y="320" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Start_cis_return__Gateway_compute_cis_deduction__if_di" bpmnElement="Flow_Start_cis_return__Gateway_compute_cis_deduction__if">
<di:waypoint x="193" y="60" />
<di:waypoint x="320" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_prepare_cis_return__Task_submit_cis_return_di" bpmnElement="Flow_Task_prepare_cis_return__Task_submit_cis_return">
<di:waypoint x="1075" y="320" />
<di:waypoint x="1145" y="320" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_send_cis_statements__End_cis_return_submitted_di" bpmnElement="Flow_Task_send_cis_statements__End_cis_return_submitted">
<di:waypoint x="1415" y="320" />
<di:waypoint x="1517" y="320" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_submit_cis_return__Task_send_cis_statements_di" bpmnElement="Flow_Task_submit_cis_return__Task_send_cis_statements">
<di:waypoint x="1245" y="320" />
<di:waypoint x="1315" y="320" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>