Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

hist_loan_balances

Contains daily balances for 'active' loan accounts (good and bad standing status's).  Doesn't included reversed transactions as they affect the 'as of' situation.  
For example, a loan might be active on Jan 1 (so should appear on a report run for Jan 1).  On Jan 2, the loan may be reversed which creates backdated transactions to contra all repayment and disbursal transactions created.
Example of listing all loans as of 1st Aug 2010:

Code Block
SELECT cust.display_name, l.loan_account_id, l.loan_amount, l.loan_status, l.disbursement_date,
       ifnull(lb.principal_outstanding, 0.000) balanceFROMbalance
FROM dim_loan l
LEFT JOIN dim_customer cust ON cust.customer_key = l.customer_key
LEFT JOIN hist_loan_balances lb ON lb.loan_account_id = l.loan_account_id and lb.as_of_date = '2010-08-01'
WHERE  (l.valid_from <= '2010-08-01' and l.valid_to > '2010-08-01')
ORDER BY cust.display_name, l.loan_account_id

hist_loan_arrears

Contains daily balances for over due loans (hist_loans_overdue is a more correct table name).

Overdue: loan is not fully up to date with repayment schedule
In Arrears: loan is overdue by more than 'lateness' days (where lateness is defined within mifos Admin functionality and copied to DW table dw_mfi_configuration).  


hist_savings_balances

Contains daily balances for 'active' savings accounts (active and inactive status's).

...