dodil/erp-method

modules/tax/signoff/tax/history/tax_tax_code.v2.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_v2" 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_v2">
  <bpmn:documentation>Tax (VAT): one pool per entity lifecycle, generated from module.yaml.</bpmn:documentation>
  <bpmn:participant id="Participant_tax_tax_code" name="Tax code" processRef="Process_tax_tax_code_v2" />
 </bpmn:collaboration>
 <bpmn:process id="Process_tax_tax_code_v2" name="Tax code" isExecutable="false">
  <bpmn:documentation>Lifecycle of the tax code, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: draft, active, retired. Note: a code's treatment and reporting_box are fixed once a document has used it (a different meaning is a new code); its description and wording may change, because each issued document keeps the wording it froze</bpmn:documentation>
  <bpmn:laneSet id="LaneSet_tax_code">
   <bpmn:lane id="Lane_tax_code_system" name="The system">
    <bpmn:flowNodeRef>Start_tax_code</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_load_pack</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_tax_code_none__if</bpmn:flowNodeRef>
   </bpmn:lane>
   <bpmn:lane id="Lane_tax_code_tax_admin" name="Whoever is responsible for VAT (the owner, the bookkeeper, the accountant)">
    <bpmn:flowNodeRef>Task_add_code</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_activate_code</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_schedule_rate</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_withdraw_rate</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_retire_code</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_schedule_rate__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_schedule_rate__if_end</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_withdraw_rate__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_withdraw_rate__if_end</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>End_tax_code_retired</bpmn:flowNodeRef>
   </bpmn:lane>
  </bpmn:laneSet>
  <bpmn:startEvent id="Start_tax_code" name="Tax code needed">
   <bpmn:outgoing>Flow_Start_tax_code__Gateway_tax_code_none__if</bpmn:outgoing>
  </bpmn:startEvent>
  <bpmn:serviceTask id="Task_load_pack" name="Load the country's codes" dodil:step="load_pack" implementation="##unspecified">
   <bpmn:documentation>By: The system. From none to draft. When: a new installation with no codes, and no migration planned. Effect: the UK pack: S, R, Z, E, OS, RC, NV, with their rates from their real dates.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_tax_code_none__if__Task_load_pack</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_load_pack__Task_activate_code</bpmn:outgoing>
  </bpmn:serviceTask>
  <bpmn:userTask id="Task_add_code" name="Add a tax code" dodil:step="add_code">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From none to draft. When: the code is not in use.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_tax_code_none__if__Task_add_code</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_add_code__Task_activate_code</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_activate_code" name="Activate the code" dodil:step="activate_code">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From draft to active. When: a treatment, a first rate (any date: no document has used the code), and the document wording where the treatment needs one (reverse charge).</bpmn:documentation>
   <bpmn:incoming>Flow_Task_load_pack__Task_activate_code</bpmn:incoming>
   <bpmn:incoming>Flow_Task_add_code__Task_activate_code</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_activate_code__Gateway_schedule_rate__if</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_schedule_rate" name="Schedule a rate change" dodil:step="schedule_rate">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From active to active. When: valid_from after today; no other rate for the code on that date; a second person's approval where tax_changes_need_second_person. Effect: a dated rate row; issued documents unchanged.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_schedule_rate__if__Task_schedule_rate</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_schedule_rate__Gateway_schedule_rate__if_end</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_withdraw_rate" name="Withdraw a rate not yet in effect" dodil:step="withdraw_rate">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From active to active. When: its valid_from is after today. Effect: the row is marked withdrawn, with who and when; it never takes effect.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_withdraw_rate__if__Task_withdraw_rate</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_withdraw_rate__Gateway_withdraw_rate__if_end</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_retire_code" name="Retire the code" dodil:step="retire_code">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From active to retired. When: no rule in effect today or later points at it. Effect: no new determinations; documents keep it.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_withdraw_rate__if_end__Task_retire_code</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_retire_code__End_tax_code_retired</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:exclusiveGateway id="Gateway_tax_code_none__if" name="New tax code?">
   <bpmn:incoming>Flow_Start_tax_code__Gateway_tax_code_none__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_tax_code_none__if__Task_load_pack</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_tax_code_none__if__Task_add_code</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_schedule_rate__if" name="valid_from after today; no other rate for the code on that date; a second person's approval where tax_changes_need_second_person?">
   <bpmn:incoming>Flow_Task_activate_code__Gateway_schedule_rate__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_schedule_rate__if__Task_schedule_rate</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_schedule_rate__if__Gateway_schedule_rate__if_end</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_schedule_rate__if_end">
   <bpmn:incoming>Flow_Gateway_schedule_rate__if__Gateway_schedule_rate__if_end</bpmn:incoming>
   <bpmn:incoming>Flow_Task_schedule_rate__Gateway_schedule_rate__if_end</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_schedule_rate__if_end__Gateway_withdraw_rate__if</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_withdraw_rate__if" name="its valid_from is after today?">
   <bpmn:incoming>Flow_Gateway_schedule_rate__if_end__Gateway_withdraw_rate__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_withdraw_rate__if__Task_withdraw_rate</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_withdraw_rate__if__Gateway_withdraw_rate__if_end</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_withdraw_rate__if_end">
   <bpmn:incoming>Flow_Gateway_withdraw_rate__if__Gateway_withdraw_rate__if_end</bpmn:incoming>
   <bpmn:incoming>Flow_Task_withdraw_rate__Gateway_withdraw_rate__if_end</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_withdraw_rate__if_end__Task_retire_code</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:endEvent id="End_tax_code_retired" name="Tax code retired">
   <bpmn:incoming>Flow_Task_retire_code__End_tax_code_retired</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:sequenceFlow id="Flow_Gateway_tax_code_none__if__Task_load_pack" sourceRef="Gateway_tax_code_none__if" targetRef="Task_load_pack" />
  <bpmn:sequenceFlow id="Flow_Gateway_tax_code_none__if__Task_add_code" sourceRef="Gateway_tax_code_none__if" targetRef="Task_add_code" />
  <bpmn:sequenceFlow id="Flow_Start_tax_code__Gateway_tax_code_none__if" sourceRef="Start_tax_code" targetRef="Gateway_tax_code_none__if" />
  <bpmn:sequenceFlow id="Flow_Task_load_pack__Task_activate_code" sourceRef="Task_load_pack" targetRef="Task_activate_code" />
  <bpmn:sequenceFlow id="Flow_Task_add_code__Task_activate_code" sourceRef="Task_add_code" targetRef="Task_activate_code" />
  <bpmn:sequenceFlow id="Flow_Gateway_schedule_rate__if__Task_schedule_rate" name="valid_from after today; no other rate for the code on that date; a second person's approval where tax_changes_need_second_person" sourceRef="Gateway_schedule_rate__if" targetRef="Task_schedule_rate" />
  <bpmn:sequenceFlow id="Flow_Gateway_schedule_rate__if__Gateway_schedule_rate__if_end" name="otherwise" sourceRef="Gateway_schedule_rate__if" targetRef="Gateway_schedule_rate__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_schedule_rate__Gateway_schedule_rate__if_end" sourceRef="Task_schedule_rate" targetRef="Gateway_schedule_rate__if_end" />
  <bpmn:sequenceFlow id="Flow_Gateway_withdraw_rate__if__Task_withdraw_rate" name="its valid_from is after today" sourceRef="Gateway_withdraw_rate__if" targetRef="Task_withdraw_rate" />
  <bpmn:sequenceFlow id="Flow_Gateway_withdraw_rate__if__Gateway_withdraw_rate__if_end" name="otherwise" sourceRef="Gateway_withdraw_rate__if" targetRef="Gateway_withdraw_rate__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_withdraw_rate__Gateway_withdraw_rate__if_end" sourceRef="Task_withdraw_rate" targetRef="Gateway_withdraw_rate__if_end" />
  <bpmn:sequenceFlow id="Flow_Gateway_schedule_rate__if_end__Gateway_withdraw_rate__if" sourceRef="Gateway_schedule_rate__if_end" targetRef="Gateway_withdraw_rate__if" />
  <bpmn:sequenceFlow id="Flow_Gateway_withdraw_rate__if_end__Task_retire_code" sourceRef="Gateway_withdraw_rate__if_end" targetRef="Task_retire_code" />
  <bpmn:sequenceFlow id="Flow_Task_activate_code__Gateway_schedule_rate__if" sourceRef="Task_activate_code" targetRef="Gateway_schedule_rate__if" />
  <bpmn:sequenceFlow id="Flow_Task_retire_code__End_tax_code_retired" sourceRef="Task_retire_code" targetRef="End_tax_code_retired" />
 </bpmn:process>
 <bpmndi:BPMNDiagram id="BPMNDiagram_tax_v2">
  <bpmndi:BPMNPlane id="BPMNPlane_tax_v2" bpmnElement="Collaboration_tax_v2">
   <bpmndi:BPMNShape id="Participant_tax_tax_code_di" bpmnElement="Participant_tax_tax_code" isHorizontal="true">
    <dc:Bounds x="0" y="0" width="1810" height="400" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_tax_code_system_di" bpmnElement="Lane_tax_code_system" isHorizontal="true">
    <dc:Bounds x="30" y="0" width="1780" height="140" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_tax_code_tax_admin_di" bpmnElement="Lane_tax_code_tax_admin" isHorizontal="true">
    <dc:Bounds x="30" y="140" width="1780" height="260" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Start_tax_code_di" bpmnElement="Start_tax_code">
    <dc:Bounds x="157" y="42" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_load_pack_di" bpmnElement="Task_load_pack">
    <dc:Bounds x="465" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_add_code_di" bpmnElement="Task_add_code">
    <dc:Bounds x="465" y="160" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_activate_code_di" bpmnElement="Task_activate_code">
    <dc:Bounds x="635" y="160" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_schedule_rate_di" bpmnElement="Task_schedule_rate">
    <dc:Bounds x="975" y="160" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_withdraw_rate_di" bpmnElement="Task_withdraw_rate">
    <dc:Bounds x="1315" y="160" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_retire_code_di" bpmnElement="Task_retire_code">
    <dc:Bounds x="1485" y="160" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_tax_code_none__if_di" bpmnElement="Gateway_tax_code_none__if">
    <dc:Bounds x="320" y="35" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_schedule_rate__if_di" bpmnElement="Gateway_schedule_rate__if">
    <dc:Bounds x="830" y="175" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_schedule_rate__if_end_di" bpmnElement="Gateway_schedule_rate__if_end">
    <dc:Bounds x="1000" y="295" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_withdraw_rate__if_di" bpmnElement="Gateway_withdraw_rate__if">
    <dc:Bounds x="1170" y="175" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_withdraw_rate__if_end_di" bpmnElement="Gateway_withdraw_rate__if_end">
    <dc:Bounds x="1340" y="295" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="End_tax_code_retired_di" bpmnElement="End_tax_code_retired">
    <dc:Bounds x="1687" y="182" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNEdge id="Flow_Gateway_tax_code_none__if__Task_load_pack_di" bpmnElement="Flow_Gateway_tax_code_none__if__Task_load_pack">
    <di:waypoint x="370" y="60" />
    <di:waypoint x="465" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_tax_code_none__if__Task_add_code_di" bpmnElement="Flow_Gateway_tax_code_none__if__Task_add_code">
    <di:waypoint x="370" y="60" />
    <di:waypoint x="440" y="60" />
    <di:waypoint x="440" y="200" />
    <di:waypoint x="465" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Start_tax_code__Gateway_tax_code_none__if_di" bpmnElement="Flow_Start_tax_code__Gateway_tax_code_none__if">
    <di:waypoint x="193" y="60" />
    <di:waypoint x="320" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_load_pack__Task_activate_code_di" bpmnElement="Flow_Task_load_pack__Task_activate_code">
    <di:waypoint x="565" y="60" />
    <di:waypoint x="610" y="60" />
    <di:waypoint x="610" y="200" />
    <di:waypoint x="635" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_add_code__Task_activate_code_di" bpmnElement="Flow_Task_add_code__Task_activate_code">
    <di:waypoint x="565" y="200" />
    <di:waypoint x="635" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_schedule_rate__if__Task_schedule_rate_di" bpmnElement="Flow_Gateway_schedule_rate__if__Task_schedule_rate">
    <di:waypoint x="880" y="200" />
    <di:waypoint x="975" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_schedule_rate__if__Gateway_schedule_rate__if_end_di" bpmnElement="Flow_Gateway_schedule_rate__if__Gateway_schedule_rate__if_end">
    <di:waypoint x="880" y="200" />
    <di:waypoint x="975" y="200" />
    <di:waypoint x="975" y="320" />
    <di:waypoint x="1000" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_schedule_rate__Gateway_schedule_rate__if_end_di" bpmnElement="Flow_Task_schedule_rate__Gateway_schedule_rate__if_end">
    <di:waypoint x="1025" y="240" />
    <di:waypoint x="1025" y="360" />
    <di:waypoint x="1025" y="360" />
    <di:waypoint x="1025" y="345" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_withdraw_rate__if__Task_withdraw_rate_di" bpmnElement="Flow_Gateway_withdraw_rate__if__Task_withdraw_rate">
    <di:waypoint x="1220" y="200" />
    <di:waypoint x="1315" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_withdraw_rate__if__Gateway_withdraw_rate__if_end_di" bpmnElement="Flow_Gateway_withdraw_rate__if__Gateway_withdraw_rate__if_end">
    <di:waypoint x="1220" y="200" />
    <di:waypoint x="1315" y="200" />
    <di:waypoint x="1315" y="320" />
    <di:waypoint x="1340" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_withdraw_rate__Gateway_withdraw_rate__if_end_di" bpmnElement="Flow_Task_withdraw_rate__Gateway_withdraw_rate__if_end">
    <di:waypoint x="1365" y="240" />
    <di:waypoint x="1365" y="366" />
    <di:waypoint x="1365" y="366" />
    <di:waypoint x="1365" y="345" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_schedule_rate__if_end__Gateway_withdraw_rate__if_di" bpmnElement="Flow_Gateway_schedule_rate__if_end__Gateway_withdraw_rate__if">
    <di:waypoint x="1050" y="320" />
    <di:waypoint x="1145" y="320" />
    <di:waypoint x="1145" y="200" />
    <di:waypoint x="1170" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_withdraw_rate__if_end__Task_retire_code_di" bpmnElement="Flow_Gateway_withdraw_rate__if_end__Task_retire_code">
    <di:waypoint x="1390" y="320" />
    <di:waypoint x="1460" y="320" />
    <di:waypoint x="1460" y="200" />
    <di:waypoint x="1485" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_activate_code__Gateway_schedule_rate__if_di" bpmnElement="Flow_Task_activate_code__Gateway_schedule_rate__if">
    <di:waypoint x="735" y="200" />
    <di:waypoint x="830" y="200" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_retire_code__End_tax_code_retired_di" bpmnElement="Flow_Task_retire_code__End_tax_code_retired">
    <di:waypoint x="1585" y="200" />
    <di:waypoint x="1687" y="200" />
   </bpmndi:BPMNEdge>
  </bpmndi:BPMNPlane>
 </bpmndi:BPMNDiagram>
</bpmn:definitions>