finish off support for using loan term details of a loan to determine interest due rather than inferring it from the number of repayments and repaid every information. This allows better support for loan schedules where the first repayment is irregular (e.g. not same timescale as repaid every)

This commit is contained in:
Keith Woodlock
2012-08-07 14:38:29 +01:00
parent 5638a0880c
commit 525902cbb2
6 changed files with 90 additions and 23 deletions
@@ -0,0 +1,9 @@
ALTER TABLE `portfolio_loan` ADD COLUMN `term_frequency` smallint(5) NOT NULL DEFAULT 0 AFTER `interest_calculated_in_period_enum`;
ALTER TABLE `portfolio_loan` ADD COLUMN `term_period_frequency_enum` smallint(5) NOT NULL DEFAULT 2 AFTER `term_frequency`;
UPDATE `mifostenant-default`.`portfolio_loan`
SET
`term_frequency` = `repay_every` * `number_of_repayments`,
`term_period_frequency_enum` = `repayment_period_frequency_enum`
WHERE id > 0;