dodil/erp-method

modules/gl/signoff/gl/gl_accrual.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_gl_v9" name="Accounting processes" targetNamespace="https://git.dodil.io/dodil/erp-platform/processes" exporter="erp-platform erp-compose bpmn" exporterVersion="1">
 <bpmn:collaboration id="Collaboration_gl_v9">
  <bpmn:documentation>Accounting: one pool per entity lifecycle, generated from module.yaml.</bpmn:documentation>
  <bpmn:participant id="Participant_gl_accrual" name="Accrual" processRef="Process_gl_accrual_v9" />
 </bpmn:collaboration>
 <bpmn:process id="Process_gl_accrual_v9" name="Accrual" isExecutable="false">
  <bpmn:documentation>Lifecycle of the accrual, generated from module.yaml by erp-compose bpmn; change the workflow there, not this file. States: proposed, active, rejected, terminated, completed.</bpmn:documentation>
  <bpmn:laneSet id="LaneSet_accrual">
   <bpmn:lane id="Lane_accrual_accountant" name="Accountant / finance manager">
    <bpmn:flowNodeRef>Start_accrual</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_register_accrual</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_approve_accrual</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_reject_accrual</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_release_accrual_period</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Task_terminate_accrual</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_accrual_proposed__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_release_accrual_period__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_release_accrual_period__if_end</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>End_accrual_rejected</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>End_accrual_terminated</bpmn:flowNodeRef>
   </bpmn:lane>
   <bpmn:lane id="Lane_accrual_system" name="The system">
    <bpmn:flowNodeRef>Task_complete_accrual</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>Gateway_accrual_active__if</bpmn:flowNodeRef>
    <bpmn:flowNodeRef>End_accrual_completed</bpmn:flowNodeRef>
   </bpmn:lane>
  </bpmn:laneSet>
  <bpmn:startEvent id="Start_accrual" name="Accrual needed">
   <bpmn:outgoing>Flow_Start_accrual__Task_register_accrual</bpmn:outgoing>
  </bpmn:startEvent>
  <bpmn:userTask id="Task_register_accrual" name="Register an accrual or deferral" dodil:step="register_accrual">
   <bpmn:documentation>By: Accountant / finance manager. From none to proposed. When: amount above zero and within NUMERIC(18,2); start period not after end; accounts valid in the company's chart. Effect: the schedule computed per period (straight-line or daily), the last period taking the remainder.</bpmn:documentation>
   <bpmn:incoming>Flow_Start_accrual__Task_register_accrual</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_register_accrual__Gateway_accrual_proposed__if</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_approve_accrual" name="Approve the registration" dodil:step="approve_accrual" dodil:approval="true">
   <bpmn:documentation>By: Accountant / finance manager. From proposed to active. When: the approver is not the registrant (email AND sub) above manual_journal_threshold. Effect: released from its start period. An approval.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_accrual_proposed__if__Task_approve_accrual</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_approve_accrual__Gateway_release_accrual_period__if</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:userTask id="Task_reject_accrual" name="Reject the registration" dodil:step="reject_accrual">
   <bpmn:documentation>By: Accountant / finance manager. From proposed to rejected. Requires: reason.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_accrual_proposed__if__Task_reject_accrual</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_reject_accrual__End_accrual_rejected</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:task id="Task_release_accrual_period" name="Release the period's share" dodil:step="release_accrual_period">
   <bpmn:documentation>By: Accountant / finance manager or The system. From active to active. When: the period open and in the schedule; not released for it. Effect: a journal keyed derived_id('accrual', accrual_id, period_id).</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_release_accrual_period__if__Task_release_accrual_period</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_release_accrual_period__Gateway_release_accrual_period__if_end</bpmn:outgoing>
  </bpmn:task>
  <bpmn:serviceTask id="Task_complete_accrual" name="Complete the registration" dodil:step="complete_accrual" implementation="##unspecified">
   <bpmn:documentation>By: The system. From active to completed. When: every period of the schedule released. Effect: released total equals the amount to the penny.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_accrual_active__if__Task_complete_accrual</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_complete_accrual__End_accrual_completed</bpmn:outgoing>
  </bpmn:serviceTask>
  <bpmn:userTask id="Task_terminate_accrual" name="Terminate early" dodil:step="terminate_accrual">
   <bpmn:documentation>By: Accountant / finance manager. From active to terminated. When: the termination period open. Requires: reason. Effect: the remainder released in the termination period; nothing after.</bpmn:documentation>
   <bpmn:incoming>Flow_Gateway_accrual_active__if__Task_terminate_accrual</bpmn:incoming>
   <bpmn:outgoing>Flow_Task_terminate_accrual__End_accrual_terminated</bpmn:outgoing>
  </bpmn:userTask>
  <bpmn:exclusiveGateway id="Gateway_accrual_proposed__if" name="Accrual proposed: what next?">
   <bpmn:incoming>Flow_Task_register_accrual__Gateway_accrual_proposed__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_accrual_proposed__if__Task_approve_accrual</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_accrual_proposed__if__Task_reject_accrual</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_release_accrual_period__if" name="the period open and in the schedule; not released for it?">
   <bpmn:incoming>Flow_Task_approve_accrual__Gateway_release_accrual_period__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_release_accrual_period__if__Task_release_accrual_period</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_release_accrual_period__if__Gateway_release_accrual_period__if_end</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_release_accrual_period__if_end">
   <bpmn:incoming>Flow_Gateway_release_accrual_period__if__Gateway_release_accrual_period__if_end</bpmn:incoming>
   <bpmn:incoming>Flow_Task_release_accrual_period__Gateway_release_accrual_period__if_end</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_release_accrual_period__if_end__Gateway_accrual_active__if</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:exclusiveGateway id="Gateway_accrual_active__if" name="Accrual active: what next?">
   <bpmn:incoming>Flow_Gateway_release_accrual_period__if_end__Gateway_accrual_active__if</bpmn:incoming>
   <bpmn:outgoing>Flow_Gateway_accrual_active__if__Task_complete_accrual</bpmn:outgoing>
   <bpmn:outgoing>Flow_Gateway_accrual_active__if__Task_terminate_accrual</bpmn:outgoing>
  </bpmn:exclusiveGateway>
  <bpmn:endEvent id="End_accrual_rejected" name="Accrual rejected">
   <bpmn:incoming>Flow_Task_reject_accrual__End_accrual_rejected</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:endEvent id="End_accrual_completed" name="Accrual completed">
   <bpmn:incoming>Flow_Task_complete_accrual__End_accrual_completed</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:endEvent id="End_accrual_terminated" name="Accrual terminated">
   <bpmn:incoming>Flow_Task_terminate_accrual__End_accrual_terminated</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:sequenceFlow id="Flow_Start_accrual__Task_register_accrual" sourceRef="Start_accrual" targetRef="Task_register_accrual" />
  <bpmn:sequenceFlow id="Flow_Gateway_accrual_proposed__if__Task_approve_accrual" sourceRef="Gateway_accrual_proposed__if" targetRef="Task_approve_accrual" />
  <bpmn:sequenceFlow id="Flow_Gateway_accrual_proposed__if__Task_reject_accrual" sourceRef="Gateway_accrual_proposed__if" targetRef="Task_reject_accrual" />
  <bpmn:sequenceFlow id="Flow_Task_register_accrual__Gateway_accrual_proposed__if" sourceRef="Task_register_accrual" targetRef="Gateway_accrual_proposed__if" />
  <bpmn:sequenceFlow id="Flow_Gateway_release_accrual_period__if__Task_release_accrual_period" name="the period open and in the schedule; not released for it" sourceRef="Gateway_release_accrual_period__if" targetRef="Task_release_accrual_period" />
  <bpmn:sequenceFlow id="Flow_Gateway_release_accrual_period__if__Gateway_release_accrual_period__if_end" name="otherwise" sourceRef="Gateway_release_accrual_period__if" targetRef="Gateway_release_accrual_period__if_end" />
  <bpmn:sequenceFlow id="Flow_Task_release_accrual_period__Gateway_release_accrual_period__if_end" sourceRef="Task_release_accrual_period" targetRef="Gateway_release_accrual_period__if_end" />
  <bpmn:sequenceFlow id="Flow_Gateway_accrual_active__if__Task_complete_accrual" sourceRef="Gateway_accrual_active__if" targetRef="Task_complete_accrual" />
  <bpmn:sequenceFlow id="Flow_Gateway_accrual_active__if__Task_terminate_accrual" sourceRef="Gateway_accrual_active__if" targetRef="Task_terminate_accrual" />
  <bpmn:sequenceFlow id="Flow_Gateway_release_accrual_period__if_end__Gateway_accrual_active__if" sourceRef="Gateway_release_accrual_period__if_end" targetRef="Gateway_accrual_active__if" />
  <bpmn:sequenceFlow id="Flow_Task_approve_accrual__Gateway_release_accrual_period__if" sourceRef="Task_approve_accrual" targetRef="Gateway_release_accrual_period__if" />
  <bpmn:sequenceFlow id="Flow_Task_reject_accrual__End_accrual_rejected" sourceRef="Task_reject_accrual" targetRef="End_accrual_rejected" />
  <bpmn:sequenceFlow id="Flow_Task_complete_accrual__End_accrual_completed" sourceRef="Task_complete_accrual" targetRef="End_accrual_completed" />
  <bpmn:sequenceFlow id="Flow_Task_terminate_accrual__End_accrual_terminated" sourceRef="Task_terminate_accrual" targetRef="End_accrual_terminated" />
 </bpmn:process>
 <bpmndi:BPMNDiagram id="BPMNDiagram_gl_v9">
  <bpmndi:BPMNPlane id="BPMNPlane_gl_v9" bpmnElement="Collaboration_gl_v9">
   <bpmndi:BPMNShape id="Participant_gl_accrual_di" bpmnElement="Participant_gl_accrual" isHorizontal="true">
    <dc:Bounds x="0" y="0" width="1640" height="400" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_accrual_accountant_di" bpmnElement="Lane_accrual_accountant" isHorizontal="true">
    <dc:Bounds x="30" y="0" width="1610" height="260" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Lane_accrual_system_di" bpmnElement="Lane_accrual_system" isHorizontal="true">
    <dc:Bounds x="30" y="260" width="1610" height="140" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Start_accrual_di" bpmnElement="Start_accrual">
    <dc:Bounds x="157" y="42" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_register_accrual_di" bpmnElement="Task_register_accrual">
    <dc:Bounds x="295" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_approve_accrual_di" bpmnElement="Task_approve_accrual">
    <dc:Bounds x="635" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_reject_accrual_di" bpmnElement="Task_reject_accrual">
    <dc:Bounds x="635" y="140" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_release_accrual_period_di" bpmnElement="Task_release_accrual_period">
    <dc:Bounds x="975" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_complete_accrual_di" bpmnElement="Task_complete_accrual">
    <dc:Bounds x="1315" y="280" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Task_terminate_accrual_di" bpmnElement="Task_terminate_accrual">
    <dc:Bounds x="1315" y="20" width="100" height="80" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_accrual_proposed__if_di" bpmnElement="Gateway_accrual_proposed__if">
    <dc:Bounds x="490" y="35" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_release_accrual_period__if_di" bpmnElement="Gateway_release_accrual_period__if">
    <dc:Bounds x="830" y="35" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_release_accrual_period__if_end_di" bpmnElement="Gateway_release_accrual_period__if_end">
    <dc:Bounds x="1000" y="155" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="Gateway_accrual_active__if_di" bpmnElement="Gateway_accrual_active__if">
    <dc:Bounds x="1170" y="295" width="50" height="50" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="End_accrual_rejected_di" bpmnElement="End_accrual_rejected">
    <dc:Bounds x="837" y="162" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="End_accrual_completed_di" bpmnElement="End_accrual_completed">
    <dc:Bounds x="1517" y="302" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNShape id="End_accrual_terminated_di" bpmnElement="End_accrual_terminated">
    <dc:Bounds x="1517" y="42" width="36" height="36" />
   </bpmndi:BPMNShape>
   <bpmndi:BPMNEdge id="Flow_Start_accrual__Task_register_accrual_di" bpmnElement="Flow_Start_accrual__Task_register_accrual">
    <di:waypoint x="193" y="60" />
    <di:waypoint x="295" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_accrual_proposed__if__Task_approve_accrual_di" bpmnElement="Flow_Gateway_accrual_proposed__if__Task_approve_accrual">
    <di:waypoint x="540" y="60" />
    <di:waypoint x="635" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_accrual_proposed__if__Task_reject_accrual_di" bpmnElement="Flow_Gateway_accrual_proposed__if__Task_reject_accrual">
    <di:waypoint x="540" y="60" />
    <di:waypoint x="610" y="60" />
    <di:waypoint x="610" y="180" />
    <di:waypoint x="635" y="180" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_register_accrual__Gateway_accrual_proposed__if_di" bpmnElement="Flow_Task_register_accrual__Gateway_accrual_proposed__if">
    <di:waypoint x="395" y="60" />
    <di:waypoint x="490" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_release_accrual_period__if__Task_release_accrual_period_di" bpmnElement="Flow_Gateway_release_accrual_period__if__Task_release_accrual_period">
    <di:waypoint x="880" y="60" />
    <di:waypoint x="975" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_release_accrual_period__if__Gateway_release_accrual_period__if_end_di" bpmnElement="Flow_Gateway_release_accrual_period__if__Gateway_release_accrual_period__if_end">
    <di:waypoint x="880" y="60" />
    <di:waypoint x="975" y="60" />
    <di:waypoint x="975" y="180" />
    <di:waypoint x="1000" y="180" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_release_accrual_period__Gateway_release_accrual_period__if_end_di" bpmnElement="Flow_Task_release_accrual_period__Gateway_release_accrual_period__if_end">
    <di:waypoint x="1025" y="100" />
    <di:waypoint x="1025" y="220" />
    <di:waypoint x="1025" y="220" />
    <di:waypoint x="1025" y="205" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_accrual_active__if__Task_complete_accrual_di" bpmnElement="Flow_Gateway_accrual_active__if__Task_complete_accrual">
    <di:waypoint x="1220" y="320" />
    <di:waypoint x="1315" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_accrual_active__if__Task_terminate_accrual_di" bpmnElement="Flow_Gateway_accrual_active__if__Task_terminate_accrual">
    <di:waypoint x="1220" y="320" />
    <di:waypoint x="1290" y="320" />
    <di:waypoint x="1290" y="60" />
    <di:waypoint x="1315" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Gateway_release_accrual_period__if_end__Gateway_accrual_active__if_di" bpmnElement="Flow_Gateway_release_accrual_period__if_end__Gateway_accrual_active__if">
    <di:waypoint x="1050" y="180" />
    <di:waypoint x="1145" y="180" />
    <di:waypoint x="1145" y="320" />
    <di:waypoint x="1170" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_approve_accrual__Gateway_release_accrual_period__if_di" bpmnElement="Flow_Task_approve_accrual__Gateway_release_accrual_period__if">
    <di:waypoint x="735" y="60" />
    <di:waypoint x="830" y="60" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_reject_accrual__End_accrual_rejected_di" bpmnElement="Flow_Task_reject_accrual__End_accrual_rejected">
    <di:waypoint x="735" y="180" />
    <di:waypoint x="837" y="180" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_complete_accrual__End_accrual_completed_di" bpmnElement="Flow_Task_complete_accrual__End_accrual_completed">
    <di:waypoint x="1415" y="320" />
    <di:waypoint x="1517" y="320" />
   </bpmndi:BPMNEdge>
   <bpmndi:BPMNEdge id="Flow_Task_terminate_accrual__End_accrual_terminated_di" bpmnElement="Flow_Task_terminate_accrual__End_accrual_terminated">
    <di:waypoint x="1415" y="60" />
    <di:waypoint x="1517" y="60" />
   </bpmndi:BPMNEdge>
  </bpmndi:BPMNPlane>
 </bpmndi:BPMNDiagram>
</bpmn:definitions>