Calculate Collection Balance

The Calculate Collection Balance Use-Case in the OCS.io system focuses on accurately determining the Collection Balance for Payment Responsible Accounts. This Use-Case involves aggregating the outstanding invoices and overpayments up to the current date to derive the Collection Balance. By summing the amounts of due invoices and overpayments, the system provides a comprehensive view of the outstanding balance for each Payment Responsible Account.

Pre-Conditions

  • Calculate Collection Balance Process Cron Job must be configured.

  • Document Types must be configured.

  • Payment Types must be configured.

  • Notifications must be configured.

Primary Actors

  • Operation.

  • Time.

Basic Flow

Calculate Collection Balance Basic Flow

Calculate Collection Balance

Step Actor Action Description

1.

Operation User

Perform Calculate Collection Balance Cron Job now

Operation User via OCS.io Configuration GUI starts Calculate Collection Balance Cron Job with immediate execution.

Process could also be triggered via RESTful API.

2.

Config / CASM Server

Trigger Calculate Collection Balance Process

OCS.io Configuration GUI / CASM Server triggers Calculate Collection Balance Process.

3.

RM Server

Start Process

RM Server asynchronously starts Calculate Collection Balance Process.

Calculate Collection Balance Process

Step Actor Action Description

4.

RM Server

Get All Payment Responsible Accounts

RM Server gets all Payment Responsible Accounts which are not in state Deactivated.

5.

RM Server

Start Process

RM Server asynchronously starts Calculate Collection Balance Process per each Payment Responsible Account.

Calculate Collection Balance Process for Payment Responsible Account

Step Actor Action Description

6.

RM Server

Read Configuration

RM Server reads configuration for Collection Balance Process.

7.

RM Server

Get all account’s documents

RM Server gets all documents belonging to Payment Responsible Account.

8.

RM Server

Filter Document

RM Server filters Document matching the required conditions.

9.

RM Server

Calculate Collection Balance from Document

RM Server calculates Collection Balance from non-filtered Document.

10.

RM Server

Get all account’s payments

RM Server gets all payments belonging to Payment Responsible Account.

11.

RM Server

Filter Payment

RM Server filters Payment matching the required conditions.

12.

RM Server

Calculate Collection Balance from Payment

RM Server calculates Collection Balance from non-filtered Payment.

13.

RM Server

Store account’s Collection Balance

RM Server stores Collection Balance on Payment Responsible Account level.

14.

RM Server

Notify Collection Balance calculated on Account

RM Server notifies that Collection Balance has been calculated for Payment Responsible Account.

15.

RM Server

Consider Collection Process Trigger

RM Server evaluates whether Collection Process for Payment Responsible Account should be triggered.

16.

RM Server

Notify Start Collection Process on Account

RM Server notifies that Collection Process should be started for Payment Responsible Account.

Process Notifications by External System

Step Actor Action Description

17.

External System

Subscribe for Notifications

External System subscribes for notifications related to Collection Balance Process.

18.

External System

Process Notifications

External System process notifications.

Filter Document

Filter Payment

Consider Collection Process Trigger