diff --git a/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql b/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql index e72e89f1e..94963f8a1 100644 --- a/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql +++ b/mifosng-db/0001a-mifosplatform-core-ddl-latest.sql @@ -528,7 +528,9 @@ CREATE TABLE `m_loan` ( `product_id` bigint(20) DEFAULT NULL, `fund_id` bigint(20) DEFAULT NULL, `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, @@ -562,7 +564,6 @@ 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`), @@ -571,10 +572,12 @@ CREATE TABLE `m_loan` ( KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`), KEY `FK_m_loan_m_staff` (`loan_officer_id`), KEY `group_id` (`group_id`), + KEY `FK_m_loan_guarantor` (`guarantor_id`), CONSTRAINT `FK7C885877240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`), CONSTRAINT `FKB6F935D87179A0CB` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), CONSTRAINT `FKB6F935D8C8D4B434` FOREIGN KEY (`product_id`) REFERENCES `m_product_loan` (`id`), CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`), + CONSTRAINT `FK_m_loan_guarantor` FOREIGN KEY (`guarantor_id`) REFERENCES `m_client` (`id`), CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`), CONSTRAINT `m_loan_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/mifosng-db/0002-mifosng-base-reference-data.sql b/mifosng-db/0002-mifosng-base-reference-data.sql index d3de240df..dc40f5a4a 100644 --- a/mifosng-db/0002-mifosng-base-reference-data.sql +++ b/mifosng-db/0002-mifosng-base-reference-data.sql @@ -31,7 +31,7 @@ VALUES (4,'AMD',2,NULL,'Armenian Dram','currency.AMD'), (5,'ANG',2,NULL,'Netherlands Antillian Guilder','currency.ANG'),(6,'AOA',2,NULL,'Angolan Kwanza','currency.AOA'), (7,'ARS',2,NULL,'Argentine Peso','currency.ARS'), -(8,'AUD',2,NULL,'Australian Dollar','currency.AUD'),(9,'AWG',2,NULL,'Aruban Guilder','currency.AWG'), +(8,'AUD',2,'A$','Australian Dollar','currency.AUD'),(9,'AWG',2,NULL,'Aruban Guilder','currency.AWG'), (10,'AZM',2,NULL,'Azerbaijanian Manat','currency.AZM'), (11,'BAM',2,NULL,'Bosnia and Herzegovina Convertible Marks','currency.BAM'), (12,'BBD',2,NULL,'Barbados Dollar','currency.BBD'), @@ -56,7 +56,8 @@ VALUES (42,'EEK',2,NULL,'Estonian Kroon','currency.EEK'),(43,'EGP',2,NULL,'Egyptian Pound','currency.EGP'),(44,'ERN',2,NULL,'Eritrea Nafka','currency.ERN'), -(45,'ETB',2,NULL,'Ethiopian Birr','currency.ETB'),(46,'EUR',2,NULL,'euro','currency.EUR'),(47,'FJD',2,NULL,'Fiji Dollar','currency.FJD'),(48,'FKP',2,NULL,'Falkland +(45,'ETB',2,NULL,'Ethiopian Birr','currency.ETB'),(46,'EUR',2,'€','Euro','currency.EUR'), +(47,'FJD',2,NULL,'Fiji Dollar','currency.FJD'),(48,'FKP',2,NULL,'Falkland Islands Pound','currency.FKP'),(49,'GBP',2,NULL,'Pound Sterling','currency.GBP'),(50,'GEL',2,NULL,'Georgian Lari','currency.GEL'), (51,'GHC',2,'GHc','Ghana Cedi','currency.GHC'), @@ -68,7 +69,8 @@ Islands Pound','currency.FKP'),(49,'GBP',2,NULL,'Pound Sterling','currency.GBP') (61,'HUF',2,NULL,'Hungarian Forint','currency.HUF'),(62,'IDR',2,NULL,'Indonesian Rupiah','currency.IDR'),(63,'ILS',2,NULL,'New Israeli Shekel','currency.ILS'), -(64,'INR',2,NULL,'Indian Rupee','currency.INR'),(65,'IQD',3,NULL,'Iraqi Dinar','currency.IQD'),(66,'IRR',2,NULL,'Iranian Rial','currency.IRR'), +(64,'INR',2,'?','Indian Rupee','currency.INR'), +(65,'IQD',3,NULL,'Iraqi Dinar','currency.IQD'),(66,'IRR',2,NULL,'Iranian Rial','currency.IRR'), (67,'ISK',0,NULL,'Iceland Krona','currency.ISK'),(68,'JMD',2,NULL,'Jamaican Dollar','currency.JMD'),(69,'JOD',3,NULL,'Jordanian Dinar','currency.JOD'), @@ -100,7 +102,7 @@ Islands Pound','currency.FKP'),(49,'GBP',2,NULL,'Pound Sterling','currency.GBP') (108,'NZD',2,NULL,'New Zealand Dollar','currency.NZD'),(109,'OMR',3,NULL,'Rial Omani','currency.OMR'),(110,'PAB',2,NULL,'Panama Balboa','currency.PAB'), -(111,'PEN',2,NULL,'Peruvian Nuevo Sol','currency.PEN'),(112,'PGK',2,NULL,'Papua New Guinea Kina','currency.PGK'),(113,'PHP',2,NULL,'Philippine Peso','currency.PHP'), +(111,'PEN',2,'S/.','Peruvian Nuevo Sol','currency.PEN'),(112,'PGK',2,NULL,'Papua New Guinea Kina','currency.PGK'),(113,'PHP',2,NULL,'Philippine Peso','currency.PHP'), (114,'PKR',2,NULL,'Pakistan Rupee','currency.PKR'),(115,'PLN',2,NULL,'Polish Zloty','currency.PLN'),(116,'PYG',0,NULL,'Paraguayan Guarani','currency.PYG'), diff --git a/mifosng-db/multi-tenant-demo-backups/bk_mifostenant_default_new_demo.sql b/mifosng-db/multi-tenant-demo-backups/bk_mifostenant_default_new_demo.sql new file mode 100644 index 000000000..a8192eba5 --- /dev/null +++ b/mifosng-db/multi-tenant-demo-backups/bk_mifostenant_default_new_demo.sql @@ -0,0 +1,1578 @@ +-- MySQL dump 10.13 Distrib 5.1.60, for Win32 (ia32) +-- +-- Host: localhost Database: mifostenant-default +-- ------------------------------------------------------ +-- Server version 5.1.60-community + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `m_acc_coa` +-- + +DROP TABLE IF EXISTS `m_acc_coa`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_acc_coa` ( + `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, + 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`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_acc_coa` +-- + +LOCK TABLES `m_acc_coa` WRITE; +/*!40000 ALTER TABLE `m_acc_coa` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_acc_coa` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_appuser` +-- + +DROP TABLE IF EXISTS `m_appuser`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_appuser` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `office_id` bigint(20) DEFAULT NULL, + `username` varchar(100) NOT NULL, + `firstname` varchar(100) NOT NULL, + `lastname` varchar(100) NOT NULL, + `password` varchar(255) NOT NULL, + `email` varchar(100) NOT NULL, + `firsttime_login_remaining` bit(1) NOT NULL, + `nonexpired` bit(1) NOT NULL, + `nonlocked` bit(1) NOT NULL, + `nonexpired_credentials` bit(1) NOT NULL, + `enabled` 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`), + UNIQUE KEY `username_org` (`username`), + KEY `FKB3D587CE0DD567A` (`office_id`), + CONSTRAINT `FKB3D587CE0DD567A` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_appuser` +-- + +LOCK TABLES `m_appuser` WRITE; +/*!40000 ALTER TABLE `m_appuser` DISABLE KEYS */; +INSERT INTO `m_appuser` VALUES (1,0,1,'mifos','App','Administrator','5787039480429368bf94732aacc771cd0a3ea02bcf504ffe1185ab94213bc63a','demomfi@openmf.org','\0','','','','',NULL,NULL,'2012-11-26 00:16:06',1),(2,0,2,'seattle1','Seattle','ExampleUser','298c2dc61a240591121da7f76edc96758b4bde459c0750bc431dede92226c9dc','demomfi@openmf.org','\0','','','','',1,'2012-11-25 23:44:25','2012-11-26 00:15:57',1); +/*!40000 ALTER TABLE `m_appuser` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_appuser_role` +-- + +DROP TABLE IF EXISTS `m_appuser_role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_appuser_role` ( + `appuser_id` bigint(20) NOT NULL, + `role_id` bigint(20) NOT NULL, + PRIMARY KEY (`appuser_id`,`role_id`), + KEY `FK7662CE59B4100309` (`appuser_id`), + KEY `FK7662CE5915CEC7AB` (`role_id`), + CONSTRAINT `FK7662CE5915CEC7AB` FOREIGN KEY (`role_id`) REFERENCES `m_role` (`id`), + CONSTRAINT `FK7662CE59B4100309` FOREIGN KEY (`appuser_id`) REFERENCES `m_appuser` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_appuser_role` +-- + +LOCK TABLES `m_appuser_role` WRITE; +/*!40000 ALTER TABLE `m_appuser_role` DISABLE KEYS */; +INSERT INTO `m_appuser_role` VALUES (1,1),(2,2); +/*!40000 ALTER TABLE `m_appuser_role` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_charge` +-- + +DROP TABLE IF EXISTS `m_charge`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_charge` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(100) DEFAULT NULL, + `currency_code` varchar(3) NOT NULL, + `charge_applies_to_enum` smallint(5) NOT NULL, + `charge_time_enum` smallint(5) NOT NULL, + `charge_calculation_enum` smallint(5) NOT NULL, + `amount` decimal(19,6) NOT NULL, + `is_penalty` tinyint(1) NOT NULL DEFAULT '0', + `is_active` tinyint(1) NOT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `createdby_id` bigint(20) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_charge` +-- + +LOCK TABLES `m_charge` WRITE; +/*!40000 ALTER TABLE `m_charge` DISABLE KEYS */; +INSERT INTO `m_charge` VALUES (1,'loan-processing-fee','EUR',1,1,2,'1.000000',0,1,0,1,'2012-11-25 14:20:27',1,'2012-11-25 14:20:27'); +/*!40000 ALTER TABLE `m_charge` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_client` +-- + +DROP TABLE IF EXISTS `m_client`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_client` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `office_id` bigint(20) NOT NULL, + `external_id` varchar(100) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `display_name` varchar(100) NOT NULL, + `image_key` varchar(500) DEFAULT NULL, + `joining_date` date DEFAULT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `external_id` (`external_id`), + KEY `FKCE00CAB3E0DD567A` (`office_id`), + KEY `FKAUD0000000000001` (`createdby_id`), + KEY `FKAUD0000000000002` (`lastmodifiedby_id`), + CONSTRAINT `FKAUD0000000000001` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FKAUD0000000000002` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FKCE00CAB3E0DD567A` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_client` +-- + +LOCK TABLES `m_client` WRITE; +/*!40000 ALTER TABLE `m_client` DISABLE KEYS */; +INSERT INTO `m_client` VALUES (1,2,NULL,NULL,'Eric Eells','Eric Eells',NULL,'2009-01-07',2,'2012-11-25 23:46:01','2012-11-25 23:46:01',2,0),(2,2,NULL,NULL,'Petrina Punch','Petrina Punch',NULL,'2009-01-08',2,'2012-11-25 23:47:37','2012-11-25 23:47:37',2,0),(3,2,NULL,NULL,'Ruth Rutland','Ruth Rutland',NULL,'2009-01-14',2,'2012-11-25 23:48:14','2012-11-26 00:13:34',1,0),(4,2,NULL,NULL,'Inge Iglesias','Inge Iglesias',NULL,'2009-01-16',1,'2012-11-26 00:14:04','2012-11-26 00:14:32',1,0),(5,2,NULL,NULL,'Alphonso Avallone','Alphonso Avallone',NULL,'2009-01-20',2,'2012-11-26 00:17:18','2012-11-26 00:17:18',2,0); +/*!40000 ALTER TABLE `m_client` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_client_identifier` +-- + +DROP TABLE IF EXISTS `m_client_identifier`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_client_identifier` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `client_id` bigint(20) NOT NULL, + `document_type_id` int(11) NOT NULL, + `document_key` varchar(50) NOT NULL, + `description` varchar(500) DEFAULT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_identifier_key` (`document_type_id`,`document_key`), + UNIQUE KEY `unique_client_identifier` (`client_id`,`document_type_id`), + KEY `FK_m_client_document_m_client` (`client_id`), + KEY `FK_m_client_document_m_code_value` (`document_type_id`), + CONSTRAINT `FK_m_client_document_m_client` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), + CONSTRAINT `FK_m_client_document_m_code_value` FOREIGN KEY (`document_type_id`) REFERENCES `m_code_value` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_client_identifier` +-- + +LOCK TABLES `m_client_identifier` WRITE; +/*!40000 ALTER TABLE `m_client_identifier` DISABLE KEYS */; +INSERT INTO `m_client_identifier` VALUES (1,1,1,'PD12345','password number',2,2,'2012-11-25 23:46:54','2012-11-25 23:46:54'); +/*!40000 ALTER TABLE `m_client_identifier` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_code` +-- + +DROP TABLE IF EXISTS `m_code`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_code` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `code_name` varchar(100) DEFAULT NULL, + `is_system_defined` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `code_name` (`code_name`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_code` +-- + +LOCK TABLES `m_code` WRITE; +/*!40000 ALTER TABLE `m_code` DISABLE KEYS */; +INSERT INTO `m_code` VALUES (1,'Customer Identifier',1); +/*!40000 ALTER TABLE `m_code` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_code_value` +-- + +DROP TABLE IF EXISTS `m_code_value`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_code_value` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `code_id` int(11) NOT NULL, + `code_value` varchar(100) DEFAULT NULL, + `order_position` int(11) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `code_value` (`code_id`,`code_value`), + KEY `FKCFCEA42640BE071Z` (`code_id`), + CONSTRAINT `FKCFCEA42640BE071Z` FOREIGN KEY (`code_id`) REFERENCES `m_code` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_code_value` +-- + +LOCK TABLES `m_code_value` WRITE; +/*!40000 ALTER TABLE `m_code_value` DISABLE KEYS */; +INSERT INTO `m_code_value` VALUES (1,1,'Passport number',0); +/*!40000 ALTER TABLE `m_code_value` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_currency` +-- + +DROP TABLE IF EXISTS `m_currency`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_currency` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `code` varchar(3) NOT NULL, + `decimal_places` smallint(5) NOT NULL, + `display_symbol` varchar(10) DEFAULT NULL, + `name` varchar(50) NOT NULL, + `internationalized_name_code` varchar(50) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=164 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_currency` +-- + +LOCK TABLES `m_currency` WRITE; +/*!40000 ALTER TABLE `m_currency` DISABLE KEYS */; +INSERT INTO `m_currency` VALUES (1,'AED',2,NULL,'UAE Dirham','currency.AED'),(2,'AFN',2,NULL,'Afghanistan Afghani','currency.AFN'),(3,'ALL',2,NULL,'Albanian Lek','currency.ALL'),(4,'AMD',2,NULL,'Armenian Dram','currency.AMD'),(5,'ANG',2,NULL,'Netherlands Antillian Guilder','currency.ANG'),(6,'AOA',2,NULL,'Angolan Kwanza','currency.AOA'),(7,'ARS',2,NULL,'Argentine Peso','currency.ARS'),(8,'AUD',2,'A$','Australian Dollar','currency.AUD'),(9,'AWG',2,NULL,'Aruban Guilder','currency.AWG'),(10,'AZM',2,NULL,'Azerbaijanian Manat','currency.AZM'),(11,'BAM',2,NULL,'Bosnia and Herzegovina Convertible Marks','currency.BAM'),(12,'BBD',2,NULL,'Barbados Dollar','currency.BBD'),(13,'BDT',2,NULL,'Bangladesh Taka','currency.BDT'),(14,'BGN',2,NULL,'Bulgarian Lev','currency.BGN'),(15,'BHD',3,NULL,'Bahraini Dinar','currency.BHD'),(16,'BIF',0,NULL,'Burundi Franc','currency.BIF'),(17,'BMD',2,NULL,'Bermudian Dollar','currency.BMD'),(18,'BND',2,'B$','Brunei Dollar','currency.BND'),(19,'BOB',2,NULL,'Bolivian Boliviano','currency.BOB'),(20,'BRL',2,NULL,'Brazilian Real','currency.BRL'),(21,'BSD',2,NULL,'Bahamian Dollar','currency.BSD'),(22,'BTN',2,NULL,'Bhutan Ngultrum','currency.BTN'),(23,'BWP',2,NULL,'Botswana Pula','currency.BWP'),(24,'BYR',0,NULL,'Belarussian Ruble','currency.BYR'),(25,'BZD',2,NULL,'Belize Dollar','currency.BZD'),(26,'CAD',2,NULL,'Canadian Dollar','currency.CAD'),(27,'CDF',2,NULL,'Franc Congolais','currency.CDF'),(28,'CHF',2,NULL,'Swiss Franc','currency.CHF'),(29,'CLP',0,NULL,'Chilean Peso','currency.CLP'),(30,'CNY',2,NULL,'Chinese Yuan Renminbi','currency.CNY'),(31,'COP',2,NULL,'Colombian Peso','currency.COP'),(32,'CRC',2,NULL,'Costa Rican Colon','currency.CRC'),(33,'CSD',2,NULL,'Serbian Dinar','currency.CSD'),(34,'CUP',2,NULL,'Cuban Peso','currency.CUP'),(35,'CVE',2,NULL,'Cape Verde Escudo','currency.CVE'),(36,'CYP',2,NULL,'Cyprus Pound','currency.CYP'),(37,'CZK',2,NULL,'Czech Koruna','currency.CZK'),(38,'DJF',0,NULL,'Djibouti Franc','currency.DJF'),(39,'DKK',2,NULL,'Danish Krone','currency.DKK'),(40,'DOP',2,NULL,'Dominican Peso','currency.DOP'),(41,'DZD',2,NULL,'Algerian Dinar','currency.DZD'),(42,'EEK',2,NULL,'Estonian Kroon','currency.EEK'),(43,'EGP',2,NULL,'Egyptian Pound','currency.EGP'),(44,'ERN',2,NULL,'Eritrea Nafka','currency.ERN'),(45,'ETB',2,NULL,'Ethiopian Birr','currency.ETB'),(46,'EUR',2,'€','Euro','currency.EUR'),(47,'FJD',2,NULL,'Fiji Dollar','currency.FJD'),(48,'FKP',2,NULL,'Falkland \n\nIslands Pound','currency.FKP'),(49,'GBP',2,NULL,'Pound Sterling','currency.GBP'),(50,'GEL',2,NULL,'Georgian Lari','currency.GEL'),(51,'GHC',2,'GHc','Ghana Cedi','currency.GHC'),(52,'GIP',2,NULL,'Gibraltar Pound','currency.GIP'),(53,'GMD',2,NULL,'Gambian Dalasi','currency.GMD'),(54,'GNF',0,NULL,'Guinea Franc','currency.GNF'),(55,'GTQ',2,NULL,'Guatemala Quetzal','currency.GTQ'),(56,'GYD',2,NULL,'Guyana Dollar','currency.GYD'),(57,'HKD',2,NULL,'Hong Kong Dollar','currency.HKD'),(58,'HNL',2,NULL,'Honduras Lempira','currency.HNL'),(59,'HRK',2,NULL,'Croatian Kuna','currency.HRK'),(60,'HTG',2,NULL,'Haiti Gourde','currency.HTG'),(61,'HUF',2,NULL,'Hungarian Forint','currency.HUF'),(62,'IDR',2,NULL,'Indonesian Rupiah','currency.IDR'),(63,'ILS',2,NULL,'New Israeli Shekel','currency.ILS'),(64,'INR',2,'₹','Indian Rupee','currency.INR'),(65,'IQD',3,NULL,'Iraqi Dinar','currency.IQD'),(66,'IRR',2,NULL,'Iranian Rial','currency.IRR'),(67,'ISK',0,NULL,'Iceland Krona','currency.ISK'),(68,'JMD',2,NULL,'Jamaican Dollar','currency.JMD'),(69,'JOD',3,NULL,'Jordanian Dinar','currency.JOD'),(70,'JPY',0,NULL,'Japanese Yen','currency.JPY'),(71,'KES',2,'KSh','Kenyan Shilling','currency.KES'),(72,'KGS',2,NULL,'Kyrgyzstan Som','currency.KGS'),(73,'KHR',2,NULL,'Cambodia Riel','currency.KHR'),(74,'KMF',0,NULL,'Comoro Franc','currency.KMF'),(75,'KPW',2,NULL,'North Korean Won','currency.KPW'),(76,'KRW',0,NULL,'Korean Won','currency.KRW'),(77,'KWD',3,NULL,'Kuwaiti Dinar','currency.KWD'),(78,'KYD',2,NULL,'Cayman Islands Dollar','currency.KYD'),(79,'KZT',2,NULL,'Kazakhstan Tenge','currency.KZT'),(80,'LAK',2,NULL,'Lao Kip','currency.LAK'),(81,'LBP',2,'L£','Lebanese Pound','currency.LBP'),(82,'LKR',2,NULL,'Sri Lanka Rupee','currency.LKR'),(83,'LRD',2,NULL,'Liberian Dollar','currency.LRD'),(84,'LSL',2,NULL,'Lesotho Loti','currency.LSL'),(85,'LTL',2,NULL,'Lithuanian Litas','currency.LTL'),(86,'LVL',2,NULL,'Latvian Lats','currency.LVL'),(87,'LYD',3,NULL,'Libyan Dinar','currency.LYD'),(88,'MAD',2,NULL,'Moroccan Dirham','currency.MAD'),(89,'MDL',2,NULL,'Moldovan Leu','currency.MDL'),(90,'MGA',2,NULL,'Malagasy Ariary','currency.MGA'),(91,'MKD',2,NULL,'Macedonian Denar','currency.MKD'),(92,'MMK',2,'K','Myanmar Kyat','currency.MMK'),(93,'MNT',2,NULL,'Mongolian Tugrik','currency.MNT'),(94,'MOP',2,NULL,'Macau Pataca','currency.MOP'),(95,'MRO',2,NULL,'Mauritania Ouguiya','currency.MRO'),(96,'MTL',2,NULL,'Maltese Lira','currency.MTL'),(97,'MUR',2,NULL,'Mauritius Rupee','currency.MUR'),(98,'MVR',2,NULL,'Maldives Rufiyaa','currency.MVR'),(99,'MWK',2,NULL,'Malawi Kwacha','currency.MWK'),(100,'MXN',2,NULL,'Mexican Peso','currency.MXN'),(101,'MYR',2,NULL,'Malaysian Ringgit','currency.MYR'),(102,'MZM',2,NULL,'Mozambique Metical','currency.MZM'),(103,'NAD',2,NULL,'Namibia Dollar','currency.NAD'),(104,'NGN',2,NULL,'Nigerian Naira','currency.NGN'),(105,'NIO',2,NULL,'Nicaragua Cordoba Oro','currency.NIO'),(106,'NOK',2,NULL,'Norwegian Krone','currency.NOK'),(107,'NPR',2,NULL,'Nepalese Rupee','currency.NPR'),(108,'NZD',2,NULL,'New Zealand Dollar','currency.NZD'),(109,'OMR',3,NULL,'Rial Omani','currency.OMR'),(110,'PAB',2,NULL,'Panama Balboa','currency.PAB'),(111,'PEN',2,'S/.','Peruvian Nuevo Sol','currency.PEN'),(112,'PGK',2,NULL,'Papua New Guinea Kina','currency.PGK'),(113,'PHP',2,NULL,'Philippine Peso','currency.PHP'),(114,'PKR',2,NULL,'Pakistan Rupee','currency.PKR'),(115,'PLN',2,NULL,'Polish Zloty','currency.PLN'),(116,'PYG',0,NULL,'Paraguayan Guarani','currency.PYG'),(117,'QAR',2,NULL,'Qatari Rial','currency.QAR'),(118,'RON',2,NULL,'Romanian Leu','currency.RON'),(119,'RUB',2,NULL,'Russian Ruble','currency.RUB'),(120,'RWF',0,NULL,'Rwanda Franc','currency.RWF'),(121,'SAR',2,NULL,'Saudi Riyal','currency.SAR'),(122,'SBD',2,NULL,'Solomon Islands Dollar','currency.SBD'),(123,'SCR',2,NULL,'Seychelles Rupee','currency.SCR'),(124,'SDD',2,NULL,'Sudanese Dinar','currency.SDD'),(125,'SEK',2,NULL,'Swedish Krona','currency.SEK'),(126,'SGD',2,NULL,'Singapore Dollar','currency.SGD'),(127,'SHP',2,NULL,'St Helena Pound','currency.SHP'),(128,'SIT',2,NULL,'Slovenian Tolar','currency.SIT'),(129,'SKK',2,NULL,'Slovak Koruna','currency.SKK'),(130,'SLL',2,NULL,'Sierra Leone Leone','currency.SLL'),(131,'SOS',2,NULL,'Somali Shilling','currency.SOS'),(132,'SRD',2,NULL,'Surinam Dollar','currency.SRD'),(133,'STD',2,NULL,'Sao Tome and Principe Dobra','currency.STD'),(134,'SVC',2,NULL,'El Salvador Colon','currency.SVC'),(135,'SYP',2,NULL,'Syrian \n\nPound','currency.SYP'),(136,'SZL',2,NULL,'Swaziland Lilangeni','currency.SZL'),(137,'THB',2,NULL,'Thai Baht','currency.THB'),(138,'TJS',2,NULL,'Tajik Somoni','currency.TJS'),(139,'TMM',2,NULL,'Turkmenistan Manat','currency.TMM'),(140,'TND',3,'DT','Tunisian Dinar','currency.TND'),(141,'TOP',2,NULL,'Tonga Pa\'anga','currency.TOP'),(142,'TRY',2,NULL,'Turkish Lira','currency.TRY'),(143,'TTD',2,NULL,'Trinidad and Tobago Dollar','currency.TTD'),(144,'TWD',2,NULL,'New Taiwan Dollar','currency.TWD'),(145,'TZS',2,NULL,'Tanzanian Shilling','currency.TZS'),(146,'UAH',2,NULL,'Ukraine Hryvnia','currency.UAH'),(147,'UGX',2,'USh','Uganda Shilling','currency.UGX'),(148,'USD',2,'$','US Dollar','currency.USD'),(149,'UYU',2,NULL,'Peso Uruguayo','currency.UYU'),(150,'UZS',2,NULL,'Uzbekistan Sum','currency.UZS'),(151,'VEB',2,NULL,'Venezuelan Bolivar','currency.VEB'),(152,'VND',2,NULL,'Vietnamese Dong','currency.VND'),(153,'VUV',0,NULL,'Vanuatu Vatu','currency.VUV'),(154,'WST',2,NULL,'Samoa Tala','currency.WST'),(155,'XAF',0,NULL,'CFA Franc BEAC','currency.XAF'),(156,'XCD',2,NULL,'East Caribbean Dollar','currency.XCD'),(157,'XDR',5,NULL,'SDR (Special Drawing Rights)','currency.XDR'),(158,'XOF',0,'CFA','CFA Franc BCEAO','currency.XOF'),(159,'XPF',0,NULL,'CFP Franc','currency.XPF'),(160,'YER',2,NULL,'Yemeni Rial','currency.YER'),(161,'ZAR',2,'R','South African Rand','currency.ZAR'),(162,'ZMK',2,NULL,'Zambian Kwacha','currency.ZMK'),(163,'ZWD',2,NULL,'Zimbabwe Dollar','currency.ZWD'); +/*!40000 ALTER TABLE `m_currency` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_deposit_account` +-- + +DROP TABLE IF EXISTS `m_deposit_account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_deposit_account` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `status_enum` smallint(5) NOT NULL DEFAULT '0', + `external_id` varchar(100) DEFAULT NULL, + `client_id` bigint(20) NOT NULL, + `product_id` bigint(20) NOT NULL, + `currency_code` varchar(3) NOT NULL, + `currency_digits` smallint(5) NOT NULL, + `deposit_amount` decimal(19,6) DEFAULT NULL, + `maturity_nominal_interest_rate` decimal(19,6) NOT NULL, + `tenure_months` int(11) NOT NULL, + `interest_compounded_every` smallint(5) NOT NULL DEFAULT '1', + `interest_compounded_every_period_enum` smallint(5) NOT NULL DEFAULT '2', + `projected_commencement_date` date NOT NULL, + `actual_commencement_date` date DEFAULT NULL, + `matures_on_date` datetime DEFAULT NULL, + `projected_interest_accrued_on_maturity` decimal(19,6) NOT NULL, + `actual_interest_accrued` decimal(19,6) DEFAULT NULL, + `projected_total_maturity_amount` decimal(19,6) NOT NULL, + `actual_total_amount` decimal(19,6) DEFAULT NULL, + `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', + `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', + `pre_closure_interest_rate` decimal(19,6) NOT NULL, + `is_lock_in_period_allowed` tinyint(1) NOT NULL DEFAULT '0', + `lock_in_period` bigint(20) DEFAULT NULL, + `lock_in_period_type` smallint(5) NOT NULL DEFAULT '2', + `withdrawnon_date` datetime DEFAULT NULL, + `rejectedon_date` datetime DEFAULT NULL, + `closedon_date` datetime DEFAULT 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`), + UNIQUE KEY `deposit_acc_external_id` (`external_id`), + KEY `FKKW0000000000001` (`client_id`), + KEY `FKKW0000000000002` (`product_id`), + KEY `FKKW0000000000003` (`renewed_account_id`), + CONSTRAINT `FKKW0000000000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), + CONSTRAINT `FKKW0000000000002` FOREIGN KEY (`product_id`) REFERENCES `m_product_deposit` (`id`), + CONSTRAINT `FKKW0000000000003` FOREIGN KEY (`renewed_account_id`) REFERENCES `m_deposit_account` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_deposit_account` +-- + +LOCK TABLES `m_deposit_account` WRITE; +/*!40000 ALTER TABLE `m_deposit_account` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_deposit_account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_deposit_account_transaction` +-- + +DROP TABLE IF EXISTS `m_deposit_account_transaction`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_deposit_account_transaction` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `deposit_account_id` bigint(20) NOT NULL, + `transaction_type_enum` smallint(5) NOT NULL, + `contra_id` bigint(20) DEFAULT NULL, + `transaction_date` date NOT NULL, + `amount` decimal(19,6) NOT NULL, + `interest` decimal(19,6) NOT NULL, + `total` decimal(19,6) NOT NULL, + PRIMARY KEY (`id`), + KEY `FKKW00000000000005` (`deposit_account_id`), + KEY `FKKW00000000000006` (`contra_id`), + CONSTRAINT `FKKW00000000000005` FOREIGN KEY (`deposit_account_id`) REFERENCES `m_deposit_account` (`id`), + CONSTRAINT `FKKW00000000000006` FOREIGN KEY (`contra_id`) REFERENCES `m_deposit_account_transaction` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_deposit_account_transaction` +-- + +LOCK TABLES `m_deposit_account_transaction` WRITE; +/*!40000 ALTER TABLE `m_deposit_account_transaction` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_deposit_account_transaction` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_document` +-- + +DROP TABLE IF EXISTS `m_document`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_document` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `parent_entity_type` varchar(50) NOT NULL, + `parent_entity_id` int(20) NOT NULL DEFAULT '0', + `name` varchar(250) NOT NULL, + `file_name` varchar(250) NOT NULL, + `size` int(20) DEFAULT '0', + `type` varchar(50) DEFAULT NULL, + `description` varchar(1000) DEFAULT NULL, + `location` varchar(500) NOT NULL DEFAULT '0', + `createdby_id` int(20) NOT NULL, + `lastmodifiedby_id` int(20) NOT NULL, + `created_date` datetime NOT NULL, + `lastmodified_date` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_document` +-- + +LOCK TABLES `m_document` WRITE; +/*!40000 ALTER TABLE `m_document` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_document` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_fund` +-- + +DROP TABLE IF EXISTS `m_fund`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_fund` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(255) DEFAULT NULL, + `external_id` varchar(100) DEFAULT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `fund_name_org` (`name`), + UNIQUE KEY `fund_externalid_org` (`external_id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_fund` +-- + +LOCK TABLES `m_fund` WRITE; +/*!40000 ALTER TABLE `m_fund` DISABLE KEYS */; +INSERT INTO `m_fund` VALUES (1,'openmf-womens-fund','1',1,'2012-11-25 13:53:45',1,'2012-11-25 13:53:45'),(2,'openmf-agriculture-fund','2',1,'2012-11-25 13:53:59',1,'2012-11-25 13:53:59'); +/*!40000 ALTER TABLE `m_fund` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_group` +-- + +DROP TABLE IF EXISTS `m_group`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_group` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `office_id` bigint(20) NOT NULL, + `name` varchar(100) DEFAULT NULL, + `external_id` varchar(100) DEFAULT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `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`), + UNIQUE KEY `name` (`name`), + UNIQUE KEY `external_id` (`external_id`), + KEY `FKJPWG000000000003` (`createdby_id`), + KEY `FKJPWG000000000004` (`lastmodifiedby_id`), + KEY `office_id` (`office_id`), + CONSTRAINT `FKJPWG000000000003` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FKJPWG000000000004` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `m_group_ibfk_1` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_group` +-- + +LOCK TABLES `m_group` WRITE; +/*!40000 ALTER TABLE `m_group` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_group` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_group_client` +-- + +DROP TABLE IF EXISTS `m_group_client`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_group_client` ( + `group_id` bigint(20) NOT NULL, + `client_id` bigint(20) NOT NULL, + PRIMARY KEY (`group_id`,`client_id`), + KEY `client_id` (`client_id`), + CONSTRAINT `m_group_client_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`), + CONSTRAINT `m_group_client_ibfk_2` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_group_client` +-- + +LOCK TABLES `m_group_client` WRITE; +/*!40000 ALTER TABLE `m_group_client` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_group_client` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_guarantor_external` +-- + +DROP TABLE IF EXISTS `m_guarantor_external`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_guarantor_external` ( + `loan_id` bigint(20) NOT NULL, + `firstname` varchar(50) NOT NULL, + `lastname` varchar(50) NOT NULL, + `dob` date DEFAULT NULL, + `address_line_1` varchar(500) DEFAULT NULL, + `address_line_2` varchar(500) DEFAULT NULL, + `city` varchar(50) DEFAULT NULL, + `state` varchar(50) DEFAULT NULL, + `country` varchar(50) DEFAULT NULL, + `zip` varchar(20) DEFAULT NULL, + `house_phone_number` varchar(20) DEFAULT NULL, + `mobile_number` varchar(20) DEFAULT NULL, + `comment` varchar(20) DEFAULT NULL, + PRIMARY KEY (`loan_id`), + CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_guarantor_external` +-- + +LOCK TABLES `m_guarantor_external` WRITE; +/*!40000 ALTER TABLE `m_guarantor_external` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_guarantor_external` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_loan` +-- + +DROP TABLE IF EXISTS `m_loan`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_loan` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `external_id` varchar(100) DEFAULT NULL, + `client_id` bigint(20) DEFAULT NULL, + `group_id` bigint(20) DEFAULT NULL, + `product_id` bigint(20) DEFAULT NULL, + `fund_id` bigint(20) DEFAULT NULL, + `loan_officer_id` bigint(20) DEFAULT NULL, + `guarantor_id` bigint(20) DEFAULT NULL, + `loan_status_id` smallint(5) NOT 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) 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, + `interest_method_enum` smallint(5) NOT NULL, + `interest_calculated_in_period_enum` smallint(5) NOT NULL DEFAULT '1', + `term_frequency` smallint(5) NOT NULL DEFAULT '0', + `term_period_frequency_enum` smallint(5) NOT NULL DEFAULT '2', + `repay_every` smallint(5) NOT NULL, + `repayment_period_frequency_enum` smallint(5) NOT NULL, + `number_of_repayments` smallint(5) NOT NULL, + `amortization_method_enum` smallint(5) NOT NULL, + `total_charges_due_at_disbursement_derived` decimal(19,6) DEFAULT NULL, + `submittedon_date` datetime DEFAULT NULL, + `approvedon_date` datetime DEFAULT NULL, + `expected_disbursedon_date` date DEFAULT NULL, + `expected_firstrepaymenton_date` date DEFAULT NULL, + `interest_calculated_from_date` date DEFAULT NULL, + `disbursedon_date` date DEFAULT NULL, + `expected_maturedon_date` date DEFAULT NULL, + `maturedon_date` date DEFAULT NULL, + `closedon_date` datetime DEFAULT NULL, + `rejectedon_date` datetime DEFAULT NULL, + `rescheduledon_date` datetime DEFAULT NULL, + `withdrawnon_date` datetime DEFAULT NULL, + `writtenoffon_date` datetime DEFAULT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `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`), + KEY `FKB6F935D8C8D4B434` (`product_id`), + KEY `FK7C885877240145` (`fund_id`), + KEY `FK_loan_ltp_strategy` (`loan_transaction_strategy_id`), + KEY `FK_m_loan_m_staff` (`loan_officer_id`), + KEY `group_id` (`group_id`), + KEY `FK_m_loan_guarantor` (`guarantor_id`), + CONSTRAINT `FK7C885877240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`), + CONSTRAINT `FKB6F935D87179A0CB` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), + CONSTRAINT `FKB6F935D8C8D4B434` FOREIGN KEY (`product_id`) REFERENCES `m_product_loan` (`id`), + CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`), + CONSTRAINT `FK_m_loan_guarantor` FOREIGN KEY (`guarantor_id`) REFERENCES `m_client` (`id`), + CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`), + CONSTRAINT `m_loan_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_loan` +-- + +LOCK TABLES `m_loan` WRITE; +/*!40000 ALTER TABLE `m_loan` DISABLE KEYS */; +INSERT INTO `m_loan` VALUES (1,NULL,3,NULL,1,1,11,NULL,100,'USD',2,'300.000000',NULL,'24.000000',3,'24.000000',0,1,48,1,1,1,48,1,NULL,'2009-01-14 00:00:00',NULL,'2009-01-20',NULL,NULL,NULL,'2009-12-22',NULL,NULL,NULL,NULL,NULL,NULL,2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,1); +/*!40000 ALTER TABLE `m_loan` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_loan_charge` +-- + +DROP TABLE IF EXISTS `m_loan_charge`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_loan_charge` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `loan_id` bigint(20) NOT NULL, + `charge_id` bigint(20) NOT NULL, + `is_penalty` tinyint(1) NOT NULL DEFAULT '0', + `charge_time_enum` smallint(5) NOT NULL, + `due_for_collection_as_of_date` date DEFAULT NULL, + `charge_calculation_enum` smallint(5) NOT NULL, + `calculation_percentage` decimal(19,6) DEFAULT NULL, + `calculation_on_amount` decimal(19,6) DEFAULT NULL, + `amount` decimal(19,6) NOT NULL, + `amount_paid_derived` decimal(19,6) DEFAULT NULL, + `amount_waived_derived` decimal(19,6) DEFAULT NULL, + `amount_writtenoff_derived` decimal(19,6) DEFAULT NULL, + `amount_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000', + `is_paid_derived` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + KEY `charge_id` (`charge_id`), + KEY `m_loan_charge_ibfk_2` (`loan_id`), + CONSTRAINT `m_loan_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), + CONSTRAINT `m_loan_charge_ibfk_2` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_loan_charge` +-- + +LOCK TABLES `m_loan_charge` WRITE; +/*!40000 ALTER TABLE `m_loan_charge` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_loan_charge` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_loan_officer_assignment_history` +-- + +DROP TABLE IF EXISTS `m_loan_officer_assignment_history`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_loan_officer_assignment_history` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `loan_id` bigint(20) NOT NULL, + `loan_officer_id` bigint(20) DEFAULT NULL, + `start_date` date NOT NULL, + `end_date` date DEFAULT 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 `fk_m_loan_officer_assignment_history_0001` (`loan_id`), + KEY `fk_m_loan_officer_assignment_history_0002` (`loan_officer_id`), + CONSTRAINT `fk_m_loan_officer_assignment_history_0001` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), + CONSTRAINT `fk_m_loan_officer_assignment_history_0002` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_loan_officer_assignment_history` +-- + +LOCK TABLES `m_loan_officer_assignment_history` WRITE; +/*!40000 ALTER TABLE `m_loan_officer_assignment_history` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_loan_officer_assignment_history` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_loan_repayment_schedule` +-- + +DROP TABLE IF EXISTS `m_loan_repayment_schedule`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_loan_repayment_schedule` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `loan_id` bigint(20) NOT NULL, + `fromdate` date DEFAULT NULL, + `duedate` date NOT NULL, + `installment` smallint(5) NOT NULL, + `principal_amount` decimal(19,6) DEFAULT NULL, + `principal_completed_derived` decimal(19,6) DEFAULT NULL, + `principal_writtenoff_derived` decimal(19,6) DEFAULT NULL, + `interest_amount` decimal(19,6) DEFAULT NULL, + `interest_completed_derived` decimal(19,6) DEFAULT NULL, + `interest_writtenoff_derived` decimal(19,6) DEFAULT NULL, + `fee_charges_amount` decimal(19,6) DEFAULT NULL, + `fee_charges_completed_derived` decimal(19,6) DEFAULT NULL, + `fee_charges_writtenoff_derived` decimal(19,6) DEFAULT NULL, + `fee_charges_waived_derived` decimal(19,6) DEFAULT NULL, + `penalty_charges_amount` decimal(19,6) DEFAULT NULL, + `penalty_charges_completed_derived` decimal(19,6) DEFAULT NULL, + `penalty_charges_writtenoff_derived` decimal(19,6) DEFAULT NULL, + `penalty_charges_waived_derived` decimal(19,6) 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, + `interest_waived_derived` decimal(19,6) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK488B92AA40BE0710` (`loan_id`), + CONSTRAINT `FK488B92AA40BE0710` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_loan_repayment_schedule` +-- + +LOCK TABLES `m_loan_repayment_schedule` WRITE; +/*!40000 ALTER TABLE `m_loan_repayment_schedule` DISABLE KEYS */; +INSERT INTO `m_loan_repayment_schedule` VALUES (1,1,'2009-01-20','2009-01-27',1,'5.600000',NULL,NULL,'1.380000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(2,1,'2009-01-27','2009-02-03',2,'5.620000',NULL,NULL,'1.360000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(3,1,'2009-02-03','2009-02-10',3,'5.650000',NULL,NULL,'1.330000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(4,1,'2009-02-10','2009-02-17',4,'5.670000',NULL,NULL,'1.310000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(5,1,'2009-02-17','2009-02-24',5,'5.700000',NULL,NULL,'1.280000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(6,1,'2009-02-24','2009-03-03',6,'5.730000',NULL,NULL,'1.250000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(7,1,'2009-03-03','2009-03-10',7,'5.750000',NULL,NULL,'1.230000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(8,1,'2009-03-10','2009-03-17',8,'5.780000',NULL,NULL,'1.200000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(9,1,'2009-03-17','2009-03-24',9,'5.810000',NULL,NULL,'1.170000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(10,1,'2009-03-24','2009-03-31',10,'5.830000',NULL,NULL,'1.150000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(11,1,'2009-03-31','2009-04-07',11,'5.860000',NULL,NULL,'1.120000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(12,1,'2009-04-07','2009-04-14',12,'5.890000',NULL,NULL,'1.090000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(13,1,'2009-04-14','2009-04-21',13,'5.910000',NULL,NULL,'1.070000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(14,1,'2009-04-21','2009-04-28',14,'5.940000',NULL,NULL,'1.040000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(15,1,'2009-04-28','2009-05-05',15,'5.970000',NULL,NULL,'1.010000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(16,1,'2009-05-05','2009-05-12',16,'6.000000',NULL,NULL,'0.980000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(17,1,'2009-05-12','2009-05-19',17,'6.020000',NULL,NULL,'0.960000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(18,1,'2009-05-19','2009-05-26',18,'6.050000',NULL,NULL,'0.930000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(19,1,'2009-05-26','2009-06-02',19,'6.080000',NULL,NULL,'0.900000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(20,1,'2009-06-02','2009-06-09',20,'6.110000',NULL,NULL,'0.870000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(21,1,'2009-06-09','2009-06-16',21,'6.140000',NULL,NULL,'0.840000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(22,1,'2009-06-16','2009-06-23',22,'6.160000',NULL,NULL,'0.820000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(23,1,'2009-06-23','2009-06-30',23,'6.190000',NULL,NULL,'0.790000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(24,1,'2009-06-30','2009-07-07',24,'6.220000',NULL,NULL,'0.760000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(25,1,'2009-07-07','2009-07-14',25,'6.250000',NULL,NULL,'0.730000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(26,1,'2009-07-14','2009-07-21',26,'6.280000',NULL,NULL,'0.700000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(27,1,'2009-07-21','2009-07-28',27,'6.310000',NULL,NULL,'0.670000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(28,1,'2009-07-28','2009-08-04',28,'6.340000',NULL,NULL,'0.640000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(29,1,'2009-08-04','2009-08-11',29,'6.370000',NULL,NULL,'0.610000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(30,1,'2009-08-11','2009-08-18',30,'6.390000',NULL,NULL,'0.590000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(31,1,'2009-08-18','2009-08-25',31,'6.420000',NULL,NULL,'0.560000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(32,1,'2009-08-25','2009-09-01',32,'6.450000',NULL,NULL,'0.530000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(33,1,'2009-09-01','2009-09-08',33,'6.480000',NULL,NULL,'0.500000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(34,1,'2009-09-08','2009-09-15',34,'6.510000',NULL,NULL,'0.470000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(35,1,'2009-09-15','2009-09-22',35,'6.540000',NULL,NULL,'0.440000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(36,1,'2009-09-22','2009-09-29',36,'6.570000',NULL,NULL,'0.410000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(37,1,'2009-09-29','2009-10-06',37,'6.600000',NULL,NULL,'0.380000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(38,1,'2009-10-06','2009-10-13',38,'6.630000',NULL,NULL,'0.350000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(39,1,'2009-10-13','2009-10-20',39,'6.670000',NULL,NULL,'0.310000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(40,1,'2009-10-20','2009-10-27',40,'6.700000',NULL,NULL,'0.280000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(41,1,'2009-10-27','2009-11-03',41,'6.730000',NULL,NULL,'0.250000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(42,1,'2009-11-03','2009-11-10',42,'6.760000',NULL,NULL,'0.220000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(43,1,'2009-11-10','2009-11-17',43,'6.790000',NULL,NULL,'0.190000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(44,1,'2009-11-17','2009-11-24',44,'6.820000',NULL,NULL,'0.160000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(45,1,'2009-11-24','2009-12-01',45,'6.850000',NULL,NULL,'0.130000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(46,1,'2009-12-01','2009-12-08',46,'6.880000',NULL,NULL,'0.100000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(47,1,'2009-12-08','2009-12-15',47,'6.920000',NULL,NULL,'0.060000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL),(48,1,'2009-12-15','2009-12-22',48,'7.060000',NULL,NULL,'0.030000',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'\0',2,'2012-11-26 00:26:01','2012-11-26 00:26:01',2,NULL); +/*!40000 ALTER TABLE `m_loan_repayment_schedule` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_loan_transaction` +-- + +DROP TABLE IF EXISTS `m_loan_transaction`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_loan_transaction` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `loan_id` bigint(20) NOT NULL, + `transaction_type_enum` smallint(5) NOT NULL, + `contra_id` bigint(20) DEFAULT NULL, + `transaction_date` date NOT NULL, + `amount` decimal(19,6) NOT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + `principal_portion_derived` decimal(19,6) DEFAULT NULL, + `interest_portion_derived` decimal(19,6) DEFAULT NULL, + `fee_charges_portion_derived` decimal(19,6) DEFAULT NULL, + `penalty_charges_portion_derived` decimal(19,6) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FKCFCEA42640BE0710` (`loan_id`), + KEY `FKCFCEA426FC69F3F1` (`contra_id`), + CONSTRAINT `FKCFCEA42640BE0710` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), + CONSTRAINT `FKCFCEA426FC69F3F1` FOREIGN KEY (`contra_id`) REFERENCES `m_loan_transaction` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_loan_transaction` +-- + +LOCK TABLES `m_loan_transaction` WRITE; +/*!40000 ALTER TABLE `m_loan_transaction` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_loan_transaction` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_note` +-- + +DROP TABLE IF EXISTS `m_note`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_note` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `client_id` bigint(20) NOT NULL, + `loan_id` bigint(20) DEFAULT NULL, + `loan_transaction_id` bigint(20) DEFAULT NULL, + `deposit_account_id` bigint(20) DEFAULT NULL, + `note_type_enum` smallint(5) NOT NULL, + `note` varchar(1000) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK7C9708924D26803` (`loan_transaction_id`), + KEY `FK7C97089541F0A56` (`createdby_id`), + KEY `FK7C970897179A0CB` (`client_id`), + KEY `FK7C970898F889C3F` (`lastmodifiedby_id`), + KEY `FK7C9708940BE0710` (`loan_id`), + KEY `FK_m_note_m_deposit_account` (`deposit_account_id`), + CONSTRAINT `FK7C9708924D26803` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`), + CONSTRAINT `FK7C9708940BE0710` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`), + CONSTRAINT `FK7C97089541F0A56` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FK7C970897179A0CB` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`), + CONSTRAINT `FK7C970898F889C3F` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FK_m_note_m_deposit_account` FOREIGN KEY (`deposit_account_id`) REFERENCES `m_deposit_account` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_note` +-- + +LOCK TABLES `m_note` WRITE; +/*!40000 ALTER TABLE `m_note` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_note` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_office` +-- + +DROP TABLE IF EXISTS `m_office`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_office` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `parent_id` bigint(20) DEFAULT NULL, + `hierarchy` varchar(100) DEFAULT NULL, + `external_id` varchar(100) DEFAULT NULL, + `name` varchar(50) NOT NULL, + `opening_date` date 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`), + UNIQUE KEY `name_org` (`name`), + UNIQUE KEY `externalid_org` (`external_id`), + KEY `FK2291C477E2551DCC` (`parent_id`), + CONSTRAINT `FK2291C477E2551DCC` FOREIGN KEY (`parent_id`) REFERENCES `m_office` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_office` +-- + +LOCK TABLES `m_office` WRITE; +/*!40000 ALTER TABLE `m_office` DISABLE KEYS */; +INSERT INTO `m_office` VALUES (1,NULL,'.','1','Open MF International','2009-01-01',NULL,NULL,'2012-11-25 13:19:54',1),(2,1,'.2.','2','Seattle (USA)','2009-01-01',1,'2012-11-25 13:20:56','2012-11-25 13:21:08',1),(4,1,'.4.','3','Dublin (Ireland)','2009-01-01',1,'2012-11-25 13:21:42','2012-11-25 13:21:42',1),(5,1,'.5.','4','Indian','2009-01-01',1,'2012-11-25 13:22:59','2012-11-25 13:22:59',1),(6,5,'.5.6.','5','Bangalore (India)','2009-01-01',1,'2012-11-25 13:23:38','2012-11-25 13:23:38',1),(7,1,'.7.','6','Tunisia','2011-03-01',1,'2012-11-25 13:27:11','2012-11-25 13:27:11',1),(8,7,'.7.8.','7','Tunis (Tunisia)','2011-03-01',1,'2012-11-25 13:28:22','2012-11-25 13:38:16',1),(9,1,'.9.','8','Lebanon','2010-05-01',1,'2012-11-25 13:38:09','2012-11-25 13:38:09',1),(10,9,'.9.10.','9','Beirut (Lebanon)','2010-05-01',1,'2012-11-25 13:39:29','2012-11-25 21:44:33',1),(11,1,'.11.','10','Australia','2011-11-01',1,'2012-11-25 13:42:09','2012-11-25 13:42:09',1),(12,11,'.11.12.','11','Melbourne (Australia)','2011-11-01',1,'2012-11-25 13:42:37','2012-11-25 13:42:37',1),(13,1,'.13.','12','Poland','2012-11-01',1,'2012-11-25 13:43:59','2012-11-25 13:43:59',1),(14,13,'.13.14.','13','Warsaw (Poland)','2012-11-01',1,'2012-11-25 13:44:27','2012-11-25 13:44:27',1); +/*!40000 ALTER TABLE `m_office` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_office_transaction` +-- + +DROP TABLE IF EXISTS `m_office_transaction`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_office_transaction` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `from_office_id` bigint(20) DEFAULT NULL, + `to_office_id` bigint(20) DEFAULT NULL, + `currency_code` varchar(3) NOT NULL, + `currency_digits` int(11) NOT NULL, + `transaction_amount` decimal(19,6) NOT NULL, + `transaction_date` date NOT NULL, + `description` varchar(100) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK1E37728B93C6C1B6` (`to_office_id`), + KEY `FK1E37728B783C5C25` (`from_office_id`), + CONSTRAINT `FK1E37728B783C5C25` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`), + CONSTRAINT `FK1E37728B93C6C1B6` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_office_transaction` +-- + +LOCK TABLES `m_office_transaction` WRITE; +/*!40000 ALTER TABLE `m_office_transaction` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_office_transaction` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_organisation_currency` +-- + +DROP TABLE IF EXISTS `m_organisation_currency`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_organisation_currency` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `code` varchar(3) NOT NULL, + `decimal_places` smallint(5) NOT NULL, + `name` varchar(50) NOT NULL, + `display_symbol` varchar(10) DEFAULT NULL, + `internationalized_name_code` varchar(50) 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`) +) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_organisation_currency` +-- + +LOCK TABLES `m_organisation_currency` WRITE; +/*!40000 ALTER TABLE `m_organisation_currency` DISABLE KEYS */; +INSERT INTO `m_organisation_currency` VALUES (32,'LBP',2,'Lebanese Pound','L£','currency.LBP',1,'2012-11-25 13:18:55','2012-11-25 13:18:55',1),(33,'TND',3,'Tunisian Dinar','DT','currency.TND',1,'2012-11-25 13:18:55','2012-11-25 13:18:55',1),(34,'USD',2,'US Dollar','$','currency.USD',1,'2012-11-25 13:18:55','2012-11-25 13:18:55',1),(35,'PEN',2,'Peruvian Nuevo Sol','S/.','currency.PEN',1,'2012-11-25 13:18:55','2012-11-25 13:18:55',1),(36,'INR',2,'Indian Rupee','₹','currency.INR',1,'2012-11-25 13:18:55','2012-11-25 13:18:55',1),(37,'EUR',2,'Euro','€','currency.EUR',1,'2012-11-25 13:18:55','2012-11-25 13:18:55',1),(38,'AUD',2,'Australian Dollar','A$','currency.AUD',1,'2012-11-25 13:18:55','2012-11-25 13:18:55',1); +/*!40000 ALTER TABLE `m_organisation_currency` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_permission` +-- + +DROP TABLE IF EXISTS `m_permission`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_permission` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `grouping` varchar(45) DEFAULT NULL, + `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', + PRIMARY KEY (`id`), + UNIQUE KEY `code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=218 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_permission` +-- + +LOCK TABLES `m_permission` WRITE; +/*!40000 ALTER TABLE `m_permission` DISABLE KEYS */; +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),(213,'authorisation','PERMISSIONS_ROLE','ROLE','PERMISSIONS',1),(214,'datatable','CREATE_m_guarantor_external','m_guarantor_external','CREATE',0),(215,'datatable','READ_m_guarantor_external','m_guarantor_external','READ',0),(216,'datatable','UPDATE_m_guarantor_external','m_guarantor_external','UPDATE',0),(217,'datatable','DELETE_m_guarantor_external','m_guarantor_external','DELETE',0); +/*!40000 ALTER TABLE `m_permission` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_portfolio_command_source` +-- + +DROP TABLE IF EXISTS `m_portfolio_command_source`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +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, + `resource_id` bigint(20) DEFAULT NULL, + `command_as_json` varchar(5000) NOT NULL, + `maker_id` bigint(20) NOT NULL, + `made_on_date` date NOT NULL, + `checker_id` bigint(20) DEFAULT NULL, + `checked_on_date` date DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK_m_maker_m_appuser` (`maker_id`), + KEY `FK_m_checker_m_appuser` (`checker_id`), + CONSTRAINT `FK_m_checker_m_appuser` FOREIGN KEY (`checker_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FK_m_maker_m_appuser` FOREIGN KEY (`maker_id`) REFERENCES `m_appuser` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_portfolio_command_source` +-- + +LOCK TABLES `m_portfolio_command_source` WRITE; +/*!40000 ALTER TABLE `m_portfolio_command_source` DISABLE KEYS */; +INSERT INTO `m_portfolio_command_source` VALUES (1,'CREATE','roles',2,'{\"name\":\"dataentry-seattle\",\"description\":\"dataentry role for staff in seattle. Allow user to add and update client information, and submit new loan applications on app.\"}',1,'2012-11-25',1,'2012-11-25'),(2,'UPDATEPERMISSIONS','roles',2,'{\"permissions\":{\"ALL_FUNCTIONS\":false,\"ALL_FUNCTIONS_READ\":true,\"ORGANISATION_ADMINISTRATION_SUPER_USER\":false,\"PORTFOLIO_MANAGEMENT_SUPER_USER\":false,\"REPORTING_SUPER_USER\":false,\"USER_ADMINISTRATION_SUPER_USER\":false,\"CREATE_CLIENT\":true,\"READ_CLIENT\":true,\"UPDATE_CLIENT\":true,\"DELETE_CLIENT\":false,\"CREATE_CLIENTIDENTIFIER\":true,\"READ_CLIENTIDENTIFIER\":true,\"UPDATE_CLIENTIDENTIFIER\":true,\"DELETE_CLIENTIDENTIFIER\":false,\"CREATE_CLIENTIMAGE\":true,\"READ_CLIENTIMAGE\":true,\"DELETE_CLIENTIMAGE\":false,\"CREATE_CLIENTNOTE\":true,\"READ_CLIENTNOTE\":true,\"UPDATE_CLIENTNOTE\":true,\"DELETE_CLIENTNOTE\":false,\"CREATE_DEPOSITACCOUNT\":false,\"READ_DEPOSITACCOUNT\":false,\"UPDATE_DEPOSITACCOUNT\":false,\"DELETE_DEPOSITACCOUNT\":false,\"CREATE_DOCUMENT\":true,\"READ_DOCUMENT\":true,\"UPDATE_DOCUMENT\":true,\"DELETE_DOCUMENT\":false,\"CREATE_GROUP\":false,\"READ_GROUP\":false,\"UPDATE_GROUP\":false,\"DELETE_GROUP\":false,\"CREATE_LOAN\":true,\"READ_LOAN\":true,\"UPDATE_LOAN\":true,\"DELETE_LOAN\":false,\"CREATEHISTORIC_LOAN\":true,\"UPDATEHISTORIC_LOAN\":true,\"CREATE_LOANCHARGE\":true,\"UPDATE_LOANCHARGE\":true,\"DELETE_LOANCHARGE\":false,\"WAIVE_LOANCHARGE\":false,\"CREATE_SAVINGSACCOUNT\":false,\"READ_SAVINGSACCOUNT\":false,\"UPDATE_SAVINGSACCOUNT\":false,\"DELETE_SAVINGSACCOUNT\":false,\"BULKREASSIGN_LOAN\":false,\"APPROVE_LOAN\":false,\"APPROVEINPAST_LOAN\":false,\"APPROVALUNDO_LOAN\":false,\"REJECT_LOAN\":false,\"REJECTINPAST_LOAN\":false,\"WITHDRAW_LOAN\":false,\"WITHDRAWINPAST_LOAN\":false,\"DISBURSE_LOAN\":false,\"DISBURSEINPAST_LOAN\":false,\"DISBURSALUNDO_LOAN\":false,\"REPAYMENT_LOAN\":false,\"REPAYMENTINPAST_LOAN\":false,\"ADJUST_LOAN\":false,\"WAIVEINTERESTPORTION_LOAN\":false,\"CLOSE_LOAN\":false,\"WRITEOFF_LOAN\":false,\"CLOSEASRESCHEDULED_LOAN\":false,\"APPROVE_DEPOSITACCOUNT\":false,\"APPROVALUNDO_DEPOSITACCOUNT\":false,\"REJECT_DEPOSITACCOUNT\":false,\"WITHDRAW_DEPOSITACCOUNT\":false,\"WITHDRAWAL_DEPOSITACCOUNT\":false,\"INTEREST_DEPOSITACCOUNT\":false,\"RENEW_DEPOSITACCOUNT\":false,\"CREATE_CHARGE\":false,\"READ_CHARGE\":false,\"UPDATE_CHARGE\":false,\"DELETE_CHARGE\":false,\"CREATE_DEPOSITPRODUCT\":false,\"READ_DEPOSITPRODUCT\":false,\"UPDATE_DEPOSITPRODUCT\":false,\"DELETE_DEPOSITPRODUCT\":false,\"CREATE_FUND\":false,\"READ_FUND\":false,\"UPDATE_FUND\":false,\"DELETE_FUND\":false,\"CREATE_LOANPRODUCT\":false,\"READ_LOANPRODUCT\":false,\"UPDATE_LOANPRODUCT\":false,\"DELETE_LOANPRODUCT\":false,\"READ_MAKERCHECKER\":false,\"CREATE_OFFICE\":false,\"READ_OFFICE\":false,\"UPDATE_OFFICE\":false,\"DELETE_OFFICE\":false,\"CREATE_OFFICETRANSACTION\":false,\"READ_OFFICETRANSACTION\":false,\"CREATE_SAVINGSPRODUCT\":false,\"READ_SAVINGSPRODUCT\":false,\"UPDATE_SAVINGSPRODUCT\":false,\"DELETE_SAVINGSPRODUCT\":false,\"CREATE_STAFF\":false,\"READ_STAFF\":false,\"UPDATE_STAFF\":false,\"DELETE_STAFF\":false,\"CREATE_CODE\":false,\"READ_CODE\":false,\"UPDATE_CODE\":false,\"DELETE_CODE\":false,\"READ_CURRENCY\":false,\"UPDATE_CURRENCY\":false,\"READ_PERMISSION\":false,\"CREATE_ROLE\":false,\"READ_ROLE\":false,\"UPDATE_ROLE\":false,\"DELETE_ROLE\":false,\"PERMISSIONS_ROLE\":false,\"CREATE_USER\":false,\"READ_USER\":false,\"UPDATE_USER\":false,\"DELETE_USER\":false,\"CREATE_m_guarantor_external\":false,\"READ_m_guarantor_external\":false,\"UPDATE_m_guarantor_external\":false,\"DELETE_m_guarantor_external\":false}}',1,'2012-11-25',1,'2012-11-25'),(3,'CREATE','clients',1,'{\"clientOrBusinessName\":\"Eric Eells\",\"officeId\":2,\"joiningDate\":[2009,1,7]}',2,'2012-11-25',2,'2012-11-25'),(4,'CREATE','clients',2,'{\"clientOrBusinessName\":\"Petrina Punch\",\"officeId\":2,\"joiningDate\":[2009,1,8]}',2,'2012-11-25',2,'2012-11-25'),(5,'CREATE','clients',3,'{\"clientOrBusinessName\":\"Petrina Punch\",\"officeId\":2,\"joiningDate\":[2009,1,14]}',2,'2012-11-25',2,'2012-11-25'),(6,'UPDATE','clients',3,'{\"clientOrBusinessName\":\"Ruth Rutland\"}',1,'2012-11-26',1,'2012-11-26'),(7,'CREATE','clients',4,'{\"clientOrBusinessName\":\"Inge Iglesias\",\"officeId\":1,\"joiningDate\":[2009,1,16]}',1,'2012-11-26',1,'2012-11-26'),(8,'UPDATE','clients',4,'{\"officeId\":2}',1,'2012-11-26',1,'2012-11-26'),(9,'CREATE','clients',5,'{\"clientOrBusinessName\":\"Alphonso Avallone\",\"officeId\":2,\"joiningDate\":[2009,1,20]}',2,'2012-11-26',2,'2012-11-26'); +/*!40000 ALTER TABLE `m_portfolio_command_source` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_product_deposit` +-- + +DROP TABLE IF EXISTS `m_product_deposit`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_product_deposit` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `external_id` varchar(100) DEFAULT NULL, + `description` varchar(500) DEFAULT NULL, + `currency_code` varchar(3) NOT NULL, + `currency_digits` smallint(5) NOT NULL, + `minimum_balance` decimal(19,6) DEFAULT NULL, + `maximum_balance` decimal(19,6) DEFAULT NULL, + `tenure_months` int(11) NOT NULL, + `interest_compounded_every` smallint(5) NOT NULL DEFAULT '1', + `interest_compounded_every_period_enum` smallint(5) NOT NULL DEFAULT '2', + `maturity_default_interest_rate` decimal(19,6) NOT NULL, + `maturity_min_interest_rate` decimal(19,6) NOT NULL, + `maturity_max_interest_rate` decimal(19,6) NOT NULL, + `is_compounding_interest_allowed` tinyint(1) NOT NULL DEFAULT '0', + `is_renewal_allowed` tinyint(1) NOT NULL DEFAULT '0', + `is_preclosure_allowed` tinyint(1) NOT NULL DEFAULT '0', + `pre_closure_interest_rate` decimal(19,6) NOT NULL, + `is_lock_in_period_allowed` tinyint(1) NOT NULL DEFAULT '0', + `lock_in_period` bigint(20) DEFAULT NULL, + `lock_in_period_type` smallint(5) NOT NULL DEFAULT '2', + `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`), + UNIQUE KEY `name_deposit_product` (`name`), + UNIQUE KEY `externalid_deposit_product` (`external_id`), + KEY `FKJPW0000000000003` (`createdby_id`), + KEY `FKJPW0000000000004` (`lastmodifiedby_id`), + CONSTRAINT `FKJPX0000000000003` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FKJPX0000000000004` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_product_deposit` +-- + +LOCK TABLES `m_product_deposit` WRITE; +/*!40000 ALTER TABLE `m_product_deposit` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_product_deposit` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_product_loan` +-- + +DROP TABLE IF EXISTS `m_product_loan`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_product_loan` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `currency_code` varchar(3) NOT NULL, + `currency_digits` smallint(5) NOT NULL, + `principal_amount` decimal(19,6) NOT NULL, + `arrearstolerance_amount` decimal(19,6) DEFAULT NULL, + `name` varchar(100) NOT NULL, + `description` varchar(500) DEFAULT NULL, + `fund_id` bigint(20) 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, + `interest_method_enum` smallint(5) NOT NULL, + `interest_calculated_in_period_enum` smallint(5) NOT NULL DEFAULT '1', + `repay_every` smallint(5) NOT NULL, + `repayment_period_frequency_enum` smallint(5) NOT NULL, + `number_of_repayments` smallint(5) NOT NULL, + `amortization_method_enum` smallint(5) NOT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `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`), + KEY `FKAUD0000000000003` (`createdby_id`), + KEY `FKAUD0000000000004` (`lastmodifiedby_id`), + KEY `FKA6A8A7D77240145` (`fund_id`), + KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`), + CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`), + CONSTRAINT `FKAUD0000000000003` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FKAUD0000000000004` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_product_loan` +-- + +LOCK TABLES `m_product_loan` WRITE; +/*!40000 ALTER TABLE `m_product_loan` DISABLE KEYS */; +INSERT INTO `m_product_loan` VALUES (1,'USD',2,'300.000000',NULL,'Womens business loan (USA)','A loan for women for micro-enterprises.',1,'24.000000',3,'24.000000',0,1,1,1,48,1,1,'2012-11-25 14:22:49','2012-11-25 14:24:44',1,1),(2,'EUR',2,'250.000000',NULL,'Womens business loan (Europe)','A business loan for women for their micro enterprises.',1,'24.000000',3,'24.000000',0,1,1,1,48,1,1,'2012-11-25 14:24:30','2012-11-25 14:24:30',1,1); +/*!40000 ALTER TABLE `m_product_loan` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_product_loan_charge` +-- + +DROP TABLE IF EXISTS `m_product_loan_charge`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_product_loan_charge` ( + `product_loan_id` bigint(20) NOT NULL, + `charge_id` bigint(20) NOT NULL, + PRIMARY KEY (`product_loan_id`,`charge_id`), + KEY `charge_id` (`charge_id`), + CONSTRAINT `m_product_loan_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`), + CONSTRAINT `m_product_loan_charge_ibfk_2` FOREIGN KEY (`product_loan_id`) REFERENCES `m_product_loan` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_product_loan_charge` +-- + +LOCK TABLES `m_product_loan_charge` WRITE; +/*!40000 ALTER TABLE `m_product_loan_charge` DISABLE KEYS */; +INSERT INTO `m_product_loan_charge` VALUES (2,1); +/*!40000 ALTER TABLE `m_product_loan_charge` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_product_savings` +-- + +DROP TABLE IF EXISTS `m_product_savings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_product_savings` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `description` varchar(500) DEFAULT NULL, + `currency_code` varchar(3) DEFAULT NULL, + `currency_digits` smallint(5) DEFAULT NULL, + `interest_rate` decimal(19,6) DEFAULT NULL, + `min_interest_rate` decimal(19,6) DEFAULT NULL, + `max_interest_rate` decimal(19,6) DEFAULT NULL, + `savings_deposit_amount` decimal(19,6) NOT NULL, + `savings_product_type` smallint(5) DEFAULT NULL, + `tenure_type` smallint(5) DEFAULT NULL, + `tenure` int(11) DEFAULT NULL, + `frequency` int(11) DEFAULT NULL, + `interest_type` smallint(5) DEFAULT NULL, + `interest_calculation_method` smallint(5) DEFAULT NULL, + `min_bal_for_withdrawal` decimal(19,6) NOT NULL, + `is_partial_deposit_allowed` tinyint(1) NOT NULL DEFAULT '0', + `is_lock_in_period_allowed` tinyint(1) NOT NULL DEFAULT '0', + `lock_in_period` bigint(20) DEFAULT NULL, + `lock_in_period_type` smallint(5) NOT NULL DEFAULT '1', + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `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 `FKJPW0000000000003` (`createdby_id`), + KEY `FKJPW0000000000004` (`lastmodifiedby_id`), + CONSTRAINT `FKJPW0000000000003` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`), + CONSTRAINT `FKJPW0000000000004` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_product_savings` +-- + +LOCK TABLES `m_product_savings` WRITE; +/*!40000 ALTER TABLE `m_product_savings` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_product_savings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_role` +-- + +DROP TABLE IF EXISTS `m_role`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_role` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(100) NOT NULL, + `description` varchar(500) 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`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_role` +-- + +LOCK TABLES `m_role` WRITE; +/*!40000 ALTER TABLE `m_role` DISABLE KEYS */; +INSERT INTO `m_role` VALUES (1,'Super user','This role provides all application permissions.',NULL,NULL,NULL,NULL),(2,'dataentry-seattle','dataentry role for staff in seattle. Allow user to add and update client information, and submit new loan applications on app.',1,'2012-11-25 23:42:27','2012-11-25 23:42:27',1); +/*!40000 ALTER TABLE `m_role` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_role_permission` +-- + +DROP TABLE IF EXISTS `m_role_permission`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_role_permission` ( + `role_id` bigint(20) NOT NULL, + `permission_id` bigint(20) NOT NULL, + PRIMARY KEY (`role_id`,`permission_id`), + KEY `FK8DEDB04815CEC7AB` (`role_id`), + KEY `FK8DEDB048103B544B` (`permission_id`), + CONSTRAINT `FK8DEDB048103B544B` FOREIGN KEY (`permission_id`) REFERENCES `m_permission` (`id`), + CONSTRAINT `FK8DEDB04815CEC7AB` FOREIGN KEY (`role_id`) REFERENCES `m_role` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_role_permission` +-- + +LOCK TABLES `m_role_permission` WRITE; +/*!40000 ALTER TABLE `m_role_permission` DISABLE KEYS */; +INSERT INTO `m_role_permission` VALUES (1,42),(2,5),(2,6),(2,20),(2,43),(2,120),(2,121),(2,123),(2,124),(2,127),(2,128),(2,129),(2,131),(2,132),(2,133),(2,141),(2,142),(2,143),(2,157),(2,158),(2,159),(2,160),(2,161); +/*!40000 ALTER TABLE `m_role_permission` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_saving_account` +-- + +DROP TABLE IF EXISTS `m_saving_account`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_saving_account` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `is_deleted` tinyint(1) NOT NULL DEFAULT '0', + `status_enum` smallint(5) NOT NULL DEFAULT '0', + `external_id` varchar(100) DEFAULT NULL, + `client_id` bigint(20) NOT NULL, + `product_id` bigint(20) NOT NULL, + `deposit_amount_per_period` decimal(19,6) NOT NULL, + `savings_product_type` smallint(5) DEFAULT NULL, + `currency_code` varchar(3) NOT NULL, + `currency_digits` smallint(5) NOT NULL, + `total_deposit_amount` decimal(19,6) NOT NULL, + `reccuring_nominal_interest_rate` decimal(19,6) NOT NULL, + `regular_saving_nominal_interest_rate` decimal(19,6) NOT NULL, + `tenure` int(11) NOT NULL, + `tenure_type` smallint(5) DEFAULT NULL, + `frequency` int(11) DEFAULT NULL, + `interest_type` smallint(5) DEFAULT NULL, + `interest_calculation_method` smallint(5) DEFAULT NULL, + `projected_commencement_date` date NOT NULL, + `actual_commencement_date` date DEFAULT NULL, + `matures_on_date` datetime DEFAULT NULL, + `projected_interest_accrued_on_maturity` decimal(19,6) NOT NULL, + `actual_interest_accrued` decimal(19,6) DEFAULT NULL, + `projected_total_maturity_amount` decimal(19,6) NOT NULL, + `actual_total_amount` decimal(19,6) DEFAULT NULL, + `is_preclosure_allowed` tinyint(1) NOT NULL DEFAULT '0', + `pre_closure_interest_rate` decimal(19,6) NOT NULL, + `is_lock_in_period_allowed` tinyint(1) NOT NULL DEFAULT '0', + `lock_in_period` bigint(20) DEFAULT NULL, + `lock_in_period_type` smallint(5) NOT NULL DEFAULT '1', + `withdrawnon_date` datetime DEFAULT NULL, + `rejectedon_date` datetime DEFAULT NULL, + `closedon_date` datetime DEFAULT 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`), + UNIQUE KEY `deposit_acc_external_id` (`external_id`), + KEY `FKSA0000000000001` (`client_id`), + KEY `FKSA0000000000002` (`product_id`), + 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; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_saving_account` +-- + +LOCK TABLES `m_saving_account` WRITE; +/*!40000 ALTER TABLE `m_saving_account` DISABLE KEYS */; +/*!40000 ALTER TABLE `m_saving_account` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `m_staff` +-- + +DROP TABLE IF EXISTS `m_staff`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `m_staff` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `is_loan_officer` tinyint(1) NOT NULL DEFAULT '0', + `office_id` bigint(20) DEFAULT NULL, + `firstname` varchar(50) DEFAULT NULL, + `lastname` varchar(50) DEFAULT NULL, + `display_name` varchar(100) NOT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `display_name` (`display_name`), + KEY `FK_m_staff_m_office` (`office_id`), + CONSTRAINT `FK_m_staff_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `m_staff` +-- + +LOCK TABLES `m_staff` WRITE; +/*!40000 ALTER TABLE `m_staff` DISABLE KEYS */; +INSERT INTO `m_staff` VALUES (8,0,1,'Phyllis','Palomo','Palomo, Phyllis',1,'2012-11-25 21:29:46',1,'2012-11-25 21:29:46'),(9,0,2,'Cher','Corry','Corry, Cher',1,'2012-11-25 21:30:21',1,'2012-11-25 21:30:21'),(10,0,2,'Yong','Yarber','Yarber, Yong',1,'2012-11-25 21:31:06',1,'2012-11-25 21:31:06'),(11,1,2,'Jeanie','Jeppesen','Jeppesen, Jeanie',1,'2012-11-25 21:31:25',1,'2012-11-25 21:31:25'),(12,1,2,'Glendora','Geib','Geib, Glendora',1,'2012-11-25 21:31:42',1,'2012-11-25 21:31:42'),(13,0,4,'Taunya','Tomko','Tomko, Taunya',1,'2012-11-25 21:37:39',1,'2012-11-25 21:37:39'),(14,0,4,'Roselee','Ritzman','Ritzman, Roselee',1,'2012-11-25 21:38:06',1,'2012-11-25 21:38:06'),(15,1,4,'Emelia','Ehmann','Ehmann, Emelia',1,'2012-11-25 21:38:32',1,'2012-11-25 21:38:32'),(16,1,4,'Greg','Gilkey','Gilkey, Greg',1,'2012-11-25 21:38:52',1,'2012-11-25 21:38:52'),(17,0,5,'Elke','Epperson','Epperson, Elke',1,'2012-11-25 21:39:35',1,'2012-11-25 21:39:35'),(18,1,6,'Marilu','Mayhan','Mayhan, Marilu',1,'2012-11-25 21:39:53',1,'2012-11-25 21:39:53'),(19,1,6,'Zane','Zamudio','Zamudio, Zane',1,'2012-11-25 21:40:11',1,'2012-11-25 21:40:11'),(20,0,7,'Marcellus','Minyard','Minyard, Marcellus',1,'2012-11-25 21:41:17',1,'2012-11-25 21:41:17'),(21,1,8,'Leslie','Lanphere','Lanphere, Leslie',1,'2012-11-25 21:42:14',1,'2012-11-25 21:42:14'),(22,1,8,'Laverne','Lofland','Lofland, Laverne',1,'2012-11-25 21:42:55',1,'2012-11-25 21:42:55'),(23,0,9,'Carrie','Coldiron','Coldiron, Carrie',1,'2012-11-25 21:43:14',1,'2012-11-25 21:43:14'),(24,1,10,'Bettina','Boshears','Boshears, Bettina',1,'2012-11-25 21:44:04',1,'2012-11-25 21:44:04'),(25,0,13,'Charolette','Coberly','Coberly, Charolette',1,'2012-11-25 21:45:48',1,'2012-11-25 21:45:48'),(26,1,14,'Felipe','Fike','Fike, Felipe',1,'2012-11-25 21:46:03',1,'2012-11-25 21:46:03'),(27,1,14,'Vergie','Valenzuela','Valenzuela, Vergie',1,'2012-11-25 21:46:30',1,'2012-11-25 21:46:30'),(28,0,11,'Evelyn','Eastep','Eastep, Evelyn',1,'2012-11-25 21:47:14',1,'2012-11-25 21:47:14'),(29,1,12,'Jodie','Jaworski','Jaworski, Jodie',1,'2012-11-25 21:47:31',1,'2012-11-25 21:47:31'),(30,1,12,'Delana','Desilva','Desilva, Delana',1,'2012-11-25 21:47:45',1,'2012-11-25 21:47:45'); +/*!40000 ALTER TABLE `m_staff` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `r_enum_value` +-- + +DROP TABLE IF EXISTS `r_enum_value`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `r_enum_value` ( + `enum_name` varchar(100) NOT NULL, + `enum_id` int(11) NOT NULL, + `enum_message_property` varchar(100) NOT NULL, + `enum_value` varchar(100) NOT NULL, + PRIMARY KEY (`enum_name`,`enum_id`), + UNIQUE KEY `enum_message_property` (`enum_name`,`enum_message_property`), + UNIQUE KEY `enum_value` (`enum_name`,`enum_value`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `r_enum_value` +-- + +LOCK TABLES `r_enum_value` WRITE; +/*!40000 ALTER TABLE `r_enum_value` DISABLE KEYS */; +INSERT INTO `r_enum_value` VALUES ('loan_status_id',100,'Submitted and awaiting approval','Submitted and awaiting approval'),('loan_status_id',200,'Approved','Approved'),('loan_status_id',300,'Active','Active'),('loan_status_id',400,'Withdrawn by client','Withdrawn by client'),('loan_status_id',500,'Rejected','Rejected'),('loan_status_id',600,'Closed','Closed'),('loan_status_id',700,'Overpaid','Overpaid'),('loan_transaction_strategy_id',1,'mifos-standard-strategy','Mifos style'),('loan_transaction_strategy_id',2,'heavensfamily-strategy','Heavensfamily'),('loan_transaction_strategy_id',3,'creocore-strategy','Creocore'),('loan_transaction_strategy_id',4,'rbi-india-strategy','RBI (India)'); +/*!40000 ALTER TABLE `r_enum_value` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `ref_loan_transaction_processing_strategy` +-- + +DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ref_loan_transaction_processing_strategy` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `code` varchar(100) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `createdby_id` bigint(20) DEFAULT NULL, + `created_date` datetime DEFAULT NULL, + `lastmodifiedby_id` bigint(20) DEFAULT NULL, + `lastmodified_date` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `ltp_strategy_code` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ref_loan_transaction_processing_strategy` +-- + +LOCK TABLES `ref_loan_transaction_processing_strategy` WRITE; +/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` DISABLE KEYS */; +INSERT INTO `ref_loan_transaction_processing_strategy` VALUES (1,'mifos-standard-strategy','Mifos style',NULL,NULL,NULL,NULL),(2,'heavensfamily-strategy','Heavensfamily',NULL,NULL,NULL,NULL),(3,'creocore-strategy','Creocore',NULL,NULL,NULL,NULL),(4,'rbi-india-strategy','RBI (India)',NULL,NULL,NULL,NULL); +/*!40000 ALTER TABLE `ref_loan_transaction_processing_strategy` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rpt_sequence` +-- + +DROP TABLE IF EXISTS `rpt_sequence`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rpt_sequence` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rpt_sequence` +-- + +LOCK TABLES `rpt_sequence` WRITE; +/*!40000 ALTER TABLE `rpt_sequence` DISABLE KEYS */; +/*!40000 ALTER TABLE `rpt_sequence` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `stretchy_parameter` +-- + +DROP TABLE IF EXISTS `stretchy_parameter`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `stretchy_parameter` ( + `parameter_id` int(11) NOT NULL AUTO_INCREMENT, + `parameter_name` varchar(45) NOT NULL, + `parameter_variable` varchar(45) DEFAULT NULL, + `parameter_label` varchar(45) NOT NULL, + `parameter_displayType` varchar(45) NOT NULL, + `parameter_FormatType` varchar(10) NOT NULL, + `parameter_default` varchar(45) NOT NULL, + `special` varchar(1) DEFAULT NULL, + `selectOne` varchar(1) DEFAULT NULL, + `selectAll` varchar(1) DEFAULT NULL, + `parameter_sql` text, + PRIMARY KEY (`parameter_id`), + UNIQUE KEY `name_UNIQUE` (`parameter_name`) +) ENGINE=InnoDB AUTO_INCREMENT=83 DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `stretchy_parameter` +-- + +LOCK TABLES `stretchy_parameter` WRITE; +/*!40000 ALTER TABLE `stretchy_parameter` DISABLE KEYS */; +INSERT INTO `stretchy_parameter` VALUES (3,'FullReportList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select r.report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\r rp.parameter_id, rp.report_parameter_name, p.parameter_name\r from stretchy_report r\r left join stretchy_report_parameter rp on rp.report_id = r.report_id\r left join stretchy_parameter p on p.parameter_id = rp.parameter_id\r where r.use_report is true\r and exists\r (\r select \'f\'\r from m_appuser_role ur \r join m_role r on r.id = ur.role_id\r join m_role_permission rp on rp.role_id = r.id\r join m_permission p on p.id = rp.permission_id\r where ur.appuser_id = ${currentUserId}\r and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name))\r )\r order by r.report_name, rp.parameter_id'),(4,'FullParameterList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select parameter_name, parameter_variable, parameter_label, parameter_displayType, parameter_FormatType, parameter_default, selectOne, selectAll\r\nfrom stretchy_parameter p\r\nwhere special is null\r\norder by parameter_id'),(5,'selectOfficeId','officeId','Office','select','number','0',NULL,'Y',NULL,'select id, \r\nconcat(substring(\"........................................\", 1, \r\n ((LENGTH(`hierarchy`) - LENGTH(REPLACE(`hierarchy`, \'.\', \'\')) - 1) * 4)), \r\n `name`) as tc\r\nfrom m_office\r\nwhere hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\norder by hierarchy'),(6,'currencyIdSelectAll','currencyId','Currency','select','number','0',NULL,'Y','Y','select `code`, `name`\r\nfrom m_organisation_currency\r\norder by `code`'),(7,'currencyIdSelectOne','currencyId','Currency','select','number','0',NULL,'Y',NULL,'select `code`, `name`\r\nfrom m_organisation_currency\r\norder by `code`'),(10,'fundIdSelectAll','fundId','Fund','select','number','0',NULL,'Y','Y','(select id, `name`\r\nfrom m_fund\r\norder by `name`)\r\nunion all\r\n(select -10, \'-\')'),(80,'selectStartDate','startDate','startDate','date','date','today',NULL,NULL,NULL,NULL),(81,'selectEndDate','endDate','endDate','date','date','today',NULL,NULL,NULL,NULL),(82,'reportCategoryList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select r.report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\r rp.parameter_id, rp.report_parameter_name, p.parameter_name\r from stretchy_report r\r left join stretchy_report_parameter rp on rp.report_id = r.report_id\r left join stretchy_parameter p on p.parameter_id = rp.parameter_id\r where r.report_category = \'${reportCategory}\'\r and r.use_report is true\r and exists\r (\r select \'f\'\r from m_appuser_role ur \r join m_role r on r.id = ur.role_id\r join m_role_permission rp on rp.role_id = r.id\r join m_permission p on p.id = rp.permission_id\r where ur.appuser_id = ${currentUserId}\r and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name))\r )\r order by r.report_name, rp.parameter_id'); +/*!40000 ALTER TABLE `stretchy_parameter` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `stretchy_report` +-- + +DROP TABLE IF EXISTS `stretchy_report`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `stretchy_report` ( + `report_id` int(11) NOT NULL AUTO_INCREMENT, + `report_name` varchar(100) NOT NULL, + `report_type` varchar(20) NOT NULL, + `report_subtype` varchar(20) DEFAULT NULL, + `report_category` varchar(45) DEFAULT NULL, + `report_sql` text, + `description` text, + `core_report` tinyint(1) DEFAULT '0', + `use_report` tinyint(1) DEFAULT '0', + PRIMARY KEY (`report_id`), + UNIQUE KEY `report_name_UNIQUE` (`report_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `stretchy_report` +-- + +LOCK TABLES `stretchy_report` WRITE; +/*!40000 ALTER TABLE `stretchy_report` DISABLE KEYS */; +/*!40000 ALTER TABLE `stretchy_report` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `stretchy_report_parameter` +-- + +DROP TABLE IF EXISTS `stretchy_report_parameter`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `stretchy_report_parameter` ( + `report_id` int(11) NOT NULL, + `parameter_id` int(11) NOT NULL, + `report_parameter_name` varchar(45) DEFAULT NULL, + PRIMARY KEY (`report_id`,`parameter_id`), + UNIQUE KEY `report_id_name_UNIQUE` (`report_id`,`report_parameter_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `stretchy_report_parameter` +-- + +LOCK TABLES `stretchy_report_parameter` WRITE; +/*!40000 ALTER TABLE `stretchy_report_parameter` DISABLE KEYS */; +/*!40000 ALTER TABLE `stretchy_report_parameter` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `x_registered_table` +-- + +DROP TABLE IF EXISTS `x_registered_table`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `x_registered_table` ( + `registered_table_name` varchar(50) NOT NULL, + `application_table_name` varchar(50) NOT NULL, + PRIMARY KEY (`registered_table_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `x_registered_table` +-- + +LOCK TABLES `x_registered_table` WRITE; +/*!40000 ALTER TABLE `x_registered_table` DISABLE KEYS */; +INSERT INTO `x_registered_table` VALUES ('m_guarantor_external','m_loan'); +/*!40000 ALTER TABLE `x_registered_table` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2012-11-26 0:32:38 diff --git a/mifosng-db/patches/patch-01-allow-null-arrears-in-tolerance.sql b/mifosng-db/patches/patch-01-allow-null-arrears-in-tolerance.sql new file mode 100644 index 000000000..5590f3b5b --- /dev/null +++ b/mifosng-db/patches/patch-01-allow-null-arrears-in-tolerance.sql @@ -0,0 +1 @@ +ALTER TABLE `m_loan` CHANGE COLUMN `arrearstolerance_amount` `arrearstolerance_amount` DECIMAL(19,6) NULL; \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/ClientData.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/data/ClientData.java index d58835ba7..dcd1e2935 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/data/ClientData.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/data/ClientData.java @@ -54,7 +54,7 @@ final public class ClientData { } final String displayName = buildDisplayNameFrom(firstnameValue, lastnameValue); - return new ClientData(officeId, null, id, firstname, lastname, displayName, externalId, joiningDate, null, null, null, null); + return new ClientData(officeId, null, id, firstnameValue, lastnameValue, displayName, externalId, joiningDate, null, null, null, null); } public static ClientData integrateChanges(final ClientData clientData, ClientData currentChange, final Collection allChanges) { diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/PortfolioApiDataConversionServiceImpl.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/PortfolioApiDataConversionServiceImpl.java index 85f3a868b..6dd458781 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/PortfolioApiDataConversionServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/PortfolioApiDataConversionServiceImpl.java @@ -388,8 +388,8 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo if (externalIdParamName.equalsIgnoreCase(parameter)) { final String baseExternalId = helper.extractStringNamed(externalIdParamName, baseElement, ignoreParameters); final String workingExternalId = helper.extractStringNamed(externalIdParamName, workingElement, ignoreParameters); - if (!baseExternalId.equals(workingExternalId)) { - externalId = workingExternalId; + if (differenceExists(baseExternalId, workingExternalId)) { + firstname = workingExternalId; parametersPassedInRequest.add(externalIdParamName); } } @@ -398,7 +398,7 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo if (firstnameParamName.equalsIgnoreCase(parameter)) { final String baseValue = helper.extractStringNamed(firstnameParamName, baseElement, ignoreParameters); final String workingCopyValue = helper.extractStringNamed(firstnameParamName, workingElement, ignoreParameters); - if (!baseValue.equals(workingCopyValue)) { + if (differenceExists(baseValue, workingCopyValue)) { firstname = workingCopyValue; parametersPassedInRequest.add(firstnameParamName); } @@ -408,7 +408,7 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo if (lastnameParamName.equalsIgnoreCase(parameter)) { final String baseValue = helper.extractStringNamed(lastnameParamName, baseElement, ignoreParameters); final String workingCopyValue = helper.extractStringNamed(lastnameParamName, workingElement, ignoreParameters); - if (!baseValue.equals(workingCopyValue)) { + if (differenceExists(baseValue, workingCopyValue)) { lastname = workingCopyValue; parametersPassedInRequest.add(lastnameParamName); } @@ -418,7 +418,7 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo if (clientOrBusinessNameParamName.equalsIgnoreCase(parameter)) { final String baseValue = helper.extractStringNamed(clientOrBusinessNameParamName, baseElement, ignoreParameters); final String workingCopyValue = helper.extractStringNamed(clientOrBusinessNameParamName, workingElement, ignoreParameters); - if (!baseValue.equals(workingCopyValue)) { + if (differenceExists(baseValue, workingCopyValue)) { clientOrBusinessName = workingCopyValue; parametersPassedInRequest.add(clientOrBusinessNameParamName); } @@ -429,7 +429,7 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo final LocalDate baseValue = helper.extractLocalDateAsArrayNamed(joinedDateParamName, baseElement, ignoreParameters); final LocalDate workingCopyValue = helper.extractLocalDateAsArrayNamed(joinedDateParamName, workingElement, ignoreParameters); - if (!baseValue.isEqual(workingCopyValue)) { + if (differenceExists(baseValue, workingCopyValue)) { joiningDate = workingCopyValue; parametersPassedInRequest.add(joinedDateParamName); } @@ -440,6 +440,30 @@ public class PortfolioApiDataConversionServiceImpl implements PortfolioApiDataCo officeId, joiningDate, false); } + private boolean differenceExists(LocalDate baseValue, LocalDate workingCopyValue) { + boolean differenceExists = false; + + if (baseValue != null) { + differenceExists = !baseValue.equals(workingCopyValue); + } else { + differenceExists = workingCopyValue != null; + } + + return differenceExists; + } + + private boolean differenceExists(final String baseValue, final String workingCopyValue) { + boolean differenceExists = false; + + if (StringUtils.isNotBlank(baseValue)) { + differenceExists = !baseValue.equals(workingCopyValue); + } else { + differenceExists = StringUtils.isNotBlank(workingCopyValue); + } + + return differenceExists; + } + @Override public ClientCommand convertApiRequestJsonToClientCommand(final Long resourceIdentifier, final String json) { if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }