Automatic Allocation
Bellow are the journeys, entities, libraries and endpoints related to the incoming payments Automatic Allocation functionality. For incoming Payments Deallocation scroll down or click the link.
-
Entity FTOS_PYMT_Payment with all attributes.
-
Entity FTOS_PYMT_PaymentScheduleItemXPayment with all attributes.
Payment Allocation
From the FTOS_PYMT_PaymentAllocation server side library, the following functions are used for automatic payment allocation:
This function gets the details of the payment to be allocated.
Input parameters: paymentId
- The Id of the payment.
Output parameters: payment[0]
- Query result containing details of the requested payment .
This function gets the reference values to be applied.
Input parameters:
-
payment
- The selected payment. -
processor
- The selected processor.
Output parameters: result
- Variable containing all references to be applied.
This function gets the invoices that match the specified conditions, passed in the input parameters.
Input parameters:
-
type
- The type of payment. -
whereValuesObj
- An object with the values of the payment. -
referenceCurrencyId
- The Id for the payment currency, extracted from the invoice reference.
Output parameters: result
- Query result containing the invoices matching the conditions.
This function gets a list of policies grouped by policy number.
Input parameters: policyNo
- The policy number.
Output parameters: result
- Query result containing the specified policies.
This function verifies whether the status of a policy is contained into the input parameter policyStatusCheck
values.
Input parameters:
-
policy
- The selected policy. -
policyStatusCheck
- The status of the selected policy.
Output parameters: true
/ false
.
This function gets the list of all unpaid installments for the specified policy.
Input parameters: policyId
- The Id of the policy.
Output parameters: result
- Query result containing the unpaid installments for the policy.
This function verifies whether the policy is eligible for automatic allocation.
Input parameters:
-
policyNo
- The policy number. -
processor
- The selected processor.
Output parameters: true
/ false
.
This function finds the invoices that comply with the references contained in the processor
input parameter.
Input parameters:
-
payment
- The selected payment. -
processor
- The selected processor.
Output parameters: statementsList
- Query result containing a list of invoices.
This function gets details about the requested invoice.
Input parameters: statementId
- The Id of the invoice.
Output parameters: statementList[0]
- Query result.
This function verifies whether the installment unpaid amount is greater than 0.
Input parameters: statementDetailId
- The Id of the invoice detail (only the amount of the payment).
Output parameters: statementDetailList
- Query result.
This function gets the invoice details about unpaid installments.
Input parameters:
-
statementId
- The Id of the invoice. -
exceptStatementDetailId
- The Id of the invoice detail for an unpaid installment.
Output parameters: statementDetailList
- The result of the query.
This function gets the list of installments.
Input parameters: statementId
- The Id of the invoice.
Output parameters: statementDetailList
- The result of the query.
This function gets the type of the default exchange rate.
Input parameters: N/A.
Output parameters: defaultExchangeRateType
- The result of the query.
This function gets the Id for the exchange rate.
Input parameters:
-
exchangeType
- The exchange type for the payment. -
fromCurrency
- -
toCurrency
- -
exchangeDate
- The exchange date for the payment.
Output parameters: result
- The result of the query.
This function carries out the following actions:
-
Generates a
statementPayment
- that is a merger between the invoice and the payment made for that invoice. ThestatementPayment
parameter contains thestatementPaymentDetail
and thestatementPaymentXPayment
values. -
Updates the payment and the invoice amounts.
-
Inserts the allocation on the specified installment.
-
Updates the remaining amounts, if the case.
-
Inserts statement details for the specified statement (invoice).
Input parameters:
-
payment
- A payment. -
statement
- An invoice. -
amount
- The amount of the payment. -
alocatedAmount
- The allocated amount. -
exchangeRateId
- The Id of the exchange rate. -
statementDetailId
- The Id of the invoice detail.
Output parameters: statementPaymentId
- The Id of the statementPayment (invoice & payment merger).
This function gets the installment details for the specified installment.
Input parameters: installmentId
- The Id of the installment.
Output parameters: fetchInstallmentItemList
- Query result.
This function inserts a record into the FTOS_PYMT_PaymentScheduleItemXPayment entity with the status Generated for the references specified in the input parameter.
Input parameters: param
Output parameters: N/A.
This function inserts the invoice details and the FTOS_PYMT_StatementPaymentDetailXPayment record, according to the allocated amount and the installment unpaid amount.
Input parameters:
-
statementDetailList
- The list containing the statement details. -
amount
- The amount of the payment. -
statementPaymentId
- The Id of the statementPayment (invoice & payment merger). -
payment
- The selected payment.
Output parameters: N/A.
This function changes the status for the specified statementPayment (invoice & payment merger).
Input parameters:
-
statementPaymentId
- The Id of the statementPayment (invoice & payment merger). -
newStatus
- The new business status of the installment.
Output parameters: N/A.
This function gets the data about the specified installment.
Input parameters: installmentId
- The Id of the installment.
Output parameters: fetchResult[0]
/ null
- The result of the query.
This function gets the code of the specified currency.
Input parameters: currencyId
- The Id of the currency.
Output parameters: fetchResult[0].code
/ null
- The result of the query.
This function gets the specified tolerance value.
Input parameters:
-
processor
- The selected processor. -
currencyId
- The Id of the currency.
Output parameters: result
- Tolerance value for the requested currency.
This function gets the type of calculation for the exchange rate.
Input parameters: processor
- The selected processor.
Output parameters: exchangeCalculationType
- The result of the query.
This function inserts the payment record containing the write-off value.
Input parameters:
-
writeOffAmount
- The write-off amount. -
statement
- The selected invoice. -
exchangeRateId
- The Id of the exchange rate for the selected currency.
Output parameters: paymentId
- The Id of the payment.
This function verifies if the invoice is eligible for automatic allocation.
Input parameters: statementId
- The Id of the invoice.
Output parameters: true
/ false
.
This function verifies all the conditions and calls the insertAllocation
function.
Input parameters: paymentId
- The Id of the payment.
Output parameters: N/A.
Payment Deallocation
Serve side functions used for automatic payment deallocation:
This function deallocates the allocated amount from the invoice and returns it to the payment.
Input parameters:
-
statementId
- The Id of the invoice. -
paymentId
- The Id of the payment.
Output parameters: N/A.
This function updates the installment paid amount to 0.
Input parameters:
-
installmentId
- The Id of the installment. -
statementId
- The Id of the invoice. -
paymentId
- The Id of the payment.
Output parameters: N/A.
This function gets the exchange rate value for the specified payment.
Input parameters: exchangeRateId
- The Id of the exchange rate for the selected currency.
Output parameters: fetchResult[0].a_exchangeRate
- The result of the query.
This function gets details about the specified payment.
Input parameters:
-
statementId
- The Id of the invoice. -
paymentId
- The Id of the payment.
Output parameters: fetchResult
- The query result containing details about the requested payment.
This function gets details about the specified write-off payment.
Input parameters:
-
statementId
- The Id of the invoice. -
statementNo
- The invoice number.
Output parameters: fetchResult
- The query result containing details about the requested write-off payment.
This function deletes the afferent installment item allocation record from the FTOS_PYMT_PaymentScheduleItemXPayment entity.
Input parameters: allocationId
- The Id of the allocation record.
Output parameters: N/A.
Input parameters:
-
statementId
- The Id of the invoice. -
paymentId
- The Id of the payment. -
tip
-
Output parameters: N/A.
This function
Input parameters:
-
statementId
- The Id of the invoice. -
paymentId
- The Id of the payment. -
tip
Output parameters: N/A.
This function updates the invoice detail - the line containing the amount of the payment.
Input parameters:
-
statementDetailId
- The Id of the invoice detail. -
updateObj
- An object containing the details for the update.
Output parameters: N/A.
This function updates invoice to initial values.
Input parameters:
-
statementId
- The Id of the invoice. -
amountDeallocateFromStatement
- The amount to be deallocated from the invoice.
Output parameters: N/A.
This function updates payment to initial values.
Input parameters:
paymentId
- The Id of the payment.
newRemainingPaymentAmount
- The remaining amount of the payment.
newAllocatedAmount
- The new allocated amount.
Output parameters: N/A.
This function gets a list with invoice details - that is payment amounts.
Input parameters: statementId
- The Id of the invoice.
Output parameters: statementDetailList
- The result of the query.
This function gets a list with all the payments (from invoice details) to be compared with the data from the payment list.
Input parameters:
statementId
- The Id of the statement.
paymentId
- The Id of the payment.
Output parameters: statementDetailList
- The result of the query.