diff --git a/processes/fg3-5/README.md b/processes/fg3-5/README.md index 7eacee2..9d0c6da 100644 --- a/processes/fg3-5/README.md +++ b/processes/fg3-5/README.md @@ -1,16 +1,76 @@ # FG3-5 — Komandējuma norēķina veikšana -Business-trip settlement: processing of travel advances and post-trip expense settlements against approved travel orders. +Level 4 atomic executable process for business-trip (travel) settlement — the +processing of trip requests, cancellations, post-trip expense reports and the +reconciliation of travel advances against documented expenses. The third FG3 +sub-process taken to executable depth. -- **UAPF level:** L4 (atomic sub-process) +- **UAPF level:** L4 (atomic executable) - **Package id:** `vk.gramatvediba.fg3-5` -- **Source:** Valsts Kase *Grāmatvedības uzskaites procesu apraksts* — FG3 - schema and process register. - **Included by:** `processes/fg3` (function group FG3). +- **Source:** Valsts Kase *Grāmatvedības uzskaites procesu apraksts* — FG3 + process register, section 3.5.3 (*Komandējuma (darba brauciena) dokumenti un + to kustība*), with the advance-repayment tail in section 3.5.4. + +## Process + +`bpmn/komandejuma-norekina.bpmn` (`Process_KomandejumaNorekina`) transcribes +the business-trip settlement flow across three lanes mapped from the source +RACI columns: + +- **Nodarbinātais** — submits the trip request (3.5.3.1) and, after the trip, + the expense report (3.5.3.3). +- **Iestāde** — approves the trip expense report in its defined flow. +- **VPC** — processes the request, annuls it if the trip is cancelled + (3.5.3.2), processes the report (3.5.3.4), reconciles it, and prepares a + repayment request, an additional payment, or posts the document. + +Flow: request processing → cancellation branch → expense-report submission and +approval → VPC processing → reconciliation decision → one of three outcomes. +Two terminating states: *settlement posted* or *trip request annulled*. + +## Decision + +`dmn/komandejuma-norekins.dmn` (`Decision_KomandejumaNorekins`) is a `FIRST` +hit-policy decision table that sets the outcome variable `norekinResultats` +from two inputs: + +| Input | Values | +|-------|--------| +| `avansaSituacija` | `nav-avansa`, `avanss-lielaks`, `avanss-vienads`, `izdevumi-lielaki` | +| `nakamaisKomandejums` | `ir`, `nav` | + +Outcomes: `papildu-izmaksa` (no advance, or expenses exceed the advance — +the difference is paid to the employee), `slegts` (advance equals expenses), +`parnesums` (the advance exceeds expenses and the employee has a next approved +trip from the same funding — the balance carries forward to that trip), +`atmaksa` (the advance exceeds expenses with no next trip — the difference is +repaid). The `Task_NoteiktRezultatu` business-rule task evaluates it. + +## Resources + +`resources/mappings.yaml` binds every BPMN user task and the DMN decision to a +target in `resources/roles.yaml` / `resources/agents.yaml`. Human steps are +`manual`; the AI agent `agent.komandejumu-asistents` is bound `assisted` to the +request processing, the report processing and the reconciliation decision — it +extracts document data and proposes the outcome, the accountant decides. No +step is `autonomous`. + +## Transcription note + +The trip request itself is prepared and approved in the personnel-management +process (PP); FG3-5 begins where the request enters accounting handling, so +the start event represents that hand-off. Advance disbursement, the additional +payment and the detailed advance-repayment steps (3.5.4) are executed in their +own processes and are referenced rather than duplicated here. The carry-forward +rule (`parnesums`) transcribes the 3.5.4 condition that an advance surplus is +retained against a next approved trip from the same funding. Step identifiers +use stable BPMN/DMN element ids; reconciliation against the register `process +nr.` numbering is a tracked follow-up and any schema/register discrepancy is +recorded rather than silently resolved (see `docs/conventions.md`). ## Status -Draft composition placeholder. The sub-process is identified and wired into -FG3 via `includes`; its executable build (BPMN + DMN + resource mappings) -follows in a later step. FG3-1 is the sub-process taken to executable depth in -this proof-of-concept. +Draft. The package is structurally complete and validates against the UAPF +2.2.0 schemas; lifecycle status advances to `review` once the source-numbering +reconciliation is signed off. diff --git a/processes/fg3-5/bpmn/komandejuma-norekina.bpmn b/processes/fg3-5/bpmn/komandejuma-norekina.bpmn new file mode 100644 index 0000000..b29bc76 --- /dev/null +++ b/processes/fg3-5/bpmn/komandejuma-norekina.bpmn @@ -0,0 +1,138 @@ + + + + + + + Start_PieteikumsIesniegts + Task_IesniegtAtskaiti + + + Task_SaskanotAtskaiti + + + Task_ApstradatPieteikumu + Gateway_Atcelts + Task_AnuletPieteikumu + End_Anulets + Task_ApstradatAtskaiti + Task_NoteiktRezultatu + Gateway_Rezultats + Task_PieprasitAtmaksu + Task_SagatavotPapilduIzmaksu + Task_Iegramatot + End_Iegramatots + + + + + Nodarbinātais iesniedz komandējuma (darba brauciena) pieteikumu Pašapkalpošanās portālā (HoP lietotnē "Komandējumi"). Pieteikuma sagatavošana un saskaņošana notiek personāla pārvaldības procesā (PP); FG3-5 sākas, kad pieteikums nonāk grāmatvedības apstrādē. + F1 + + + + VPC, saņemot pieteikumu par komandējumu vai tā izmaiņām, veic pieteikuma apstrādi komandējuma dokumentos saskaņā ar Horizon projektējumā norādīto. Ja Nodarbinātajam komandējuma vajadzībām ir piešķirta Iestādei piesaistītā norēķinu karte, izmaksas tiek veiktas uz to, pārējos gadījumos — uz darbinieka algas kontu. Sistēma: RVS Horizon. SLA: ne vēlāk kā 2 darba dienas pirms komandējuma par dienas naudu; 3 darba dienas no apstiprināta pieteikuma saņemšanas, ja avanss pieprasīts citiem komandējuma izdevumiem. Procesa solis 3.5.3.1. + F1 + F2 + + + + F2 + F3 + F4 + + + + VPC, saņemot informāciju par komandējuma atcelšanu, anulē pieteikumu un pārbauda veiktās izmaksas. Izmaksu gadījumā tālāk rīkojas atbilstoši komandējuma pieteikumā norādītajam. Sistēma: RVS Horizon. SLA: 3 darba dienas no informācijas saņemšanas. Procesa solis 3.5.3.2. + F4 + F5 + + + + F5 + + + + Nodarbinātais (vai Iestāde, ja komandējumā nosūtīta persona, kas nav Iestādes Nodarbinātais) iesniedz komandējuma atskaiti Pašapkalpošanās portālā (HoP lietotnē "Komandējumi"). Atskaite jāiesniedz arī gadījumos, ja nav radušies papildu izdevumi. Sistēma: Pašapkalpošanās portāls. SLA: 10 darba dienas pēc atgriešanās no komandējuma. Procesa solis 3.5.3.3. + F3 + F6 + + + + Iestādes atbildīgā amatpersona saskaņo iesniegto komandējuma izdevumu atskaiti atbilstoši Iestādes definētajai saskaņošanas plūsmai. Sistēma: Pašapkalpošanās portāls. + F6 + F7 + + + + VPC, saņemot komandējuma izdevumu atskaiti, veic atskaites apstrādi komandējuma dokumentos vai avansa norēķina dokumentos un nepieciešamības gadījumā atzīst prasības pret uzaicinātājpusi. Rezultāts: mainīgie avansaSituacija = "nav-avansa" | "avanss-lielaks" | "avanss-vienads" | "izdevumi-lielaki" un nakamaisKomandejums = "ir" | "nav". Sistēma: RVS Horizon. SLA: 3 darba dienas no atskaites apstiprināšanas. Procesa solis 3.5.3.4. + F7 + F8 + + + + Automatizēti izvērtē komandējuma norēķina rezultātu, izpildot lēmumu Decision_KomandejumaNorekins (dmn/komandejuma-norekins.dmn). Ievaddati: avansaSituacija, nakamaisKomandejums. Rezultāts: mainīgais norekinResultats. + F8 + F9 + + + + F9 + F10 + F11 + F12 + + + + VPC informē Atbalsta sistēmā (Redmine) Iestādi par nepieciešamību veikt avansa atmaksu, ja izmaksātais komandējuma avanss pārsniedz iesniegtos attaisnojuma izdevumus un nav apstiprināts nākamais komandējums no tā paša finansējuma. Sistēma: RVS Horizon, Atbalsta sistēma (Redmine). Saistīts process: 3.5.4 (Avansa atmaksas). + F11 + F13 + + + + Ja iesniegtie attaisnojuma izdevumi pārsniedz izmaksāto avansu (vai avanss nav bijis), VPC sagatavo papildu izmaksas priekšlikumu Nodarbinātajam par starpību. Izmaksa tiek veikta FG2 maksājumu procesā. Sistēma: RVS Horizon. + F12 + F14 + + + + VPC iegrāmato komandējuma norēķina dokumentu grāmatvedības informācijas sistēmā. Ja izmaksātais avanss pārsniedz izdevumus un Nodarbinātajam ir apstiprināts nākamais komandējums no tā paša finansējuma, avansa atlikums tiek saglabāts (pārnests) uz nākamo apstiprināto komandējumu. Sistēma: RVS Horizon. + F10 + F13 + F14 + F15 + + + + F15 + + + + + + + komandejumsAtcelts = "ja" + + + + + + + + + norekinResultats = "atmaksa" + + + norekinResultats = "papildu-izmaksa" + + + + + + + diff --git a/processes/fg3-5/dmn/komandejuma-norekins.dmn b/processes/fg3-5/dmn/komandejuma-norekins.dmn new file mode 100644 index 0000000..4c92fc8 --- /dev/null +++ b/processes/fg3-5/dmn/komandejuma-norekins.dmn @@ -0,0 +1,74 @@ + + + + + + + + Nosaka komandējuma avansa norēķina rezultātu, salīdzinot izmaksāto avansu ar iesniegtajiem attaisnojuma izdevumiem un ņemot vērā, vai Nodarbinātajam ir apstiprināts nākamais komandējums no tā paša finansējuma. + + + + + + + + + + + avansaSituacija + + + "nav-avansa","avanss-lielaks","avanss-vienads","izdevumi-lielaki" + + + + + nakamaisKomandejums + + + "ir","nav" + + + + + "slegts","atmaksa","papildu-izmaksa","parnesums" + + + + + Avanss nav bijis — izdevumi atlīdzināmi pilnā apmērā kā papildu izmaksa. + "nav-avansa" + - + "papildu-izmaksa" + + + Izdevumi pārsniedz avansu — starpība atlīdzināma kā papildu izmaksa. + "izdevumi-lielaki" + - + "papildu-izmaksa" + + + Avanss vienāds ar izdevumiem — norēķins slēgts bez papildu darbībām. + "avanss-vienads" + - + "slegts" + + + Avanss pārsniedz izdevumus un ir apstiprināts nākamais komandējums no tā paša finansējuma — atlikums pārnests. + "avanss-lielaks" + "ir" + "parnesums" + + + Avanss pārsniedz izdevumus un nav nākamā komandējuma — starpība atmaksājama. + "avanss-lielaks" + - + "atmaksa" + + + + diff --git a/processes/fg3-5/metadata/lifecycle.yaml b/processes/fg3-5/metadata/lifecycle.yaml index 78c04b2..3a0b57d 100644 --- a/processes/fg3-5/metadata/lifecycle.yaml +++ b/processes/fg3-5/metadata/lifecycle.yaml @@ -2,3 +2,8 @@ kind: uapf.metadata.lifecycle status: draft created: "2026-05-19T00:00:00Z" lastModified: "2026-05-19T00:00:00Z" +changeHistory: + - version: 0.1.0 + date: "2026-05-19" + summary: "Initial executable build — BPMN process, DMN settlement-reconciliation decision and resource mappings." + author: vpc.process-office diff --git a/processes/fg3-5/metadata/policies.yaml b/processes/fg3-5/metadata/policies.yaml new file mode 100644 index 0000000..295f815 --- /dev/null +++ b/processes/fg3-5/metadata/policies.yaml @@ -0,0 +1,18 @@ +kind: uapf.policies +classification: + level: internal + dataCategories: + - financial-records + - employee-data +execution: + requiresApproval: false + auditRequired: true + allowedEnvironments: + - development + - staging + - production +delegation: + allowAgentDelegation: true + maxDelegationDepth: 2 + trustedAgents: + - agent.komandejumu-asistents diff --git a/processes/fg3-5/resources/agents.yaml b/processes/fg3-5/resources/agents.yaml new file mode 100644 index 0000000..00b5f17 --- /dev/null +++ b/processes/fg3-5/resources/agents.yaml @@ -0,0 +1,9 @@ +kind: uapf.resources.agents +agents: + - id: agent.komandejumu-asistents + name: Komandējumu norēķinu apstrādes asistents + type: ai_agent + capabilities: + - capability.document.extract + - capability.policy.lookup + - capability.decision.assist diff --git a/processes/fg3-5/resources/mappings.yaml b/processes/fg3-5/resources/mappings.yaml new file mode 100644 index 0000000..cc54ace --- /dev/null +++ b/processes/fg3-5/resources/mappings.yaml @@ -0,0 +1,83 @@ +kind: uapf.resources.mapping + +targets: + - id: role.nodarbinatais + type: human_role + name: Nodarbinātais (iestāde) + - id: role.atbildigais + type: human_role + name: Atbildīgā amatpersona (iestāde) + - id: role.gramatvedis + type: human_role + name: Grāmatvedis (VPC) + - id: agent.komandejumu-asistents + type: ai_agent + name: Komandējumu norēķinu apstrādes asistents + capabilities: + - capability.document.extract + - capability.policy.lookup + - capability.decision.assist + +bindings: + - source: + type: bpmn.userTask + ref: Task_ApstradatPieteikumu + targetId: agent.komandejumu-asistents + mode: assisted + notes: "Asistents apstrādā komandējuma pieteikumu komandējuma dokumentos un sagatavo avansa aprēķinu; grāmatvedis apstiprina." + + - source: + type: bpmn.userTask + ref: Task_AnuletPieteikumu + targetId: role.gramatvedis + mode: manual + notes: "Grāmatvedis anulē atcelto komandējuma pieteikumu un pārbauda veiktās izmaksas." + + - source: + type: bpmn.userTask + ref: Task_IesniegtAtskaiti + targetId: role.nodarbinatais + mode: manual + notes: "Nodarbinātais iesniedz komandējuma izdevumu atskaiti un pievieno apliecinošos dokumentus." + + - source: + type: bpmn.userTask + ref: Task_SaskanotAtskaiti + targetId: role.atbildigais + mode: manual + notes: "Iestādes atbildīgā amatpersona saskaņo komandējuma izdevumu atskaiti." + + - source: + type: bpmn.userTask + ref: Task_ApstradatAtskaiti + targetId: agent.komandejumu-asistents + mode: assisted + notes: "Asistents izgūst rekvizītus no apliecinošajiem dokumentiem un sagatavo avansa/izdevumu salīdzinājumu; grāmatvedis apstiprina." + + - source: + type: dmn.decision + ref: Decision_KomandejumaNorekins + targetId: agent.komandejumu-asistents + mode: assisted + notes: "Asistents izpilda norēķina rezultāta lēmumu tabulu un sniedz rezultāta priekšlikumu ar pamatojumu." + + - source: + type: bpmn.userTask + ref: Task_PieprasitAtmaksu + targetId: role.gramatvedis + mode: manual + notes: "Grāmatvedis sagatavo avansa atmaksas pieprasījumu Atbalsta sistēmā (Redmine)." + + - source: + type: bpmn.userTask + ref: Task_SagatavotPapilduIzmaksu + targetId: role.gramatvedis + mode: manual + notes: "Grāmatvedis sagatavo papildu izmaksas priekšlikumu par avansu pārsniedzošajiem izdevumiem." + + - source: + type: bpmn.userTask + ref: Task_Iegramatot + targetId: role.gramatvedis + mode: manual + notes: "Grāmatvedis iegrāmato komandējuma norēķina dokumentu grāmatvedības informācijas sistēmā." diff --git a/processes/fg3-5/resources/roles.yaml b/processes/fg3-5/resources/roles.yaml new file mode 100644 index 0000000..061f210 --- /dev/null +++ b/processes/fg3-5/resources/roles.yaml @@ -0,0 +1,11 @@ +kind: uapf.resources.roles +roles: + - id: role.nodarbinatais + name: Nodarbinātais (iestāde) + description: Iesniedz komandējuma pieteikumu un pēc komandējuma — komandējuma izdevumu atskaiti ar apliecinošiem dokumentiem. + - id: role.atbildigais + name: Atbildīgā amatpersona (iestāde) + description: Saskaņo iesniegto komandējuma izdevumu atskaiti atbilstoši Iestādes definētajai plūsmai. + - id: role.gramatvedis + name: Grāmatvedis (VPC) + description: Apstrādā komandējuma pieteikumu un atskaiti, anulē atceltus pieteikumus, sagatavo avansa atmaksas pieprasījumu vai papildu izmaksas priekšlikumu un iegrāmato norēķinu. diff --git a/processes/fg3-5/uapf.yaml b/processes/fg3-5/uapf.yaml index bf1f30d..18c29a5 100644 --- a/processes/fg3-5/uapf.yaml +++ b/processes/fg3-5/uapf.yaml @@ -1,15 +1,60 @@ kind: uapf.package id: vk.gramatvediba.fg3-5 name: "FG3-5 — Komandējuma norēķina veikšana" -description: "Business-trip settlement: processing of travel advances and post-trip expense settlements against approved travel orders." +description: "Level 4 atomic executable process: processing of business-trip (travel) requests and cancellations, submission and approval of post-trip expense reports, VPC processing, advance-vs-expense reconciliation and the resulting repayment, additional payment or carry-forward to a next approved trip. The third FG3 sub-process taken to executable depth (BPMN + DMN + resource mappings)." level: 4 version: 0.1.0 includes: [] cornerstones: - bpmn: false - dmn: false + bpmn: true + dmn: true cmmn: false - resources: false + resources: true +paths: + bpmn: bpmn + dmn: dmn + cmmn: cmmn + resources: resources + metadata: metadata +exposure: + mcp: + enabled: true + runnable: true + exposedEntrypoints: + - process: Process_KomandejumaNorekina + tool: vk.fg3-5.run + - decision: Decision_KomandejumaNorekins + tool: vk.fg3-5.evaluate-settlement + exposedArtifacts: + - manifest + - bpmn + - dmn +inputs: + - komandejuma-pieteikums + - komandejuma-izdevumu-atskaite +outputs: + - iegramatots-norekins + - avansa-atmaksas-pieprasijums + - papildu-izmaksas-priekslikums +artifacts: + bpmn: + - path: bpmn/komandejuma-norekina.bpmn + role: primary-process + description: "Business-trip settlement: trip-request processing, cancellation branch, expense-report submission and approval, VPC processing, reconciliation and outcome handling." + dmn: + - path: dmn/komandejuma-norekins.dmn + role: routing-decision + description: "Reconciles the trip advance against documented expenses and the existence of a next trip, and sets the settlement outcome." + resources: + - path: resources/roles.yaml + role: roles + description: "Human roles participating in the process." + - path: resources/agents.yaml + role: agents + description: "AI agent declared for assisted steps." + - path: resources/mappings.yaml + role: resource-mapping + description: "Bindings of BPMN tasks and the DMN decision to targets." owners: - type: team id: vpc