Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

When a savings product is created, the user defines the frequency of interest posting of which only Monthly is supported in Mifos. Once at least one savings is open for a given savings product, a number of attributes of a savings product cannot be changed. The interest posting frequency and interest calculation frequency are two of this such attributes.

Interest posting always occurs on the end of the month and the exact dates are determined based on the start of the fiscal year (which is currently always Jan 1st in Mifos) and the chosen interest posting frequency.

Panel

For example every 3 months from Jan 1st would product interest posting dates of:
31st of March
30th of June
30th of September
31st of December

Interest posting is possible in Mifos from:

  1. An Overnight batch job named SavingsIntPostingTask that detects savings accounts that are due for interest posting
  2. When a savings account Savings Account is closed and interest is due based on balance of savings account at closing.

...

  1. No adjustments of deposits or withdrawals are allowed if the transaction exists in a previous interest posting period. To help enforce this we post interest even if the calculated interest is zero as this will result in the user being unable to adjust transactions prior to the interest posting.
  2. No back-dated transactions are allowed if the transaction exists in a previous interest posting period

How Interest

...

At present interest calculation is carried out by an overnight batch job (SavingsIntCalcTask). It determines when to run based on the next interest calculation date value stored in savings_account -> next_int_calc_date datable table/column.

When a savings account goes active for the first time, an initial next calculation date is determine based on the start of the fiscal year which is fixed at January 1st and the interest calculation time period chosen in the savings account product definition. For interest calculation, this can be Daily (e.g. every x days) or Monthly at the end of the month (e.g. every x months on last day of month).

So interest is only calculated for any transactions that occur within a given 'interest calculation period'. The interest calculated for a given period is stored (savings_account -> int_to_be_posted) until the next interest posting date is reached whereby the sum of all calculated interest is posted to the savings account.

Interest Calculation Dates in Months

Example:

Interest calculation is determined every 3 months so based on starting from Fiscal start of year, the valid interest calculation dates are:

Jan-01 to Mar-31

Apr-01 to Jun-30

July-01 to Sep-30

Oct-01 to Dec-31

Interest Calculation Dates in Days

Interest calculation is determined every 28 days (4 weeks) so based on starting from Fiscal start of year, the valid interest calculation dates are:

Fri Jan-01 to Fri Jan 29
Sat Jan-30 to Fri Feb 26
..
..

Interest Posting

Interest posting always occurs on a monthly basis on the last day of the month.

When interest is due for posting, its takes the value from (savings_account -> int_to_be_posted) and posts it the date of last day of month.

Interest posting is handled overnight by batch job (SavingsIntPostingTask).

Interest Posting Dates in Months

Interest calculation is determined every 1 months so based on starting from Fiscal start of year, the valid interest posting dates are:

Jan-01 to Jan-31

Feb-01 to Feb-28/29

Mar-01 to Mar-31
..
..
Dec-01 to Dec-31

Interest Calculation Formula

Interest Calculation Formula

Balance

Table Used

A = P(1+r/n)

Minimum Balance

SAVINGS_TRXN_DETAIL

A = P(1+r/n)

Average Balance

SAVINGS_TRXN_DETAIL

...

r = R/100 x D/F

P = AvB/D or MB/D

Is Calculated

When it becomes time to execute an interest posting for a given savings account we do the following:

  1. Retreive all End Of Day Details for the account. (By this we mean that we find all deposits, withdrawals and interest that occured on a day)
  2. Determine the range of applicable days for the interest posting period e.g. 1st of Jan to 31st of March
  3. Determine the interest calculation periods that fall within this interest posting period. e.g. 1st of Jan to 31st of Jan, 1st of Feb to end of Feb etc
  4. For each interest calculation period we determine the applicable interest calculation period details. This will contain information such as account balance at start of period, and all applicable End Of Day Details for period.
  5. For each interest calculation period we also create an associated Interest Calculation Period Calculator which is solely responsible for calculating the interest earned/due for the given interest calculation period. The Savings Interest Details used by the calculator are taken directly from the savings product or if the savings products interest details have changed, its can use historical interest details. As a result, its is possible for adjust interest rates (or min interest required balance rule) and still calculate correctly the interest that was due in an interest calculation period that exists in the past.

Interest Calculation Formula

Panel

I = P(r) only if P is greater than or equal to minimum balance required for interest calculation otherwise the interest (I) will be zero.

r = R/100 x D/F

where,

P = AvB/D or MB/D

I = Interest Amount

AvB = Total Average Balance for duration D

MB = Minimum Balance for duration D

D = Duration/Interval (Days) for which the interest is being calculated

F = Number of Days in Financial Year

P = Principal amount (initial amount) (Average/Minimum Balance)

R = Annual rate of interest (as a decimal) (defined during savings product creation)

r = Effective interest rate for the duration D

I = Interest Amount A = amount of money accumulated including interest

Interest Calculation Examples

...

see Interest Calculation For Average Balance By Example
see Interest Calculation For Minimum Balance By Example

Interest Calculation/Posting (Notes)

Interest Calculation Date: SAVINGS_ACCOUNT.LAST_INT_CALC_DATE (fromDate), SAVINGS_ACCOUNT.NEXT_INT_CALC_DATE(toDate)

Interest Posting Date: SAVINGS_ACCOUNT.LAST_INT_POST_DATE, SAVINGS_ACCOUNT.NEXT_INT_POST_DATE

Based on the interest calculation meeting from Savings Product Offering "next interest calculation date" is set during interest calculation.

The interest calculation is done for the period determined by fromDate and toDate.

Initial (first) interest calculation has LAST_INT_CALC_DATE as null, in this case the activation date account is taken as fromDate.

Interest calculation takes place when the NEXT_INT_CALC_DATE is older than currentDate.

Interest calculation takes place when principal (P) is greater or equal to the Minimum balance required for interest calculation(Savings Product has property miniBalForIntCalc)

Calculated interest is saved in SavingsBO.interestToBePosted field after every interest calculation. 

e.g. if there interest calculation period is 1 month and posting frequency is 3 month then the interest will be calculated 3 times and stored in SavingsBO.interestToBePosted. Interest Posting Batch job will pick the interest from SavingsBO.interestToBePosted.

 This makes a necessary condition that Interest calculation batch job should always run before interest posting batch job.

 If one interest calculation fails interest posting job has no way to determine and it will still post the interest as SavingsBO.interestToBePosted which could be zero if interest calculation job fails.

Warning
titleWarning

At present, once interest for a given calculation period is calculated it will never again be recalculated however it is possible for users to adjust their last transaction which could well be in the last 'calculation period' and thus the previous interest figure would be wrong.

...

titleHandy Hint

...