From 94459fe2a5838045bc15b80f1a462473e2e5755a Mon Sep 17 00:00:00 2001 From: Keith Woodlock Date: Thu, 20 Dec 2012 11:42:42 +0000 Subject: [PATCH] update core DDL and reference data to latest. --- .../0001a-mifosplatform-core-ddl-latest.sql | 126 +++++++++++++++--- .../0002-mifosng-base-reference-data.sql | 7 +- 2 files changed, 111 insertions(+), 22 deletions(-) diff --git a/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql b/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql index 3d7867a21..073dbd6b3 100644 --- a/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql +++ b/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql @@ -2,7 +2,9 @@ SET foreign_key_checks = 0; -- drop accounting subsystem -DROP TABLE IF EXISTS `m_acc_coa`; +DROP TABLE IF EXISTS `acc_gl_account`; +DROP TABLE IF EXISTS `acc_gl_closure`; +DROP TABLE IF EXISTS `acc_gl_journal_entry`; -- drop portfolio subsystem DROP TABLE IF EXISTS `m_appuser`; @@ -37,6 +39,7 @@ DROP TABLE IF EXISTS `m_product_savings`; DROP TABLE IF EXISTS `m_role`; DROP TABLE IF EXISTS `m_role_permission`; DROP TABLE IF EXISTS `m_saving_account`; +DROP TABLE IF EXISTS `m_saving_schedule`; DROP TABLE IF EXISTS `m_staff`; DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`; DROP TABLE IF EXISTS `x_registered_table`; @@ -53,6 +56,14 @@ DROP TABLE IF EXISTS `stretchydata_dataset`; DROP TABLE IF EXISTS `stretchydata_dataset_fields`; DROP TABLE IF EXISTS `stretchydata_datasettype`; +-- drop deprecated a 'additional data' tables +drop table IF EXISTS `m_client_xadditional information`; +drop table IF EXISTS `m_client_xhighly improbable info`; +drop table IF EXISTS `m_loan_xadditional information`; + +-- drop deprecated a 'accounting' tables +DROP TABLE IF EXISTS `m_acc_coa`; + SET foreign_key_checks = 1; -- DDL for reference/lookup tables @@ -197,7 +208,7 @@ CREATE TABLE `m_permission` ( `code` varchar(100) NOT NULL, `entity_name` varchar(100) DEFAULT NULL, `action_name` varchar(100) DEFAULT NULL, - `is_maker_checker` TINYINT(1) NOT NULL DEFAULT '0', + `can_maker_checker` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `code` (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -262,14 +273,19 @@ CREATE TABLE `m_appuser_role` ( -- DDL for organisation wide related concepts CREATE TABLE `m_portfolio_command_source` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, - `api_operation` varchar(20) NOT NULL, - `api_resource` varchar(20) NOT NULL, + `action_name` varchar(50) NOT NULL, + `entity_name` varchar(50) NOT NULL, + `api_operation` varchar(30) NOT NULL, + `api_resource` varchar(100) NOT NULL, `resource_id` bigint(20) DEFAULT NULL, - `command_as_json` varchar(5000) NOT NULL, + `api_subresource` varchar(100) DEFAULT NULL, + `subresource_id` bigint(20) DEFAULT NULL, + `command_as_json` text NOT NULL, `maker_id` bigint(20) NOT NULL, - `made_on_date` date NOT NULL, + `made_on_date` datetime NOT NULL, `checker_id` bigint(20) DEFAULT NULL, - `checked_on_date` date DEFAULT NULL, + `checked_on_date` datetime DEFAULT NULL, + `processing_result_enum` smallint(5) NOT NULL, PRIMARY KEY (`id`), KEY `FK_m_maker_m_appuser` (`maker_id`), KEY `FK_m_checker_m_appuser` (`checker_id`), @@ -358,7 +374,7 @@ CREATE TABLE `m_client` ( `lastname` varchar(50) DEFAULT NULL, `display_name` varchar(100) NOT NULL, `image_key` varchar(500) DEFAULT NULL, - `joining_date` date DEFAULT NULL, + `joined_date` date DEFAULT NULL, `createdby_id` bigint(20) DEFAULT NULL, `created_date` datetime DEFAULT NULL, `lastmodified_date` datetime DEFAULT NULL, @@ -441,6 +457,7 @@ CREATE TABLE `m_product_deposit` ( CONSTRAINT `FKJPX0000000000004` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `m_product_savings` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(100) NOT NULL, @@ -453,6 +470,7 @@ CREATE TABLE `m_product_savings` ( `savings_deposit_amount` decimal(19,6) NOT NULL, `savings_product_type` smallint(5) DEFAULT NULL, `tenure_type` smallint(5) DEFAULT NULL, + `deposit_every` bigint(20) DEFAULT NULL, `tenure` int(11) DEFAULT NULL, `frequency` int(11) DEFAULT NULL, `interest_type` smallint(5) DEFAULT NULL, @@ -530,11 +548,10 @@ CREATE TABLE `m_loan` ( `loan_officer_id` bigint(20) DEFAULT NULL, `guarantor_id` bigint(20) DEFAULT NULL, `loan_status_id` smallint(5) NOT NULL, - `loan_transaction_strategy_id` bigint(20) DEFAULT NULL, `currency_code` varchar(3) NOT NULL, `currency_digits` smallint(5) NOT NULL, `principal_amount` decimal(19,6) NOT NULL, - `arrearstolerance_amount` decimal(19,6) NOT NULL, + `arrearstolerance_amount` decimal(19,6) DEFAULT NULL, `nominal_interest_rate_per_period` decimal(19,6) NOT NULL, `interest_period_frequency_enum` smallint(5) NOT NULL, `annual_nominal_interest_rate` decimal(19,6) NOT NULL, @@ -564,6 +581,7 @@ CREATE TABLE `m_loan` ( `created_date` datetime DEFAULT NULL, `lastmodified_date` datetime DEFAULT NULL, `lastmodifiedby_id` bigint(20) DEFAULT NULL, + `loan_transaction_strategy_id` bigint(20) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `org_id` (`external_id`), KEY `FKB6F935D87179A0CB` (`client_id`), @@ -702,6 +720,10 @@ CREATE TABLE `m_deposit_account` ( `is_compounding_interest_allowed` tinyint(1) NOT NULL DEFAULT '0', `interest_paid` decimal(19,6) NOT NULL DEFAULT '0.000000', `is_interest_withdrawable` tinyint(1) NOT NULL DEFAULT '0', + `available_interest` decimal(19,6) DEFAULT '0.000000', + `interest_posted_amount` decimal(19,6) DEFAULT '0.000000', + `last_interest_posted_date` date DEFAULT NULL, + `next_interest_posting_date` date DEFAULT NULL, `is_renewal_allowed` tinyint(1) NOT NULL DEFAULT '0', `renewed_account_id` bigint(20) DEFAULT NULL, `is_preclosure_allowed` tinyint(1) NOT NULL DEFAULT '0', @@ -761,6 +783,7 @@ CREATE TABLE `m_saving_account` ( `regular_saving_nominal_interest_rate` decimal(19,6) NOT NULL, `tenure` int(11) NOT NULL, `tenure_type` smallint(5) DEFAULT NULL, + `deposit_every` bigint(20) DEFAULT NULL, `frequency` int(11) DEFAULT NULL, `interest_type` smallint(5) DEFAULT NULL, `interest_calculation_method` smallint(5) DEFAULT NULL, @@ -790,6 +813,24 @@ CREATE TABLE `m_saving_account` ( CONSTRAINT `FKSA0000000000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), CONSTRAINT `FKSA0000000000002` FOREIGN KEY (`product_id`) REFERENCES `m_product_savings` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `m_saving_schedule` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `saving_account_id` bigint(20) NOT NULL, + `duedate` date NOT NULL, + `installment` smallint(5) NOT NULL, + `deposit` decimal(21,4) NOT NULL, + `payment_date` date DEFAULT NULL, + `deposit_paid` decimal(21,4) DEFAULT NULL, + `completed_derived` bit(1) NOT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FKSS00000000001` (`saving_account_id`), + CONSTRAINT `FKSS00000000001` FOREIGN KEY (`saving_account_id`) REFERENCES `m_saving_account` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- end of savings account related tables -- DDL for notes associated with all client/group and financial accounts @@ -822,22 +863,73 @@ CREATE TABLE `m_note` ( -- DDL for accounting sub system related tables -CREATE TABLE `m_acc_coa` ( +CREATE TABLE `acc_gl_account` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `name` varchar(45) NOT NULL, `parent_id` bigint(20) DEFAULT NULL, `gl_code` varchar(45) NOT NULL, - `is_disabled` tinyint(1) NOT NULL DEFAULT '0', - `manual_entries_allowed` tinyint(1) NOT NULL DEFAULT '0', - `category` varchar(45) NOT NULL, - `ledger_type` varchar(45) NOT NULL, - `description` varchar(500) NOT NULL, + `disabled` tinyint(1) NOT NULL DEFAULT '0', + `manual_journal_entries_allowed` tinyint(1) NOT NULL DEFAULT '1', + `header_account` tinyint(1) NOT NULL DEFAULT '0', + `classification` varchar(45) NOT NULL, + `description` varchar(500) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `acc_gl_code` (`gl_code`), KEY `FK_ACC_0000000001` (`parent_id`), - CONSTRAINT `FK_ACC_0000000001` FOREIGN KEY (`parent_id`) REFERENCES `m_acc_coa` (`id`) + CONSTRAINT `FK_ACC_0000000001` FOREIGN KEY (`parent_id`) REFERENCES `acc_gl_account` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `acc_gl_closure` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `office_id` bigint(20) NOT NULL, + `closing_date` date NOT NULL, + `is_deleted` int(20) NOT NULL DEFAULT '0', + `createdby_id` bigint(20) DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + `comments` varchar(500) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `office_id_closing_date` (`office_id`,`closing_date`), + KEY `FK_acc_gl_closure_m_office` (`office_id`), + KEY `FK_acc_gl_closure_m_appuser` (`createdby_id`), + KEY `FK_acc_gl_closure_m_appuser_2` (`lastmodifiedby_id`), + CONSTRAINT `FK_acc_gl_closure_m_appuser` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FK_acc_gl_closure_m_appuser_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FK_acc_gl_closure_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `acc_gl_journal_entry` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `account_id` bigint(20) NOT NULL, + `office_id` bigint(20) NOT NULL, + `reversal_id` bigint(20) DEFAULT NULL, + `transaction_id` varchar(50) NOT NULL, + `reversed` tinyint(1) NOT NULL DEFAULT '0', + `portfolio_generated` tinyint(1) NOT NULL DEFAULT '0', + `entry_date` date NOT NULL, + `type` varchar(50) NOT NULL, + `amount` decimal(19,6) NOT NULL, + `description` varchar(500) DEFAULT NULL, + `entity_type` varchar(50) DEFAULT NULL, + `entity_id` bigint(20) DEFAULT NULL, + `createdby_id` bigint(20) NOT NULL, + `lastmodifiedby_id` bigint(20) NOT NULL, + `created_date` datetime NOT NULL, + `lastmodified_date` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `FK_acc_gl_journal_entry_m_office` (`office_id`), + KEY `FK_acc_gl_journal_entry_m_appuser` (`createdby_id`), + KEY `FK_acc_gl_journal_entry_m_appuser_2` (`lastmodifiedby_id`), + KEY `FK_acc_gl_journal_entry_acc_gl_journal_entry` (`reversal_id`), + KEY `FK_acc_gl_journal_entry_acc_gl_account` (`account_id`), + CONSTRAINT `FK_acc_gl_journal_entry_acc_gl_account` FOREIGN KEY (`account_id`) REFERENCES `acc_gl_account` (`id`), + CONSTRAINT `FK_acc_gl_journal_entry_acc_gl_journal_entry` FOREIGN KEY (`reversal_id`) REFERENCES `acc_gl_journal_entry` (`id`), + CONSTRAINT `FK_acc_gl_journal_entry_m_appuser` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FK_acc_gl_journal_entry_m_appuser_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FK_acc_gl_journal_entry_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- =========== end of accounting related tables ========== -- DDL for reporting related tables diff --git a/mifosng-db/0002-mifosng-base-reference-data.sql b/mifosng-db/0002-mifosng-base-reference-data.sql index bfc73950c..09167b78e 100644 --- a/mifosng-db/0002-mifosng-base-reference-data.sql +++ b/mifosng-db/0002-mifosng-base-reference-data.sql @@ -23,9 +23,7 @@ VALUES ('processing_result_enum', '0', 'invalid', 'Invalid'), ('processing_result_enum', '1', 'processed', 'Processed'), ('processing_result_enum', '2', 'awaiting.approval', 'Awaiting Approval'), -('processing_result_enum', '3', 'rejected', 'Rejected'); - - +('processing_result_enum', '3', 'rejected', 'Rejected'); INSERT INTO `m_currency` (`id`,`code`,`decimal_places`,`display_symbol`,`name`, `internationalized_name_code`) @@ -178,8 +176,7 @@ delete from m_permission; /* System Supplied Permissons */ INSERT INTO `m_permission` VALUES -(1,'special','USER_ADMINISTRATION_SUPER_USER',NULL,NULL,0), -(2,'special','ORGANISATION_ADMINISTRATION_SUPER_USER',NULL,NULL,0),(3,'special','PORTFOLIO_MANAGEMENT_SUPER_USER',NULL,NULL,0),(4,'special','REPORTING_SUPER_USER',NULL,NULL,0),(5,'portfolio','CREATE_LOAN','LOAN','CREATE',1),(6,'portfolio','CREATEHISTORIC_LOAN','LOAN','CREATEHISTORIC',1),(7,'transaction_loan','APPROVE_LOAN','LOAN','APPROVE',1),(8,'transaction_loan','APPROVEINPAST_LOAN','LOAN','APPROVEINPAST',1),(9,'transaction_loan','REJECT_LOAN','LOAN','REJECT',1),(10,'transaction_loan','REJECTINPAST_LOAN','LOAN','REJECTINPAST',1),(11,'transaction_loan','WITHDRAW_LOAN','LOAN','WITHDRAW',1),(12,'transaction_loan','WITHDRAWINPAST_LOAN','LOAN','WITHDRAWINPAST',1),(13,'portfolio','DELETE_LOAN','LOAN','DELETE',1),(14,'transaction_loan','APPROVALUNDO_LOAN','LOAN','APPROVALUNDO',1),(15,'transaction_loan','DISBURSE_LOAN','LOAN','DISBURSE',1),(16,'transaction_loan','DISBURSEINPAST_LOAN','LOAN','DISBURSEINPAST',1),(17,'transaction_loan','DISBURSALUNDO_LOAN','LOAN','DISBURSALUNDO',1),(18,'transaction_loan','REPAYMENT_LOAN','LOAN','REPAYMENT',1),(19,'transaction_loan','REPAYMENTINPAST_LOAN','LOAN','REPAYMENTINPAST',1),(20,'portfolio','CREATE_CLIENT','CLIENT','CREATE',1),(42,'special','ALL_FUNCTIONS',NULL,NULL,0),(43,'special','ALL_FUNCTIONS_READ',NULL,NULL,0),(112,'organisation','CREATE_CHARGE','CHARGE','CREATE',1),(113,'organisation','READ_CHARGE','CHARGE','READ',0),(114,'organisation','UPDATE_CHARGE','CHARGE','UPDATE',1),(115,'organisation','DELETE_CHARGE','CHARGE','DELETE',1),(120,'portfolio','READ_CLIENT','CLIENT','READ',0),(121,'portfolio','UPDATE_CLIENT','CLIENT','UPDATE',1),(122,'portfolio','DELETE_CLIENT','CLIENT','DELETE',1),(123,'portfolio','CREATE_CLIENTIMAGE','CLIENTIMAGE','CREATE',1),(124,'portfolio','READ_CLIENTIMAGE','CLIENTIMAGE','READ',0),(126,'portfolio','DELETE_CLIENTIMAGE','CLIENTIMAGE','DELETE',1),(127,'portfolio','CREATE_CLIENTNOTE','CLIENTNOTE','CREATE',1),(128,'portfolio','READ_CLIENTNOTE','CLIENTNOTE','READ',0),(129,'portfolio','UPDATE_CLIENTNOTE','CLIENTNOTE','UPDATE',1),(130,'portfolio','DELETE_CLIENTNOTE','CLIENTNOTE','DELETE',1),(131,'portfolio','CREATE_CLIENTIDENTIFIER','CLIENTIDENTIFIER','CREATE',1),(132,'portfolio','READ_CLIENTIDENTIFIER','CLIENTIDENTIFIER','READ',0),(133,'portfolio','UPDATE_CLIENTIDENTIFIER','CLIENTIDENTIFIER','UPDATE',1),(134,'portfolio','DELETE_CLIENTIDENTIFIER','CLIENTIDENTIFIER','DELETE',1),(135,'configuration','CREATE_CODE','CODE','CREATE',1),(136,'configuration','READ_CODE','CODE','READ',0),(137,'configuration','UPDATE_CODE','CODE','UPDATE',1),(138,'configuration','DELETE_CODE','CODE','DELETE',1),(139,'configuration','READ_CURRENCY','CURRENCY','READ',0),(140,'configuration','UPDATE_CURRENCY','CURRENCY','UPDATE',1),(141,'portfolio','CREATE_DOCUMENT','DOCUMENT','CREATE',1),(142,'portfolio','READ_DOCUMENT','DOCUMENT','READ',0),(143,'portfolio','UPDATE_DOCUMENT','DOCUMENT','UPDATE',1),(144,'portfolio','DELETE_DOCUMENT','DOCUMENT','DELETE',1),(145,'organisation','CREATE_FUND','FUND','CREATE',1),(146,'organisation','READ_FUND','FUND','READ',0),(147,'organisation','UPDATE_FUND','FUND','UPDATE',1),(148,'organisation','DELETE_FUND','FUND','DELETE',1),(149,'portfolio','CREATE_GROUP','GROUP','CREATE',1),(150,'portfolio','READ_GROUP','GROUP','READ',0),(151,'portfolio','UPDATE_GROUP','GROUP','UPDATE',1),(152,'portfolio','DELETE_GROUP','GROUP','DELETE',1),(153,'organisation','CREATE_LOANPRODUCT','LOANPRODUCT','CREATE',1),(154,'organisation','READ_LOANPRODUCT','LOANPRODUCT','READ',0),(155,'organisation','UPDATE_LOANPRODUCT','LOANPRODUCT','UPDATE',1),(156,'organisation','DELETE_LOANPRODUCT','LOANPRODUCT','DELETE',1),(157,'portfolio','READ_LOAN','LOAN','READ',0),(158,'portfolio','UPDATE_LOAN','LOAN','UPDATE',1),(159,'portfolio','UPDATEHISTORIC_LOAN','LOAN','UPDATEHISTORIC',1),(160,'portfolio','CREATE_LOANCHARGE','LOANCHARGE','CREATE',1),(161,'portfolio','UPDATE_LOANCHARGE','LOANCHARGE','UPDATE',1),(162,'portfolio','DELETE_LOANCHARGE','LOANCHARGE','DELETE',1),(163,'portfolio','WAIVE_LOANCHARGE','LOANCHARGE','WAIVE',1),(164,'transaction_loan','BULKREASSIGN_LOAN','LOAN','BULKREASSIGN',1),(165,'transaction_loan','ADJUST_LOAN','LOAN','ADJUST',1),(166,'transaction_loan','WAIVEINTERESTPORTION_LOAN','LOAN','WAIVEINTERESTPORTION',1),(167,'transaction_loan','WRITEOFF_LOAN','LOAN','WRITEOFF',1),(168,'transaction_loan','CLOSE_LOAN','LOAN','CLOSE',1),(169,'transaction_loan','CLOSEASRESCHEDULED_LOAN','LOAN','CLOSEASRESCHEDULED',1),(170,'organisation','READ_MAKERCHECKER','MAKERCHECKER','READ',0),(171,'organisation','CREATE_OFFICE','OFFICE','CREATE',1),(172,'organisation','READ_OFFICE','OFFICE','READ',0),(173,'organisation','UPDATE_OFFICE','OFFICE','UPDATE',1),(174,'organisation','DELETE_OFFICE','OFFICE','DELETE',1),(175,'organisation','READ_OFFICETRANSACTION','OFFICETRANSACTION','READ',0),(176,'organisation','CREATE_OFFICETRANSACTION','OFFICETRANSACTION','CREATE',1),(177,'authorisation','READ_PERMISSION','PERMISSION','READ',0),(178,'authorisation','CREATE_ROLE','ROLE','CREATE',1),(179,'authorisation','READ_ROLE','ROLE','READ',0),(180,'authorisation','UPDATE_ROLE','ROLE','UPDATE',1),(181,'authorisation','DELETE_ROLE','ROLE','DELETE',1),(182,'authorisation','CREATE_USER','USER','CREATE',1),(183,'authorisation','READ_USER','USER','READ',0),(184,'authorisation','UPDATE_USER','USER','UPDATE',1),(185,'authorisation','DELETE_USER','USER','DELETE',1),(186,'organisation','CREATE_STAFF','STAFF','CREATE',1),(187,'organisation','READ_STAFF','STAFF','READ',0),(188,'organisation','UPDATE_STAFF','STAFF','UPDATE',1),(189,'organisation','DELETE_STAFF','STAFF','DELETE',1),(190,'organisation','CREATE_SAVINGSPRODUCT','SAVINGSPRODUCT','CREATE',1),(191,'organisation','READ_SAVINGSPRODUCT','SAVINGSPRODUCT','READ',0),(192,'organisation','UPDATE_SAVINGSPRODUCT','SAVINGSPRODUCT','UPDATE',1),(193,'organisation','DELETE_SAVINGSPRODUCT','SAVINGSPRODUCT','DELETE',1),(194,'organisation','CREATE_DEPOSITPRODUCT','DEPOSITPRODUCT','CREATE',1),(195,'organisation','READ_DEPOSITPRODUCT','DEPOSITPRODUCT','READ',0),(196,'organisation','UPDATE_DEPOSITPRODUCT','DEPOSITPRODUCT','UPDATE',1),(197,'organisation','DELETE_DEPOSITPRODUCT','DEPOSITPRODUCT','DELETE',1),(198,'portfolio','CREATE_DEPOSITACCOUNT','DEPOSITACCOUNT','CREATE',1),(199,'portfolio','READ_DEPOSITACCOUNT','DEPOSITACCOUNT','READ',0),(200,'portfolio','UPDATE_DEPOSITACCOUNT','DEPOSITACCOUNT','UPDATE',1),(201,'portfolio','DELETE_DEPOSITACCOUNT','DEPOSITACCOUNT','DELETE',1),(202,'transaction_deposit','APPROVE_DEPOSITACCOUNT','DEPOSITACCOUNT','APPROVE',1),(203,'transaction_deposit','REJECT_DEPOSITACCOUNT','DEPOSITACCOUNT','REJECT',1),(204,'transaction_deposit','WITHDRAW_DEPOSITACCOUNT','DEPOSITACCOUNT','WITHDRAW',1),(205,'transaction_deposit','APPROVALUNDO_DEPOSITACCOUNT','DEPOSITACCOUNT','APPROVALUNDO',1),(206,'transaction_deposit','WITHDRAWAL_DEPOSITACCOUNT','DEPOSITACCOUNT','WITHDRAWAL',1),(207,'transaction_deposit','INTEREST_DEPOSITACCOUNT','DEPOSITACCOUNT','INTEREST',1),(208,'transaction_deposit','RENEW_DEPOSITACCOUNT','DEPOSITACCOUNT','RENEW',1),(209,'portfolio','CREATE_SAVINGSACCOUNT','SAVINGSACCOUNT','CREATE',1),(210,'portfolio','READ_SAVINGSACCOUNT','SAVINGSACCOUNT','READ',0),(211,'portfolio','UPDATE_SAVINGSACCOUNT','SAVINGSACCOUNT','UPDATE',1),(212,'portfolio','DELETE_SAVINGSACCOUNT','SAVINGSACCOUNT','DELETE',1), +(4,'special','REPORTING_SUPER_USER',NULL,NULL,0),(5,'portfolio','CREATE_LOAN','LOAN','CREATE',1),(6,'portfolio','CREATEHISTORIC_LOAN','LOAN','CREATEHISTORIC',1),(7,'transaction_loan','APPROVE_LOAN','LOAN','APPROVE',1),(8,'transaction_loan','APPROVEINPAST_LOAN','LOAN','APPROVEINPAST',1),(9,'transaction_loan','REJECT_LOAN','LOAN','REJECT',1),(10,'transaction_loan','REJECTINPAST_LOAN','LOAN','REJECTINPAST',1),(11,'transaction_loan','WITHDRAW_LOAN','LOAN','WITHDRAW',1),(12,'transaction_loan','WITHDRAWINPAST_LOAN','LOAN','WITHDRAWINPAST',1),(13,'portfolio','DELETE_LOAN','LOAN','DELETE',1),(14,'transaction_loan','APPROVALUNDO_LOAN','LOAN','APPROVALUNDO',1),(15,'transaction_loan','DISBURSE_LOAN','LOAN','DISBURSE',1),(16,'transaction_loan','DISBURSEINPAST_LOAN','LOAN','DISBURSEINPAST',1),(17,'transaction_loan','DISBURSALUNDO_LOAN','LOAN','DISBURSALUNDO',1),(18,'transaction_loan','REPAYMENT_LOAN','LOAN','REPAYMENT',1),(19,'transaction_loan','REPAYMENTINPAST_LOAN','LOAN','REPAYMENTINPAST',1),(20,'portfolio','CREATE_CLIENT','CLIENT','CREATE',1),(42,'special','ALL_FUNCTIONS',NULL,NULL,0),(43,'special','ALL_FUNCTIONS_READ',NULL,NULL,0),(112,'organisation','CREATE_CHARGE','CHARGE','CREATE',1),(113,'organisation','READ_CHARGE','CHARGE','READ',0),(114,'organisation','UPDATE_CHARGE','CHARGE','UPDATE',1),(115,'organisation','DELETE_CHARGE','CHARGE','DELETE',1),(120,'portfolio','READ_CLIENT','CLIENT','READ',0),(121,'portfolio','UPDATE_CLIENT','CLIENT','UPDATE',1),(122,'portfolio','DELETE_CLIENT','CLIENT','DELETE',1),(123,'portfolio','CREATE_CLIENTIMAGE','CLIENTIMAGE','CREATE',1),(124,'portfolio','READ_CLIENTIMAGE','CLIENTIMAGE','READ',0),(126,'portfolio','DELETE_CLIENTIMAGE','CLIENTIMAGE','DELETE',1),(127,'portfolio','CREATE_CLIENTNOTE','CLIENTNOTE','CREATE',1),(128,'portfolio','READ_CLIENTNOTE','CLIENTNOTE','READ',0),(129,'portfolio','UPDATE_CLIENTNOTE','CLIENTNOTE','UPDATE',1),(130,'portfolio','DELETE_CLIENTNOTE','CLIENTNOTE','DELETE',1),(131,'portfolio','CREATE_CLIENTIDENTIFIER','CLIENTIDENTIFIER','CREATE',1),(132,'portfolio','READ_CLIENTIDENTIFIER','CLIENTIDENTIFIER','READ',0),(133,'portfolio','UPDATE_CLIENTIDENTIFIER','CLIENTIDENTIFIER','UPDATE',1),(134,'portfolio','DELETE_CLIENTIDENTIFIER','CLIENTIDENTIFIER','DELETE',1),(135,'configuration','CREATE_CODE','CODE','CREATE',1),(136,'configuration','READ_CODE','CODE','READ',0),(137,'configuration','UPDATE_CODE','CODE','UPDATE',1),(138,'configuration','DELETE_CODE','CODE','DELETE',1),(139,'configuration','READ_CURRENCY','CURRENCY','READ',0),(140,'configuration','UPDATE_CURRENCY','CURRENCY','UPDATE',1),(141,'portfolio','CREATE_DOCUMENT','DOCUMENT','CREATE',1),(142,'portfolio','READ_DOCUMENT','DOCUMENT','READ',0),(143,'portfolio','UPDATE_DOCUMENT','DOCUMENT','UPDATE',1),(144,'portfolio','DELETE_DOCUMENT','DOCUMENT','DELETE',1),(145,'organisation','CREATE_FUND','FUND','CREATE',1),(146,'organisation','READ_FUND','FUND','READ',0),(147,'organisation','UPDATE_FUND','FUND','UPDATE',1),(148,'organisation','DELETE_FUND','FUND','DELETE',1),(149,'portfolio','CREATE_GROUP','GROUP','CREATE',1),(150,'portfolio','READ_GROUP','GROUP','READ',0),(151,'portfolio','UPDATE_GROUP','GROUP','UPDATE',1),(152,'portfolio','DELETE_GROUP','GROUP','DELETE',1),(153,'organisation','CREATE_LOANPRODUCT','LOANPRODUCT','CREATE',1),(154,'organisation','READ_LOANPRODUCT','LOANPRODUCT','READ',0),(155,'organisation','UPDATE_LOANPRODUCT','LOANPRODUCT','UPDATE',1),(156,'organisation','DELETE_LOANPRODUCT','LOANPRODUCT','DELETE',1),(157,'portfolio','READ_LOAN','LOAN','READ',0),(158,'portfolio','UPDATE_LOAN','LOAN','UPDATE',1),(159,'portfolio','UPDATEHISTORIC_LOAN','LOAN','UPDATEHISTORIC',1),(160,'portfolio','CREATE_LOANCHARGE','LOANCHARGE','CREATE',1),(161,'portfolio','UPDATE_LOANCHARGE','LOANCHARGE','UPDATE',1),(162,'portfolio','DELETE_LOANCHARGE','LOANCHARGE','DELETE',1),(163,'portfolio','WAIVE_LOANCHARGE','LOANCHARGE','WAIVE',1),(164,'transaction_loan','BULKREASSIGN_LOAN','LOAN','BULKREASSIGN',1),(165,'transaction_loan','ADJUST_LOAN','LOAN','ADJUST',1),(166,'transaction_loan','WAIVEINTERESTPORTION_LOAN','LOAN','WAIVEINTERESTPORTION',1),(167,'transaction_loan','WRITEOFF_LOAN','LOAN','WRITEOFF',1),(168,'transaction_loan','CLOSE_LOAN','LOAN','CLOSE',1),(169,'transaction_loan','CLOSEASRESCHEDULED_LOAN','LOAN','CLOSEASRESCHEDULED',1),(170,'organisation','READ_MAKERCHECKER','MAKERCHECKER','READ',0),(171,'organisation','CREATE_OFFICE','OFFICE','CREATE',1),(172,'organisation','READ_OFFICE','OFFICE','READ',0),(173,'organisation','UPDATE_OFFICE','OFFICE','UPDATE',1),(174,'organisation','DELETE_OFFICE','OFFICE','DELETE',1),(175,'organisation','READ_OFFICETRANSACTION','OFFICETRANSACTION','READ',0),(176,'organisation','CREATE_OFFICETRANSACTION','OFFICETRANSACTION','CREATE',1),(177,'authorisation','READ_PERMISSION','PERMISSION','READ',0),(178,'authorisation','CREATE_ROLE','ROLE','CREATE',1),(179,'authorisation','READ_ROLE','ROLE','READ',0),(180,'authorisation','UPDATE_ROLE','ROLE','UPDATE',1),(181,'authorisation','DELETE_ROLE','ROLE','DELETE',1),(182,'authorisation','CREATE_USER','USER','CREATE',1),(183,'authorisation','READ_USER','USER','READ',0),(184,'authorisation','UPDATE_USER','USER','UPDATE',1),(185,'authorisation','DELETE_USER','USER','DELETE',1),(186,'organisation','CREATE_STAFF','STAFF','CREATE',1),(187,'organisation','READ_STAFF','STAFF','READ',0),(188,'organisation','UPDATE_STAFF','STAFF','UPDATE',1),(189,'organisation','DELETE_STAFF','STAFF','DELETE',1),(190,'organisation','CREATE_SAVINGSPRODUCT','SAVINGSPRODUCT','CREATE',1),(191,'organisation','READ_SAVINGSPRODUCT','SAVINGSPRODUCT','READ',0),(192,'organisation','UPDATE_SAVINGSPRODUCT','SAVINGSPRODUCT','UPDATE',1),(193,'organisation','DELETE_SAVINGSPRODUCT','SAVINGSPRODUCT','DELETE',1),(194,'organisation','CREATE_DEPOSITPRODUCT','DEPOSITPRODUCT','CREATE',1),(195,'organisation','READ_DEPOSITPRODUCT','DEPOSITPRODUCT','READ',0),(196,'organisation','UPDATE_DEPOSITPRODUCT','DEPOSITPRODUCT','UPDATE',1),(197,'organisation','DELETE_DEPOSITPRODUCT','DEPOSITPRODUCT','DELETE',1),(198,'portfolio','CREATE_DEPOSITACCOUNT','DEPOSITACCOUNT','CREATE',1),(199,'portfolio','READ_DEPOSITACCOUNT','DEPOSITACCOUNT','READ',0),(200,'portfolio','UPDATE_DEPOSITACCOUNT','DEPOSITACCOUNT','UPDATE',1),(201,'portfolio','DELETE_DEPOSITACCOUNT','DEPOSITACCOUNT','DELETE',1),(202,'transaction_deposit','APPROVE_DEPOSITACCOUNT','DEPOSITACCOUNT','APPROVE',1),(203,'transaction_deposit','REJECT_DEPOSITACCOUNT','DEPOSITACCOUNT','REJECT',1),(204,'transaction_deposit','WITHDRAW_DEPOSITACCOUNT','DEPOSITACCOUNT','WITHDRAW',1),(205,'transaction_deposit','APPROVALUNDO_DEPOSITACCOUNT','DEPOSITACCOUNT','APPROVALUNDO',1),(206,'transaction_deposit','WITHDRAWAL_DEPOSITACCOUNT','DEPOSITACCOUNT','WITHDRAWAL',1),(207,'transaction_deposit','INTEREST_DEPOSITACCOUNT','DEPOSITACCOUNT','INTEREST',1),(208,'transaction_deposit','RENEW_DEPOSITACCOUNT','DEPOSITACCOUNT','RENEW',1),(209,'portfolio','CREATE_SAVINGSACCOUNT','SAVINGSACCOUNT','CREATE',1),(210,'portfolio','READ_SAVINGSACCOUNT','SAVINGSACCOUNT','READ',0),(211,'portfolio','UPDATE_SAVINGSACCOUNT','SAVINGSACCOUNT','UPDATE',1),(212,'portfolio','DELETE_SAVINGSACCOUNT','SAVINGSACCOUNT','DELETE',1), (213,'authorisation','PERMISSIONS_ROLE','ROLE','PERMISSIONS',1); INSERT INTO `m_role` (`id`, `name`, `description`, `createdby_id`, `created_date`, `lastmodified_date`, `lastmodifiedby_id`)