dodil/erp-method
modules/payments/signoff/payments/history/payments_dd_run.v6.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_payments_v8" name="Payments & collections processes" targetNamespace="https://git.dodil.io/dodil/erp-platform/processes" exporter="erp-platform erp-compose bpmn" exporterVersion="1">
<bpmn:collaboration id="Collaboration_payments_v8">
<bpmn:documentation>Payments & collections: one pool per entity lifecycle, generated from module.yaml.</bpmn:documentation>
<bpmn:participant id="Participant_payments_dd_run" name="Dd run" processRef="Process_payments_dd_run_v8" />
</bpmn:collaboration>
<bpmn:process id="Process_payments_dd_run_v8" name="Dd run" isExecutable="false">
<bpmn:documentation>Lifecycle of the dd run, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: draft, approved, submitted, collected.</bpmn:documentation>
<bpmn:laneSet id="LaneSet_dd_run">
<bpmn:lane id="Lane_dd_run_cashier" name="Whoever records money (bookkeeper, office manager)">
<bpmn:flowNodeRef>Start_dd_run</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_prepare_dd_run</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_submit_dd_run</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_apply_arudd_returns</bpmn:flowNodeRef>
<bpmn:flowNodeRef>End_dd_run_collected</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_dd_run_approver" name="Owner / finance manager">
<bpmn:flowNodeRef>Task_approve_dd_run</bpmn:flowNodeRef>
</bpmn:lane>
<bpmn:lane id="Lane_dd_run_system" name="The system">
<bpmn:flowNodeRef>Task_send_dd_notices</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Task_collect_dd_run</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Timer_collect_dd_run</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_send_dd_notices__if</bpmn:flowNodeRef>
<bpmn:flowNodeRef>Gateway_send_dd_notices__if_end</bpmn:flowNodeRef>
</bpmn:lane>
</bpmn:laneSet>
<bpmn:startEvent id="Start_dd_run" name="Dd run needed">
<bpmn:outgoing>Flow_Start_dd_run__Task_prepare_dd_run</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:userTask id="Task_prepare_dd_run" name="Prepare a direct-debit run (v3)" dodil:step="prepare_dd_run">
<bpmn:documentation>By: Whoever records money (bookkeeper, office manager). From none to draft. When: a collection date that is a working day; active mandates; invoices due on or before it. Effect: keyed dd:<bank_account_id>:<collection_date>, invoices named (PAY-19).</bpmn:documentation>
<bpmn:incoming>Flow_Start_dd_run__Task_prepare_dd_run</bpmn:incoming>
<bpmn:outgoing>Flow_Task_prepare_dd_run__Task_approve_dd_run</bpmn:outgoing>
</bpmn:userTask>
<bpmn:userTask id="Task_approve_dd_run" name="Approve the run" dodil:step="approve_dd_run" dodil:approval="true">
<bpmn:documentation>By: Owner / finance manager. From draft to approved. When: the approver is not the preparer (email and sub). An approval.</bpmn:documentation>
<bpmn:incoming>Flow_Task_prepare_dd_run__Task_approve_dd_run</bpmn:incoming>
<bpmn:outgoing>Flow_Task_approve_dd_run__Gateway_send_dd_notices__if</bpmn:outgoing>
</bpmn:userTask>
<bpmn:serviceTask id="Task_send_dd_notices" name="Send the advance notices" dodil:step="send_dd_notices" implementation="##unspecified">
<bpmn:documentation>By: The system. From approved to approved. When: each notice at least the notice period before the collection date. Effect: an invoice whose notice is late moves to the next run.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_send_dd_notices__if__Task_send_dd_notices</bpmn:incoming>
<bpmn:outgoing>Flow_Task_send_dd_notices__Gateway_send_dd_notices__if_end</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:userTask id="Task_submit_dd_run" name="Submit the Bacs file" dodil:step="submit_dd_run">
<bpmn:documentation>By: Whoever records money (bookkeeper, office manager). From approved to submitted. When: the file produced (Standard 18 or pain.008) and submitted by the input day. Requires: submission_ref. Effect: the file kept as an object; the run frozen.</bpmn:documentation>
<bpmn:incoming>Flow_Gateway_send_dd_notices__if_end__Task_submit_dd_run</bpmn:incoming>
<bpmn:outgoing>Flow_Task_submit_dd_run__Timer_collect_dd_run</bpmn:outgoing>
</bpmn:userTask>
<bpmn:serviceTask id="Task_collect_dd_run" name="Record the collections on the entry day" dodil:step="collect_dd_run" implementation="##unspecified">
<bpmn:documentation>By: The system. From submitted to collected. When: the collection date is today. Effect: a receipt per collection, allocated with decided_how direct_debit. Waits: the collection date.</bpmn:documentation>
<bpmn:incoming>Flow_Timer_collect_dd_run__Task_collect_dd_run</bpmn:incoming>
<bpmn:outgoing>Flow_Task_collect_dd_run__Task_apply_arudd_returns</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:intermediateCatchEvent id="Timer_collect_dd_run" name="the collection date">
<bpmn:incoming>Flow_Task_submit_dd_run__Timer_collect_dd_run</bpmn:incoming>
<bpmn:outgoing>Flow_Timer_collect_dd_run__Task_collect_dd_run</bpmn:outgoing>
<bpmn:timerEventDefinition id="Timer_collect_dd_run__definition">
<bpmn:timeDuration xsi:type="bpmn:tFormalExpression">the collection date</bpmn:timeDuration>
</bpmn:timerEventDefinition>
</bpmn:intermediateCatchEvent>
<bpmn:userTask id="Task_apply_arudd_returns" name="Apply the unpaid direct-debit report (ARUDD)" dodil:step="apply_arudd_returns">
<bpmn:documentation>By: Whoever records money (bookkeeper, office manager). From collected to collected. Effect: returned collections reversed (PAY-07); reason 0 may be re-presented once (code 18).</bpmn:documentation>
<bpmn:incoming>Flow_Task_collect_dd_run__Task_apply_arudd_returns</bpmn:incoming>
<bpmn:outgoing>Flow_Task_apply_arudd_returns__End_dd_run_collected</bpmn:outgoing>
</bpmn:userTask>
<bpmn:exclusiveGateway id="Gateway_send_dd_notices__if" name="each notice at least the notice period before the collection date?">
<bpmn:incoming>Flow_Task_approve_dd_run__Gateway_send_dd_notices__if</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_send_dd_notices__if__Task_send_dd_notices</bpmn:outgoing>
<bpmn:outgoing>Flow_Gateway_send_dd_notices__if__Gateway_send_dd_notices__if_end</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:exclusiveGateway id="Gateway_send_dd_notices__if_end">
<bpmn:incoming>Flow_Gateway_send_dd_notices__if__Gateway_send_dd_notices__if_end</bpmn:incoming>
<bpmn:incoming>Flow_Task_send_dd_notices__Gateway_send_dd_notices__if_end</bpmn:incoming>
<bpmn:outgoing>Flow_Gateway_send_dd_notices__if_end__Task_submit_dd_run</bpmn:outgoing>
</bpmn:exclusiveGateway>
<bpmn:endEvent id="End_dd_run_collected" name="Dd run collected">
<bpmn:incoming>Flow_Task_apply_arudd_returns__End_dd_run_collected</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_Timer_collect_dd_run__Task_collect_dd_run" sourceRef="Timer_collect_dd_run" targetRef="Task_collect_dd_run" />
<bpmn:sequenceFlow id="Flow_Start_dd_run__Task_prepare_dd_run" sourceRef="Start_dd_run" targetRef="Task_prepare_dd_run" />
<bpmn:sequenceFlow id="Flow_Task_prepare_dd_run__Task_approve_dd_run" sourceRef="Task_prepare_dd_run" targetRef="Task_approve_dd_run" />
<bpmn:sequenceFlow id="Flow_Gateway_send_dd_notices__if__Task_send_dd_notices" name="each notice at least the notice period before the collection date" sourceRef="Gateway_send_dd_notices__if" targetRef="Task_send_dd_notices" />
<bpmn:sequenceFlow id="Flow_Gateway_send_dd_notices__if__Gateway_send_dd_notices__if_end" name="otherwise" sourceRef="Gateway_send_dd_notices__if" targetRef="Gateway_send_dd_notices__if_end" />
<bpmn:sequenceFlow id="Flow_Task_send_dd_notices__Gateway_send_dd_notices__if_end" sourceRef="Task_send_dd_notices" targetRef="Gateway_send_dd_notices__if_end" />
<bpmn:sequenceFlow id="Flow_Gateway_send_dd_notices__if_end__Task_submit_dd_run" sourceRef="Gateway_send_dd_notices__if_end" targetRef="Task_submit_dd_run" />
<bpmn:sequenceFlow id="Flow_Task_approve_dd_run__Gateway_send_dd_notices__if" sourceRef="Task_approve_dd_run" targetRef="Gateway_send_dd_notices__if" />
<bpmn:sequenceFlow id="Flow_Task_submit_dd_run__Timer_collect_dd_run" sourceRef="Task_submit_dd_run" targetRef="Timer_collect_dd_run" />
<bpmn:sequenceFlow id="Flow_Task_apply_arudd_returns__End_dd_run_collected" sourceRef="Task_apply_arudd_returns" targetRef="End_dd_run_collected" />
<bpmn:sequenceFlow id="Flow_Task_collect_dd_run__Task_apply_arudd_returns" sourceRef="Task_collect_dd_run" targetRef="Task_apply_arudd_returns" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_payments_v8">
<bpmndi:BPMNPlane id="BPMNPlane_payments_v8" bpmnElement="Collaboration_payments_v8">
<bpmndi:BPMNShape id="Participant_payments_dd_run_di" bpmnElement="Participant_payments_dd_run" isHorizontal="true">
<dc:Bounds x="0" y="0" width="1810" height="540" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_dd_run_cashier_di" bpmnElement="Lane_dd_run_cashier" isHorizontal="true">
<dc:Bounds x="30" y="0" width="1780" height="140" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_dd_run_approver_di" bpmnElement="Lane_dd_run_approver" isHorizontal="true">
<dc:Bounds x="30" y="140" width="1780" height="140" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Lane_dd_run_system_di" bpmnElement="Lane_dd_run_system" isHorizontal="true">
<dc:Bounds x="30" y="280" width="1780" height="260" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Start_dd_run_di" bpmnElement="Start_dd_run">
<dc:Bounds x="157" y="42" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_prepare_dd_run_di" bpmnElement="Task_prepare_dd_run">
<dc:Bounds x="295" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_approve_dd_run_di" bpmnElement="Task_approve_dd_run">
<dc:Bounds x="465" y="160" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_send_dd_notices_di" bpmnElement="Task_send_dd_notices">
<dc:Bounds x="805" y="300" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_submit_dd_run_di" bpmnElement="Task_submit_dd_run">
<dc:Bounds x="975" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_collect_dd_run_di" bpmnElement="Task_collect_dd_run">
<dc:Bounds x="1315" y="300" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Timer_collect_dd_run_di" bpmnElement="Timer_collect_dd_run">
<dc:Bounds x="1177" y="322" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Task_apply_arudd_returns_di" bpmnElement="Task_apply_arudd_returns">
<dc:Bounds x="1485" y="20" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_send_dd_notices__if_di" bpmnElement="Gateway_send_dd_notices__if">
<dc:Bounds x="660" y="315" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Gateway_send_dd_notices__if_end_di" bpmnElement="Gateway_send_dd_notices__if_end">
<dc:Bounds x="830" y="435" width="50" height="50" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="End_dd_run_collected_di" bpmnElement="End_dd_run_collected">
<dc:Bounds x="1687" y="42" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_Timer_collect_dd_run__Task_collect_dd_run_di" bpmnElement="Flow_Timer_collect_dd_run__Task_collect_dd_run">
<di:waypoint x="1213" y="340" />
<di:waypoint x="1315" y="340" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Start_dd_run__Task_prepare_dd_run_di" bpmnElement="Flow_Start_dd_run__Task_prepare_dd_run">
<di:waypoint x="193" y="60" />
<di:waypoint x="295" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_prepare_dd_run__Task_approve_dd_run_di" bpmnElement="Flow_Task_prepare_dd_run__Task_approve_dd_run">
<di:waypoint x="395" 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_Gateway_send_dd_notices__if__Task_send_dd_notices_di" bpmnElement="Flow_Gateway_send_dd_notices__if__Task_send_dd_notices">
<di:waypoint x="710" y="340" />
<di:waypoint x="805" y="340" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_send_dd_notices__if__Gateway_send_dd_notices__if_end_di" bpmnElement="Flow_Gateway_send_dd_notices__if__Gateway_send_dd_notices__if_end">
<di:waypoint x="710" y="340" />
<di:waypoint x="805" y="340" />
<di:waypoint x="805" y="460" />
<di:waypoint x="830" y="460" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_send_dd_notices__Gateway_send_dd_notices__if_end_di" bpmnElement="Flow_Task_send_dd_notices__Gateway_send_dd_notices__if_end">
<di:waypoint x="855" y="380" />
<di:waypoint x="855" y="500" />
<di:waypoint x="855" y="500" />
<di:waypoint x="855" y="485" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Gateway_send_dd_notices__if_end__Task_submit_dd_run_di" bpmnElement="Flow_Gateway_send_dd_notices__if_end__Task_submit_dd_run">
<di:waypoint x="880" y="460" />
<di:waypoint x="950" y="460" />
<di:waypoint x="950" y="60" />
<di:waypoint x="975" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_approve_dd_run__Gateway_send_dd_notices__if_di" bpmnElement="Flow_Task_approve_dd_run__Gateway_send_dd_notices__if">
<di:waypoint x="565" y="200" />
<di:waypoint x="635" y="200" />
<di:waypoint x="635" y="340" />
<di:waypoint x="660" y="340" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_submit_dd_run__Timer_collect_dd_run_di" bpmnElement="Flow_Task_submit_dd_run__Timer_collect_dd_run">
<di:waypoint x="1075" y="60" />
<di:waypoint x="1152" y="60" />
<di:waypoint x="1152" y="340" />
<di:waypoint x="1177" y="340" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_apply_arudd_returns__End_dd_run_collected_di" bpmnElement="Flow_Task_apply_arudd_returns__End_dd_run_collected">
<di:waypoint x="1585" y="60" />
<di:waypoint x="1687" y="60" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_Task_collect_dd_run__Task_apply_arudd_returns_di" bpmnElement="Flow_Task_collect_dd_run__Task_apply_arudd_returns">
<di:waypoint x="1415" y="340" />
<di:waypoint x="1460" y="340" />
<di:waypoint x="1460" y="60" />
<di:waypoint x="1485" y="60" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>