Import Bank Statements
The Import Bank Statements functionality lets you import bank statement files for payment processing. In FintechOS Portal, select Billing and Collection and then select Bank Statements. On the Bank Statements List page, click the Insert button to load a new bank account statement. The Insert triggers the import of the bank file in the system and changes the business status of the record to Imported. This functionality also allows for import of payment files from online payment processors.
The journeys, entities, libraries, and endpoints related to the Import Bank Statements functionality are as follows:
Entity FTOS_PYMT_PaymentGroup with all attributes.
Payment Group Insert Journey
General description:
This is a user journey aimed at implementing the Insert Bank Statement functionality. The journey is marked as Default for insert on FTOS_PYMT_PaymentGroup entity.
After selecting the file to import, when pressing Import Data, the record is saved - using the ebs.saveEditForm
method, from the FintechOS Client Side SDK. Next, the flow is redirected to the default form driven flow of FTOS_PYMT_PaymentGroup entity - using the ebs.goToUrl
method from FintechOS Client Side SDK.
Payment Group Journey
General description:
This is a user journey aimed at implementing the payment group functionality. The journey is marked as Default for insert on FTOS_PYMT_PaymentGroup entity. This journey has three steps:
-
Bank Statement - Processing the information from the bank statement.
-
Payments - Making the payment.
-
GL - Creating the general ledger record for the payment.
The journey uses the initiateTotals
function, which collects all the unallocated payments - paymentOrder
, paymentExternal
, brokerPremiumPayment
and outgoing
- and shows them to the Payments and Outgoing Payments grids.
Input parameters: paymentGroupId
- The Id of the payment group.
Output Parameters: N/A.
Business Workflow Configurations Actions
Below is the diagram with the statuses and transitions managed through the Import Bank Statements functionality.
Business Workflow Transitions:
Status | Description |
---|---|
_Draft | Initial status |
Draft_Imported | From Draft to Imported - final status. This transition is manual and it happens when the user presses the Import button. |
Server Side Script Libraries
From this library, the General function is used. This function includes the following functions:
This function gets all the allocated payments from a specific bank statement, based on Id.
Input parameters: paymentGroupId
- The Id of the payment group.
Output parameters: Returns the results of the fetch.
Based on the result of the getAllocatedPayments function, this function throws an error if a bank statement has an assigned payment.
Input parameters: paymentGroupId
- The Id of the payment group.
Output parameters: throwException - If conditions are met.
From the FTOS_ImportPaymentFiles library, the following functions are used:
Function used to process standardized bank statement files (complying with the MT940 format) for payment accounts with BRD code.
Inside the BRD
function, the following functions are used:
This function gets details about the payment group - paymentAccountId
, file
, FTOS_PYMT_PaymentGroupid
, paymentGroupTypeId
.
Input parameters: paymentGroupId
- The Id of the payment group.
Output parameters: pg
- The result of the query, which returns the details about the payment group.
This function gets the import template.
Input parameters: templateName
- The name of the template.
Output parameters: t
- The result of the query made from the data import entity.
This function updates the lastImport attribute of previous payments in FTOS_PYMT_Payment_BRD entity to false.
Input parameters: N/A.
Output parameters: N/A.
This function gets the details about the payment account.
Input parameters: paymentAccountId
- The Id of the payment account.
Output parameters: pa
- The details about the payment account, returned by the query.
This function gets the unprocessed payments.
Input parameters: paymentGroupId
- The Id of the payment group.
Output parameters: initialPayments
- The result of the query containing all unprocessed BRD payments.
This function generates an object containing payment details.
Input parameters: brdPaymentDetails
Output parameters: returnObj
- The object containing payment details.
This function executes the following:
-
selects the payments by group id, with the details about the unprocessed payments;
-
calls the
FTOS_PYMT_PaymentAllocation
library to allocate payment; -
updates the isProcessed flag attribute to true, to mark the payment as processed;
-
changes the business status to Imported.
Input parameters:
-
paymentGroupId
- The Id of the payment group. -
paymentAccountId
- The Id of the payment account.
Output parameters: N/A.
Function used to process standardized statement files from PayU.
Inside the PAYU
function, the following functions are used:
This function gets the import template.
Input parameters: templateName
- The name of the template.
Output parameters: t
- The result of the query made from the data import entity.
This function gets payment details - file
, paymentAmount
, currencyId
, businessStatusId
.
Input parameters: paymentId
- The unique identifier of the payment.
Output parameters: pa
- The details about the payment, returned by the query.
This function deletes revenue records, by id, from the FTOS_PYMT_ExternalPaymentRevenue entity.
Input parameters: paymentId
- The unique identifier of the payment.
Output parameters: N/A.
This function imports a PayU file.
Input parameters:
-
fileAttr
- The file. -
additionalValues
- The additional values. -
templateId
- The Id of the template.
Output parameters: N/A.
Inside theExternalRevenue
function, the following functions are used:
This function gets the statement information.
Input parameters: reference
- The reference for the invoice.
Output parameters:
-
rez
- The result of the query. -
null
- In case the query result is empty.
The function gets the payments in Confirmed status.
Input parameters: statementId
- The statement identifier.
Output parameters: fetchResult
- The result of the query.
The function gets the currency code.
Input parameters: currencyId
- The currency identifier.
Output parameters:
-
rez
- The result of the query. -
null
- In case the currency does not exist.
The function gets the total amount on external payment revenues.
Input parameters: paymentId
- The payment unique identifier.
Output parameters:
-
sum
- The total amount on external payment revenues. -
0
- If there are no external payment revenues.
The function gets the currency Id by currency code.
Input parameters: code
- The currency code.
Output parameters:
-
rez
- The result of the query. -
null
- If there is no currency.
The function gets details about the external payment revenue.
Input parameters: paymentId
- The payment identifier.
Output parameters: rez
- The details returned by query.
The function checks external revenue data.
Input parameters: paymentId
- The payment identifier.
Output parameters: bdxOk
- true
/ false
.
The function checks the reconciliation process by subtracting the paymentAmount
from the totalAmount
.
Input parameters:
-
paymentId
- The payment identifier. -
paymentDetails
- The payment details.
Output parameters: true
/ false
.
The function performs the PayU payment validation. Next, it changes the business status to Closed.
Input parameters: paymentId
- The payment identifier.
Output parameters: N/A.
The function checks whether the payment is already closed. Next, it verifies if there are unmatched records or reconciliation errors.
Input parameters: paymentId
- The payment identifier.
Output parameters: N/A.
Inside the MT
function we have the following functions:
Inside this function, the getTextFileReader
function is used to store the content of a file.
Input parameters: fileRealName
- The Id of the file.
Output parameters: content
- Returns the file content in string format.
The function normalizes strings.
Input parameters:
-
str
- The string. -
splitter
- A splitter. -
code
- The code.
Output parameters: items
- The normalized items.
The function reads the imported file.
Input parameters:
-
itemStr
-
code
Output parameters: item
- The idem found.
The function processes the MT940 document.
Input parameters:
-
items
- The items form the file. -
code
Output parameters: true
/ false
The function gets the payment details for the incoming payments.
Input parameters:
-
paymentDetails
- The details of the payment. -
broker
- The broker details.
Output parameters: returnObj
- Returns an object with the payment details.
The function gets the payment details for the outgoing payments.
Input parameters: paymentDetails
- The details of the payment.
Output parameters: returnObj
- Returns an object with the payment details.
The function gets reference from a string.
Input parameters: str
- The string containing the invoice reference.
Output parameters: reference
- The reference for the invoice.
The function gets the policy number from a string.
Input parameters:str
- The string containing the number of the policy.
Output parameters: policyNo
- The policy number.
This function calls the FTOS_PYMT_PaymentAllocation
library in order to automatically allocate payments.
Input parameters:
-
paymentGroupId
- The Id of the payment group. -
paymentAccountId
- The Id of the payment account. -
code
- The code of the payment.
Output parameters: N/A.
This function gets the bankId from the IBAN.
Input parameters: iban
- The IBAN of the payment.
Output parameters: bankId
- The Id of the bank.
This function gets the payer.
Input parameters: name
- The name of the payer.
Output parameters: accountId
- Returns the id of the account associated with the input name, if it exists. If not, the output is null.
This function gets the identifier for the broker.
Input parameters: iban
- The IBAN of the broker.
Output parameters: brokerId
- Returns the Id of the broker account associated with the input value, if it exists. If not, the output is null.
This function gets the unprocessed payments.
Input parameters:
-
paymentGroupId
- The Id of the payment group. -
code
- The code of the payment.
Output parameters: initialPayments
- The previous payments.
This function gets the payment group details- paymentAccountId
, file
, FTOS_PYMT_PaymentGroupid
, paymentGroupTypeId
.
Input parameters: paymentGroupId
- The Id of the payment group.
Output parameters:pg
- The result of the query, which returns the details about the payment group.
This function gets the payment account details.
Input parameters: paymentAccountId
- The Id of the payment account.
Output parameters: pa
- The details about the payment account, returned by the query.
Function used to process standardized bank statement files (complying with the MT940 format) for payment accounts with ING code.
Inside the ING
function, the following functions are used:
This function gets the transactions details.
Input parameters: itemStr
- The string containing the payment details.
Output parameters: transactions
- The transactions from the bank statement.
This function gets the transactions lines.
Input parameters:
-
insertINGItemTransaction
- The transaction details. -
transactionLineStr
- The string containing the line of the transaction. -
currency
- The currency of the payment.
Output parameters: N/A.
This function defines the transaction details.
Input parameters:
-
insertINGItemTransaction
- The transaction details. -
transactionDescription
- The description of the transaction.
Output parameters: N/A.
Function used to process standardized bank statement files (complying with the MT940 format) for payment accounts with BRDMT code.
Inside the BRDMT
function, the following functions are used:
This function gets the transactions from a string.
Input parameters: itemStr
- The string containing the payment details.
Output parameters: transactions
- The transactions from the bank statement.
This function inserts the transaction lines.
Input parameters:
-
insertBRDMTItemTransaction
- The transaction details. -
transactionLineStr
- The string containing the line of the transaction. -
currency
- The currency of the payment.
Output parameters: N/A.
This function defines the transaction details.
Input parameters:
-
insertBRDMTItemTransaction
- The transaction details. -
transactionDescription
- The description of the transaction.
Output parameters: N/A.
Function used to process standardized bank statement files (complying with the MT940 format) for payment accounts with ABNMT code.
Inside the ABNMT
function, the following functions are used:
This function gets the transactions from a string.
Input parameters: itemStr
- The string containing the payment details.
Output parameters: transactions
- The transactions from the bank statement.
This function inserts the transaction lines.
Input parameters:
-
insertBRDMTItemTransaction
- The transaction details. -
transactionLineStr
- The string containing the line of the transaction. -
currency
- The currency of the payment.
Output parameters: N/A.
This function defines the transaction details.
Input parameters:
-
insertBRDMTItemTransaction
- The transaction details. -
transactionDescription
- The description of the transaction.
Output parameters: N/A.