update ceda schema with changes to datables from feedback with esther.
This commit is contained in:
@@ -473,7 +473,7 @@ CREATE TABLE `m_product_loan` (
|
|||||||
`accounting_type` smallint(5) NOT NULL,
|
`accounting_type` smallint(5) NOT NULL,
|
||||||
`loan_transaction_strategy_id` bigint(20) DEFAULT NULL,
|
`loan_transaction_strategy_id` bigint(20) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `unq_name` (`name`)
|
UNIQUE KEY `unq_name` (`name`),
|
||||||
KEY `FKA6A8A7D77240145` (`fund_id`),
|
KEY `FKA6A8A7D77240145` (`fund_id`),
|
||||||
KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
|
KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
|
||||||
CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
|
CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -80,7 +80,7 @@ CREATE TABLE `mifostenant-ceda`.`client additional data` (
|
|||||||
`YesNo_cd_Business plan provided` int(11) NOT NULL,
|
`YesNo_cd_Business plan provided` int(11) NOT NULL,
|
||||||
`YesNo_cd_Access to internet` int(11) DEFAULT NULL,
|
`YesNo_cd_Access to internet` int(11) DEFAULT NULL,
|
||||||
`Introduced by` varchar(100) DEFAULT NULL,
|
`Introduced by` varchar(100) DEFAULT NULL,
|
||||||
`Known to introducer since` date NOT NULL,
|
`Known to introducer since` varchar(100) NOT NULL,
|
||||||
`Last visited by` varchar(100) DEFAULT NULL,
|
`Last visited by` varchar(100) DEFAULT NULL,
|
||||||
`Last visited on` date NOT NULL,
|
`Last visited on` date NOT NULL,
|
||||||
PRIMARY KEY (`client_id`),
|
PRIMARY KEY (`client_id`),
|
||||||
@@ -91,8 +91,8 @@ DROP TABLE IF EXISTS `mifostenant-ceda`.`impact measurement`;
|
|||||||
CREATE TABLE `mifostenant-ceda`.`impact measurement` (
|
CREATE TABLE `mifostenant-ceda`.`impact measurement` (
|
||||||
`loan_id` bigint(20) NOT NULL,
|
`loan_id` bigint(20) NOT NULL,
|
||||||
`YesNo_cd_RepaidOnSchedule` int(11) NOT NULL,
|
`YesNo_cd_RepaidOnSchedule` int(11) NOT NULL,
|
||||||
`ReasonNotRepaidOnSchedule` varchar(200) DEFAULT NULL,
|
`ReasonNotRepaidOnSchedule` text DEFAULT NULL,
|
||||||
`How was Loan Amount Invested` varchar(200) NOT NULL,
|
`How was Loan Amount Invested` text NOT NULL,
|
||||||
`Additional Income Generated` decimal(19,6) NOT NULL,
|
`Additional Income Generated` decimal(19,6) NOT NULL,
|
||||||
`Additional Income Used For` text NOT NULL,
|
`Additional Income Used For` text NOT NULL,
|
||||||
`YesNo_cd_NewJobsCreated` int(11) NOT NULL,
|
`YesNo_cd_NewJobsCreated` int(11) NOT NULL,
|
||||||
@@ -116,7 +116,35 @@ CREATE TABLE `mifostenant-ceda`.`loan additional data` (
|
|||||||
CONSTRAINT `FK_loan_additional_data` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
|
CONSTRAINT `FK_loan_additional_data` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- datatables mapping
|
||||||
|
INSERT INTO `mifostenant-ceda`.`x_registered_table`
|
||||||
|
(`registered_table_name`,
|
||||||
|
`application_table_name`)
|
||||||
|
VALUES
|
||||||
|
('client additional data', 'm_client'),
|
||||||
|
('impact measurement', 'm_loan'),
|
||||||
|
('loan additional data', 'm_loan');
|
||||||
|
|
||||||
|
-- make sure permissions created for registered datatables
|
||||||
|
/* add a create, read, update and delete permission for each registered datatable */
|
||||||
|
insert into m_permission(grouping, `code`, entity_name, action_name)
|
||||||
|
select 'datatable', concat('CREATE_', r.registered_table_name), r.registered_table_name, 'CREATE'
|
||||||
|
from x_registered_table r;
|
||||||
|
|
||||||
|
insert into m_permission(grouping, `code`, entity_name, action_name)
|
||||||
|
select 'datatable', concat('READ_', r.registered_table_name), r.registered_table_name, 'READ'
|
||||||
|
from x_registered_table r;
|
||||||
|
|
||||||
|
insert into m_permission(grouping, `code`, entity_name, action_name)
|
||||||
|
select 'datatable', concat('UPDATE_', r.registered_table_name), r.registered_table_name, 'UPDATE'
|
||||||
|
from x_registered_table r;
|
||||||
|
|
||||||
|
insert into m_permission(grouping, `code`, entity_name, action_name)
|
||||||
|
select 'datatable', concat('DELETE_', r.registered_table_name), r.registered_table_name, 'DELETE'
|
||||||
|
from x_registered_table r;
|
||||||
|
|
||||||
|
|
||||||
|
-- ==== Chart of Accounts =====
|
||||||
DELETE FROM `mifostenant-ceda`.`acc_gl_account` WHERE id>0;
|
DELETE FROM `mifostenant-ceda`.`acc_gl_account` WHERE id>0;
|
||||||
|
|
||||||
INSERT INTO `mifostenant-ceda`.`acc_gl_account` VALUES
|
INSERT INTO `mifostenant-ceda`.`acc_gl_account` VALUES
|
||||||
|
|||||||
@@ -1,4 +1,17 @@
|
|||||||
UPDATE `mifostenant-ceda`.`m_appuser` SET `username` = 'admin' WHERE id=1;
|
DELETE FROM `mifostenant-ceda`.`m_organisation_currency` WHERE id>0;
|
||||||
|
|
||||||
|
INSERT INTO `mifostenant-ceda`.`m_organisation_currency`
|
||||||
|
(
|
||||||
|
`code`,
|
||||||
|
`decimal_places`,
|
||||||
|
`name`,
|
||||||
|
`display_symbol`,
|
||||||
|
`internationalized_name_code`)
|
||||||
|
VALUES
|
||||||
|
('UGX', 2, 'Uganda Shilling', 'USh', 'currency.UGX');
|
||||||
|
|
||||||
|
|
||||||
|
UPDATE `mifostenant-ceda`.`m_appuser` SET `username` = 'admin' WHERE id=1;
|
||||||
|
|
||||||
INSERT INTO `mifostenant-ceda`.`m_appuser`
|
INSERT INTO `mifostenant-ceda`.`m_appuser`
|
||||||
(`is_deleted`,
|
(`is_deleted`,
|
||||||
@@ -40,3 +53,47 @@ INSERT INTO `mifostenant-ceda`.`m_staff`
|
|||||||
VALUES
|
VALUES
|
||||||
(1, 1, 'CEDA HO', 'LoanOfficer', 'LoanOfficer, CEDA HO'),
|
(1, 1, 'CEDA HO', 'LoanOfficer', 'LoanOfficer, CEDA HO'),
|
||||||
(1, 2, 'Kampala', 'LoanOfficer', 'LoanOfficer, Kampala');
|
(1, 2, 'Kampala', 'LoanOfficer', 'LoanOfficer, Kampala');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `mifostenant-ceda`.`m_charge`
|
||||||
|
(
|
||||||
|
`name`,
|
||||||
|
`currency_code`,
|
||||||
|
`charge_applies_to_enum`,
|
||||||
|
`charge_time_enum`,
|
||||||
|
`charge_calculation_enum`,
|
||||||
|
`amount`,
|
||||||
|
`is_penalty`,
|
||||||
|
`is_active`,
|
||||||
|
`is_deleted`)
|
||||||
|
VALUES ('Bank Fee (per installment)', 'UGX', 1, 2, 1, 1500.000000, 0, 1, 0);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `mifostenant-ceda`.`m_product_loan`
|
||||||
|
(
|
||||||
|
`currency_code`,
|
||||||
|
`currency_digits`,
|
||||||
|
`principal_amount`,
|
||||||
|
`arrearstolerance_amount`,
|
||||||
|
`name`,
|
||||||
|
`description`,
|
||||||
|
`fund_id`,
|
||||||
|
`nominal_interest_rate_per_period`,
|
||||||
|
`interest_period_frequency_enum`,
|
||||||
|
`annual_nominal_interest_rate`,
|
||||||
|
`interest_method_enum`,
|
||||||
|
`interest_calculated_in_period_enum`,
|
||||||
|
`repay_every`,
|
||||||
|
`repayment_period_frequency_enum`,
|
||||||
|
`number_of_repayments`,
|
||||||
|
`amortization_method_enum`,
|
||||||
|
`accounting_type`,
|
||||||
|
`loan_transaction_strategy_id`)
|
||||||
|
VALUES
|
||||||
|
('UGX', 2, 1000000.000000, null , 'Kampala Product (with cash accounting)',
|
||||||
|
'Typical Kampala loan product with cash accounting enabled for testing.', null ,
|
||||||
|
24.000000, 3, 24.000000, 1, 1, 1, 2, 12, 1, 2, 2);
|
||||||
|
|
||||||
|
-- mapping of that loan product to GL Accounts
|
||||||
|
INSERT INTO `mifostenant-ceda`.`acc_product_mapping`
|
||||||
|
VALUES (1,4,1,1,1),(2,8,1,1,2),(3,34,1,1,3),(4,37,1,1,4),(5,35,1,1,5),(6,97,1,1,6);
|
||||||
Reference in New Issue
Block a user