dodil/erp-method

modules/tax/signoff/tax/history/tax_vat_return.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_v5" 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_v5">
  <bpmn:documentation>Tax (VAT): one pool per entity lifecycle, generated from module.yaml.</bpmn:documentation>
  <bpmn:participant id="Participant_tax_vat_return" name="Vat return" processRef="Process_tax_vat_return_v5" />
 </bpmn:collaboration>
 <bpmn:process id="Process_tax_vat_return_v5" name="Vat return" isExecutable="false">
  <bpmn:documentation>Lifecycle of the vat return, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: open, draft, locked, submitted. Note: a submission that times out is settled by GET /organisations/vat/{vrn}/returns/{periodKey} before any retry, so a return is never filed twice; a correction after submission is an adjustment on a later return or a VAT652 notice, never an edit</bpmn:documentation>
  <bpmn:laneSet id="LaneSet_vat_return">
   <bpmn:lane id="Lane_vat_return_system" name="The system">
    <bpmn:flowNodeRef>Start_vat_return</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_sync_vat_obligations</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Timer_sync_vat_obligations</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_ai_review_vat_return</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_settle_vat_return</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_refresh_vat_liability</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Timer_refresh_vat_liability</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_ai_review_vat_return__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_ai_review_vat_return__if_end</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_settle_vat_return__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_settle_vat_return__if_end</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_refresh_vat_liability__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_refresh_vat_liability__if_end</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>End_vat_return_submitted</bpmn:flowNodeRef>
   </bpmn:lane>
   <bpmn:lane id="Lane_vat_return_tax_admin" name="Whoever is responsible for VAT (the owner, the bookkeeper, the accountant)">
    <bpmn:flowNodeRef>Task_prepare_vat_return</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_refresh_vat_return</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_record_vat_adjustment</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_record_vat_error_notice</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_lock_vat_return</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_reopen_vat_return</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_record_vat_adjustment__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_record_vat_adjustment__if_end</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_record_vat_error_notice__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_record_vat_error_notice__if_end</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_vat_return_locked__if</bpmn:flowNodeRef>
   </bpmn:lane>
   <bpmn:lane id="Lane_vat_return_owner" name="The owner or a finance controller">
    <bpmn:flowNodeRef>Task_submit_vat_return</bpmn:flowNodeRef>
   </bpmn:lane>
  </bpmn:laneSet>
  <bpmn:startEvent id="Start_vat_return" name="Vat return needed">
   <bpmn:outgoing>Flow_Start_vat_return__Timer_sync_vat_obligations</bpmn:outgoing>
  </bpmn:startEvent>
  <bpmn:serviceTask id="Task_sync_vat_obligations" name="Read our obligations from HMRC" dodil:step="sync_vat_obligations" implementation="##unspecified">
   <bpmn:documentation>By: The system. From none to open. When: an HMRC connection for the VRN. Effect: one vat_obligation per periodKey with HMRC's dates; a period HMRC shows filed is marked so (TAX-27). Waits: daily.</bpmn:documentation>
   <bpmn:incoming>Flow_Timer_sync_vat_obligations__Task_sync_vat_obligations</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_sync_vat_obligations__Task_prepare_vat_return</bpmn:outgoing>
  </bpmn:serviceTask>
  <bpmn:intermediateCatchEvent id="Timer_sync_vat_obligations" name="daily">
   <bpmn:incoming>Flow_Start_vat_return__Timer_sync_vat_obligations</bpmn:incoming>
   <bpmn:outgoing>Flow_Timer_sync_vat_obligations__Task_sync_vat_obligations</bpmn:outgoing>
   <bpmn:timerEventDefinition id="Timer_sync_vat_obligations__definition">
    <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">daily</bpmn:timeDuration>
   </bpmn:timerEventDefinition>
  </bpmn:intermediateCatchEvent>
  <bpmn:userTask id="Task_prepare_vat_return" name="Prepare the return" dodil:step="prepare_vat_return">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From open to draft. When: the obligation is open at HMRC. Effect: boxes 1-9 from frozen document tax not yet in a return (claimed per [document_ref, tax_code]), under the period's scheme: invoice or cash basis, flat rate, partial exemption, bad debt claims and repayments, PVA entries, adjustments (TAX-28, TAX-35..TAX-37, TAX-48).</bpmn:documentation>
   <bpmn:incoming>Flow_Task_sync_vat_obligations__Task_prepare_vat_return</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_prepare_vat_return__Task_refresh_vat_return</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_refresh_vat_return" name="Prepare the draft again" dodil:step="refresh_vat_return">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From draft to draft. Effect: this draft's entries replaced; entries of other returns untouched.</bpmn:documentation>
   <bpmn:incoming>Flow_Task_prepare_vat_return__Task_refresh_vat_return</bpmn:incoming>
   <bpmn:incoming>Flow_Task_reopen_vat_return__Task_refresh_vat_return</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_refresh_vat_return__Gateway_record_vat_adjustment__if</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_record_vat_adjustment" name="Correct an earlier period's error on this return" dodil:step="record_vat_adjustment">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From draft to draft. When: net errors within the error-correction threshold and the error within four years. Requires: reason. Effect: an adjustment row naming the period it corrects, in box 1 or 4 (TAX-29).</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_record_vat_adjustment__if__Task_record_vat_adjustment</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_record_vat_adjustment__Gateway_record_vat_adjustment__if_end</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_record_vat_error_notice" name="Record an error notified to HMRC (VAT652)" dodil:step="record_vat_error_notice">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From draft to draft. When: an error above the threshold. Requires: reference. Effect: the notice kept with its date, periods and amount; it is not on the return.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_record_vat_error_notice__if__Task_record_vat_error_notice</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_record_vat_error_notice__Gateway_record_vat_error_notice__if_end</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:serviceTask id="Task_ai_review_vat_return" name="AI reviews the draft return (suggest)" dodil:step="ai_review_vat_return" implementation="##unspecified">
   <bpmn:documentation>By: The system. From draft to draft. When: the step is on. Effect: findings (a box moving far from the last four periods, a document with an unusual code) listed for the tax admin; nothing changes.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_ai_review_vat_return__if__Task_ai_review_vat_return</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_ai_review_vat_return__Gateway_ai_review_vat_return__if_end</bpmn:outgoing>
  </bpmn:serviceTask>
  <bpmn:userTask id="Task_lock_vat_return" name="Lock the return for submission" dodil:step="lock_vat_return">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From draft to locked. When: the period has ended (its end before today in business_timezone); the period's postponed-import statements reconciled; flat-rate eligibility answered; no adjustment above the threshold. Effect: boxes and entries frozen; a new document with a tax point in the period is refused (tax_point_open).</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_ai_review_vat_return__if_end__Task_lock_vat_return</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_lock_vat_return__Gateway_vat_return_locked__if</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_reopen_vat_return" name="Reopen a locked return" dodil:step="reopen_vat_return">
   <bpmn:documentation>By: Whoever is responsible for VAT (the owner, the bookkeeper, the accountant). From locked to draft. When: not submitted. Requires: reason.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_vat_return_locked__if__Task_reopen_vat_return</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_reopen_vat_return__Task_refresh_vat_return</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_submit_vat_return" name="Submit to HMRC with the declaration" dodil:step="submit_vat_return" dodil:approval="true">
   <bpmn:documentation>By: The owner or a finance controller. From locked to submitted. When: the HMRC connection is valid; the person ticked the legal declaration; a second person where vat_return_needs_second_person (not the identity that locked it, by email or sub); every fraud-prevention header present; HMRC still shows the obligation open. Requires: declaration. Effect: HMRC's receipt stored; the return immutable; its tax points filed (TAX-30, TAX-31). An approval.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_vat_return_locked__if__Task_submit_vat_return</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_submit_vat_return__Gateway_settle_vat_return__if</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:serviceTask id="Task_settle_vat_return" name="Post the return's settlement to the ledger" dodil:step="settle_vat_return" implementation="##unspecified">
   <bpmn:documentation>By: The system. From submitted to submitted. When: the ledger is installed. Effect: each tax code's VAT against vat_control, journal id derived from the return; once (TAX-32).</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_settle_vat_return__if__Task_settle_vat_return</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_settle_vat_return__Gateway_settle_vat_return__if_end</bpmn:outgoing>
  </bpmn:serviceTask>
  <bpmn:serviceTask id="Task_refresh_vat_liability" name="Read HMRC's liabilities and payments" dodil:step="refresh_vat_liability" implementation="##unspecified">
   <bpmn:documentation>By: The system. From submitted to submitted. When: an HMRC connection. Effect: liability, paid and outstanding per period as HMRC holds them (TAX-32). Waits: daily.</bpmn:documentation>
   <bpmn:incoming>Flow_Timer_refresh_vat_liability__Task_refresh_vat_liability</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_refresh_vat_liability__Gateway_refresh_vat_liability__if_end</bpmn:outgoing>
  </bpmn:serviceTask>
  <bpmn:intermediateCatchEvent id="Timer_refresh_vat_liability" name="daily">
   <bpmn:incoming>Flow_Gateway_refresh_vat_liability__if__Timer_refresh_vat_liability</bpmn:incoming>
   <bpmn:outgoing>Flow_Timer_refresh_vat_liability__Task_refresh_vat_liability</bpmn:outgoing>
   <bpmn:timerEventDefinition id="Timer_refresh_vat_liability__definition">
    <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">daily</bpmn:timeDuration>
   </bpmn:timerEventDefinition>
  </bpmn:intermediateCatchEvent>
  <bpmn:exclusiveGateway id="Gateway_record_vat_adjustment__if" name="net errors within the error-correction threshold and the error within four years?">
   <bpmn:incoming>Flow_Task_refresh_vat_return__Gateway_record_vat_adjustment__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_record_vat_adjustment__if__Task_record_vat_adjustment</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_record_vat_adjustment__if__Gateway_record_vat_adjustment__if_end</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_record_vat_adjustment__if_end">
   <bpmn:incoming>Flow_Gateway_record_vat_adjustment__if__Gateway_record_vat_adjustment__if_end</bpmn:incoming>
   <bpmn:incoming>Flow_Task_record_vat_adjustment__Gateway_record_vat_adjustment__if_end</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_record_vat_adjustment__if_end__Gateway_record_vat_error_notice__if</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_record_vat_error_notice__if" name="an error above the threshold?">
   <bpmn:incoming>Flow_Gateway_record_vat_adjustment__if_end__Gateway_record_vat_error_notice__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_record_vat_error_notice__if__Task_record_vat_error_notice</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_record_vat_error_notice__if__Gateway_record_vat_error_notice__if_end</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_record_vat_error_notice__if_end">
   <bpmn:incoming>Flow_Gateway_record_vat_error_notice__if__Gateway_record_vat_error_notice__if_end</bpmn:incoming>
   <bpmn:incoming>Flow_Task_record_vat_error_notice__Gateway_record_vat_error_notice__if_end</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_record_vat_error_notice__if_end__Gateway_ai_review_vat_return__if</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_ai_review_vat_return__if" name="the step is on?">
   <bpmn:incoming>Flow_Gateway_record_vat_error_notice__if_end__Gateway_ai_review_vat_return__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_ai_review_vat_return__if__Task_ai_review_vat_return</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_ai_review_vat_return__if__Gateway_ai_review_vat_return__if_end</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_ai_review_vat_return__if_end">
   <bpmn:incoming>Flow_Gateway_ai_review_vat_return__if__Gateway_ai_review_vat_return__if_end</bpmn:incoming>
   <bpmn:incoming>Flow_Task_ai_review_vat_return__Gateway_ai_review_vat_return__if_end</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_ai_review_vat_return__if_end__Task_lock_vat_return</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_vat_return_locked__if" name="Vat return locked: what next?">
   <bpmn:incoming>Flow_Task_lock_vat_return__Gateway_vat_return_locked__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_vat_return_locked__if__Task_reopen_vat_return</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_vat_return_locked__if__Task_submit_vat_return</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_settle_vat_return__if" name="the ledger is installed?">
   <bpmn:incoming>Flow_Task_submit_vat_return__Gateway_settle_vat_return__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_settle_vat_return__if__Task_settle_vat_return</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_settle_vat_return__if__Gateway_settle_vat_return__if_end</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_settle_vat_return__if_end">
   <bpmn:incoming>Flow_Gateway_settle_vat_return__if__Gateway_settle_vat_return__if_end</bpmn:incoming>
   <bpmn:incoming>Flow_Task_settle_vat_return__Gateway_settle_vat_return__if_end</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_settle_vat_return__if_end__Gateway_refresh_vat_liability__if</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_refresh_vat_liability__if" name="an HMRC connection?">
   <bpmn:incoming>Flow_Gateway_settle_vat_return__if_end__Gateway_refresh_vat_liability__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_refresh_vat_liability__if__Timer_refresh_vat_liability</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_refresh_vat_liability__if__Gateway_refresh_vat_liability__if_end</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_refresh_vat_liability__if_end">
   <bpmn:incoming>Flow_Gateway_refresh_vat_liability__if__Gateway_refresh_vat_liability__if_end</bpmn:incoming>
   <bpmn:incoming>Flow_Task_refresh_vat_liability__Gateway_refresh_vat_liability__if_end</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_refresh_vat_liability__if_end__End_vat_return_submitted</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:endEvent id="End_vat_return_submitted" name="Vat return submitted">
   <bpmn:incoming>Flow_Gateway_refresh_vat_liability__if_end__End_vat_return_submitted</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:sequenceFlow id="Flow_Timer_sync_vat_obligations__Task_sync_vat_obligations" sourceRef="Timer_sync_vat_obligations" targetRef="Task_sync_vat_obligations" />
  <bpmn:sequenceFlow id="Flow_Timer_refresh_vat_liability__Task_refresh_vat_liability" sourceRef="Timer_refresh_vat_liability" targetRef="Task_refresh_vat_liability" />
  <bpmn:sequenceFlow id="Flow_Start_vat_return__Timer_sync_vat_obligations" sourceRef="Start_vat_return" targetRef="Timer_sync_vat_obligations" />
  <bpmn:sequenceFlow id="Flow_Task_sync_vat_obligations__Task_prepare_vat_return" sourceRef="Task_sync_vat_obligations" targetRef="Task_prepare_vat_return" />
  <bpmn:sequenceFlow id="Flow_Gateway_record_vat_adjustment__if__Task_record_vat_adjustment" name="net errors within the error-correction threshold and the error within four years" sourceRef="Gateway_record_vat_adjustment__if" targetRef="Task_record_vat_adjustment" />
  <bpmn:sequenceFlow id="Flow_Gateway_record_vat_adjustment__if__Gateway_record_vat_adjustment__if_end" name="otherwise" sourceRef="Gateway_record_vat_adjustment__if" targetRef="Gateway_record_vat_adjustment__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_record_vat_adjustment__Gateway_record_vat_adjustment__if_end" sourceRef="Task_record_vat_adjustment" targetRef="Gateway_record_vat_adjustment__if_end" />
  <bpmn:sequenceFlow id="Flow_Gateway_record_vat_error_notice__if__Task_record_vat_error_notice" name="an error above the threshold" sourceRef="Gateway_record_vat_error_notice__if" targetRef="Task_record_vat_error_notice" />
  <bpmn:sequenceFlow id="Flow_Gateway_record_vat_error_notice__if__Gateway_record_vat_error_notice__if_end" name="otherwise" sourceRef="Gateway_record_vat_error_notice__if" targetRef="Gateway_record_vat_error_notice__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_record_vat_error_notice__Gateway_record_vat_error_notice__if_end" sourceRef="Task_record_vat_error_notice" targetRef="Gateway_record_vat_error_notice__if_end" />
  <bpmn:sequenceFlow id="Flow_Gateway_ai_review_vat_return__if__Task_ai_review_vat_return" name="the step is on" sourceRef="Gateway_ai_review_vat_return__if" targetRef="Task_ai_review_vat_return" />
  <bpmn:sequenceFlow id="Flow_Gateway_ai_review_vat_return__if__Gateway_ai_review_vat_return__if_end" name="otherwise" sourceRef="Gateway_ai_review_vat_return__if" targetRef="Gateway_ai_review_vat_return__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_ai_review_vat_return__Gateway_ai_review_vat_return__if_end" sourceRef="Task_ai_review_vat_return" targetRef="Gateway_ai_review_vat_return__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_refresh_vat_return__Gateway_record_vat_adjustment__if" sourceRef="Task_refresh_vat_return" targetRef="Gateway_record_vat_adjustment__if" />
  <bpmn:sequenceFlow id="Flow_Gateway_record_vat_adjustment__if_end__Gateway_record_vat_error_notice__if" sourceRef="Gateway_record_vat_adjustment__if_end" targetRef="Gateway_record_vat_error_notice__if" />
  <bpmn:sequenceFlow id="Flow_Gateway_record_vat_error_notice__if_end__Gateway_ai_review_vat_return__if" sourceRef="Gateway_record_vat_error_notice__if_end" targetRef="Gateway_ai_review_vat_return__if" />
  <bpmn:sequenceFlow id="Flow_Gateway_ai_review_vat_return__if_end__Task_lock_vat_return" sourceRef="Gateway_ai_review_vat_return__if_end" targetRef="Task_lock_vat_return" />
  <bpmn:sequenceFlow id="Flow_Task_prepare_vat_return__Task_refresh_vat_return" sourceRef="Task_prepare_vat_return" targetRef="Task_refresh_vat_return" />
  <bpmn:sequenceFlow id="Flow_Gateway_vat_return_locked__if__Task_reopen_vat_return" sourceRef="Gateway_vat_return_locked__if" targetRef="Task_reopen_vat_return" />
  <bpmn:sequenceFlow id="Flow_Gateway_vat_return_locked__if__Task_submit_vat_return" sourceRef="Gateway_vat_return_locked__if" targetRef="Task_submit_vat_return" />
  <bpmn:sequenceFlow id="Flow_Task_lock_vat_return__Gateway_vat_return_locked__if" sourceRef="Task_lock_vat_return" targetRef="Gateway_vat_return_locked__if" />
  <bpmn:sequenceFlow id="Flow_Task_reopen_vat_return__Task_refresh_vat_return" sourceRef="Task_reopen_vat_return" targetRef="Task_refresh_vat_return" />
  <bpmn:sequenceFlow id="Flow_Gateway_settle_vat_return__if__Task_settle_vat_return" name="the ledger is installed" sourceRef="Gateway_settle_vat_return__if" targetRef="Task_settle_vat_return" />
  <bpmn:sequenceFlow id="Flow_Gateway_settle_vat_return__if__Gateway_settle_vat_return__if_end" name="otherwise" sourceRef="Gateway_settle_vat_return__if" targetRef="Gateway_settle_vat_return__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_settle_vat_return__Gateway_settle_vat_return__if_end" sourceRef="Task_settle_vat_return" targetRef="Gateway_settle_vat_return__if_end" />
  <bpmn:sequenceFlow id="Flow_Gateway_refresh_vat_liability__if__Timer_refresh_vat_liability" name="an HMRC connection" sourceRef="Gateway_refresh_vat_liability__if" targetRef="Timer_refresh_vat_liability" />
  <bpmn:sequenceFlow id="Flow_Gateway_refresh_vat_liability__if__Gateway_refresh_vat_liability__if_end" name="otherwise" sourceRef="Gateway_refresh_vat_liability__if" targetRef="Gateway_refresh_vat_liability__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_refresh_vat_liability__Gateway_refresh_vat_liability__if_end" sourceRef="Task_refresh_vat_liability" targetRef="Gateway_refresh_vat_liability__if_end" />
  <bpmn:sequenceFlow id="Flow_Gateway_settle_vat_return__if_end__Gateway_refresh_vat_liability__if" sourceRef="Gateway_settle_vat_return__if_end" targetRef="Gateway_refresh_vat_liability__if" />
  <bpmn:sequenceFlow id="Flow_Gateway_refresh_vat_liability__if_end__End_vat_return_submitted" sourceRef="Gateway_refresh_vat_liability__if_end" targetRef="End_vat_return_submitted" />
  <bpmn:sequenceFlow id="Flow_Task_submit_vat_return__Gateway_settle_vat_return__if" sourceRef="Task_submit_vat_return" targetRef="Gateway_settle_vat_return__if" />
 </bpmn:process>
 <bpmndi:BPMNDiagram id="BPMNDiagram_tax_v5">
  <bpmndi:BPMNPlane id="BPMNPlane_tax_v5" bpmnElement="Collaboration_tax_v5">
   <bpmndi:BPMNShape id="Participant_tax_vat_return_di" bpmnElement="Participant_tax_vat_return" isHorizontal="true">
    <dc:Bounds x="0" y="0" width="3340" height="660" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_vat_return_system_di" bpmnElement="Lane_vat_return_system" isHorizontal="true">
    <dc:Bounds x="30" y="0" width="3310" height="260" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_vat_return_tax_admin_di" bpmnElement="Lane_vat_return_tax_admin" isHorizontal="true">
    <dc:Bounds x="30" y="260" width="3310" height="260" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_vat_return_owner_di" bpmnElement="Lane_vat_return_owner" isHorizontal="true">
    <dc:Bounds x="30" y="520" width="3310" height="140" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Start_vat_return_di" bpmnElement="Start_vat_return">
    <dc:Bounds x="157" y="42" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_sync_vat_obligations_di" bpmnElement="Task_sync_vat_obligations">
    <dc:Bounds x="465" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Timer_sync_vat_obligations_di" bpmnElement="Timer_sync_vat_obligations">
    <dc:Bounds x="327" y="42" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_prepare_vat_return_di" bpmnElement="Task_prepare_vat_return">
    <dc:Bounds x="635" y="280" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_refresh_vat_return_di" bpmnElement="Task_refresh_vat_return">
    <dc:Bounds x="805" y="280" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_record_vat_adjustment_di" bpmnElement="Task_record_vat_adjustment">
    <dc:Bounds x="1145" y="280" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_record_vat_error_notice_di" bpmnElement="Task_record_vat_error_notice">
    <dc:Bounds x="1485" y="280" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_ai_review_vat_return_di" bpmnElement="Task_ai_review_vat_return">
    <dc:Bounds x="1825" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_lock_vat_return_di" bpmnElement="Task_lock_vat_return">
    <dc:Bounds x="1995" y="280" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_reopen_vat_return_di" bpmnElement="Task_reopen_vat_return">
    <dc:Bounds x="2335" y="280" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_submit_vat_return_di" bpmnElement="Task_submit_vat_return">
    <dc:Bounds x="2335" y="540" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_settle_vat_return_di" bpmnElement="Task_settle_vat_return">
    <dc:Bounds x="2675" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_refresh_vat_liability_di" bpmnElement="Task_refresh_vat_liability">
    <dc:Bounds x="3185" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Timer_refresh_vat_liability_di" bpmnElement="Timer_refresh_vat_liability">
    <dc:Bounds x="3047" y="42" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_record_vat_adjustment__if_di" bpmnElement="Gateway_record_vat_adjustment__if">
    <dc:Bounds x="1000" y="295" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_record_vat_adjustment__if_end_di" bpmnElement="Gateway_record_vat_adjustment__if_end">
    <dc:Bounds x="1170" y="415" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_record_vat_error_notice__if_di" bpmnElement="Gateway_record_vat_error_notice__if">
    <dc:Bounds x="1340" y="295" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_record_vat_error_notice__if_end_di" bpmnElement="Gateway_record_vat_error_notice__if_end">
    <dc:Bounds x="1510" y="415" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_ai_review_vat_return__if_di" bpmnElement="Gateway_ai_review_vat_return__if">
    <dc:Bounds x="1680" y="35" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_ai_review_vat_return__if_end_di" bpmnElement="Gateway_ai_review_vat_return__if_end">
    <dc:Bounds x="1850" y="155" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_vat_return_locked__if_di" bpmnElement="Gateway_vat_return_locked__if">
    <dc:Bounds x="2190" y="295" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_settle_vat_return__if_di" bpmnElement="Gateway_settle_vat_return__if">
    <dc:Bounds x="2530" y="35" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_settle_vat_return__if_end_di" bpmnElement="Gateway_settle_vat_return__if_end">
    <dc:Bounds x="2700" y="155" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_refresh_vat_liability__if_di" bpmnElement="Gateway_refresh_vat_liability__if">
    <dc:Bounds x="2870" y="35" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_refresh_vat_liability__if_end_di" bpmnElement="Gateway_refresh_vat_liability__if_end">
    <dc:Bounds x="3040" y="155" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="End_vat_return_submitted_di" bpmnElement="End_vat_return_submitted">
    <dc:Bounds x="3217" y="162" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNEdge id="Flow_Timer_sync_vat_obligations__Task_sync_vat_obligations_di" bpmnElement="Flow_Timer_sync_vat_obligations__Task_sync_vat_obligations">
    <di:waypoint x="363" y="60" />
    <di:waypoint x="465" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Timer_refresh_vat_liability__Task_refresh_vat_liability_di" bpmnElement="Flow_Timer_refresh_vat_liability__Task_refresh_vat_liability">
    <di:waypoint x="3083" y="60" />
    <di:waypoint x="3185" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Start_vat_return__Timer_sync_vat_obligations_di" bpmnElement="Flow_Start_vat_return__Timer_sync_vat_obligations">
    <di:waypoint x="193" y="60" />
    <di:waypoint x="327" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_sync_vat_obligations__Task_prepare_vat_return_di" bpmnElement="Flow_Task_sync_vat_obligations__Task_prepare_vat_return">
    <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_record_vat_adjustment__if__Task_record_vat_adjustment_di" bpmnElement="Flow_Gateway_record_vat_adjustment__if__Task_record_vat_adjustment">
    <di:waypoint x="1050" y="320" />
    <di:waypoint x="1145" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_record_vat_adjustment__if__Gateway_record_vat_adjustment__if_end_di" bpmnElement="Flow_Gateway_record_vat_adjustment__if__Gateway_record_vat_adjustment__if_end">
    <di:waypoint x="1050" y="320" />
    <di:waypoint x="1145" y="320" />
    <di:waypoint x="1145" y="440" />
    <di:waypoint x="1170" y="440" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_record_vat_adjustment__Gateway_record_vat_adjustment__if_end_di" bpmnElement="Flow_Task_record_vat_adjustment__Gateway_record_vat_adjustment__if_end">
    <di:waypoint x="1195" y="360" />
    <di:waypoint x="1195" y="480" />
    <di:waypoint x="1195" y="480" />
    <di:waypoint x="1195" y="465" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_record_vat_error_notice__if__Task_record_vat_error_notice_di" bpmnElement="Flow_Gateway_record_vat_error_notice__if__Task_record_vat_error_notice">
    <di:waypoint x="1390" y="320" />
    <di:waypoint x="1485" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_record_vat_error_notice__if__Gateway_record_vat_error_notice__if_end_di" bpmnElement="Flow_Gateway_record_vat_error_notice__if__Gateway_record_vat_error_notice__if_end">
    <di:waypoint x="1390" y="320" />
    <di:waypoint x="1485" y="320" />
    <di:waypoint x="1485" y="440" />
    <di:waypoint x="1510" y="440" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_record_vat_error_notice__Gateway_record_vat_error_notice__if_end_di" bpmnElement="Flow_Task_record_vat_error_notice__Gateway_record_vat_error_notice__if_end">
    <di:waypoint x="1535" y="360" />
    <di:waypoint x="1535" y="486" />
    <di:waypoint x="1535" y="486" />
    <di:waypoint x="1535" y="465" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_ai_review_vat_return__if__Task_ai_review_vat_return_di" bpmnElement="Flow_Gateway_ai_review_vat_return__if__Task_ai_review_vat_return">
    <di:waypoint x="1730" y="60" />
    <di:waypoint x="1825" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_ai_review_vat_return__if__Gateway_ai_review_vat_return__if_end_di" bpmnElement="Flow_Gateway_ai_review_vat_return__if__Gateway_ai_review_vat_return__if_end">
    <di:waypoint x="1730" y="60" />
    <di:waypoint x="1825" y="60" />
    <di:waypoint x="1825" y="180" />
    <di:waypoint x="1850" y="180" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_ai_review_vat_return__Gateway_ai_review_vat_return__if_end_di" bpmnElement="Flow_Task_ai_review_vat_return__Gateway_ai_review_vat_return__if_end">
    <di:waypoint x="1875" y="100" />
    <di:waypoint x="1875" y="232" />
    <di:waypoint x="1875" y="232" />
    <di:waypoint x="1875" y="205" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_refresh_vat_return__Gateway_record_vat_adjustment__if_di" bpmnElement="Flow_Task_refresh_vat_return__Gateway_record_vat_adjustment__if">
    <di:waypoint x="905" y="320" />
    <di:waypoint x="1000" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_record_vat_adjustment__if_end__Gateway_record_vat_error_notice__if_di" bpmnElement="Flow_Gateway_record_vat_adjustment__if_end__Gateway_record_vat_error_notice__if">
    <di:waypoint x="1220" y="440" />
    <di:waypoint x="1315" y="440" />
    <di:waypoint x="1315" y="320" />
    <di:waypoint x="1340" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_record_vat_error_notice__if_end__Gateway_ai_review_vat_return__if_di" bpmnElement="Flow_Gateway_record_vat_error_notice__if_end__Gateway_ai_review_vat_return__if">
    <di:waypoint x="1560" y="440" />
    <di:waypoint x="1655" y="440" />
    <di:waypoint x="1655" y="60" />
    <di:waypoint x="1680" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_ai_review_vat_return__if_end__Task_lock_vat_return_di" bpmnElement="Flow_Gateway_ai_review_vat_return__if_end__Task_lock_vat_return">
    <di:waypoint x="1900" y="180" />
    <di:waypoint x="1970" y="180" />
    <di:waypoint x="1970" y="320" />
    <di:waypoint x="1995" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_prepare_vat_return__Task_refresh_vat_return_di" bpmnElement="Flow_Task_prepare_vat_return__Task_refresh_vat_return">
    <di:waypoint x="735" y="320" />
    <di:waypoint x="805" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_vat_return_locked__if__Task_reopen_vat_return_di" bpmnElement="Flow_Gateway_vat_return_locked__if__Task_reopen_vat_return">
    <di:waypoint x="2240" y="320" />
    <di:waypoint x="2335" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_vat_return_locked__if__Task_submit_vat_return_di" bpmnElement="Flow_Gateway_vat_return_locked__if__Task_submit_vat_return">
    <di:waypoint x="2240" y="320" />
    <di:waypoint x="2310" y="320" />
    <di:waypoint x="2310" y="580" />
    <di:waypoint x="2335" y="580" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_lock_vat_return__Gateway_vat_return_locked__if_di" bpmnElement="Flow_Task_lock_vat_return__Gateway_vat_return_locked__if">
    <di:waypoint x="2095" y="320" />
    <di:waypoint x="2190" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_reopen_vat_return__Task_refresh_vat_return_di" bpmnElement="Flow_Task_reopen_vat_return__Task_refresh_vat_return">
    <di:waypoint x="2385" y="360" />
    <di:waypoint x="2385" y="393" />
    <di:waypoint x="855" y="393" />
    <di:waypoint x="855" y="360" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_settle_vat_return__if__Task_settle_vat_return_di" bpmnElement="Flow_Gateway_settle_vat_return__if__Task_settle_vat_return">
    <di:waypoint x="2580" y="60" />
    <di:waypoint x="2675" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_settle_vat_return__if__Gateway_settle_vat_return__if_end_di" bpmnElement="Flow_Gateway_settle_vat_return__if__Gateway_settle_vat_return__if_end">
    <di:waypoint x="2580" y="60" />
    <di:waypoint x="2675" y="60" />
    <di:waypoint x="2675" y="180" />
    <di:waypoint x="2700" y="180" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_settle_vat_return__Gateway_settle_vat_return__if_end_di" bpmnElement="Flow_Task_settle_vat_return__Gateway_settle_vat_return__if_end">
    <di:waypoint x="2725" y="100" />
    <di:waypoint x="2725" y="220" />
    <di:waypoint x="2725" y="220" />
    <di:waypoint x="2725" y="205" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_refresh_vat_liability__if__Timer_refresh_vat_liability_di" bpmnElement="Flow_Gateway_refresh_vat_liability__if__Timer_refresh_vat_liability">
    <di:waypoint x="2920" y="60" />
    <di:waypoint x="3047" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_refresh_vat_liability__if__Gateway_refresh_vat_liability__if_end_di" bpmnElement="Flow_Gateway_refresh_vat_liability__if__Gateway_refresh_vat_liability__if_end">
    <di:waypoint x="2920" y="60" />
    <di:waypoint x="3015" y="60" />
    <di:waypoint x="3015" y="180" />
    <di:waypoint x="3040" y="180" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_refresh_vat_liability__Gateway_refresh_vat_liability__if_end_di" bpmnElement="Flow_Task_refresh_vat_liability__Gateway_refresh_vat_liability__if_end">
    <di:waypoint x="3235" y="100" />
    <di:waypoint x="3235" y="226" />
    <di:waypoint x="3065" y="226" />
    <di:waypoint x="3065" y="205" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_settle_vat_return__if_end__Gateway_refresh_vat_liability__if_di" bpmnElement="Flow_Gateway_settle_vat_return__if_end__Gateway_refresh_vat_liability__if">
    <di:waypoint x="2750" y="180" />
    <di:waypoint x="2845" y="180" />
    <di:waypoint x="2845" y="60" />
    <di:waypoint x="2870" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_refresh_vat_liability__if_end__End_vat_return_submitted_di" bpmnElement="Flow_Gateway_refresh_vat_liability__if_end__End_vat_return_submitted">
    <di:waypoint x="3090" y="180" />
    <di:waypoint x="3217" y="180" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_submit_vat_return__Gateway_settle_vat_return__if_di" bpmnElement="Flow_Task_submit_vat_return__Gateway_settle_vat_return__if">
    <di:waypoint x="2435" y="580" />
    <di:waypoint x="2505" y="580" />
    <di:waypoint x="2505" y="60" />
    <di:waypoint x="2530" y="60" />
   </bpmndi:BPMNEdge>
  </bpmndi:BPMNPlane>
 </bpmndi:BPMNDiagram>
</bpmn:definitions>