Compare commits

...
500 Commits
Author SHA1 Message Date
John Woodlock 1f7cd4d293 update api-docs (mostly reports tempplate) 2013-04-29 10:22:46 +01:00
Michael Vorburger a7556b17d8 Added *~ to .gitignore, for temporary files created e.g. by gedit 2013-04-28 23:01:55 +02:00
Michael Vorburger 9220129142 replaced non UTF-8 apostrophe to avoid 'error: unmappable character for encoding UTF8' on Linux 2013-04-28 22:56:54 +02:00
John Woodlock 09bddb7bf7 wip mifosx-195 add list of parameters to reports template 2013-04-28 03:05:14 +01:00
John Woodlock a3a40f5a45 fixed mifosx-304 deleting loan product charges not working 2013-04-26 17:29:40 +01:00
Keith Woodlock 44cef96643 MIFOSX-246: support for withdrawal fees on savings accounts. 2013-04-26 10:13:39 +01:00
John Woodlock 51d63b6db7 rename migration v25 file properly 2013-04-24 20:56:45 +01:00
John Woodlock c742ca0519 fix mifosx-303 2013-04-24 19:17:21 +01:00
ashok-conflux f93cf1b620 fixed MIFOSX-301 to select a valid disbursement date 2013-04-24 09:10:20 +05:30
Keith Woodlock 46c5565fb9 MIFOSX-250: interest posting/crediting added. 2013-04-23 11:52:45 +01:00
ashok-conflux db35e26d0a Fixed MIFOSX-301, modified validation conditions for calendar fields and loan disbursement date 2013-04-23 13:48:19 +05:30
Keith Woodlock a46c9be5b8 Update README.md 2013-04-22 12:57:49 +02:00
Keith Woodlock 52ceaf9f98 update notes on 0.12.0.beta release 2013-04-22 12:56:58 +02:00
Keith Woodlock 1ee775998d update release for master branch. 2013-04-22 11:45:39 +01:00
ashok-conflux 1068fe5870 added foreign key contraint for group and client in loan table 2013-04-22 12:41:45 +05:30
Keith Woodlock fe5c68d1e4 Update README.md 2013-04-22 01:26:14 +02:00
Keith Woodlock 14306f44a7 Update for 0.12.0.beta release 2013-04-22 01:24:53 +02:00
Keith Woodlock ea0ee84967 MIFOSX-213: center, group and clients api for activating entity to move from pending to active status. 2013-04-21 23:57:10 +01:00
ashok-conflux 500767a400 wip: added client loan in group context 2013-04-19 23:38:31 +05:30
Keith Woodlock 4b43b09651 MIFOSX-262: slight changes to anuruddha's commit to use joda date classes over java.util. 2013-04-19 17:16:53 +01:00
Anuruddha Premalal 2762463311 perform client activation date validation with office activation date
before creation.
2013-04-19 20:47:24 +05:30
Keith Woodlock dff53b9318 remove usage lookup data objects, formating of report java code, update api docs for center, groups. 2013-04-19 13:27:27 +01:00
Keith Woodlock 604f07f13e MIFOSX-213: wip statuses on center and group data and remove is_deleted from client. 2013-04-19 00:43:36 +01:00
John Woodlock a6dcba11cf wip mifosx-195 maintenance changes 2013-04-18 19:41:33 +01:00
Keith Woodlock 0e54ca5fa2 MIFOSX-213: wip add status to centers and groups, tidy up CRUD on each and update api docs. 2013-04-18 15:18:25 +01:00
John Woodlock 53b5e3c7be wip mifosx-195 maintainance and validation fixes 2013-04-18 14:49:14 +01:00
Keith Woodlock abc6e5a42a Merge branch 'master' of github.com:openMF/mifosx 2013-04-18 13:11:11 +01:00
Gurpreet LuthraandKeith Woodlock c3b91d84f0 Added Jenkins Cloudbees build status image on github readme. Had to enable Embeddable Build Status plugin in Jenkins. 2013-04-18 13:09:38 +01:00
Keith Woodlock fec8d16e6d Added Jenkins Cloudbees build status image on github readme. Had to enable Embeddable Build Status plugin in Jenkins. 2013-04-18 13:01:05 +01:00
John Woodlock a7c72a89b0 wip mifosx-195 add report template ability 2013-04-17 17:19:53 +01:00
Keith Woodlock 9a8476b6cd Merge remote-tracking branch 'ashok/MIFOSX-282' 2013-04-17 15:38:54 +01:00
ashok-conflux a7c5c5ae67 updated interestRateFrequencyType in API doc 2013-04-17 19:44:47 +05:30
ashok-conflux 8f18f847f5 wip: fixed issues in Group add/edit and add client functionality 2013-04-17 19:18:01 +05:30
Keith Woodlock f212b78b99 fix integrationt tests due to api changes to clients api. 2013-04-17 13:16:54 +01:00
Keith Woodlock 1180200ca3 MIFOSX-213: support pending, active, closed status for clients. 2013-04-17 13:05:24 +01:00
John Woodlock 3001cc3582 wip mifosx-195 add/remove READ_{reportName} permissions when add/remove non-core reports 2013-04-17 12:23:55 +01:00
Keith Woodlock e5b0c31200 Update README.md 2013-04-17 09:56:01 +02:00
Keith Woodlock ae4d669434 Update README.md 2013-04-17 09:54:57 +02:00
Keith Woodlock 3f9c47821e Update CHANGELOG.md 2013-04-17 01:27:14 +02:00
Keith Woodlock b9994713fc update latest release 2013-04-17 01:25:15 +02:00
Keith Woodlock cd082fc2af MIFOSX-299: correct permissions on document management java services. 2013-04-17 00:22:16 +01:00
Priti-BiyaniandKeith Woodlock 0f6079b8e9 Squash commits around integration tests into one. 2013-04-16 22:58:17 +01:00
John Woodlock 06cd8cd940 wip mifosx-195 reports UI 2013-04-16 17:59:44 +01:00
ashok-conflux a6e655761f wip: group and center API changes 2013-04-16 20:28:05 +05:30
John Woodlock 436f77c3a8 wip mifosx-195 runreports api now used for running reports instead of reports - updated in api-docs along with report maintenance apis 2013-04-16 12:22:25 +01:00
John Woodlock 97d7104c93 WIP mifosx-195 read report api (has conflict 2013-04-16 03:22:37 +01:00
John Woodlock c4ba4c54ca WIP mifosx-195 create/update validation down to domain level from json checks + put report CRUD into config bucket 2013-04-16 02:25:46 +01:00
John Woodlock cd81798270 WIP mifosx-195 maintenance apis 2013-04-15 17:36:26 +01:00
Keith Woodlock 38b1d10f62 update V17 patch which cause funny foreign key contraint on existing production dbs. 2013-04-15 13:24:31 +01:00
ashok-confluxandKeith Woodlock 4b80393d4a removed interestRatePeriodType from Json parameters validation 2013-04-15 13:24:31 +01:00
John Woodlock b71e659420 WIP mifosx-195 more maintenance work plus fix reportId, parameterId in list reports api 2013-04-15 13:02:52 +01:00
John Woodlock b41661cca4 wip mifosx-195 - report class 2013-04-15 02:39:02 +01:00
John Woodlock 4104150bd1 wip mifosx-195 - updated report related ddl and data 2013-04-15 02:26:02 +01:00
Keith Woodlock 654b31f75e MIFOSX-290: update api docs and refactor READ side of center, group underneath api. 2013-04-14 13:13:02 +01:00
John Woodlock e777491d76 wip mifosx-195 refactor list reports api for maintenance function use and change api-docs 2013-04-13 19:33:43 +01:00
Keith Woodlock 9cc6abd6c4 Merge remote-tracking branch 'ashok/MIFOSX-282' 2013-04-13 18:37:33 +01:00
ashok-conflux 72bcb78b09 remove interestRateFrequencyType from supported parameters 2013-04-13 22:38:02 +05:30
Vishwas Babu AJ 8e99a2ef36 payment for disbursal 2013-04-13 21:12:05 +05:30
ashok-conflux debce5655f MIFOSX-282: remove min and max fields from loan table 2013-04-13 18:08:51 +05:30
Vishwas Babu AJ 45bf43de5e updates for payment details 2013-04-12 20:40:42 +05:30
ashok-conflux 850981d4a9 wip:fixing collection sheet bugs 2013-04-12 17:20:04 +05:30
Keith Woodlock 6274217e9d Update README.md 2013-04-11 00:47:57 +02:00
Keith Woodlock 3014fbccd5 update release version 2013-04-10 23:42:44 +01:00
Keith Woodlock 232ccdf715 Update CHANGELOG.md 2013-04-11 00:38:58 +02:00
Keith Woodlock 33c7e9f7d5 fix merge conflict form cherry pick of 974e45c7875f2b08f4d25a35ac79c25b51a0b1ea 2013-04-10 23:36:47 +01:00
Keith Woodlock b7f72b2943 MIFOSX-292: ensure correct decimal places value for currency is returned. 2013-04-10 23:26:00 +01:00
Keith Woodlock dbed6037f3 move migration file into coredb folder. 2013-04-10 18:01:25 +01:00
Nayan Ambali efe0379258 Groups api for centers/groups 2013-04-10 16:30:10 +05:30
Nayan Ambali 9ee3280b7a WIP: Group center 2013-04-10 16:26:45 +05:30
John Woodlock a8c10facd9 change status_id to status_enum 2013-04-10 11:22:11 +01:00
John Woodlock fdc0767f7f add client and group status fields 2013-04-10 10:48:17 +01:00
Vishwas Babu AJ e15a72eab1 wip: repayment/disbursal apis support optional payment details 2013-04-09 17:00:25 +05:30
John Woodlock c2a462aede api docs update 2013-04-09 11:34:17 +01:00
Keith Woodlock e97695c2c9 file path support for local development that should work on jenkins. 2013-04-09 11:23:59 +01:00
Priti 59dec0097a Khushal/Sailee: Changed the path of migration folder in flyway related task in build.gradle so that they run on Jenkins 2013-04-08 14:56:35 +05:30
Keith Woodlock 14aa62073e MIFOSX-250: wip on interest compounding and posting 2013-04-06 11:41:14 +01:00
Keith Woodlock 8730976f99 Update README.md 2013-04-06 12:01:51 +02:00
Keith Woodlock cd744d9f2d Update CHANGELOG.md 2013-04-06 11:54:14 +02:00
Keith Woodlock 7174b82f9d Update CHANGELOG.md 2013-04-06 11:53:26 +02:00
Keith Woodlock f2ce84db46 update to build snapshot version again. 2013-04-05 22:42:44 +01:00
Keith Woodlock ec87116ddf Update CHANGELOG.md 2013-04-05 23:37:55 +02:00
Keith Woodlock 3d9c949f6a update minor release for bug fixes. 2013-04-05 22:34:52 +01:00
Keith Woodlock 87ee45a592 remove unused import warnings. 2013-04-05 22:31:07 +01:00
Keith Woodlock 9011f5568c Due to SPR-10395 - revert back to hibernate 4.1.9 from hibernate 4.2 as causes issues with persistence for datatables. 2013-04-05 22:22:40 +01:00
Keith Woodlock e0b856ba69 MIFOSX-291: fix creation of office. problem with jpa nullable=false being wrong. 2013-04-05 22:16:06 +01:00
Keith Woodlock 4df690b501 Update CHANGELOG.md 2013-04-05 23:00:21 +02:00
Keith Woodlock 20f010cbc3 bump up version of database patch. 2013-04-05 21:32:58 +01:00
ashok-conflux 2446a0f05e MIFOSX-282:added min and max constraints for Interest rate and number of repayments 2013-04-05 20:24:40 +05:30
Keith Woodlock c28ad6b18c move release property back to build snapshot 2013-04-05 13:45:23 +01:00
Keith Woodlock cdef41924b update to release 0.11.0.beta 2013-04-05 13:01:01 +01:00
Keith Woodlock 7b422c956c update ceda customisations. 2013-04-05 12:45:25 +01:00
Keith Woodlock 409c48dd78 remove legacy permissions 2013-04-05 12:25:07 +01:00
Keith Woodlock 694658daa8 Merge remote-tracking branch 'tw_priti/API_Documentation' 2013-04-05 11:37:35 +01:00
Keith Woodlock 7dfcb76e4b Merge remote-tracking branch 'vishwas/mifosx-283' 2013-04-05 10:57:14 +01:00
Vishwas Babu AJ d458f90c3d upper case in read query was causing errors on Ubuntu demo server (due to mysql case sensitivity issues on unix) 2013-04-05 14:49:13 +05:30
John Woodlock d98360dd39 mifosx-270 api docs audit/makerchecker/permissions + wip mifosx-97 make functionality match api docs 2013-04-05 02:09:04 +01:00
John Woodlock 0ade90b70c wip mifosx-97 allow 'id' criteria for audit and makerchecker search + wip mifosx-270 audit/makerchecker api docs 2013-04-04 18:57:03 +01:00
Keith Woodlock da12288024 add sensible defaults to db wrapper tasks. 2013-04-04 12:30:48 +01:00
Priti 8aacc1bb53 Full api matrix updated for write off 2013-04-04 16:56:11 +05:30
Keith Woodlock af79fd0790 Merge remote-tracking branch 'khusha/FlywayWrapperTasksForDBMigration' 2013-04-04 12:13:11 +01:00
Priti 8b135f769a API Doc file updated
1. WriteOff Loan documentation added
2. UndoApproval : command correction and request body added
2013-04-04 16:17:14 +05:30
Khushal Oza 4bda6f3d43 Added seperate gradle tasks for migrating a list DB and a tenant DB. No need to now pass a folder name. Discussed with Vishwas, and modified the war task to pick up the migration files from the appropriate folder... core_db folder. 2013-04-04 16:14:20 +05:30
sailee 3e1ef6dafd [Sailee/Priti]:
Modified LoanProductTestBuilder in Integration tests to support minPrincipal and maxPrincipal fields for LoanProduct
2013-04-04 14:59:01 +05:30
Khushal Oza 8956ef35a3 [Khushal/Priti] Modified build.gradle to have tasks for migrating both types of DB. Added migrateDB and showDBInfo with params as DB name. They wrap over flyway so that one can pass DB name as param. Also seperated the migration folder into list_db and core_db so that migrations for tenant list and core tenent db can be placed in different folders. 2013-04-04 12:21:18 +05:30
John Woodlock 9652844889 wip mifosx-270 audit/makerchecker api docs + minor doc changes 2013-04-04 01:42:43 +01:00
John Woodlock 81233724a2 Merge pull request #212 from vishwasbabu/mifosx-11
handling rename of TenantUpgradeService to TenantDatabaseUpgradeService
2013-04-03 12:02:50 -07:00
Vishwas Babu AJ 371973466d handling rename of TenantDatabaseUpgradeService 2013-04-04 00:11:09 +05:30
John Woodlock 98faa19b8e wip mifosx-97 only see maker check data that user is allowed to approve 2013-04-03 19:39:28 +01:00
Keith Woodlock 1666b2b452 minor changes to vishwass pull request.2 2013-04-03 18:12:52 +01:00
Vishwas Babu AJ 2ae603dcc2 minor additions to Flyway support...ability to optionally upgrade databases on application startup 2013-04-03 21:56:08 +05:30
John Woodlock af8219de29 rename add_min_max sql to have 2 underscores for flyway naming std 2013-04-03 15:52:19 +01:00
Keith Woodlock 08542b9034 bump up migration script by one version, support clean integrationTest tasks in gradle. 2013-04-03 15:27:28 +01:00
ashok-conflux f077733cfb WIP: add min and max constraint to Principal amount 2013-04-03 19:37:00 +05:30
sailee 979308e41c [Sailee/Gurpreet]: Added SSL support for Integration Test 2013-04-03 18:41:42 +05:30
John Woodlock 12f799fe6b wip mifosx-97 refactor audit/makerchecker datascoping for non-headoffice user 2013-04-03 03:12:12 +01:00
Keith Woodlock 8e274b2d4a recent upgrade of hibernate seems to check JPA annotations more rigidly. fix incorrect nullable=false 2013-04-03 01:59:59 +01:00
Keith Woodlock 4f4fb982e5 update junit and hamcrest dependencies, use non-dreprecated junit Assert class, add better error failure messages when tests cannot connect to server or https as not being disabled. 2013-04-03 01:53:56 +01:00
Keith Woodlock c32ba579cd update dependences. do gradle clean cleanEclipse eclipse 2013-04-03 00:33:15 +01:00
John Woodlock a9eb946ecd mifosx-97 still refactoring audit/makerchecker bits 2013-04-02 18:49:58 +01:00
Keith Woodlock ec810d9485 MIFOSX-250: interest calculation change for compounding with api docs updates. 2013-04-02 17:12:03 +01:00
Keith Woodlock 41b31ded07 remove warnings on unchecked types and unused imports. Add IntegrationTest to end of test name. 2013-04-02 15:16:47 +01:00
Keith Woodlock 1a5ef94def Merge remote-tracking branch 'tw_priti/IT_With_Waive_Interest' 2013-04-02 15:01:30 +01:00
ashok-conflux 18d02396b6 MIFOSX-289 - update Search api doc 2013-04-02 19:11:18 +05:30
Priti 7f90f0861c Merge branch 'master' into IT_With_Waive_Interest
Merging branch master into this branch to stay current with the codebase before sending pull request
2013-04-02 17:33:18 +05:30
Priti 0dab99ecdb Renamed File 2013-04-02 17:26:55 +05:30
Priti 571174e10d 'out/' added to gitignore 2013-04-02 17:12:46 +05:30
Priti a9a190827e ClientBuilder renamed as ClientHalper 2013-04-02 17:09:30 +05:30
Priti a70712d8fc Refactoring 2013-04-02 17:09:07 +05:30
Priti be32e0b7eb [Priti/Sailee] Refactoring 2013-04-02 16:34:00 +05:30
Priti a66ef5cfbf 1. LoanTranscations Moved out and created seperate Helper file for this
2. Client related activities are moved to ClientBuilder
3. Utils Will Have server Post/Get calls
[Priti/Sailee]
2013-04-02 16:31:21 +05:30
Priti f6fbbbb7d2 [Priti/Sailee] Created ClientBuilder 2013-04-02 16:27:59 +05:30
Keith Woodlock e13daf0d29 update ignoring of .ini files. 2013-04-02 11:08:22 +01:00
Keith Woodlock 4e4b2138d4 delete desktop.ini pentaho file. 2013-04-02 11:07:20 +01:00
Vishwas Babu A J 6c46026b5a Merge pull request #205 from vishwasbabu/mifosx-277
updating charges and loan charges documentation
2013-04-01 21:53:23 -07:00
Vishwas Babu AJ ccedf5bfdc updating charges and loan charges documentation 2013-04-02 10:19:46 +05:30
John Woodlock d0576c4488 wip mifosx-97 refactor audits and makercheckers under commands package 2013-04-02 02:26:29 +01:00
John Woodlock 596bc82bbe wip mifosx-97 refactor endpoints to audits/makercheckers from audit/commands 2013-04-02 02:09:52 +01:00
John Woodlock 7cf6c20b38 wip mifosx-97 refactor audit/makerchecker functions 2013-04-02 01:51:58 +01:00
Keith Woodlock f0b526aa53 add self signed certificate keystore and point to it from gradle build for local development. 2013-04-02 01:45:48 +01:00
Keith Woodlock 110d183176 update DDL and patches files and move to migrations folder usage now. 2013-04-02 00:21:43 +01:00
Keith Woodlock c45b41e21a update core files to be update to latest patches, gradle flywayclean flywaymigrate will drop and create database to latest schema - need to all agree where we start from when using migrations approach. 2013-04-02 00:08:39 +01:00
Keith Woodlock 8465664f89 Merge remote-tracking branch 'ashok/MIFOSX-278' 2013-04-01 20:54:28 +01:00
Priti 513f6f2764 Refactoring 2013-04-01 19:32:57 +05:30
Priti 3924fafe88 Renaming 2013-04-01 17:08:24 +05:30
ashok-conflux 4b53161ac4 Fixed MIFOSX-278 and MIFOSX-280 2013-04-01 17:06:09 +05:30
Priti 49eb712a5d Conflicts Resolved 2013-04-01 16:51:20 +05:30
Priti f08da673f2 [Priti/Sailee] Renamed package as common 2013-04-01 16:47:24 +05:30
Priti 419f127cd8 [Priti/Sailee] Refactoring
1. Created common package
2. Moved test files to IntegrationTest
3. Moved all helpers to Common package
2013-04-01 16:46:14 +05:30
Khushal Oza 5c73a46f2a Khushal/Gurpreet: Added task in gradle for creating and droping database- createDatabase and dropDatabase 2013-04-01 16:00:25 +05:30
Priti 23ed73316d Refactoring 2013-04-01 12:15:24 +05:30
Priti d58fa92f3e common jsonCreator moved to Utils 2013-04-01 12:15:24 +05:30
Priti 4a2f7a0597 LoanStatusChecker added which checks the loan status 2013-04-01 12:15:24 +05:30
Priti e555666ac2 Builder for LoanApplication Added 2013-04-01 12:15:24 +05:30
Priti 02a3934e9f 1.Integration Test : LoanWithWaiveInterest added
2. LoanProduct Builder created
3. RandomGenerator methods moved to Util file
2013-04-01 12:15:24 +05:30
Vishwas Babu A J 56829c2036 Merge pull request #202 from vishwasbabu/mifosx-277
fix for loan officer assignment mifosx-260
2013-03-31 04:30:35 -07:00
Vishwas Babu AJ 98472b3e59 fix for loan officer assignment mifosx-260 2013-03-31 16:53:43 +05:30
Vishwas Babu A J 860caa76a0 Merge pull request #201 from vishwasbabu/mifosx-277
adding overflow and fixed height for api-docs flybar
2013-03-31 03:38:54 -07:00
Vishwas Babu AJ d7c2af3538 adding overflow and fixed height for api-docs flybar 2013-03-31 16:06:30 +05:30
Vishwas Babu A J c7c02448e5 Merge pull request #200 from vishwasbabu/mifosx-277
api documentation for loan collaterals
2013-03-30 12:15:14 -07:00
Vishwas Babu AJ d39047e36e api documentation for loan collaterals 2013-03-31 00:44:05 +05:30
Priti 5d4bbf191e Refactoring 2013-03-30 11:08:16 +05:30
Priti ed95612b3f common jsonCreator moved to Utils 2013-03-30 11:07:58 +05:30
Priti 3471475c94 LoanStatusChecker added which checks the loan status 2013-03-30 11:07:21 +05:30
Priti b4edfc4c34 Builder for LoanApplication Added 2013-03-30 11:06:02 +05:30
John Woodlock 0637fb2697 wip mifosx-97 refactor audit/makerchecker for re-use 2013-03-29 23:48:43 +00:00
Vishwas Babu AJ 4883ce1b63 adding relationship for guarantor + adding wrappers 2013-03-30 03:53:27 +05:30
Keith Woodlock aa6dbd6fd4 Merge remote-tracking branch 'khusha/flyway_support' 2013-03-29 17:01:16 +00:00
Khushal Oza 239933fe91 Added support for DB Migration using flybase migration plugin. It reads the schema sql files from mifosng-db/migrations folder. Runs the files in sequence by reading V1, V2, etc so on. 2013-03-29 18:00:19 +05:30
Khushal Oza da6ff46f4c Removed the DBHelper class. We dont need it now. Will be upgrading the DB from gradle using the flyway plugin 2013-03-29 17:55:49 +05:30
Khushal Oza 3b041ab507 Removed call to DB helper. We will instead perform migration from Command line or Gradle 2013-03-29 16:41:58 +05:30
Khushal Oza f6bcd1fb8a Merge branch 'flyway_support' of github.com:khushaloza/mifosx into flyway_support
* 'flyway_support' of github.com:khushaloza/mifosx:
  Khushal/Gurpreet: Added support for Flyway DB migration tool into MifosX. Added a call for it in TomatJDBCDataSourcePerTenantService so that it gets called per tenant once.
2013-03-29 16:39:15 +05:30
Khushal Oza ee5ffbc883 removing the call to DB helper, since we want to do migration by command/gradle instead of automatically thru server 2013-03-29 16:37:54 +05:30
Khushal Oza 72eb99432a Khushal/Gurpreet: Added support for Flyway DB migration tool into MifosX. Added a call for it in TomatJDBCDataSourcePerTenantService so that it gets called per tenant once. 2013-03-29 16:33:41 +05:30
Keith Woodlock 3df312a871 Merge remote-tracking branch 'nayan/MIFOSX-269' 2013-03-29 10:49:51 +00:00
Khushal Oza ddc2a6e852 Khushal/Gurpreet: Added support for Flyway DB migration tool into MifosX. Added a call for it in TomatJDBCDataSourcePerTenantService so that it gets called per tenant once. 2013-03-29 15:41:39 +05:30
Vishwas Babu A J ff9dc97316 Merge pull request #197 from vishwasbabu/mifosx-229
sql errors faced by thoughtworks folks (able to replicate only on window...
2013-03-29 03:05:32 -07:00
Vishwas Babu AJ 3635ed411a sql errors faced by thoughtworks folks (able to replicate only on windows box) 2013-03-29 15:32:47 +05:30
Nayan Ambali 030f379307 Bulk JLG loans 2013-03-29 11:25:34 +05:30
Nayan Ambali 364941ca76 support jlg loans 2013-03-29 11:25:31 +05:30
John Woodlock 2662b692bf add audit 'id' field to api get 2013-03-28 21:52:09 +00:00
Priti c362e0f19a 1.Integration Test : LoanWithWaiveInterest added
2. LoanProduct Builder created
3. RandomGenerator methods moved to Util file
2013-03-28 21:57:28 +05:30
John Woodlock e37f3cebfa mifosx-196 - added pentaho report to git directory after testing 2013-03-28 16:21:43 +00:00
Vishwas Babu A J e44d7e2c2e Merge pull request #195 from vishwasbabu/mifosx-228
Update loan code to handle Collateral Value
2013-03-28 01:49:38 -07:00
Vishwas Babu AJ 06a59b95f2 Update loan code to handle Collateral Value 2013-03-28 14:18:02 +05:30
Vishwas Babu A J 310a9e248e Merge pull request #194 from vishwasbabu/mifosx-228
cleaning up collateral api's
2013-03-27 21:19:02 -07:00
Vishwas Babu AJ c0464a571b cleaning up collateral api's 2013-03-28 09:44:42 +05:30
Keith Woodlock 3711c5cfd8 MIFOSX-201: formatting tweaks. 2013-03-28 00:38:28 +00:00
Keith Woodlock 715bc2cf17 MIFOSX-250: add support for daily balance and average daily balance methods. support for daily,weekly,monthly interest periods. 2013-03-27 23:45:43 +00:00
ashok-conflux ca038a8ebf bug fix: MIFOSX-201 and MIFOSX-202 2013-03-27 19:31:20 +05:30
ashok-conflux c77f3e15f1 Collection sheet UI and bulk update 2013-03-27 16:30:45 +05:30
Vishwas Babu AJ 69d228a502 wip: Loan Collateral 2013-03-27 03:42:21 +05:30
John Woodlock b8e4cf3dc9 mifosx-275 datatables - support ids on audit for loans/savings that are group related 2013-03-26 13:57:01 +00:00
John Woodlock 2d405a14ab mifosx-276 Support audit 'ids' when in maker-checker mode 2013-03-26 11:31:58 +00:00
John Woodlock f579054c33 rename audit savings field to savings_account_id 2013-03-26 00:38:18 +00:00
John Woodlock bf680a2dad mifosx-274 add account_savings_id to audit table 2013-03-26 00:33:00 +00:00
John Woodlock 82f97875a7 mifosx-274 add id fields for datatables (to audit log) 2013-03-26 00:32:59 +00:00
Keith Woodlock d4a5b55e71 Merge remote-tracking branch 'vishwas/mifosx-228' 2013-03-25 20:33:53 +00:00
Vishwas Babu AJ 17ad0984c0 updating fee_charges_charged and fee_charges_repaid to include charges due at disbursal 2013-03-26 01:24:41 +05:30
Keith Woodlock e5a0b8b2cf Merge remote-tracking branch 'vishwas/mifosx-228' 2013-03-25 18:51:01 +00:00
Vishwas Babu AJ ef223b346c fix for Repayment schedule not showing charges due at disbursement 2013-03-26 00:12:42 +05:30
Keith Woodlock be86537124 update DDL for missing savings_id column and dumps. 2013-03-25 18:18:11 +00:00
Keith Woodlock a38c1a69a0 udpate DDL and latest schema dumps to latest patch. 2013-03-25 17:48:08 +00:00
Keith Woodlock 63eba40115 MIFOSX-247: add basic lifecycle state to savings account and support some constrains around deposits and withdrawals. 2013-03-25 17:39:01 +00:00
John Woodlock 3e36a8a3cb mifosx-273 savings datatable ability 2013-03-25 16:06:51 +00:00
John Woodlock f2e4df94b8 error msg when commandId not found for maker-checker approvals 2013-03-24 17:00:43 +00:00
Vishwas Babu A J 0032939e9a Merge pull request #188 from vishwasbabu/master
updating demo server
2013-03-24 07:29:25 -07:00
Vishwas Babu AJ d0e19c440e updating demo server 2013-03-24 19:57:33 +05:30
Vishwas Babu A J e67da73ebc Merge pull request #187 from vishwasbabu/mifosx-183
bug fixes for accrual based accounting
2013-03-24 06:43:08 -07:00
Vishwas Babu AJ 28d66e39ec adding Lifecycle event called Interest Applied 2013-03-24 19:05:32 +05:30
Vishwas Babu AJ 29c071d763 bug fixes for accrual based accounting 2013-03-23 16:52:18 +05:30
John Woodlock b0fca8c44d fixed mifox-271 locale & dateFormat added to changes list for datatable updates 2013-03-22 15:07:04 +00:00
Keith Woodlock d34e1a01c8 update datatables for default demo schema. 2013-03-22 12:38:58 +00:00
Keith Woodlock ac2f5d60df Merge remote-tracking branch 'vishwas/mifosx-255' 2013-03-22 11:43:39 +00:00
Keith Woodlock ec6f5539b5 Merge remote-tracking branch 'tw_saileeb/Integration-Tests' 2013-03-22 11:19:45 +00:00
Keith Woodlock 31bb3b3e28 update latest DDL, reference data and schema dump to latest patches. 2013-03-22 10:19:02 +00:00
sailee c9223cd485 First cut Integration Test using REST-Assured. Also modifed .gitignore for Mac. 2013-03-22 14:58:19 +05:30
Vishwas Babu AJ bb5e9598ea bug fixes for accounting 2013-03-22 11:53:11 +05:30
Keith Woodlock 345d4e2811 MIFOSX-247: ensure summary and transactions shown as part of retrieve savings account. 2013-03-22 01:25:10 +00:00
Keith Woodlock 59ec8a5669 MIFOSX-247: update api document for savings account transactions api. 2013-03-22 01:14:10 +00:00
Keith Woodlock 1b4403e767 MIFOSX-247: basic savings functions for deposit and withdrawal. 2013-03-22 00:42:01 +00:00
Keith Woodlock 2374bf9402 Merge remote-tracking branch 'vishwas/mifosx-255' 2013-03-22 00:28:48 +00:00
John Woodlock b94dc4ebe2 remove apptableId and datatableId from audit & maker-checker processing (refactored to not need them) 2013-03-21 23:48:05 +00:00
John Woodlock ea9e24a270 fixed mifosx-268 one to many datatable update and deletes fail maker checker approve... plus minor other changes 2013-03-21 22:20:32 +00:00
Vishwas Babu AJ 58d5acda0a fix for bug in accounting 2013-03-22 01:13:51 +05:30
Vishwas Babu AJ d24dc10818 fixing validation on loan repayment to allow reversal from API 2013-03-21 20:41:25 +05:30
Keith Woodlock 32b2ed91b4 Merge remote-tracking branch 'vishwas/mifosx-255' 2013-03-21 12:29:47 +00:00
Vishwas Babu AJ 8300127522 tracebility for loan transaction updates 2013-03-21 17:25:38 +05:30
ashok-conflux 577b32fd22 Minor changes in Calendare read queries 2013-03-21 15:17:47 +05:30
Vishwas Babu AJ d811304841 wip:improving tracebililty for loan transaction updates 2013-03-21 02:03:38 +05:30
Keith Woodlock 043e8dc4fd Merge remote-tracking branch 'ashok/MIFOSX-256' 2013-03-20 17:28:36 +00:00
John Woodlock ceb193af37 fixed mifosx-266 default all permissions to not be maker-checkerable 2013-03-20 15:59:02 +00:00
ashok-conflux eec727db5b MIFOSX-256: Added calendar meeting date validation for expected disbursment date and first repayment date 2013-03-20 21:03:38 +05:30
Keith Woodlock 7ae32b346d fix datatables on maker checker 2013-03-20 14:35:32 +00:00
Keith Woodlock 13723f5e80 Merge remote-tracking branch 'sander/MIFOSX-230-2' 2013-03-20 14:34:01 +00:00
Sander van der Heyden 44aa60d237 MIFOSX-230-2: Extended documents functionality to groups entity and added to documentation 2013-03-20 15:27:00 +01:00
Nayan Ambali 587c03a277 get parent groups details along with client data 2013-03-20 19:45:26 +05:30
Keith Woodlock 324ae9acd9 update core DDL and default schema dumps to latest patch-3 on savings changes to date. 2013-03-20 12:00:30 +00:00
Keith Woodlock 3e8d9f1c13 MIFOSX-258: return roles of authenticated user in response of authentication api. 2013-03-20 01:13:34 +00:00
Keith Woodlock 2c8efb4977 MIFOSX-245: add basic shell for savings products and accounts. 2013-03-20 00:35:56 +00:00
Keith Woodlock eb7d616834 Merge remote-tracking branch 'ashok/MIFOSX-256' 2013-03-19 17:20:23 +00:00
Keith Woodlock cce49b634f Merge remote-tracking branch 'vishwas/mifosx-251' 2013-03-19 17:19:41 +00:00
ashok-conflux 473b579df3 wip:MIFOSX-256 - attaching calendar to loan 2013-03-19 20:51:38 +05:30
Vishwas Babu AJ 5145b242ae documentation stub for entity documents and code values 2013-03-19 20:09:01 +05:30
Nayan Ambali a5b52492d5 group collection sheet apis 2013-03-19 19:44:49 +05:30
Sander van der Heyden cb8b8e72d1 MIFOSX-230-1: Extended datatables functionality to Groups and Offices 2013-03-19 12:08:48 +01:00
Vishwas Babu A J d7496593c1 Merge pull request #172 from vishwasbabu/mifosx-251
restarting numbering sequence for patches
2013-03-18 21:40:34 -07:00
Vishwas Babu AJ f01e7e80c4 restarting numbering sequence for patches 2013-03-19 10:09:08 +05:30
Vishwas Babu AJ c85e10cfab minor changes to client images and updates to documentation 2013-03-19 01:36:46 +05:30
Keith Woodlock d1896d43b1 Merge remote-tracking branch 'ashok/MIFOSX-244' 2013-03-18 11:03:26 +00:00
Keith Woodlock 198ec85d1b Merge remote-tracking branch 'vishwas/mifosx-240' 2013-03-18 10:58:58 +00:00
ashok-conflux 4caa564c4e MIFOSX-244: Added recurring rule to calendar and added calendar to Groups 2013-03-18 16:10:35 +05:30
John Woodlock c5e40ab744 alter default jdbc setting until mifosx-254 addressed 2013-03-17 20:13:35 +00:00
Vishwas Babu AJ b7e1ff3fa8 wip: refactored accounting and added charge applied event 2013-03-17 21:25:09 +05:30
Nayan Ambali 759b832360 added grouping heirarchy sorted 2013-03-17 15:22:42 +05:30
Keith Woodlock f111f16660 Merge remote-tracking branch 'vishwas/mifosx-240' 2013-03-16 17:26:13 +00:00
John Woodlock d1ca092405 only look at active (or before) status for repayments on branch expected cash flow 2013-03-16 16:58:56 +00:00
John Woodlock ea78f7b126 add expect payments by date pentaho rpt to core reports script + other minor changes 2013-03-16 15:28:58 +00:00
Vishwas Babu AJ a65c15a09b minor clean up 2013-03-16 19:58:14 +05:30
John Woodlock ed323c00a3 mifosx-209 datatables tie-in with maker-checker process - WIP create data table entry change 2013-03-15 22:54:31 +00:00
John Woodlock e581be40be add read permissions for core reports into core reports script 2013-03-15 21:59:00 +00:00
John Woodlock b9a6e3f410 use jdbctemplate batchupdate in datatables where > 1 update in a db transaction 2013-03-15 21:32:01 +00:00
Nayan Ambali 0db309d692 Update GroupWritePlatformServiceJpaRepositoryImpl.java 2013-03-15 18:41:53 +05:30
Nayan Ambali f28e8a0533 after unassign parent group update heirarchy 2013-03-15 18:27:54 +05:30
Keith Woodlock 11bd10ddeb Merge remote-tracking branch 'vishwas/mifosx-240' 2013-03-15 12:39:23 +00:00
Vishwas Babu AJ f0bcbc2fc9 updating demo server 2013-03-15 18:00:36 +05:30
ashok-conflux f5463ebb97 wip:MIFOSX-244 Adding Calendar RecurringRule 2013-03-15 17:50:34 +05:30
Keith Woodlock 26f8fd3a4c Merge remote-tracking branch 'nayan/workspace' 2013-03-15 10:35:47 +00:00
Nayan Ambali 903a958783 review comments incorporated 2013-03-15 15:32:02 +05:30
Vishwas Babu AJ 50b9839024 wip:minor changes to charges 2013-03-15 13:19:00 +05:30
John Woodlock fe426352ff fix mifosx-194 (updated core reportswith cascade details and added expected payments screen report from mifosx-196 2013-03-14 19:44:00 +00:00
John Woodlock bfe3b18837 WIP mifosx-194 cascading report UI params 2013-03-14 13:06:34 +00:00
Nayan Ambali 772fe35a36 incorp review comments 2013-03-14 11:43:20 +05:30
Nayan Ambali 5a48f88586 Incorp review comments 2013-03-13 22:02:48 +05:30
Keith Woodlock 5ca8d6801d MIFOSX-237: ensure big decimal entries are compared correctly and only transactions with changes are audited. 2013-03-13 01:49:28 +00:00
John Woodlock 509daca905 fixed mifosx-236 make account report support multi-tenancy 2013-03-12 22:27:40 +00:00
Nayan Ambali 52642045a2 GroupUpdate api:in response send list of clients changed, using Guava symmetricDifference 2013-03-12 22:45:59 +05:30
John Woodlock f98b78a180 put pentaho properties in pentahoReports folder and increase jdbc pooled connections temporarily to allow pentaho reports to run without timeouts 2013-03-12 16:33:14 +00:00
Keith Woodlock 8ad52ca3a4 MIFOSX-239: update dist task to bundle pentaho reports inside pentahoReports directory in zip disbribution. 2013-03-12 13:45:45 +00:00
Keith Woodlock 3c49134c17 update default demo dumps to have accounting pentaho reports enabled by default. 2013-03-12 13:19:02 +00:00
Keith Woodlock 55f828c0b9 MIFOSX-239: add in accounting reports and properties from vishwases repository. 2013-03-12 12:39:52 +00:00
Keith Woodlock 6aebffcfeb add deploy pentaho reports task so gradle tomcatrunwar will deploy multi-tenant supported reports into proper directory by default for development. 2013-03-12 12:10:42 +00:00
John Woodlock d8dd0ac13e add pentahoReports folder and report to test gradle putting pentaho reports under mifosx/pentahoReports 2013-03-12 11:26:23 +00:00
Vishwas Babu A J 513cfeae77 Merge pull request #159 from vishwasbabu/master
Deleting file with wrong case
2013-03-11 23:07:59 -07:00
Vishwas Babu AJ f90bf403cf renaming file 2013-03-12 11:35:46 +05:30
Vishwas Babu A J 5717240ccf Merge pull request #158 from vishwasbabu/mifosx-240
resolving compilation issues due to git case insensitivity
2013-03-11 23:02:08 -07:00
Vishwas Babu AJ f3e686406d resolving compilation issues due to git case insensitivity 2013-03-12 11:28:44 +05:30
Keith Woodlock 84747cb109 MIFOSX-237: api doc changes and ensure error handling supported is added back in for datatables api. 2013-03-11 19:42:44 +00:00
John Woodlock b3c77fe045 patch contained creocore database name - removed 2013-03-11 16:00:10 +00:00
Keith Woodlock be011529de MIFOSX-237: use of jdbcTemplate and SqlRowSet along with refactoring as a result of these changes. 2013-03-11 13:54:57 +00:00
ashok-conflux d310d4df3c MIFOSX-162 - Fixed date validation 2013-03-11 16:52:39 +05:30
Keith Woodlock cf81fe92b1 Merge remote-tracking branch 'nayan/MIFOSX-186' 2013-03-10 22:53:37 +00:00
John Woodlock 99ae901cc2 add userhierarchy parameter for pentaho reprots and change pentaho directory location 2013-03-10 22:20:45 +00:00
John Woodlock 485182db45 fixed mifosx-166 multi-tenant pentaho reports 2013-03-10 20:38:53 +00:00
Nayan Ambali 84b4811e61 code restructuring 2013-03-10 16:27:40 +05:30
John Woodlock b975da0d45 temp pentaho parameter added 2013-03-09 15:28:31 +00:00
Keith Woodlock b407f282d0 update dependencies and build script. 2013-03-09 13:31:37 +00:00
Keith Woodlock 458d2a303c update api docs and comments on joda usuage in loan officer history. 2013-03-08 16:51:25 +00:00
Keith Woodlock 7ad92a0330 MIFOSX-232: align loan account api data with loan product data. 2013-03-08 14:11:48 +00:00
ashok-conflux e3f03f1de3 updated loan officer unassign date validation error message 2013-03-08 18:46:36 +05:30
ashok-conflux 47c8daf0df Modified NoteResourceNotSupportedException class name 2013-03-08 16:32:16 +05:30
ashok-conflux 6593faca64 MIFOSX-162 - Added Loan office assignment date validations 2013-03-08 16:26:52 +05:30
ashok-conflux 34e2bb3c4d Updated Notes in API doc 2013-03-07 22:11:06 +05:30
Keith Woodlock 80c3850e00 update latest ddl and reference data for patches 19 and 20. 2013-03-07 14:08:15 +00:00
Keith Woodlock 76d2dd6209 MIFOSX-232: WIP - split out terms and settings related fields on loan product along with charges and accounting related inputs. 2013-03-07 13:35:52 +00:00
John Woodlock 619ec9e8cc all Long data type for pentaho reports to cater for database ids 2013-03-07 11:43:36 +00:00
Vishwas Babu AJ 856f406e31 Bug fixes for accrual based accounting 2013-03-07 15:37:39 +05:30
Madhukar 2b784cc0f9 Throwing valid exceptions for deposit account 2013-03-07 11:27:26 +05:30
Keith Woodlock 66232baa01 update patch numbers and remove some unused code(non note related). 2013-03-06 17:55:34 +00:00
ashok-conflux a497aeec55 Implemented Notes API 2013-03-06 22:28:59 +05:30
Vishwas Babu AJandKeith Woodlock 155339342a fix for disbursal reversal handling in cash based accounting 2013-03-06 13:55:09 +00:00
John Woodlock 0fdfdd314e core report updated 2013-03-06 13:26:53 +00:00
Nayan Ambali 63da11993d Add client within a group, add new group within a parent group 2013-03-06 17:32:43 +05:30
Keith Woodlock fed9f6dc68 MIFOSX-175: Fix issue with one-to-one mapping for arrears on loan. 2013-03-06 11:29:52 +00:00
Vishwas Babu AJ 3850f22140 wip:initial work for accrual accounting and refactoring 2013-03-06 15:13:27 +05:30
Madhukar f846286858 Throwing account specific exceptions for saving product 2013-03-06 12:24:54 +05:30
Keith Woodlock da7caddd46 Fix up issue with fee charges not been summed up correctly for preview loan schedule. 2013-03-05 17:13:56 +00:00
John Woodlock e251633960 wip core reports update with loan derived fields 2013-03-04 23:21:19 +00:00
John Woodlock c04b9a3444 wip update core reports to use derived loan fields 2013-03-04 22:56:33 +00:00
Keith Woodlock bf6d06e5ce Update api docs. 2013-03-04 17:02:00 +00:00
Keith Woodlock 9ec9a0080e update DDL and demo dumps based on patch 18. 2013-03-04 16:23:55 +00:00
Keith Woodlock 2d7bd6f171 MIFOSX-175: make relationship to arrears aging summary table optional. 2013-03-04 15:35:41 +00:00
Keith Woodlock 0bca626252 update patch to change order of min, max, deafult fields on schema. 2013-03-04 14:44:28 +00:00
Keith Woodlock 0959a22ea8 update patch. 2013-03-04 14:41:49 +00:00
Keith Woodlock 23ab5f430d Merge remote-tracking branch 'madhukar/MIFOSX-222' 2013-03-04 14:24:46 +00:00
Keith Woodlock 8d4aa69302 MIFOSX-175: break out overdue fields into one-to-one table with shared primary key. 2013-03-04 13:48:47 +00:00
John Woodlock e491859cf5 rename ddl related to mifosx-175 loan derived fields to have order of running 2013-03-04 13:39:17 +00:00
John Woodlock 6eafd7298f fix for insert error on base-reference-data 2013-03-04 13:27:37 +00:00
John Woodlock b6c09cab38 patches and updates related to mifosx-175 Loan Derived Fields 2013-03-04 13:22:11 +00:00
Madhukar 0e13d4982e renaming deposit product fields
adding default amount column for deposit product
2013-03-04 17:46:18 +05:30
Keith Woodlock d81316541d MIFOSX-224: remove unused savings related code and format code whislt reviewing existing savings implementation. 2013-03-03 22:17:09 +00:00
Keith Woodlock ecd9135965 update DDL and base reference data with patches 16 and 17. 2013-03-03 02:27:25 +00:00
Keith Woodlock fa9f40d3a2 Merge remote-tracking branch 'ashok/globalsearch' 2013-03-02 23:41:20 +00:00
Keith Woodlock f80c1dd5f2 update default charset to UTF-8 2013-03-02 23:33:11 +00:00
ashok-conflux 3636ea7fcf Included ClientIdentifiers in global search scope 2013-03-02 16:55:58 +05:30
ashok-conflux 1945109647 Implemented basic Calendar services, GET, POST and PUT 2013-03-01 22:05:23 +05:30
Keith Woodlock d90a07ba6c MIFOSX-175: move derived fields into loan summary object (but still part of loan table for now. 2013-02-28 17:25:45 +00:00
Keith Woodlock e6434aac8b add 2013 roadmap 2013-02-27 23:40:43 +00:00
Keith Woodlock 57c3b58f95 update DDL and demo dumps to patch-15 2013-02-27 23:39:29 +00:00
Keith Woodlock fd9954a977 formatting 2013-02-27 15:53:23 +00:00
Nayan Ambali 6e60f5baf8 fix: get group summary details 2013-02-27 19:24:52 +05:30
Madhukar d322e70649 Handle exception for retrieving non existed resource for deposit product 2013-02-27 12:16:12 +05:30
Keith Woodlock 998c9bb3b2 MIFOSX-175: WIP - adding loan summary fields to loan table and resultant refactor of loan schedule and loan summary retrieval code. 2013-02-27 01:31:18 +00:00
Nayan Ambali 0bfaf2cbaf adding group summary details 2013-02-27 00:49:31 +05:30
ashok-conflux fdfaab1038 basic global search implementation 2013-02-26 17:31:18 +05:30
Madhukar eb09a39a8e FIXING RETRIEVAL OF DELETED DEPOSIT PRODUCT
Remove per row audit for deposit product
2013-02-26 12:20:28 +05:30
John Woodlock e08b0044da fix prob with linefeeds on csv export & allow reports to have normal json output 2013-02-25 17:19:00 +00:00
Keith Woodlock 40f991c467 update core DDL and demo dumps with latest patch. 2013-02-25 11:04:13 +00:00
Keith Woodlock 0cb9ab3c56 MIFOSX-172: finish off update to api-docs around loans, loan transactions and loan charges apis. 2013-02-24 23:47:24 +00:00
Nayan Ambali bddfa98c4a added Staff details to GET /groups api 2013-02-24 23:51:27 +05:30
Vishwas Babu AJ 328f294e1a fixing minor issues detected while testing cash based accounting 2013-02-24 14:28:16 +05:30
Madhukar 040c33d608 Fixing validations for update deposit products 2013-02-23 12:19:15 +05:30
Keith Woodlock 9f9378376b formatting. 2013-02-22 15:18:54 +00:00
Keith Woodlock 634a66cbe9 MIFOSX-172: WIP - update api docs on loan application workflow api. 2013-02-22 14:30:47 +00:00
Madhukar 29360a8fd6 Saving product Audit conversion
Saving Account Audit Conversion
2013-02-22 19:44:30 +05:30
John Woodlock 5e69f4a558 fixed mifosx-192 & altered base reference DDL 2013-02-22 12:20:44 +00:00
Keith Woodlock 1effc7bbe4 Merge remote-tracking branch 'nayan/MIFOSX-164' 2013-02-21 13:52:41 +00:00
John Woodlock 726c1caac0 WIP core reports 2013-02-21 13:28:22 +00:00
Nayan Ambali 03c369b6d5 Mifos parity features centers/groups 2013-02-21 18:54:27 +05:30
Keith Woodlock a94dcb6f50 update DDL and reference data files and also demo dumps with latest schema and core reports work. 2013-02-21 01:59:27 +00:00
Keith Woodlock fd2515c1ff remove warnings. 2013-02-20 20:00:33 +00:00
Nayan Ambali 3b636fcc2e Updated template and add group apis 2013-02-21 00:11:05 +05:30
Vishwas Babu AJ 22e1bef324 minor update to journal entries 2013-02-20 20:25:02 +05:30
John Woodlock bb7662b995 WIP core reports + r_enum_value update 2013-02-20 13:09:10 +00:00
Keith Woodlock 7743563597 MIFOSX-172: WIP - update validation and api around loan charges. 2013-02-20 12:18:33 +00:00
Nayan AmbaliandKeith Woodlock 9cc9706df1 Update mifosng-db/patches/11-ddl_group_level_table.sql 2013-02-20 10:36:24 +00:00
John Woodlock cad20ff7b5 WIP core reports 2013-02-20 10:15:16 +00:00
John Woodlock 2d9a42e04a wip core reports 2013-02-19 23:47:14 +00:00
John Woodlock c13632c47c core reports - remainder of loan_purpose param & do loans awaiting approval / disbursal reports 2013-02-19 16:07:57 +00:00
Nayan Ambali 77a44f7b19 DDL for GROUP_LEVEL table and modifications to GROUP table 2013-02-19 21:04:07 +05:30
Nayan Ambali 8822ecea50 New api to get contextMenus list for creating groups at different levels 2013-02-19 20:37:31 +05:30
Keith Woodlock 524206f0ff MIFOSX-172: WIP support loan writeoff, closure scenarios with accounting. 2013-02-19 12:59:51 +00:00
Keith Woodlock 87eb0a6fe8 mifosx-172: wip - support adjust transaction for accounting. 2013-02-19 00:45:33 +00:00
Keith Woodlock bb63d2cb2d MIFOSX-172: wip - support for loan disbursal and undo with reversing transactions. 2013-02-18 15:32:56 +00:00
Vishwas Babu AJ 4030608442 code cleanup and renaming entry date in journal entries 2013-02-18 20:32:07 +05:30
Keith Woodlock bf2bdde478 code formatting. 2013-02-18 11:27:35 +00:00
Keith Woodlock e20869ad9b remove warnings for unused code, formating in savings area. 2013-02-18 10:55:55 +00:00
Keith Woodlock cc27eccd79 Merge remote-tracking branch 'madhukar/MIFOSX-144-Final' 2013-02-18 09:57:22 +00:00
Vishwas Babu AJ 8975d1ff58 wip: updates to accounting documentation 2013-02-18 14:44:39 +05:30
Madhukar 7a2f3d10a2 Change the savings and deposits responses to string
Deposit Product audit conversion

Deposit Account Audit Conversion
2013-02-18 14:26:37 +05:30
Keith Woodlock abf075a0c0 Merge remote-tracking branch 'vishwasbabu/mifosx-161' 2013-02-17 12:00:25 +00:00
Vishwas Babu AJ 7941b0dcf3 wip: adding audit for accounting 2013-02-16 20:55:58 +05:30
Nayan Ambali 8e02d51b14 Added assign/unassign loanofficerto group and update api docs 2013-02-16 18:28:03 +05:30
Keith Woodlock 16ae622590 WIP: change to approach for undo disbursal to just reverse transactions rather than clear them down. Doing this leads to observation that need to change the way we are supported reversing or contra entries in the portfolio area for loan transactions. 2013-02-15 17:42:17 +00:00
Keith Woodlock 24a5012852 Update README.md 2013-02-15 11:17:41 +00:00
Keith Woodlock b50f463677 Update README.md 2013-02-15 11:14:43 +00:00
Keith Woodlock 4f285063b0 Merge pull request #123 from gsluthra/TravisCI-setup
Added travis ci configuration file
2013-02-15 03:07:42 -08:00
Gurpreet Luthra 05ab9dc233 Added travis ci configuration file, and a shell script that would be executed by travis ci to run the tests 2013-02-15 16:29:03 +05:30
John Woodlock ffed686144 WIP core reports 2013-02-15 01:01:27 +00:00
Keith Woodlock 949fa8b24f upate default demo ddl. 2013-02-15 00:01:52 +00:00
Keith Woodlock 8cb35fdb26 update ddl and demo schema files. 2013-02-14 23:47:50 +00:00
Keith Woodlock 285594e125 support for tracking what user took action on loan and being able to provide that data as part of api. 2013-02-14 23:13:38 +00:00
Nayan Ambali 0ec56c32f8 Added option for group to have loan officer assigned 2013-02-14 20:17:13 +05:30
John Woodlock d6431bffc1 save core reports WIP 2013-02-14 14:37:00 +00:00
Keith Woodlock ea854b8754 tidy up unneeded pass back of permissions with loan account data. 2013-02-13 21:05:32 +00:00
Keith Woodlock 20cb05c708 Update README.md 2013-02-13 16:44:23 +00:00
Keith Woodlock e54ca69ce7 Update README.md 2013-02-13 16:40:53 +00:00
Keith Woodlock a1e1491167 Update README.md 2013-02-13 16:38:40 +00:00
Keith Woodlock 6b593abd2b Update README.md 2013-02-13 16:38:27 +00:00
Keith Woodlock 13cf9e98a2 Update CHANGELOG.md 2013-02-13 16:18:59 +00:00
Keith Woodlock e42453f276 Update CHANGELOG.md 2013-02-13 16:18:28 +00:00
Keith Woodlock 37ed43588e add content on versioning approach. 2013-02-13 16:04:47 +00:00
John Woodlock 1ac850157a Add WIP copy of core reports 2013-02-13 15:47:06 +00:00
Keith Woodlock 720a8dc83d add changelog 2013-02-13 15:44:48 +00:00
Keith Woodlock dd6fcb6309 code contributors file. 2013-02-13 15:40:31 +00:00
Keith Woodlock cee0601edc add license to webapp folder which is missed by default setup of gradle license plugin. 2013-02-13 15:05:22 +00:00
Keith Woodlock a13a313718 update files with MPL v2 using gradle plugin. 2013-02-13 14:59:10 +00:00
Keith Woodlock 63cddd9e23 add license plugin. 2013-02-13 14:53:02 +00:00
Keith Woodlock 3c6f5bb526 add MPL v2 license to test push to new repository. 2013-02-13 14:28:49 +00:00
Keith Woodlock 28e1548475 WIP: submit and modify loan application. support for loan purpose, loan collateral, loan fees. Restrict modification of loan application details to be only allowed in 'submitted and pending approval' state which is first improved required to reach loan and cash based accounting integration. 2013-02-13 14:06:55 +00:00
Vishwas Babu AJ c66a7515aa wip: documentation stubs prior to refactoring 2013-02-13 03:09:34 +05:30
Keith Woodlock 3850cd9fb9 tidy up some bits around deposit products for example going forward. 2013-02-11 19:48:45 +00:00
Madhukar 835b034926 Deposit documentation fixes from pull#111 2013-02-11 21:37:15 +05:30
ashok-conflux 91a3249c09 MIFOSX-36 - Added validation for Integer parameters 2013-02-11 12:52:29 +05:30
Keith Woodlock 061872e4e6 Merge remote-tracking branch 'vishwasbabu/mifosx-151' 2013-02-10 20:34:53 +00:00
Keith Woodlock cb8bc87bf7 update patch on tenants 2013-02-10 20:29:01 +00:00
Vishwas Babu AJ 86dd2bc9c3 wip: Refactoring and Documentation 2013-02-11 01:48:36 +05:30
Keith Woodlock 9a33ca6fb6 Merge remote-tracking branch 'nayan/unassignlo' 2013-02-10 20:04:30 +00:00
Nayan Ambali e91c821d1c Added business rules validatation for unassign loan officer 2013-02-10 22:25:57 +05:30
ashok-conflux 70185e086e MIFOSX-36 - Add/Edit Code values 2013-02-10 16:19:00 +05:30
John Woodlock 169c1ce178 another update to cover not properly formatted (utf8) report metadata 2013-02-09 16:52:14 +00:00
Vishwas Babu AJ 8776d1e13a This is a combination of 2 commits.
Addressing review comments for Loan-Accounting bridge
2013-02-08 15:47:51 +05:30
Keith Woodlock b84abcee2e update demo ddls with latest patches for permissions. 2013-02-07 15:23:24 +00:00
Keith Woodlock 5f7a2f9f3a Merge remote-tracking branch 'ashok/MIFOSX-36' 2013-02-07 13:56:08 +00:00
Keith Woodlock 9cb3ce56f9 update base reference data with update and remove loan officer permissions and also add in _CHECKER permission 2013-02-07 13:07:27 +00:00
ashok-conflux 0ef0478d22 WIP Code Value MIFOSX-36 (database changes) 2013-02-07 17:19:28 +05:30
ashok-conflux 7839ec825a WIP CodeValue MIFOSX-36 2013-02-07 16:56:09 +05:30
Nayan Ambali b7fef480d5 Adding unique constraint on Loan Product name 2013-02-07 15:28:21 +05:30
Keith Woodlock 22698f09df support fees on specified dates for FLAT interest type loans and loan schedules. 2013-02-07 01:01:44 +00:00
Keith Woodlock 059c2d4529 update ceda schema with changes to datables from feedback with esther. 2013-02-06 20:41:28 +00:00
Keith Woodlock 5b366b66a4 Merge remote-tracking branch 'ashok/MIFOSX-36' 2013-02-06 16:39:28 +00:00
Keith Woodlock 54535d90ac add default coa to demo schemas. 2013-02-06 16:26:03 +00:00
ashok-conflux 19108aab04 WIP CodeValue MIFOSX-36 2013-02-06 21:47:50 +05:30
Keith Woodlock ce3978525c update latest default and barebones schemas with latest details. 2013-02-06 14:30:11 +00:00
Keith Woodlock 327dde7fc0 tidy up schema ddl for demos and ceda. 2013-02-06 13:46:08 +00:00
Keith Woodlock 1c4b09dc3c fix some spelling/grammar mistakes. 2013-02-06 10:48:32 +00:00
Madhukar 8b6844a3c1 Documentation of FD and Saving Accounts 2013-02-06 10:51:17 +05:30
Keith Woodlock 36197b4fe3 fix up formating on api-docs. 2013-02-06 00:09:27 +00:00
Keith Woodlock 305ed1d1f3 fix up formating on api-docs 2013-02-05 20:58:22 +00:00
Keith Woodlock 0bb4fd282b formatting and rename of patch files. 2013-02-05 20:53:44 +00:00
Keith Woodlock 58ee1847e3 Merge remote-tracking branch 'nayan/workspace' 2013-02-05 20:44:50 +00:00
Keith Woodlock f73dc7e742 formatting changes on file. 2013-02-05 20:40:09 +00:00
ashok-conflux 27bb852e3a Added name Unique Constraint to Role 2013-02-06 01:30:03 +05:30
Nayan Ambali b711436c9e loan prodcut update method changed to saveAndFlush 2013-02-06 01:24:51 +05:30
Nayan Ambali 22ea9d4dff Adding unique constraint on Loan Product name 2013-02-06 00:23:29 +05:30
John Woodlock e7819f6c25 api docs format updates 2013-02-05 15:26:16 +00:00
John Woodlock ba14e1bb01 api docs format updates 2013-02-05 13:53:00 +00:00
John Woodlock 82614f3fb4 api docs format updates 2013-02-05 13:46:04 +00:00
John Woodlock f9f3b22858 remove bit of merge conflict text 2013-02-05 13:08:01 +00:00
John Woodlock c6b741651b update api docs format 2013-02-05 13:04:49 +00:00
Keith Woodlock 6bef172c7f update demo base schemas. 2013-02-05 12:38:37 +00:00
Keith Woodlock 7ab3520738 update api docs after running through datatables api.2 2013-02-05 12:28:46 +00:00
Keith Woodlock 297263f5a0 update api-docs and loan functionality from api. 2013-02-05 11:06:43 +00:00
John Woodlock 3305221870 update core reports config a bit 2013-02-05 09:36:44 +00:00
John Woodlock 986dbfb61f base reference data utf-8 encoded 2013-02-05 08:43:36 +00:00
Keith Woodlock 8321dc7c4d update api-docs in prep for demo. 2013-02-04 16:47:59 +00:00
Keith Woodlock df637aa103 prepare some demos, reset existing demo to bare bones schema and some small data setup. 2013-02-04 10:14:47 +00:00
Keith Woodlock a00577a30c update demo dumps 2013-02-02 01:33:05 +00:00
Keith Woodlock 80138efb3e save reference data as utf-8 encoded for currency symbols, update bare-bones-demo to latest of core DDL and base reference schema. 2013-02-01 23:42:14 +00:00
John Woodlock 8c28634957 updated base reference data with core reports definition 2013-02-01 17:58:07 +00:00
Keith Woodlock 7676172fb9 tidy up validation order of staff. 2013-02-01 16:20:06 +00:00
Keith Woodlock 614cd93b2a fix definition of advanace payment for heavensfamily payment processing. 2013-02-01 15:31:57 +00:00
Keith Woodlock b5135b0d2d update patches based on latest server upgrade. 2013-02-01 11:49:32 +00:00
Keith Woodlock 65e7563748 tidy up validation around office transactions api. 2013-02-01 09:37:18 +00:00
Keith Woodlock 4a07e78171 tidy up validation for currency configuration. 2013-01-31 15:09:18 +00:00
Keith Woodlock 359b62a550 last update of ddl and base reference data with correct set of permissions. 2013-01-30 20:44:17 +00:00
Keith Woodlock b5e0e2982f update ddl with correct permissions todate. 2013-01-30 20:11:35 +00:00
Keith Woodlock 07a4d7c476 update loan products api-docs and validation. some refactor at point where loan product and GLAccount mappings meet. 2013-01-30 16:38:41 +00:00
John Woodlock dd9179dadd patch to put in r-enum-values used in reporting 2013-01-30 14:26:20 +00:00
Vishwas Babu AJ 52ff4da563 Package rename and very minor modifications 2013-01-30 06:17:07 +05:30
Keith Woodlock 08e804d03f update loan products api docs 2013-01-29 20:23:19 +00:00
Keith Woodlock e0036e8d2b drop audit columns on client and group entities. update client api docs. update ddl and demo schemas. 2013-01-29 13:24:35 +00:00
Keith Woodlock 5f4e1103c2 remove old schema dump. 2013-01-29 12:28:45 +00:00
Keith Woodlock 3445ad56ce update ddl, reference data and demo schemas based on patch 2013-01-29 11:44:40 +00:00
Vishwas Babu AJ 036bb02df4 wip:modifications to guarantor related services 2013-01-29 15:35:39 +05:30
Keith Woodlock af7c9b7989 update api docs for charges, update validation of charges. 2013-01-28 22:29:26 +00:00
Keith Woodlock a99da667fb add ability to delete office transactions based on chat with dick. 2013-01-28 16:54:37 +00:00
Keith Woodlock 0bc06f9215 update staff api docs and validation. 2013-01-28 13:21:36 +00:00
Keith Woodlock 17f6e6ba66 update docs on funds api 2013-01-28 12:21:31 +00:00
Keith Woodlock 495ca15fad update api docs around codes, update validation from JSON API request. 2013-01-28 10:16:12 +00:00
Keith Woodlock b9ba666bfb drop audit columns for office transactions, funds, staff, charges. 2013-01-27 22:13:22 +00:00
Keith Woodlock abea5e3116 update DDL of demo database. move portfolio specific serialization classes our of infrastructe packages. 2013-01-27 00:32:34 +00:00
Keith Woodlock d5c09659ff drop audit columns on organisation currency, update api docs on configuration api. 2013-01-27 00:04:01 +00:00
Keith Woodlock 1ff1e53fb5 update demo backup. 2013-01-26 20:26:16 +00:00
Keith Woodlock 071f5556f6 drop audit fields for office tables, update api-docs, update DDL and schemas. 2013-01-26 20:23:22 +00:00
Keith Woodlock 1639fe695e update schemas after patch. 2013-01-26 03:14:21 +00:00
Keith Woodlock d1d12abd30 Continue tidy up of DDL and reference data, focusing on user admin area correcting api and implementation details. 2013-01-26 02:58:34 +00:00
Keith Woodlock 445e84fc79 Update mifosng-db/multi-tenant-demo-backups/bare-bones-demo/README.md
update description of whats in the bare-bones-demo
2013-01-25 14:52:58 +00:00
Keith Woodlock c63db1ce40 update core DDL + minimum reference data for deploying mifosx platform. 2013-01-25 14:32:22 +00:00
Keith Woodlock 216e493840 fix validation on inArrearsTolerance for loan creation, update sql after production and demo server upgrade. 2013-01-25 11:35:11 +00:00
Keith Woodlock 91d50831f2 allow user with read only permissions to still change their own account details. 2013-01-24 15:19:10 +00:00
Keith Woodlock 47f8dc9bc7 update latest mifostenant-default schema for now. 2013-01-23 16:51:19 +00:00
John Woodlock 4c90f3fd6e allow generateJsonFromGenericResultsetData to handle double quotes in strings 2013-01-22 17:26:52 +00:00
Keith Woodlock 9b85e9b274 removed unused warnings and code and format of code. 2013-01-22 10:54:14 +00:00
Madhukar e8cc870f21 Add interest posting functionality for saving accounts
rename_patches_after_rebasing

remove existed db script file
2013-01-22 13:48:29 +05:30
Madhukar 2ab7097b85 Change declarations for enums and spell checks
Adding Saving account & product creation from UI

Add state transitions for Saving accounts

Approve saving account state patch partially done

Approval of saving account

Soft delete of saving account

Add intereset calculation method for saving account

Interest Posting functionality not completed yet

Saving Interest Posting without interest calculation method
2013-01-22 12:55:47 +05:30
Vishwas Babu AJ 72e712de24 accounting wip: addressing review comments 2013-01-22 03:08:44 +05:30
Vishwas Babu AJ 0a30e4e08c adding accounting module specific dto's for loans 2013-01-17 18:20:49 +05:30
Vishwas Babu AJ bc20ae399e accounting wip : completed cash based posting includes writeoffs and adjustments 2013-01-17 15:38:38 +05:30
Keith Woodlock 0b9d76582f fix client update to support data integrity errors on accountNo and externalId. 2013-01-16 17:01:00 +00:00
Keith Woodlock 11e4a38796 add behaviour for checking if accounting enabled for loan product to loan and product rather than ask for data each time. 2013-01-16 16:41:17 +00:00
1261 changed files with 76269 additions and 35099 deletions
+4
View File
@@ -16,3 +16,7 @@ repos
*.ipr
*.iws
rebel.xml
*.sublime-workspace
*.DS_Store
*.ini
*~
+6
View File
@@ -0,0 +1,6 @@
language: java
jdk:
- openjdk6
script: ./travis_build.sh
notifications:
email: true
+63
View File
@@ -0,0 +1,63 @@
Changelog
=====
See VERSIONING (https://github.com/openMF/mifosx/blob/master/VERSIONING.md) for information on what updates to the version number implies for the platform.
Releases
===============
1. 22 April 2013 - 0.12.0.beta
1. 17 April 2013 - 0.11.3.beta
1. 10 April 2013 - 0.11.2.beta
1. 05 April 2013 - 0.11.1.beta
1. 05 April 2013 - 0.11.0.beta
0.12.0.beta
==========
Focus on stabalising API and functionality around centers, groups and clients. Contains breaking changes in this API from the 0.11.x releases.
Note: known issue with existing set of reports provided out of box. Due to changes in client database
columns for is_deleted (removed), joining_date (changed to activation_date) some of the reports do not work correctly at present.
We will provide patches to update these.
Bugs
- [MIFOSX-262] - You can add a client to an office prior to the opening date of the office
Improvements/Features
- [MIFOSX-213] - Support client and group 'statuses' to enable approval workflows
- [MIFOSX-282] - Add min max constraints to loan product and enforce for loan application creation, disbursal
- [MIFOSX-247] - Savings account deposits
- [MIFOSX-248] - Savings account withdrawals
- [MIFOSX-290] - Groups api for centers/groups/communal banks
- [MIFOSX-277] - Add API Documentation for Loan Charges
- [MIFOSX-285] - Fix Api docs css
- [MIFOSX-288] - Improve documentation for charges
0.11.3.beta
==========
Bug Release.
- [MIFOSX-299] - Only super users are able to update client and loan documents
0.11.2.beta
==========
Bug Release.
- https://mifosforge.jira.com/browse/MIFOSX-292 - Retrieving an existing loan product does not return the correct value for decimalPlaces
- https://mifosforge.jira.com/browse/MIFOSX-293 - Calculating the Loan Schedule does not use the correct value for decimalPlaces
- https://mifosforge.jira.com/browse/MIFOSX-294 - Updating loan products min/max principal details incorrectly results in error message relating to interestRatePerPeriod
0.11.1.beta
==========
Bug Release.
- Revert back to hibernate 4.1.9.Final to allow datatables to be persisted
- MIFOSX-291 - unable to create office
0.11.0.beta
==========
Focus on Individual Lending with Cash Accounting, in development features such as centers, groups,
savings accounts and accrual accounting in progress.
Known issues
- Due to https://jira.springsource.org/browse/SPR-10395 datatables not persisting correct
- Due to upgrade to hibernate 4.2, JPA specs more strict causing some entities to not persist correctly (https://mifosforge.jira.com/browse/MIFOSX-291)
+4
View File
@@ -0,0 +1,4 @@
Contributors
=====
List of code contributors can be viewed @ https://github.com/openMF/mifosx/contributors
+3
View File
@@ -0,0 +1,3 @@
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this file,
You can obtain one at http://mozilla.org/MPL/2.0/.
+45 -18
View File
@@ -1,39 +1,67 @@
mifosx
Mifos X: A Platform for Microfinance
======
The next evolution of mifos focussing being faster, lighter and cheaper to change (than existing mifos) so that it is more responsive to the needs of MFI’s and Integrators
Video Demonstration
===============
Build Status
============
http://www.youtube.com/watch?v=zN5Dn1Lc_js
Travis
Online Client Application Demos
=============================
[![Build
Status](https://travis-ci.org/openMF/mifosx.png?branch=master)](https://travis-ci.org/openMF/mifosx)
<a target="_blank" href="https://demo.openmf.org" title="Client apps: Individual Lending">Individual Lending App</a>
Cloudbees Jenkins
[![Build
Status](https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/badge/icon)](https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/)
<a target="_blank" href="https://openmf.ci.cloudbees.com/job/MIFOSX%20INTEGRATION%20TEST/" title="Jenkins@CloudBees">Jenkins@CloudBees Unit + Integration Tests</a>
Version
==========
The mifosx platform is currently still in BETA. That means its likely that there will be changes to the Platform API so any use or development against is at your own risk.
Latest stable release: <a target="_blank" href="https://github.com/openMF/mifosx/tree/mifosplatform-0.12.0.beta" title="mifosplatform-0.12.0.beta">mifosplatform-0.12.0.beta</a>
License
=============
This project is licensed under the open source MPL V2. See https://github.com/openMF/mifosx/blob/master/LICENSE.md
Mifos Platform API
=====================
<a target="_blank" href="https://demo.openmf.org/api-docs/apiLive.htm" title="mifos platform api beta 1">API Documentation (Demo Server)</a>
Online Client Application Demos
=============================
<a target="_blank" href="https://demo.openmf.org" title="Reference Client App">Reference Client App</a>
Developers
==========
see https://mifosforge.jira.com/wiki/display/MIFOSX/MifosX+Technical - Developers Wiki Page
see https://github.com/keithwoodlock/mifosx/wiki for getting started.
see https://mifosforge.jira.com/wiki/display/MIFOSX/Getting+started+-+Contributing+to+MifosX - Getting Started.
see https://mifosforge.jira.com/wiki/display/MIFOSX/MifosX+Technical
see https://mifosforge.jira.com/wiki/display/MIFOSX/The+Basic+Design - Overview of Platform Implementation
see https://github.com/keithwoodlock/mifosx/wiki/Screen-Based-Reporting for info around reporting
see https://github.com/openMF/mifosx/wiki/Screen-Based-Reporting for info around reporting
see https://github.com/keithwoodlock/mifosx/wiki/Git-Usuage for info around using git
see https://github.com/openMF/mifosx/wiki/Git-Usuage for info around using git
see https://www.ohloh.net/p/mifosx for activity overview and basic code analysis.
Amazon Public AMI
=================
Note: The Public AMI is currently out of date
Launch instance <a target="_blank" href="https://console.aws.amazon.com/ec2/home?region=eu-west-1#launchAmi=ami-65e6e011" title="Mifos X Public AMI 1">ami-65e6e011</a>
- Mifos X Public AMI 1
@@ -42,10 +70,9 @@ Launch instance <a target="_blank" href="https://console.aws.amazon.com/ec2/home
Roadmap
==============
- Round out Individual Lending platform and application cababilities:
- GK-maarg http://www.gfspl.in/maarg) - see see https://mifosforge.jira.com/browse/MIFOSX-31
- Elevate Africa, Heavens Family, CEDA Microfinance
- Solidatory Groups (Joint Liability Groups) & Linking loan functionality to these groups (@michal-At-soldevho - see https://mifosforge.jira.com/browse/MIFOSX-127, https://mifosforge.jira.com/browse/MIFOSX-5)
- Add spine of Fixed-Term Deposit Accounts and Savings Accounts (@madhukar-At-hugo - see https://mifosforge.jira.com/browse/MIFOSX-1)
- http://goo.gl/IXS9Q
Video Demonstration
===============
Demonstration of first Prototype of this platform with browser App (April 2012) - http://www.youtube.com/watch?v=zN5Dn1Lc_js
+54
View File
@@ -0,0 +1,54 @@
Versioning
=====
For releases we will follow semantic versioning approach. (http://semver.org/)
Semantic Versioning
===================
Semantic versioning is a very simple scheme built around the X.Y.Z-buildNo concept (for example 2.6.0-x or 2.6.0-BUILD-SNAPSHOT):
Increment Z when you fix something
Increment Y when you add a new feature
Increment X when you break backwards-compatibility or add major features
Use the buildNo to differentiate different builds off the same branch, and to differentiate between development, test and production builds.
Version structure
{number}.{release_type}
where {number} is further broken down as {major}.{minor}.{micro}.
Examples:
1.0.0.BUILD-SNAPSHOT
1.0.0.M1
1.0.0.RC1
1.0.0.RELEASE
Number semantics
major/minor/micro semantics may have some variance across projects but in general this is what we mean.
In general:
a major version suggests many significant new features, an associated marketing campaign, and possible breaking of backward compatibility.
a minor version may also contain serious new features, but should not break compatibility. You can expect minor releases every 1-3 months.
a micro version typically contains many bug fixes and improvements and perhaps several smaller new features. You can expect micro version approximately every 5-20 days (depending on bugs or suggested improvements).
Order matters
Notice that the following sequence of versions is in ordered ascending both alphabetically and toward GA:
1.0.0.BUILD-SNAPSHOT
1.0.0.M1
1.0.0.RC1
1.0.0.RELEASE
What You Should Install Where
As a rule of thumb …
Snapshot or Milestone versions should only be installed on dev boxes and integration environments. They shouldn’t be deployed to any of the dedicated test environments.
Release candidates should be installed in the dedicated test environments. In an emergency, a release candidate can be installed into the production environment.
Production releases can be installed anywhere - and they are the only kind of build that should be installed into the production environment.
-6
View File
@@ -1,6 +0,0 @@
my api notes
- loan products api should return currencyCode and digitsAfterDecimal
2) "officeId": 1, comes back for clients/template ... seems to suggest a new client defaults to head office rather than select one?
+13965 -3175
View File
File diff suppressed because it is too large Load Diff
+46 -33
View File
@@ -5,6 +5,13 @@
color: blue;
}
.apiClickNotPretty {
text-decoration: underline;
cursor: hand;
cursor: pointer;
color: blue;
}
#jpw {
text-decoration: underline;
cursor: hand;
@@ -137,7 +144,7 @@ body {
height: 40px;
min-width: 745px;
left: 0; right: 0; top: 0;
padding-left: 200px;
padding-left: 150px;
background: #eee;
background: -webkit-gradient(linear, left top, left bottom, from(#6eb4db), to(#dadada));
background: -moz-linear-gradient(top, #6eb4db, #dadada);
@@ -165,7 +172,7 @@ body {
text-align: center;
text-transform: uppercase;
font-size: 12px;
padding: 0 1em;
padding: 0 0.5em;
line-height: 40px;
border-right: 1px solid transparent;
border-left: 1px solid transparent;
@@ -177,7 +184,7 @@ body {
.flybar-nav {
display: block;
float: left;
width: 150px;
width: 80px;
position: relative;
}
@@ -200,8 +207,9 @@ body {
display: none;
position: absolute;
top: 41px;
width: 850px;
max-height:550px;
overflow:auto;
width: 1000px;
background-color: rgba(249, 249, 249, 0.99);
border: 1px solid rgb(187, 187, 187);
border-top: 0;
@@ -230,46 +238,51 @@ body {
box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}
.flybar-menu-convenience {
display: none;
position: absolute;
top: 41px;
width: 575px;
background-color: rgba(249, 249, 249, 0.99);
border: 1px solid rgb(187, 187, 187);
border-top: 0;
padding: 1em;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
-webkit-box-shadow: 0 3px 5px rgba(0,0,0,0.1);
-moz-box-shadow: 0 3px 5px rgba(0,0,0,0.1);
box-shadow: 0 3px 5px rgba(0,0,0,0.1);
}
#toc-menu1 {
#toc-menu-client {
position:absolute;
left:-150px;
left:-50px;
}
#toc-menu2 {
#toc-menu-group {
position:absolute;
left:-300px;
left:-130px;
}
#toc-menu3 {
#toc-menu-loan {
position:absolute;
left:-210px;
}
#toc-menu-savings {
position:absolute;
left:-290px;
}
#toc-menu-accounting {
position:absolute;
left:-370px;
}
#toc-menu-org {
position:absolute;
left:-450px;
}
#toc-menu4 {
#toc-menu-user {
position:absolute;
left:-600px;
left:-530px;
}
#toc-menu5 {
#toc-menu-system {
position:absolute;
left:-450px;
left:-610px;
}
#toc-menu-noncore {
position:absolute;
left:-690px;
}
#toc-menu-report {
position:absolute;
left:-770px;
}
#toc-menu-template {
position:absolute;
left:-850px;
}
#language-menu {
-48
View File
@@ -1,48 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="jquery-1.7.min.js"></script>
<title>Demo use of Mifos X platform</title>
</head>
<body>
<script type = "text/javascript">
function setBasicAuthKey(username, password)
{
basicAuthKey = "";
var jqxhr = $.ajax({
url : "https://localhost:8443/mifosng-provider/api/v1/authentication?username=" + username + "&password=" + password,
type : 'POST',
contentType : "application/json; charset=utf-8",
dataType : 'json',
data : "{}",
cache : false,
success : function(data, textStatus, jqXHR) {
basicAuthKey = data.base64EncodedAuthenticationKey;
window.location = "http://www.google.com";
return false;
},
error : function(jqXHR, textStatus, errorThrown) {
alert("Invalid Username/Password");
return true;
}
});
}
</script>
<form name = "logonform">
<table>
<tr><td>User Name:</td><td><input type="text" name="username"></td></tr>
<tr><td>Password: </td><td><input type="password" name="password"></td></tr>
<tr><td><input type="button" value="Logon to Rough Approval" name="Submit" onclick= "setBasicAuthKey(document.logonform.username.value, document.logonform.password.value )"></td><td></td></tr>
</table>
</form>
</body>
-27
View File
@@ -1,27 +0,0 @@
Loan Transitions ... approve etc - possible done CHECK AFTER
if "eventLocalDate" parameter added with string date then instead of parameter not supported msg do get jackson conversion exception. -
"JsonMappingException: Invalid format: &quot;07 June 2012&quot; " KW might do jackson conversion exception to json.
approve loan (already closed) with approval date before submitted date - now fine and shows json msg but
if approve loan (already closed) with approval date after submitted date - DataIntegrityViolationException: Column 'loan_status_id' cannot be null;
describe waiver CHECK RULES AFTER - good but maybe there should be an amount pass in ? it let me waive 12 when there was only 10 left...
when creating loan: if arrearsTolerance left there is an exception - for the other mandatory fields... just a json msg saying it is mandatory (OK).
BUT NOT FOR NOWS
should be able to get clients by branch as well
also get loans of different status's by branch etc
list of loan transactions not available (except in summary - presume repayments section has repayments and waivers and adjusts)
BIN
View File
Binary file not shown.
@@ -1,42 +0,0 @@
DROP TABLE IF EXISTS `additional client fields data`;
DROP TABLE IF EXISTS `extra family details data`;
DROP TABLE IF EXISTS `additional loan fields data`;
CREATE TABLE `additional client fields data` (
`client_id` bigint(20) NOT NULL,
`Business Description` varchar(100) DEFAULT NULL,
`Years in Business` int(11) DEFAULT NULL,
`Gender_cd` int(11) DEFAULT NULL,
`Education_cv` varchar(60) DEFAULT NULL,
`Next Visit` date DEFAULT NULL,
`Highest Rate Paid` decimal(19,6) DEFAULT NULL,
`Comment` text,
PRIMARY KEY (`client_id`),
CONSTRAINT `FK_Additional Client Fields Data_1` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `extra family details data` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`client_id` bigint(20) NOT NULL,
`Name` varchar(40) DEFAULT NULL,
`Date of Birth` date DEFAULT NULL,
`Points Score` int(11) DEFAULT NULL,
`Education_cdHighest` int(11) DEFAULT NULL,
`Other Notes` text,
PRIMARY KEY (`id`),
KEY `FK_Extra Family Details Data_1` (`client_id`),
CONSTRAINT `FK_Extra Family Details Data_1` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
CREATE TABLE `additional loan fields data` (
`loan_id` bigint(20) NOT NULL,
`Business Description` varchar(100) DEFAULT NULL,
`Years in Business` int(11) DEFAULT NULL,
`Gender_cd` int(11) DEFAULT NULL,
`Education_cv` varchar(60) DEFAULT NULL,
`Next Visit` date DEFAULT NULL,
`Highest Rate Paid` decimal(19,6) DEFAULT NULL,
`Comment` text,
PRIMARY KEY (`loan_id`),
CONSTRAINT `FK_Additional Loan Fields Data_1` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-58
View File
@@ -1,58 +0,0 @@
drop table if exists `Loan Additional Data`;
CREATE TABLE `Loan Additional Data` (
`loan_id` bigint(20) NOT NULL,
`PurposeOfLoan_cd` int(11) NOT NULL,
`CollateralType_cd` int(11) NOT NULL,
`Collateral notes` text NOT NULL,
`YesNo_cd_Guarantor` int(11) NOT NULL,
`Guarantor name` varchar(100) DEFAULT NULL,
`Guarantor relation` varchar(100) DEFAULT NULL,
`Guarantor address` varchar(100) DEFAULT NULL,
`Guarantor telepone number` varchar(20) DEFAULT NULL,
PRIMARY KEY (`loan_id`),
CONSTRAINT `FK_loan_additional_data` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
drop table if exists `Client Additional Data`;
CREATE TABLE `Client Additional Data` (
`client_id` bigint(20) NOT NULL,
`Gender_cd` int(11) NOT NULL,
`Date of Birth` date NOT NULL,
`Home address` text NOT NULL,
`Telepone number` varchar(20) NOT NULL,
`Telepone number (2nd)` varchar(20) NOT NULL,
`Email address` varchar(50) NOT NULL,
`EducationLevel_cd` int(11) NOT NULL,
`MaritalStatus_cd` int(11) NOT NULL,
`Number of children` int(11) NOT NULL,
`Citizenship` varchar(50) NOT NULL,
`PovertyStatus_cd` int(11) NOT NULL,
`YesNo_cd_Employed` int(11) NOT NULL,
`FieldOfEmployment_cd_Field of employment` int(11) DEFAULT NULL,
`Employer name` varchar(50) DEFAULT NULL,
`Number of years` int(11) DEFAULT NULL,
`Monthly salary` decimal(19,6) DEFAULT NULL,
`YesNo_cd_Self employed` int(11) NOT NULL,
`FieldOfEmployment_cd_Field of self-employment` int(11) DEFAULT NULL,
`Business address` text DEFAULT NULL,
`Number of employees` int(11) DEFAULT NULL,
`Monthly salaries paid` decimal(19,6) DEFAULT NULL,
`Monthly net income (of business activity)` decimal(19,6) DEFAULT NULL,
`Monthly rent` decimal(19,6) DEFAULT NULL,
`Other income generating activities` varchar(100) DEFAULT NULL,
`YesNo_cd_Bookeeping` int(11) NOT NULL,
`YesNo_cd_Loans with other institutions` int(11) NOT NULL,
`From whom` varchar(100) DEFAULT NULL,
`Amount` decimal(19,6) DEFAULT NULL,
`Interest rate p.a` decimal(19,6) DEFAULT NULL,
`Number of people depending on overal income` int(11) NOT NULL,
`YesNo_cd_Bank account` int(11) NOT NULL,
`YesNo_cd_Business plan provided` int(11) NOT NULL,
`YesNo_cd_Access to internet` int(11) DEFAULT NULL,
`Introduced by` varchar(100) DEFAULT NULL,
`Known to introducer since` date NOT NULL,
`Last visited by` varchar(100) DEFAULT NULL,
`Last visited on` date NOT NULL,
PRIMARY KEY (`client_id`),
CONSTRAINT `FK_client_additional_data` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES
('transaction_savings', 'POSTINTEREST_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'POSTINTEREST', '1'),
('transaction_savings', 'POSTINTEREST_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'POSTINTEREST', '0');
ALTER TABLE `m_savings_product`
ADD COLUMN `interest_posting_period_enum` SMALLINT(5) NOT NULL DEFAULT 4 AFTER `interest_compounding_period_enum`;
ALTER TABLE `m_savings_account`
ADD COLUMN `interest_posting_period_enum` SMALLINT(5) NOT NULL DEFAULT 4 AFTER `interest_compounding_period_enum`;
+27
View File
@@ -0,0 +1,27 @@
/*
New table for storing transaction details (for both loan and savings)
*/
CREATE TABLE `m_payment_detail` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`payment_type_enum` SMALLINT(5) NOT NULL,
`account_number` VARCHAR(100) NULL DEFAULT NULL,
`check_number` VARCHAR(100) NULL DEFAULT NULL,
`receipt_number` VARCHAR(100) NULL DEFAULT NULL,
`bank_number` VARCHAR(100) NULL DEFAULT NULL,
`routing_code` VARCHAR(100) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;
/*
Update loan transaction to add a link to transaction detail table
*/
ALTER TABLE `m_loan_transaction`
ADD COLUMN `payment_detail_id` BIGINT(20) NULL AFTER `loan_id`,
ADD CONSTRAINT `FK_m_loan_transaction_m_payment_detail` FOREIGN KEY (`payment_detail_id`) REFERENCES `m_payment_detail` (`id`);
@@ -0,0 +1,28 @@
ALTER TABLE m_group
ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ;
ALTER TABLE m_product_loan
ADD COLUMN `external_id` VARCHAR(100) NULL AFTER `loan_transaction_strategy_id` ,
ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ;
ALTER TABLE m_staff
ADD COLUMN `external_id` VARCHAR(100) NULL AFTER `display_name` ,
ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ;
/* status_id values for client and group
0 - Invalid
100 - Pending
300 - Active
600 - Closed( or Exited)
*/
ALTER TABLE m_client
ADD COLUMN `status_id` INT(5) NOT NULL DEFAULT 300 AFTER `is_deleted` ;
ALTER TABLE m_group
ADD COLUMN `status_id` INT(5) NOT NULL DEFAULT 300 AFTER `is_deleted` ;
@@ -0,0 +1,19 @@
/*
default client and group status is active 300. If you want to be able to have pending as the initial client stat
*/
INSERT INTO c_configuration (`name`, `enabled`) VALUES ('allow-pending-client-status', '0');
INSERT INTO c_configuration (`name`, `enabled`) VALUES ('allow-pending-group-status', '0');
INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('status_id', '0', 'Invalid', 'Invalid');
INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('status_id', '100', 'Pending', 'Pending');
INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('status_id', '300', 'Active', 'Active');
INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('status_id', '600', 'Closed', 'Closed');
INSERT INTO .`r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('loan_status_id', '0', 'Invalid', 'Invalid');
@@ -0,0 +1,8 @@
ALTER TABLE m_group CHANGE COLUMN `status_id` `status_enum` INT(5) NOT NULL DEFAULT '300' ;
ALTER TABLE m_client CHANGE COLUMN `status_id` `status_enum` INT(5) NOT NULL DEFAULT '300' ;
update r_enum_value
set enum_name = 'status_enum'
where enum_name = 'status_id';
@@ -0,0 +1,7 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_CENTER', 'CENTER', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_CENTER', 'CENTER', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'CREATE_CENTER_CHECKER', 'CENTER', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_CENTER', 'CENTER', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_CENTER_CHECKER', 'CENTER', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_CENTER', 'CENTER', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_CENTER_CHECKER', 'CENTER', 'DELETE', 0);
@@ -0,0 +1,7 @@
ALTER TABLE `m_loan`
DROP COLUMN `min_principal_amount`,
DROP COLUMN `max_principal_amount`,
DROP COLUMN `min_nominal_interest_rate_per_period`,
DROP COLUMN `max_nominal_interest_rate_per_period`,
DROP COLUMN `min_number_of_repayments`,
DROP COLUMN `max_number_of_repayments`;
@@ -0,0 +1,90 @@
/*
Reason for all the tmp tables and renames is had mysql problems with foreign keys doing alter table commands
*/
CREATE TABLE `stretchy_report_tmp` (
`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 (`id`),
UNIQUE KEY `report_name_UNIQUE` (`report_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into stretchy_report_tmp
(id, report_name, report_type, report_subtype, report_category,
report_sql, description, core_report, use_report)
select report_id, report_name, report_type, report_subtype, report_category,
report_sql, description, core_report, use_report
from stretchy_report;
CREATE TABLE `stretchy_parameter_tmp` (
`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,
`parent_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`parameter_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into stretchy_parameter_tmp
(id, parameter_name, parameter_variable, parameter_label, parameter_displayType, parameter_FormatType,
parameter_default, special, selectOne, selectAll, parameter_sql, parent_id)
select parameter_id, parameter_name, parameter_variable, parameter_label, parameter_displayType, parameter_FormatType,
parameter_default, special, selectOne, selectAll, parameter_sql, parent_parameter_id
from stretchy_parameter;
CREATE TABLE `stretchy_report_parameter_tmp` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`report_id` int(11) NOT NULL,
`parameter_id` int(11) NOT NULL,
`report_parameter_name` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `report_id_name_UNIQUE` (`report_id`,`report_parameter_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into stretchy_report_parameter_tmp(report_id, parameter_id, report_parameter_name)
select report_id, parameter_id, report_parameter_name
from stretchy_report_parameter;
ALTER TABLE `stretchy_parameter_tmp`
ADD CONSTRAINT `fk_stretchy_parameter_001`
FOREIGN KEY (`parent_id` )
REFERENCES `stretchy_parameter_tmp` (`id` )
ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD INDEX `fk_stretchy_parameter_001_idx` (`parent_id` ASC);
SET foreign_key_checks = 0;
ALTER TABLE `stretchy_report_parameter_tmp`
ADD CONSTRAINT `fk_report_parameter_001` FOREIGN KEY (`report_id` )
REFERENCES `stretchy_report_tmp` (`id` ) ON DELETE CASCADE ON UPDATE RESTRICT,
ADD CONSTRAINT `fk_report_parameter_002` FOREIGN KEY (`parameter_id` )
REFERENCES `stretchy_parameter_tmp` (`id` ) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD INDEX `fk_report_parameter_001_idx` (`report_id` ASC),
ADD INDEX `fk_report_parameter_002_idx` (`parameter_id` ASC) ;
SET foreign_key_checks = 1;
drop table stretchy_report_parameter;
drop table stretchy_report;
drop table stretchy_parameter;
rename table
stretchy_report_tmp to stretchy_report,
stretchy_parameter_tmp to stretchy_parameter,
stretchy_report_parameter_tmp to stretchy_report_parameter;
@@ -0,0 +1,7 @@
UPDATE `stretchy_parameter` SET `parameter_sql`='select sp.parameter_name, sp.parameter_variable, sp.parameter_label, sp.parameter_displayType, \r sp.parameter_FormatType, sp.parameter_default, sp.selectOne, sp.selectAll, spp.parameter_name as parentParameterName\r from stretchy_parameter sp\r left join stretchy_parameter spp on spp.id = sp.parent_id\r where sp.special is null\r and exists \r (select \'f\' \r from stretchy_report sr\r join stretchy_report_parameter srp on srp.report_id = sr.id\r where sr.report_name in(${reportListing})\r and srp.parameter_id = sp.id\r )\r order by sp.id' WHERE `id`='1002';
UPDATE `stretchy_parameter` SET `parameter_sql`='select r.id as report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\nrp.id as parameter_id, rp.report_parameter_name, p.parameter_name\n from stretchy_report r\n left join stretchy_report_parameter rp on rp.report_id = r.id \n left join stretchy_parameter p on p.id = rp.parameter_id\n where r.use_report is true\n and exists\n ( select \'f\'\n from m_appuser_role ur \n join m_role r on r.id = ur.role_id\n join m_role_permission rp on rp.role_id = r.id\n join m_permission p on p.id = rp.permission_id\n where ur.appuser_id = ${currentUserId}\n and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name)) )\n order by r.report_category, r.report_name, rp.id' WHERE `id`='1001';
UPDATE `stretchy_parameter` SET `parameter_sql`='select r.id as report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\n rp.id as parameter_id, rp.report_parameter_name, p.parameter_name\n from stretchy_report r\n left join stretchy_report_parameter rp on rp.report_id = r.id\n left join stretchy_parameter p on p.id = rp.parameter_id\n where r.report_category = \'${reportCategory}\'\n and r.use_report is true\n and exists\n (select \'f\'\n from m_appuser_role ur \n join m_role r on r.id = ur.role_id\n join m_role_permission rp on rp.role_id = r.id\n join m_permission p on p.id = rp.permission_id\n where ur.appuser_id = ${currentUserId}\n and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name)) )\n order by r.report_category, r.report_name, rp.id' WHERE `id`='1003';
@@ -0,0 +1,15 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('report', 'READ_REPORT', 'REPORT', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('report', 'CREATE_REPORT', 'REPORT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('report', 'CREATE_REPORT_CHECKER', 'REPORT', 'CREATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('report', 'UPDATE_REPORT', 'REPORT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('report', 'UPDATE_REPORT_CHECKER', 'REPORT', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('report', 'DELETE_REPORT', 'REPORT', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('report', 'DELETE_REPORT_CHECKER', 'REPORT', 'DELETE', 0);
@@ -0,0 +1,946 @@
-- drop tables in base-schema
SET foreign_key_checks = 0;
-- drop accounting subsystem
DROP TABLE IF EXISTS `acc_gl_account`;
DROP TABLE IF EXISTS `acc_gl_closure`;
DROP TABLE IF EXISTS `acc_gl_journal_entry`;
DROP TABLE IF EXISTS `acc_product_mapping`;
-- drop portfolio subsystem
DROP TABLE IF EXISTS `c_configuration`;
DROP TABLE IF EXISTS `m_appuser`;
DROP TABLE IF EXISTS `m_appuser_role`;
DROP TABLE IF EXISTS `m_calendar`;
DROP TABLE IF EXISTS `m_calendar_instance`;
DROP TABLE IF EXISTS `m_charge`;
DROP TABLE IF EXISTS `m_client`;
DROP TABLE IF EXISTS `m_client_identifier`;
DROP TABLE IF EXISTS `m_code`;
DROP TABLE IF EXISTS `m_code_value`;
DROP TABLE IF EXISTS `m_currency`;
DROP TABLE IF EXISTS `m_deposit_account`;
DROP TABLE IF EXISTS `m_deposit_account_transaction`;
DROP TABLE IF EXISTS `m_document`;
DROP TABLE IF EXISTS `m_fund`;
DROP TABLE IF EXISTS `m_group`;
DROP TABLE IF EXISTS `m_group_level`;
DROP TABLE IF EXISTS `m_group_client`;
DROP TABLE IF EXISTS `m_guarantor`;
DROP TABLE IF EXISTS `m_loan`;
DROP TABLE IF EXISTS `m_loan_charge`;
DROP TABLE IF EXISTS `m_loan_arrears_aging`;
DROP TABLE IF EXISTS `m_loan_collateral`;
DROP TABLE IF EXISTS `m_loan_officer_assignment_history`;
DROP TABLE IF EXISTS `m_loan_repayment_schedule`;
DROP TABLE IF EXISTS `m_loan_transaction`;
DROP TABLE IF EXISTS `m_note`;
DROP TABLE IF EXISTS `m_office`;
DROP TABLE IF EXISTS `m_office_transaction`;
DROP TABLE IF EXISTS `m_organisation_currency`;
DROP TABLE IF EXISTS `m_permission`;
DROP TABLE IF EXISTS `m_portfolio_command_source`;
DROP TABLE IF EXISTS `m_product_deposit`;
DROP TABLE IF EXISTS `m_product_loan`;
DROP TABLE IF EXISTS `m_product_loan_charge`;
DROP TABLE IF EXISTS `m_role`;
DROP TABLE IF EXISTS `m_role_permission`;
DROP TABLE IF EXISTS `m_savings_account`;
DROP TABLE IF EXISTS `m_savings_account_transaction`;
DROP TABLE IF EXISTS `m_savings_product`;
DROP TABLE IF EXISTS `m_staff`;
DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`;
DROP TABLE IF EXISTS `x_registered_table`;
-- drop reporting related tables
DROP TABLE IF EXISTS `r_enum_value`;
DROP TABLE IF EXISTS `rpt_sequence`;
DROP TABLE IF EXISTS `stretchy_parameter`;
DROP TABLE IF EXISTS `stretchy_report`;
DROP TABLE IF EXISTS `stretchy_report_parameter`;
SET foreign_key_checks = 1;
-- DDL for reference/lookup tables
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 DEFAULT CHARSET=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,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=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 DEFAULT CHARSET=utf8;
CREATE TABLE `c_configuration` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=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 DEFAULT CHARSET=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 DEFAULT CHARSET=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',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*not a major table - just intended for database reporting use for enums and values that would be hidden in java*/
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;
/* used to link MySql tables to Mifos X application tables for additional data needs */
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;
CREATE TABLE IF NOT EXISTS `m_calendar` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(50) NOT NULL,
`description` varchar(100) DEFAULT NULL,
`location` varchar(50) DEFAULT NULL,
`start_date` date NOT NULL,
`end_date` date DEFAULT NULL,
`duration` smallint(6) DEFAULT NULL,
`calendar_type_enum` smallint(5) NOT NULL,
`repeating` tinyint(1) NOT NULL DEFAULT '0',
`recurrence` varchar(100) DEFAULT NULL,
`remind_by_enum` smallint(5) DEFAULT NULL,
`first_reminder` smallint(11) DEFAULT NULL,
`second_reminder` smallint(11) 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`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_calendar_instance` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`calendar_id` bigint(20) NOT NULL,
`entity_id` bigint(20) NOT NULL,
`entity_type_enum` smallint(5) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_m_calendar_m_calendar_instance` (`calendar_id`),
CONSTRAINT `FK_m_calendar_m_calendar_instance` FOREIGN KEY (`calendar_id`) REFERENCES `m_calendar` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ================= end of reference/lookup tables =============
-- DDL for office related tables
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,
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 DEFAULT CHARSET=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,
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;
-- ============ end of office related tables ==========
-- DDL for admin tables
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,
`can_maker_checker` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_role` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`description` varchar(500) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unq_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=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;
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,
PRIMARY KEY (`id`),
UNIQUE KEY `username_org` (`username`),
KEY `FKB3D587CE0DD567A` (`office_id`),
CONSTRAINT `FKB3D587CE0DD567A` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=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;
-- ================ end of user admin tables ===============
-- DDL for organisation wide related concepts
CREATE TABLE `m_portfolio_command_source` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`action_name` varchar(50) NOT NULL,
`entity_name` varchar(50) NOT NULL,
`office_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`client_id` bigint(20) DEFAULT NULL,
`loan_id` bigint(20) DEFAULT NULL,
`savings_account_id` bigint(20) DEFAULT NULL,
`api_get_url` varchar(100) NOT NULL,
`resource_id` bigint(20) DEFAULT NULL,
`subresource_id` bigint(20) DEFAULT NULL,
`command_as_json` text NOT NULL,
`maker_id` bigint(20) NOT NULL,
`made_on_date` datetime NOT NULL,
`checker_id` bigint(20) DEFAULT NULL,
`checked_on_date` datetime DEFAULT NULL,
`processing_result_enum` smallint(5) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_m_maker_m_appuser` (`maker_id`),
KEY `FK_m_checker_m_appuser` (`checker_id`),
KEY `action_name` (`action_name`),
KEY `entity_name` (`entity_name`,`resource_id`),
KEY `made_on_date` (`made_on_date`),
KEY `checked_on_date` (`checked_on_date`),
KEY `processing_result_enum` (`processing_result_enum`),
KEY `office_id` (`office_id`),
KEY `group_id` (`office_id`),
KEY `client_id` (`office_id`),
KEY `loan_id` (`office_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 DEFAULT CHARSET=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',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_fund` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`external_id` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `fund_name_org` (`name`),
UNIQUE KEY `fund_externalid_org` (`external_id`)
) ENGINE=InnoDB DEFAULT CHARSET=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,
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 DEFAULT CHARSET=utf8;
-- ============ end of organisation wide related tables ===========
-- DDL client/group related tables
CREATE TABLE `m_group_level` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`parent_id` INT(11) NULL DEFAULT NULL,
`super_parent` TINYINT(1) NOT NULL,
`level_name` VARCHAR(100) NOT NULL,
`recursable` TINYINT(1) NOT NULL,
`can_have_clients` TINYINT(1) NOT NULL,
PRIMARY KEY (`id`),
INDEX `Parent_levelId_reference` (`parent_id`),
CONSTRAINT `Parent_levelId_reference` FOREIGN KEY (`parent_id`) REFERENCES `m_group_level` (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_group` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`office_id` bigint(20) NOT NULL,
`staff_id` BIGINT(20) DEFAULT NULL,
`parent_id` BIGINT(20) NULL DEFAULT NULL,
`level_Id` INT(11) NOT NULL,
`hierarchy` VARCHAR(100) NULL DEFAULT NULL,
`name` varchar(100) NOT NULL,
`external_id` varchar(100) DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`, `level_id`),
UNIQUE KEY `external_id` (`external_id`, `level_Id`),
KEY `office_id` (`office_id`),
KEY `staff_id` (`staff_id`),
CONSTRAINT `m_group_ibfk_1` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`),
CONSTRAINT `Parent_Id_reference` FOREIGN KEY (`parent_id`) REFERENCES `m_group` (`id`),
CONSTRAINT `FK_m_group_level` FOREIGN KEY (`level_Id`) REFERENCES `m_group_level` (`id`),
CONSTRAINT `FK_m_group_m_staff` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_client` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_no` varchar(20) NOT NULL,
`office_id` bigint(20) NOT NULL,
`external_id` varchar(100) DEFAULT NULL,
`firstname` varchar(50) DEFAULT NULL,
`middlename` varchar(50) DEFAULT NULL,
`lastname` varchar(50) DEFAULT NULL,
`fullname` varchar(100) DEFAULT NULL,
`display_name` varchar(100) NOT NULL,
`image_key` varchar(500) DEFAULT NULL,
`joined_date` date DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `account_no_UNIQUE` (`account_no`),
UNIQUE KEY `external_id` (`external_id`),
KEY `FKCE00CAB3E0DD567A` (`office_id`),
CONSTRAINT `FKCE00CAB3E0DD567A` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=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 DEFAULT CHARSET=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;
-- ==== end of client/group related tables ==========
-- DDL for loan and loan related tables
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,
`accounting_type` smallint(5) NOT NULL,
`loan_transaction_strategy_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unq_name` (`name`),
KEY `FKA6A8A7D77240145` (`fund_id`),
KEY `FK_ltp_strategy` (`loan_transaction_strategy_id`),
CONSTRAINT `FKA6A8A7D77240145` FOREIGN KEY (`fund_id`) REFERENCES `m_fund` (`id`),
CONSTRAINT `FK_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=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;
CREATE TABLE `m_loan` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_no` varchar(20) NOT NULL,
`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,
`loanpurpose_cv_id` int(11) 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,
`submittedon_date` date DEFAULT NULL,
`submittedon_userid` bigint(20) DEFAULT NULL,
`approvedon_date` date DEFAULT NULL,
`approvedon_userid` bigint(20) 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,
`disbursedon_userid` bigint(20) DEFAULT NULL,
`expected_maturedon_date` date DEFAULT NULL,
`maturedon_date` date DEFAULT NULL,
`closedon_date` date DEFAULT NULL,
`closedon_userid` bigint(20) DEFAULT NULL,
`total_charges_due_at_disbursement_derived` decimal(19,6) DEFAULT NULL,
`principal_disbursed_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`principal_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`principal_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`principal_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_charged_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_charged_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_charged_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_expected_repayment_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_repayment_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_expected_costofloan_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_costofloan_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`rejectedon_date` date DEFAULT NULL,
`rejectedon_userid` bigint(20) DEFAULT NULL,
`rescheduledon_date` date DEFAULT NULL,
`withdrawnon_date` date DEFAULT NULL,
`withdrawnon_userid` bigint(20) DEFAULT NULL,
`writtenoffon_date` date DEFAULT NULL,
`loan_transaction_strategy_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `loan_account_no_UNIQUE` (`account_no`),
UNIQUE KEY `loan_externalid_UNIQUE` (`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_loanpurpose_codevalue` (`loanpurpose_cv_id`),
KEY `FK_submittedon_userid` (`submittedon_userid`),
KEY `FK_approvedon_userid` (`approvedon_userid`),
KEY `FK_rejectedon_userid` (`rejectedon_userid`),
KEY `FK_withdrawnon_userid` (`withdrawnon_userid`),
KEY `FK_disbursedon_userid` (`disbursedon_userid`),
KEY `FK_closedon_userid` (`closedon_userid`),
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_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_loan_ltp_strategy` FOREIGN KEY (`loan_transaction_strategy_id`) REFERENCES `ref_loan_transaction_processing_strategy` (`id`),
CONSTRAINT `FK_m_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`),
CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`),
CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_submittedon_userid` FOREIGN KEY (`submittedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_withdrawnon_userid` FOREIGN KEY (`withdrawnon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `m_loan_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_loan_arrears_aging` (
`loan_id` bigint(20) NOT NULL AUTO_INCREMENT,
`principal_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`overdue_since_date_derived` date DEFAULT NULL,
PRIMARY KEY (`loan_id`),
CONSTRAINT `m_loan_arrears_aging_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_guarantor` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`loan_id` BIGINT(20) NOT NULL,
`client_reln_cv_id` INT(11) DEFAULT NULL,
`type_enum` SMALLINT(5) NOT NULL,
`entity_id` BIGINT(20) NULL DEFAULT NULL,
`firstname` VARCHAR(50) NULL DEFAULT NULL,
`lastname` VARCHAR(50) NULL DEFAULT NULL,
`dob` DATE NULL DEFAULT NULL,
`address_line_1` VARCHAR(500) NULL DEFAULT NULL,
`address_line_2` VARCHAR(500) NULL DEFAULT NULL,
`city` VARCHAR(50) NULL DEFAULT NULL,
`state` VARCHAR(50) NULL DEFAULT NULL,
`country` VARCHAR(50) NULL DEFAULT NULL,
`zip` VARCHAR(20) NULL DEFAULT NULL,
`house_phone_number` VARCHAR(20) NULL DEFAULT NULL,
`mobile_number` VARCHAR(20) NULL DEFAULT NULL,
`comment` VARCHAR(500) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_guarantor_m_loan` (`loan_id`),
CONSTRAINT `FK_m_guarantor_m_code_value` FOREIGN KEY (`client_reln_cv_id`) REFERENCES `m_code_value` (`id`),
CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=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',
`waived` 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;
CREATE TABLE `m_loan_collateral` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`loan_id` bigint(20) NOT NULL,
`type_cv_id` int(11) NOT NULL,
`value` DECIMAL(19,6) DEFAULT NULL,
`description` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_collateral_m_loan` (`loan_id`),
KEY `FK_collateral_code_value` (`type_cv_id`),
CONSTRAINT `FK_collateral_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `FK_collateral_code_value` FOREIGN KEY (`type_cv_id`) REFERENCES `m_code_value` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=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;
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 DEFAULT CHARSET=utf8;
CREATE TABLE `m_loan_transaction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`loan_id` bigint(20) NOT NULL,
`is_reversed` TINYINT(1) NOT NULL,
`transaction_type_enum` smallint(5) NOT NULL,
`transaction_date` date NOT NULL,
`amount` decimal(19,6) NOT 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`),
CONSTRAINT `FKCFCEA42640BE0710` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ======== end of loan related tables ==========
CREATE TABLE `m_savings_product` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`description` varchar(500) NOT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
`nominal_interest_rate_per_period` decimal(19,6) NOT NULL,
`nominal_interest_rate_period_frequency_enum` smallint(5) NOT NULL,
`interest_period_enum` SMALLINT(5) NOT NULL,
`interest_calculation_type_enum` SMALLINT(5) NOT NULL,
`interest_calculation_days_in_year_type_enum` SMALLINT(5) NOT NULL,
`min_required_opening_balance` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency_enum` smallint(5) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `sp_unq_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_savings_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_no` varchar(20) NOT NULL,
`external_id` varchar(100) DEFAULT NULL,
`client_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`product_id` bigint(20) DEFAULT NULL,
`status_enum` SMALLINT(5) NOT NULL DEFAULT 300,
`activation_date` DATE DEFAULT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
`nominal_interest_rate_per_period` decimal(19,6) NOT NULL,
`nominal_interest_rate_period_frequency_enum` smallint(5) NOT NULL,
`annual_nominal_interest_rate` decimal(19,6) NOT NULL,
`interest_period_enum` SMALLINT(5) NOT NULL,
`interest_calculation_type_enum` SMALLINT(5) NOT NULL,
`interest_calculation_days_in_year_type_enum` SMALLINT(5) NOT NULL,
`min_required_opening_balance` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency_enum` smallint(5) DEFAULT NULL,
`lockedin_until_date_derived` DATE DEFAULT NULL,
`total_deposits_derived` decimal(19,6) DEFAULT NULL,
`total_withdrawals_derived` decimal(19,6) DEFAULT NULL,
`total_interest_earned_derived` decimal(19,6) DEFAULT NULL,
`total_interest_posted_derived` decimal(19,6) DEFAULT NULL,
`account_balance_derived` decimal(19,6) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `sa_account_no_UNIQUE` (`account_no`),
UNIQUE KEY `sa_externalid_UNIQUE` (`external_id`),
KEY `FKSA00000000000001` (`client_id`),
KEY `FKSA00000000000002` (`group_id`),
KEY `FKSA00000000000003` (`product_id`),
CONSTRAINT `FKSA00000000000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FKSA00000000000002` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`),
CONSTRAINT `FKSA00000000000003` FOREIGN KEY (`product_id`) REFERENCES `m_savings_product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_savings_account_transaction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`savings_account_id` bigint(20) NOT NULL,
`transaction_type_enum` smallint(5) NOT NULL,
`transaction_date` date NOT NULL,
`amount` decimal(19,6) NOT NULL,
`is_reversed` tinyint(1) NOT NULL,
`running_balance_derived` DECIMAL(19,6) NULL,
`balance_number_of_days_derived` INT NULL,
`balance_end_date_derived` DATE NULL,
`cumulative_balance_derived` DECIMAL(19,6) NULL,
PRIMARY KEY (`id`),
KEY `FKSAT0000000001` (`savings_account_id`),
CONSTRAINT `FKSAT0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- end of savings account related tables
-- DDL for notes associated with all client/group and financial accounts
CREATE TABLE `m_note` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`client_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`loan_id` bigint(20) DEFAULT NULL,
`loan_transaction_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 `FK_m_note_m_group` (`group_id`),
KEY `FK7C970898F889C3F` (`lastmodifiedby_id`),
KEY `FK7C9708940BE0710` (`loan_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 `FK_m_note_m_group` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`),
CONSTRAINT `FK7C970898F889C3F` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DDL for accounting sub system related tables
CREATE TABLE `acc_gl_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(45) NOT NULL,
`parent_id` bigint(20) DEFAULT NULL,
`gl_code` varchar(45) NOT NULL,
`disabled` tinyint(1) NOT NULL DEFAULT '0',
`manual_journal_entries_allowed` tinyint(1) NOT NULL DEFAULT '1',
`account_usage` tinyint(1) NOT NULL DEFAULT '2',
`classification_enum` smallint(5) NOT NULL,
`description` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `acc_gl_code` (`gl_code`),
KEY `FK_ACC_0000000001` (`parent_id`),
CONSTRAINT `FK_ACC_0000000001` FOREIGN KEY (`parent_id`) REFERENCES `acc_gl_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `acc_gl_closure` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`office_id` bigint(20) NOT NULL,
`closing_date` date NOT NULL,
`is_deleted` int(20) NOT NULL DEFAULT '0',
`createdby_id` bigint(20) DEFAULT NULL,
`lastmodifiedby_id` bigint(20) DEFAULT NULL,
`created_date` datetime DEFAULT NULL,
`lastmodified_date` datetime DEFAULT NULL,
`comments` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `office_id_closing_date` (`office_id`,`closing_date`),
KEY `FK_acc_gl_closure_m_office` (`office_id`),
KEY `FK_acc_gl_closure_m_appuser` (`createdby_id`),
KEY `FK_acc_gl_closure_m_appuser_2` (`lastmodifiedby_id`),
CONSTRAINT `FK_acc_gl_closure_m_appuser` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_acc_gl_closure_m_appuser_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_acc_gl_closure_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `acc_gl_journal_entry` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_id` bigint(20) NOT NULL,
`office_id` bigint(20) NOT NULL,
`reversal_id` bigint(20) DEFAULT NULL,
`transaction_id` varchar(50) NOT NULL,
`reversed` tinyint(1) NOT NULL DEFAULT '0',
`manual_entry` TINYINT(1) NOT NULL DEFAULT '0',
`entry_date` date NOT NULL,
`type_enum` smallint(5) NOT NULL,
`amount` decimal(19,6) NOT NULL,
`description` varchar(500) DEFAULT NULL,
`entity_type_enum` smallint(5) DEFAULT NULL,
`entity_id` bigint(20) DEFAULT NULL,
`createdby_id` bigint(20) NOT NULL,
`lastmodifiedby_id` bigint(20) NOT NULL,
`created_date` datetime NOT NULL,
`lastmodified_date` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_acc_gl_journal_entry_m_office` (`office_id`),
KEY `FK_acc_gl_journal_entry_m_appuser` (`createdby_id`),
KEY `FK_acc_gl_journal_entry_m_appuser_2` (`lastmodifiedby_id`),
KEY `FK_acc_gl_journal_entry_acc_gl_journal_entry` (`reversal_id`),
KEY `FK_acc_gl_journal_entry_acc_gl_account` (`account_id`),
CONSTRAINT `FK_acc_gl_journal_entry_acc_gl_account` FOREIGN KEY (`account_id`) REFERENCES `acc_gl_account` (`id`),
CONSTRAINT `FK_acc_gl_journal_entry_acc_gl_journal_entry` FOREIGN KEY (`reversal_id`) REFERENCES `acc_gl_journal_entry` (`id`),
CONSTRAINT `FK_acc_gl_journal_entry_m_appuser` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_acc_gl_journal_entry_m_appuser_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_acc_gl_journal_entry_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `acc_product_mapping` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`gl_account_id` bigint(20) DEFAULT NULL,
`product_id` bigint(20) DEFAULT NULL,
`product_type` smallint(5) DEFAULT NULL,
`financial_account_type` smallint(5) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- =========== end of accounting related tables ==========
-- DDL for reporting related tables
CREATE TABLE `rpt_sequence` (
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=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,
`parent_parameter_id` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`parameter_id`),
UNIQUE KEY `name_UNIQUE` (`parameter_name`),
INDEX `fk_stretchy_parameter_0001_idx` (`parent_parameter_id`),
CONSTRAINT `fk_stretchy_parameter_0001` FOREIGN KEY (`parent_parameter_id`) REFERENCES `stretchy_parameter` (`parameter_id`)
) ENGINE=InnoDB DEFAULT CHARSET=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;
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;
-- =========== end of reporting related tables ============
@@ -0,0 +1,2 @@
update m_permission set grouping = 'configuration' where entity_name = 'report';
@@ -0,0 +1,8 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_CLIENT', 'CLIENT', 'ACTIVATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_CLIENT_CHECKER', 'CLIENT', 'ACTIVATE', 0);
ALTER TABLE `m_client`
CHANGE COLUMN `external_id` `external_id` VARCHAR(100) NULL DEFAULT NULL AFTER `account_no`,
CHANGE COLUMN `status_enum` `status_enum` INT(5) NOT NULL DEFAULT '300' AFTER `external_id`,
CHANGE COLUMN `joined_date` `activation_date` DATE NULL DEFAULT NULL AFTER `status_enum`;
@@ -0,0 +1,19 @@
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_CENTER', 'CENTER', 'ACTIVATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_CENTER_CHECKER', 'CENTER', 'ACTIVATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_GROUP', 'GROUP', 'ACTIVATE', 1);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'ACTIVATE_GROUP_CHECKER', 'GROUP', 'ACTIVATE', 0);
ALTER TABLE `m_group` DROP FOREIGN KEY `FK_m_group_level`;
ALTER TABLE `m_group`
CHANGE COLUMN `external_id` `external_id` VARCHAR(100) NULL DEFAULT NULL AFTER `id`,
CHANGE COLUMN `status_enum` `status_enum` INT(5) NOT NULL DEFAULT '300' AFTER `external_id`,
CHANGE COLUMN `name` `display_name` VARCHAR(100) NOT NULL AFTER `level_id`,
CHANGE COLUMN `level_Id` `level_id` INT(11) NOT NULL,
ADD CONSTRAINT `FK_m_group_level` FOREIGN KEY (`level_id`) REFERENCES `m_group_level` (`id`);
ALTER TABLE `m_group`
DROP COLUMN `is_deleted`,
ADD COLUMN `activation_date` DATE NULL DEFAULT NULL AFTER `status_enum` ;
@@ -0,0 +1,4 @@
DELETE FROM `c_configuration` WHERE `name`='allow-pending-client-status';
DELETE FROM `c_configuration` WHERE `name`='allow-pending-group-status';
ALTER TABLE `m_client` DROP COLUMN `is_deleted`;
@@ -0,0 +1,7 @@
ALTER TABLE m_loan
ADD CONSTRAINT `fk_m_group_client_001`
FOREIGN KEY (`group_id` , `client_id` )
REFERENCES m_group_client (`group_id` , `client_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION
, ADD INDEX `fk_m_group_client_001_idx` (`group_id` ASC, `client_id` ASC) ;
@@ -0,0 +1,82 @@
update stretchy_report
set report_sql = "select
concat(repeat("".."",
((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, '.', '')) - 1))), ounder.`name`) as ""Office/Branch"",
c.account_no as ""Client Account No."",
c.display_name as ""Name"",
r.enum_message_property as ""Status"",
c.activation_date as ""Activation"", c.external_id as ""External Id""
from m_office o
join m_office ounder on ounder.hierarchy like concat(o.hierarchy, '%')
and ounder.hierarchy like concat('${currentUserHierarchy}', '%')
join m_client c on c.office_id = ounder.id
left join r_enum_value r on r.enum_name = 'status_enum' and r.enum_id = c.status_enum
where o.id = ${officeId}
order by ounder.hierarchy, c.account_no"
where report_name = 'Client Listing';
update stretchy_report
set report_sql = "select
concat(repeat("".."",
((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, '.', '')) - 1))), ounder.`name`) as ""Office/Branch"", c.account_no as ""Client Account No."",
c.display_name as ""Name"",
r.enum_message_property as ""Client Status"",
lo.display_name as ""Loan Officer"", l.account_no as ""Loan Account No."", l.external_id as ""External Id"", p.name as Loan, st.enum_message_property as ""Status"",
f.`name` as Fund, purp.code_value as ""Loan Purpose"",
ifnull(cur.display_symbol, l.currency_code) as Currency,
l.principal_amount, l.arrearstolerance_amount as ""Arrears Tolerance Amount"",
l.number_of_repayments as ""Expected No. Repayments"",
l.annual_nominal_interest_rate as "" Annual Nominal Interest Rate"",
l.nominal_interest_rate_per_period as ""Nominal Interest Rate Per Period"",
ipf.enum_message_property as ""Interest Rate Frequency"",
im.enum_message_property as ""Interest Method"",
icp.enum_message_property as ""Interest Calculated in Period"",
l.term_frequency as ""Term Frequency"",
tf.enum_message_property as ""Term Frequency Period"",
l.repay_every as ""Repayment Frequency"",
rf.enum_message_property as ""Repayment Frequency Period"",
am.enum_message_property as ""Amortization"",
l.total_charges_due_at_disbursement_derived as ""Total Charges Due At Disbursement"",
date(l.submittedon_date) as Submitted, date(l.approvedon_date) Approved, l.expected_disbursedon_date As ""Expected Disbursal"",
date(l.expected_firstrepaymenton_date) as ""Expected First Repayment"",
date(l.interest_calculated_from_date) as ""Interest Calculated From"" ,
date(l.disbursedon_date) as Disbursed,
date(l.expected_maturedon_date) ""Expected Maturity"",
date(l.maturedon_date) as ""Matured On"", date(l.closedon_date) as Closed,
date(l.rejectedon_date) as Rejected, date(l.rescheduledon_date) as Rescheduled,
date(l.withdrawnon_date) as Withdrawn, date(l.writtenoffon_date) ""Written Off""
from m_office o
join m_office ounder on ounder.hierarchy like concat(o.hierarchy, '%')
and ounder.hierarchy like concat('${currentUserHierarchy}', '%')
join m_client c on c.office_id = ounder.id
left join r_enum_value r on r.enum_name = 'status_enum'
and r.enum_id = c.status_enum
left join m_loan l on l.client_id = c.id
left join m_staff lo on lo.id = l.loan_officer_id
left join m_product_loan p on p.id = l.product_id
left join m_fund f on f.id = l.fund_id
left join r_enum_value st on st.enum_name = ""loan_status_id"" and st.enum_id = l.loan_status_id
left join r_enum_value ipf on ipf.enum_name = ""interest_period_frequency_enum""
and ipf.enum_id = l.interest_period_frequency_enum
left join r_enum_value im on im.enum_name = ""interest_method_enum""
and im.enum_id = l.interest_method_enum
left join r_enum_value tf on tf.enum_name = ""term_period_frequency_enum""
and tf.enum_id = l.term_period_frequency_enum
left join r_enum_value icp on icp.enum_name = ""interest_calculated_in_period_enum""
and icp.enum_id = l.interest_calculated_in_period_enum
left join r_enum_value rf on rf.enum_name = ""repayment_period_frequency_enum""
and rf.enum_id = l.repayment_period_frequency_enum
left join r_enum_value am on am.enum_name = ""amortization_method_enum""
and am.enum_id = l.amortization_method_enum
left join m_code_value purp on purp.id = l.loanpurpose_cv_id
left join m_currency cur on cur.code = l.currency_code
where o.id = ${officeId}
and (l.currency_code = ""${currencyId}"" or ""-1"" = ""${currencyId}"")
and (l.product_id = ""${loanProductId}"" or ""-1"" = ""${loanProductId}"")
and (ifnull(l.loan_officer_id, -10) = ""${loanOfficerId}"" or ""-1"" = ""${loanOfficerId}"")
and (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})
and (ifnull(l.loanpurpose_cv_id, -10) = ${loanPurposeId} or -1 = ${loanPurposeId})
order by ounder.hierarchy, 2 , l.id"
where report_name = 'Client Loans Listing';
@@ -0,0 +1,12 @@
ALTER TABLE `m_savings_product`
ADD COLUMN `withdrawal_fee_amount` DECIMAL(19,6) NULL DEFAULT NULL AFTER `lockin_period_frequency_enum`,
ADD COLUMN `withdrawal_fee_type_enum` SMALLINT(5) NULL DEFAULT NULL AFTER `withdrawal_fee_amount`;
ALTER TABLE `m_savings_account`
ADD COLUMN `withdrawal_fee_amount` DECIMAL(19,6) NULL DEFAULT NULL AFTER `lockin_period_frequency_enum`,
ADD COLUMN `withdrawal_fee_type_enum` SMALLINT(5) NULL DEFAULT NULL AFTER `withdrawal_fee_amount`;
ALTER TABLE `m_savings_account`
ADD COLUMN `total_withdrawal_fees_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_withdrawals_derived`;
@@ -0,0 +1,321 @@
-- currency symbols may not apply through command line on windows so use a different client like mysql workbench
INSERT INTO `ref_loan_transaction_processing_strategy`
(`id`,`code`,`name`)
VALUES
(1, 'mifos-standard-strategy', 'Mifos style'),
(2, 'heavensfamily-strategy', 'Heavensfamily'),
(3, 'creocore-strategy', 'Creocore'),
(4, 'rbi-india-strategy', 'RBI (India)');
INSERT INTO `c_configuration`
(`name`, `enabled`)
VALUES
('maker-checker', 0);
INSERT INTO `r_enum_value`
VALUES
('amortization_method_enum',0,'Equal principle payments','Equal principle payments'),
('amortization_method_enum',1,'Equal installments','Equal installments'),
('interest_calculated_in_period_enum',0,'Daily','Daily'),
('interest_calculated_in_period_enum',1,'Same as repayment period','Same as repayment period'),
('interest_method_enum',0,'Declining Balance','Declining Balance'),
('interest_method_enum',1,'Flat','Flat'),
('interest_period_frequency_enum',2,'Per month','Per month'),
('interest_period_frequency_enum',3,'Per year','Per year'),
('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',601,'Written-Off','Written-Off'),
('loan_status_id',602,'Rescheduled','Rescheduled'),
('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)'),
('processing_result_enum',0,'invalid','Invalid'),
('processing_result_enum',1,'processed','Processed'),
('processing_result_enum',2,'awaiting.approval','Awaiting Approval'),
('processing_result_enum',3,'rejected','Rejected'),
('repayment_period_frequency_enum',0,'Days','Days'),
('repayment_period_frequency_enum',1,'Weeks','Weeks'),
('repayment_period_frequency_enum',2,'Months','Months'),
('term_period_frequency_enum',0,'Days','Days'),
('term_period_frequency_enum',1,'Weeks','Weeks'),
('term_period_frequency_enum',2,'Months','Months'),
('term_period_frequency_enum',3,'Years','Years');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '1', 'Disbursement', 'Disbursement');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '2', 'Repayment', 'Repayment');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '3', 'Contra', 'Contra');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '4', 'Waive Interest', 'Waive Interest');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '5', 'Repayment At Disbursement', 'Repayment At Disbursement');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '6', 'Write-Off', 'Write-Off');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '7', 'Marked for Rescheduling', 'Marked for Rescheduling');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '8', 'Recovery Repayment', 'Recovery Repayment');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '9', 'Waive Charges', 'Waive Charges');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '10', 'Apply Charges', 'Apply Charges');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '11', 'Apply Interest', 'Apply Interest');
INSERT INTO `m_currency`
(`id`,`code`,`decimal_places`,`display_symbol`,`name`, `internationalized_name_code`)
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,'$','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,'Bs.','Bolivian Boliviano','currency.BOB'),
(20,'BRL',2,'R$','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,'BZ$','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,'$','Chilean Peso','currency.CLP'),
(30,'CNY',2,NULL,'Chinese Yuan Renminbi','currency.CNY'),
(31,'COP',2,'$','Colombian Peso','currency.COP'),
(32,'CRC',2,'₡','Costa Rican Colon','currency.CRC'),
(33,'CSD',2,NULL,'Serbian Dinar','currency.CSD'),
(34,'CUP',2,'$MN','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,'RD$','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 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'),
(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,'Q','Guatemala Quetzal','currency.GTQ'),
(56,'GYD',2,NULL,'Guyana Dollar','currency.GYD'),
(57,'HKD',2,NULL,'Hong Kong Dollar','currency.HKD'),
(58,'HNL',2,'L','Honduras Lempira','currency.HNL'),
(59,'HRK',2,NULL,'Croatian Kuna','currency.HRK'),
(60,'HTG',2,'G','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,'$','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,'C$','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,'B/.','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,'₲','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 Pound','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,'$U','Peso Uruguayo','currency.UYU'),
(150,'UZS',2,NULL,'Uzbekistan Sum','currency.UZS'),
(151,'VEB',2,'Bs.F.','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');
-- ======== end of currencies ==
INSERT INTO `m_organisation_currency` (`id`, `code`, `decimal_places`, `name`, `display_symbol`, `internationalized_name_code`)
VALUES (21,'USD',2,'US Dollar','$','currency.USD');
INSERT INTO `m_office` (`id`, `parent_id`, `hierarchy`, `external_id`, `name`, `opening_date`)
VALUES
(1,NULL,'.','1','Head Office','2009-01-01');
INSERT INTO `m_group_level` (`id`, `parent_id`, `super_parent`, `level_name`, `recursable`, `can_have_clients`)
VALUES (1, NULL, 1, 'Center', 1, 0);
INSERT INTO `m_group_level` (`id`, `parent_id`, `super_parent`, `level_name`, `recursable`, `can_have_clients`)
VALUES (2, 1, 0, 'Group', 0, 1);
-- create single code and code value for client identifiers
INSERT INTO `m_code`
(`code_name`, `is_system_defined`)
VALUES
('Customer Identifier',1),
('LoanCollateral',1),
('LoanPurpose',1),
('Gender',1),
('YesNo',1),
('GuarantorRelationship',1);
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Passport', 1
from m_code mc
where mc.`code_name` = "Customer Identifier";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Id', 2
from m_code mc
where mc.`code_name` = "Customer Identifier";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Drivers License', 3
from m_code mc
where mc.`code_name` = "Customer Identifier";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Any Other Id Type', 4
from m_code mc
where mc.`code_name` = "Customer Identifier";
-- Adding a few Default Guarantor Relationships
insert into m_code_value (code_id,code_value,order_position)
select id,"Spouse",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Parent",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Sibling",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Business Associate",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Other",0
from m_code
where m_code.code_name="GuarantorRelationship";
@@ -0,0 +1,334 @@
-- ========= roles and permissions =========
/*
this scripts removes all current m_role_permission and m_permission entries
and then inserts new m_permission entries and just one m_role_permission entry
which gives the role (id 1 - super user) an ALL_FUNCTIONS permission
If you had other roles set up with specific permissions you will have to set up their permissions again.
*/
-- truncate `m_role_permission`;
-- truncate `m_permission`;
-- truncate `x_registered_table`;
INSERT INTO `m_permission`
(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES
('special','ALL_FUNCTIONS',NULL,NULL,0),
('special','ALL_FUNCTIONS_READ',NULL,NULL,0),
('special', 'CHECKER_SUPER_USER', NULL, NULL, '0'),
('special','REPORTING_SUPER_USER',NULL,NULL,0),
('authorisation','READ_PERMISSION','PERMISSION','READ',0),
('authorisation','PERMISSIONS_ROLE','ROLE','PERMISSIONS',1),
('authorisation','CREATE_ROLE','ROLE','CREATE',1),
('authorisation','CREATE_ROLE_CHECKER','ROLE','CREATE',0),
('authorisation','READ_ROLE','ROLE','READ',0),
('authorisation','UPDATE_ROLE','ROLE','UPDATE',1),
('authorisation','UPDATE_ROLE_CHECKER','ROLE','UPDATE',0),
('authorisation','DELETE_ROLE','ROLE','DELETE',1),
('authorisation','DELETE_ROLE_CHECKER','ROLE','DELETE',0),
('authorisation','CREATE_USER','USER','CREATE',1),
('authorisation','CREATE_USER_CHECKER','USER','CREATE',0),
('authorisation','READ_USER','USER','READ',0),
('authorisation','UPDATE_USER','USER','UPDATE',1),
('authorisation','UPDATE_USER_CHECKER','USER','UPDATE',0),
('authorisation','DELETE_USER','USER','DELETE',1),
('authorisation','DELETE_USER_CHECKER','USER','DELETE',0),
('configuration','READ_CONFIGURATION','CONFIGURATION','READ',1),
('configuration','UPDATE_CONFIGURATION','CONFIGURATION','UPDATE',1),
('configuration','UPDATE_CONFIGURATION_CHECKER','CONFIGURATION','UPDATE',0),
('configuration','READ_CODE','CODE','READ',0),
('configuration','CREATE_CODE','CODE','CREATE',1),
('configuration','CREATE_CODE_CHECKER','CODE','CREATE',0),
('configuration','UPDATE_CODE','CODE','UPDATE',1),
('configuration','UPDATE_CODE_CHECKER','CODE','UPDATE',0),
('configuration','DELETE_CODE','CODE','DELETE',1),
('configuration','DELETE_CODE_CHECKER','CODE','DELETE',0),
('configuration', 'READ_CODEVALUE', 'CODEVALUE', 'READ', '0'),
('configuration', 'CREATE_CODEVALUE', 'CODEVALUE', 'CREATE', '1'),
('configuration', 'CREATE_CODEVALUE_CHECKER', 'CODEVALUE', 'CREATE', '0'),
('configuration', 'UPDATE_CODEVALUE', 'CODEVALUE', 'UPDATE', '1'),
('configuration', 'UPDATE_CODEVALUE_CHECKER', 'CODEVALUE', 'UPDATE', '0'),
('configuration', 'DELETE_CODEVALUE', 'CODEVALUE', 'DELETE', '1'),
('configuration', 'DELETE_CODEVALUE_CHECKER', 'CODEVALUE', 'DELETE', '0'),
('configuration','READ_CURRENCY','CURRENCY','READ',0),
('configuration','UPDATE_CURRENCY','CURRENCY','UPDATE',1),
('configuration','UPDATE_CURRENCY_CHECKER','CURRENCY','UPDATE',0),
('configuration', 'UPDATE_PERMISSION', 'PERMISSION', 'UPDATE', '1'),
('configuration', 'UPDATE_PERMISSION_CHECKER', 'PERMISSION', 'UPDATE', '0'),
('configuration', 'READ_DATATABLE', 'DATATABLE', 'READ', '0'),
('configuration', 'REGISTER_DATATABLE', 'DATATABLE', 'REGISTER', '1'),
('configuration', 'REGISTER_DATATABLE_CHECKER', 'DATATABLE', 'REGISTER', '0'),
('configuration', 'DEREGISTER_DATATABLE', 'DATATABLE', 'DEREGISTER', '1'),
('configuration', 'DEREGISTER_DATATABLE_CHECKER', 'DATATABLE', 'DEREGISTER', '0'),
('configuration', 'READ_AUDIT', 'AUDIT', 'READ', '0'),
('configuration', 'CREATE_CALENDAR', 'CALENDAR', 'CREATE', '0'),
('configuration', 'READ_CALENDAR', 'CALENDAR', 'READ', '0'),
('configuration', 'UPDATE_CALENDAR', 'CALENDAR', 'UPDATE', '0'),
('configuration', 'DELETE_CALENDAR', 'CALENDAR', 'DELETE', '0'),
('configuration', 'CREATE_CALENDAR_CHECKER', 'CALENDAR', 'CREATE', '0'),
('configuration', 'UPDATE_CALENDAR_CHECKER', 'CALENDAR', 'UPDATE', '0'),
('configuration', 'DELETE_CALENDAR_CHECKER', 'CALENDAR', 'DELETE', '0'),
('organisation', 'READ_MAKERCHECKER', 'MAKERCHECKER', 'READ', '0'),
('organisation', 'READ_CHARGE', 'CHARGE', 'READ', '0'),
('organisation', 'CREATE_CHARGE', 'CHARGE', 'CREATE', '1'),
('organisation', 'CREATE_CHARGE_CHECKER', 'CHARGE', 'CREATE', '0'),
('organisation', 'UPDATE_CHARGE', 'CHARGE', 'UPDATE', '1'),
('organisation', 'UPDATE_CHARGE_CHECKER', 'CHARGE', 'UPDATE', '0'),
('organisation', 'DELETE_CHARGE', 'CHARGE', 'DELETE', '1'),
('organisation', 'DELETE_CHARGE_CHECKER', 'CHARGE', 'DELETE', '0'),
('organisation', 'READ_FUND', 'FUND', 'READ', '0'),
('organisation', 'CREATE_FUND', 'FUND', 'CREATE', '1'),
('organisation', 'CREATE_FUND_CHECKER', 'FUND', 'CREATE', '0'),
('organisation', 'UPDATE_FUND', 'FUND', 'UPDATE', '1'),
('organisation', 'UPDATE_FUND_CHECKER', 'FUND', 'UPDATE', '0'),
('organisation', 'DELETE_FUND', 'FUND', 'DELETE', '1'),
('organisation', 'DELETE_FUND_CHECKER', 'FUND', 'DELETE', '0'),
('organisation', 'READ_LOANPRODUCT', 'LOANPRODUCT', 'READ', '0'),
('organisation', 'CREATE_LOANPRODUCT', 'LOANPRODUCT', 'CREATE', '1'),
('organisation', 'CREATE_LOANPRODUCT_CHECKER', 'LOANPRODUCT', 'CREATE', '0'),
('organisation', 'UPDATE_LOANPRODUCT', 'LOANPRODUCT', 'UPDATE', '1'),
('organisation', 'UPDATE_LOANPRODUCT_CHECKER', 'LOANPRODUCT', 'UPDATE', '0'),
('organisation', 'DELETE_LOANPRODUCT', 'LOANPRODUCT', 'DELETE', '1'),
('organisation', 'DELETE_LOANPRODUCT_CHECKER', 'LOANPRODUCT', 'DELETE', '0'),
('organisation', 'READ_OFFICE', 'OFFICE', 'READ', '0'),
('organisation', 'CREATE_OFFICE', 'OFFICE', 'CREATE', '1'),
('organisation', 'CREATE_OFFICE_CHECKER', 'OFFICE', 'CREATE', '0'),
('organisation', 'UPDATE_OFFICE', 'OFFICE', 'UPDATE', '1'),
('organisation', 'UPDATE_OFFICE_CHECKER', 'OFFICE', 'UPDATE', '0'),
('organisation', 'READ_OFFICETRANSACTION', 'OFFICETRANSACTION', 'READ', '0'),
('organisation', 'DELETE_OFFICE_CHECKER', 'OFFICE', 'DELETE', '0'),
('organisation', 'CREATE_OFFICETRANSACTION', 'OFFICETRANSACTION', 'CREATE', '1'),
('organisation', 'CREATE_OFFICETRANSACTION_CHECKER', 'OFFICETRANSACTION', 'CREATE', '0'),
('organisation', 'DELETE_OFFICETRANSACTION', 'OFFICETRANSACTION', 'DELETE', 1),
('organisation', 'DELETE_OFFICETRANSACTION_CHECKER', 'OFFICETRANSACTION', 'DELETE', 0),
('organisation', 'READ_STAFF', 'STAFF', 'READ', '0'),
('organisation', 'CREATE_STAFF', 'STAFF', 'CREATE', '1'),
('organisation', 'CREATE_STAFF_CHECKER', 'STAFF', 'CREATE', '0'),
('organisation', 'UPDATE_STAFF', 'STAFF', 'UPDATE', '1'),
('organisation', 'UPDATE_STAFF_CHECKER', 'STAFF', 'UPDATE', '0'),
('organisation', 'DELETE_STAFF', 'STAFF', 'DELETE', '1'),
('organisation', 'DELETE_STAFF_CHECKER', 'STAFF', 'DELETE', '0'),
('organisation', 'READ_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'READ', '0'),
('organisation', 'CREATE_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'CREATE', '1'),
('organisation', 'CREATE_SAVINGSPRODUCT_CHECKER', 'SAVINGSPRODUCT', 'CREATE', '0'),
('organisation', 'UPDATE_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'UPDATE', '1'),
('organisation', 'UPDATE_SAVINGSPRODUCT_CHECKER', 'SAVINGSPRODUCT', 'UPDATE', '0'),
('organisation', 'DELETE_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'DELETE', '1'),
('organisation', 'DELETE_SAVINGSPRODUCT_CHECKER', 'SAVINGSPRODUCT', 'DELETE', '0'),
('portfolio', 'READ_LOAN', 'LOAN', 'READ', '0'),
('portfolio', 'CREATE_LOAN', 'LOAN', 'CREATE', '1'),
('portfolio', 'CREATE_LOAN_CHECKER', 'LOAN', 'CREATE', '0'),
('portfolio', 'UPDATE_LOAN', 'LOAN', 'UPDATE', '1'),
('portfolio', 'UPDATE_LOAN_CHECKER', 'LOAN', 'UPDATE', '0'),
('portfolio', 'DELETE_LOAN', 'LOAN', 'DELETE', '1'),
('portfolio', 'DELETE_LOAN_CHECKER', 'LOAN', 'DELETE', '0'),
-- ('portfolio', 'CREATEHISTORIC_LOAN', 'LOAN', 'CREATEHISTORIC', '1'),
-- ('portfolio', 'CREATEHISTORIC_LOAN_CHECKER', 'LOAN', 'CREATEHISTORIC', '0'),
-- ('portfolio', 'UPDATEHISTORIC_LOAN', 'LOAN', 'UPDATEHISTORIC', '1'),
-- ('portfolio', 'UPDATEHISTORIC_LOAN_CHECKER', 'LOAN', 'UPDATEHISTORIC', '0'),
('portfolio', 'READ_CLIENT', 'CLIENT', 'READ', '0'),
('portfolio', 'CREATE_CLIENT', 'CLIENT', 'CREATE', '1'),
('portfolio', 'CREATE_CLIENT_CHECKER', 'CLIENT', 'CREATE', '0'),
('portfolio', 'UPDATE_CLIENT', 'CLIENT', 'UPDATE', '1'),
('portfolio', 'UPDATE_CLIENT_CHECKER', 'CLIENT', 'UPDATE', '0'),
('portfolio', 'DELETE_CLIENT', 'CLIENT', 'DELETE', '1'),
('portfolio', 'DELETE_CLIENT_CHECKER', 'CLIENT', 'DELETE', '0'),
('portfolio', 'READ_CLIENTIMAGE', 'CLIENTIMAGE', 'READ', '0'),
('portfolio', 'CREATE_CLIENTIMAGE', 'CLIENTIMAGE', 'CREATE', '1'),
('portfolio', 'CREATE_CLIENTIMAGE_CHECKER', 'CLIENTIMAGE', 'CREATE', '0'),
('portfolio', 'DELETE_CLIENTIMAGE', 'CLIENTIMAGE', 'DELETE', '1'),
('portfolio', 'DELETE_CLIENTIMAGE_CHECKER', 'CLIENTIMAGE', 'DELETE', '0'),
('portfolio', 'READ_CLIENTNOTE', 'CLIENTNOTE', 'READ', '0'),
('portfolio', 'CREATE_CLIENTNOTE', 'CLIENTNOTE', 'CREATE', '1'),
('portfolio', 'CREATE_CLIENTNOTE_CHECKER', 'CLIENTNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_CLIENTNOTE', 'CLIENTNOTE', 'UPDATE', '1'),
('portfolio', 'UPDATE_CLIENTNOTE_CHECKER', 'CLIENTNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_CLIENTNOTE', 'CLIENTNOTE', 'DELETE', '1'),
('portfolio', 'DELETE_CLIENTNOTE_CHECKER', 'CLIENTNOTE', 'DELETE', '0'),
('portfolio', 'READ_GROUPNOTE', 'GROUPNOTE', 'READ', '0'),
('portfolio', 'CREATE_GROUPNOTE', 'GROUPNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_GROUPNOTE', 'GROUPNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_GROUPNOTE', 'GROUPNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'DELETE', '0'),
('portfolio', 'READ_LOANNOTE', 'LOANNOTE', 'READ', '0'),
('portfolio', 'CREATE_LOANNOTE', 'LOANNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_LOANNOTE', 'LOANNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_LOANNOTE', 'LOANNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_LOANNOTE_CHECKER', 'LOANNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_LOANNOTE_CHECKER', 'LOANNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_LOANNOTE_CHECKER', 'LOANNOTE', 'DELETE', '0'),
('portfolio', 'READ_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'READ', '0'),
('portfolio', 'CREATE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'DELETE', '0'),
('portfolio', 'READ_SAVINGNOTE', 'SAVINGNOTE', 'READ', '0'),
('portfolio', 'CREATE_SAVINGNOTE', 'SAVINGNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_SAVINGNOTE', 'SAVINGNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_SAVINGNOTE', 'SAVINGNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'DELETE', '0'),
('portfolio', 'READ_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'READ', '0'),
('portfolio', 'CREATE_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'CREATE', '1'),
('portfolio', 'CREATE_CLIENTIDENTIFIER_CHECKER', 'CLIENTIDENTIFIER', 'CREATE', '0'),
('portfolio', 'UPDATE_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'UPDATE', '1'),
('portfolio', 'UPDATE_CLIENTIDENTIFIER_CHECKER', 'CLIENTIDENTIFIER', 'UPDATE', '0'),
('portfolio', 'DELETE_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'DELETE', '1'),
('portfolio', 'DELETE_CLIENTIDENTIFIER_CHECKER', 'CLIENTIDENTIFIER', 'DELETE', '0'),
('portfolio', 'READ_DOCUMENT', 'DOCUMENT', 'READ', '0'),
('portfolio', 'CREATE_DOCUMENT', 'DOCUMENT', 'CREATE', '1'),
('portfolio', 'CREATE_DOCUMENT_CHECKER', 'DOCUMENT', 'CREATE', '0'),
('portfolio', 'UPDATE_DOCUMENT', 'DOCUMENT', 'UPDATE', '1'),
('portfolio', 'UPDATE_DOCUMENT_CHECKER', 'DOCUMENT', 'UPDATE', '0'),
('portfolio', 'DELETE_DOCUMENT', 'DOCUMENT', 'DELETE', '1'),
('portfolio', 'DELETE_DOCUMENT_CHECKER', 'DOCUMENT', 'DELETE', '0'),
('portfolio', 'READ_GROUP', 'GROUP', 'READ', '0'),
('portfolio', 'CREATE_GROUP', 'GROUP', 'CREATE', '1'),
('portfolio', 'CREATE_GROUP_CHECKER', 'GROUP', 'CREATE', '0'),
('portfolio', 'UPDATE_GROUP', 'GROUP', 'UPDATE', '1'),
('portfolio', 'UPDATE_GROUP_CHECKER', 'GROUP', 'UPDATE', '0'),
('portfolio', 'DELETE_GROUP', 'GROUP', 'DELETE', '1'),
('portfolio', 'DELETE_GROUP_CHECKER', 'GROUP', 'DELETE', '0'),
('portfolio', 'UNASSIGNSTAFF_GROUP', 'GROUP', 'UNASSIGNSTAFF', 1),
('portfolio', 'UNASSIGNSTAFF_GROUP_CHECKER', 'GROUP', 'UNASSIGNSTAFF', 0),
('portfolio', 'CREATE_LOANCHARGE', 'LOANCHARGE', 'CREATE', '1'),
('portfolio', 'CREATE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'CREATE', '0'),
('portfolio', 'UPDATE_LOANCHARGE', 'LOANCHARGE', 'UPDATE', '1'),
('portfolio', 'UPDATE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'UPDATE', '0'),
('portfolio', 'DELETE_LOANCHARGE', 'LOANCHARGE', 'DELETE', '1'),
('portfolio', 'DELETE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'DELETE', '0'),
('portfolio', 'WAIVE_LOANCHARGE', 'LOANCHARGE', 'WAIVE', '1'),
('portfolio', 'WAIVE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'WAIVE', '0'),
('portfolio', 'READ_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'READ', '0'),
('portfolio', 'CREATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'CREATE', '1'),
('portfolio', 'CREATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'CREATE', '0'),
('portfolio', 'UPDATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UPDATE', '1'),
('portfolio', 'UPDATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UPDATE', '0'),
('portfolio', 'DELETE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'DELETE', '1'),
('portfolio', 'DELETE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'DELETE', '0'),
('portfolio', 'READ_GUARANTOR', 'GUARANTOR', 'READ', 0),
('portfolio', 'CREATE_GUARANTOR', 'GUARANTOR', 'CREATE', 1),
('portfolio', 'CREATE_GUARANTOR_CHECKER', 'GUARANTOR', 'CREATE', 0),
('portfolio', 'UPDATE_GUARANTOR', 'GUARANTOR', 'UPDATE', 1),
('portfolio', 'UPDATE_GUARANTOR_CHECKER', 'GUARANTOR', 'UPDATE', 0),
('portfolio', 'DELETE_GUARANTOR', 'GUARANTOR', 'DELETE', 1),
('portfolio', 'DELETE_GUARANTOR_CHECKER', 'GUARANTOR', 'DELETE', 0),
('portfolio', 'READ_COLLATERAL', 'COLLATERAL', 'READ', '0'),
('portfolio', 'CREATE_COLLATERAL', 'COLLATERAL', 'CREATE', '1'),
('portfolio', 'UPDATE_COLLATERAL', 'COLLATERAL', 'UPDATE', '1'),
('portfolio', 'DELETE_COLLATERAL', 'COLLATERAL', 'DELETE', '1'),
('portfolio', 'CREATE_COLLATERAL_CHECKER', 'COLLATERAL', 'CREATE', '0'),
('portfolio', 'UPDATE_COLLATERAL_CHECKER', 'COLLATERAL', 'UPDATE', '0'),
('portfolio', 'DELETE_COLLATERAL_CHECKER', 'COLLATERAL', 'DELETE', '0'),
('transaction_loan', 'APPROVE_LOAN', 'LOAN', 'APPROVE', '1'),
('transaction_loan', 'APPROVEINPAST_LOAN', 'LOAN', 'APPROVEINPAST', '1'),
('transaction_loan', 'REJECT_LOAN', 'LOAN', 'REJECT', '1'),
('transaction_loan', 'REJECTINPAST_LOAN', 'LOAN', 'REJECTINPAST', '1'),
('transaction_loan', 'WITHDRAW_LOAN', 'LOAN', 'WITHDRAW', '1'),
('transaction_loan', 'WITHDRAWINPAST_LOAN', 'LOAN', 'WITHDRAWINPAST', '1'),
('transaction_loan', 'APPROVALUNDO_LOAN', 'LOAN', 'APPROVALUNDO', '1'),
('transaction_loan', 'DISBURSE_LOAN', 'LOAN', 'DISBURSE', '1'),
('transaction_loan', 'DISBURSEINPAST_LOAN', 'LOAN', 'DISBURSEINPAST', '1'),
('transaction_loan', 'DISBURSALUNDO_LOAN', 'LOAN', 'DISBURSALUNDO', '1'),
('transaction_loan', 'REPAYMENT_LOAN', 'LOAN', 'REPAYMENT', '1'),
('transaction_loan', 'REPAYMENTINPAST_LOAN', 'LOAN', 'REPAYMENTINPAST', '1'),
('transaction_loan', 'ADJUST_LOAN', 'LOAN', 'ADJUST', '1'),
('transaction_loan', 'WAIVEINTERESTPORTION_LOAN', 'LOAN', 'WAIVEINTERESTPORTION', '1'),
('transaction_loan', 'WRITEOFF_LOAN', 'LOAN', 'WRITEOFF', '1'),
('transaction_loan', 'CLOSE_LOAN', 'LOAN', 'CLOSE', '1'),
('transaction_loan', 'CLOSEASRESCHEDULED_LOAN', 'LOAN', 'CLOSEASRESCHEDULED', '1'),
('transaction_loan', 'UPDATELOANOFFICER_LOAN', 'LOAN', 'UPDATELOANOFFICER', 1),
('transaction_loan', 'UPDATELOANOFFICER_LOAN_CHECKER', 'LOAN', 'UPDATELOANOFFICER', 0),
('transaction_loan', 'REMOVELOANOFFICER_LOAN', 'LOAN', 'REMOVELOANOFFICER', 1),
('transaction_loan', 'REMOVELOANOFFICER_LOAN_CHECKER', 'LOAN', 'REMOVELOANOFFICER', 0),
('transaction_loan', 'BULKREASSIGN_LOAN', 'LOAN', 'BULKREASSIGN', '1'),
('transaction_loan', 'BULKREASSIGN_LOAN_CHECKER', 'LOAN', 'BULKREASSIGN', '0'),
('transaction_loan', 'APPROVE_LOAN_CHECKER', 'LOAN', 'APPROVE', '0'),
('transaction_loan', 'APPROVEINPAST_LOAN_CHECKER', 'LOAN', 'APPROVEINPAST', '0'),
('transaction_loan', 'REJECT_LOAN_CHECKER', 'LOAN', 'REJECT', '0'),
('transaction_loan', 'REJECTINPAST_LOAN_CHECKER', 'LOAN', 'REJECTINPAST', '0'),
('transaction_loan', 'WITHDRAW_LOAN_CHECKER', 'LOAN', 'WITHDRAW', '0'),
('transaction_loan', 'WITHDRAWINPAST_LOAN_CHECKER', 'LOAN', 'WITHDRAWINPAST', '0'),
('transaction_loan', 'APPROVALUNDO_LOAN_CHECKER', 'LOAN', 'APPROVALUNDO', '0'),
('transaction_loan', 'DISBURSE_LOAN_CHECKER', 'LOAN', 'DISBURSE', '0'),
('transaction_loan', 'DISBURSEINPAST_LOAN_CHECKER', 'LOAN', 'DISBURSEINPAST', '0'),
('transaction_loan', 'DISBURSALUNDO_LOAN_CHECKER', 'LOAN', 'DISBURSALUNDO', '0'),
('transaction_loan', 'REPAYMENT_LOAN_CHECKER', 'LOAN', 'REPAYMENT', '0'),
('transaction_loan', 'REPAYMENTINPAST_LOAN_CHECKER', 'LOAN', 'REPAYMENTINPAST', '0'),
('transaction_loan', 'ADJUST_LOAN_CHECKER', 'LOAN', 'ADJUST', '0'),
('transaction_loan', 'WAIVEINTERESTPORTION_LOAN_CHECKER', 'LOAN', 'WAIVEINTERESTPORTION', '0'),
('transaction_loan', 'WRITEOFF_LOAN_CHECKER', 'LOAN', 'WRITEOFF', '0'),
('transaction_loan', 'CLOSE_LOAN_CHECKER', 'LOAN', 'CLOSE', '0'),
('transaction_loan', 'CLOSEASRESCHEDULED_LOAN_CHECKER', 'LOAN', 'CLOSEASRESCHEDULED', '0'),
('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'DEPOSIT', '1'),
('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'DEPOSIT', '0'),
('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'WITHDRAWAL', '1'),
('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'WITHDRAWAL', '0'),
('transaction_savings', 'ACTIVATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'ACTIVATE', '1'),
('transaction_savings', 'ACTIVATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'ACTIVATE', '0'),
('transaction_savings', 'CALCULATEINTEREST_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'CALCULATEINTEREST', '1'),
('transaction_savings', 'CALCULATEINTEREST_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'CALCULATEINTEREST', '0');
-- == accounting related permissions
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES
('accounting', 'CREATE_GLACCOUNT', 'GLACCOUNT', 'CREATE', 1),
('accounting', 'UPDATE_GLACCOUNT', 'GLACCOUNT', 'UPDATE', 1),
('accounting', 'DELETE_GLACCOUNT', 'GLACCOUNT', 'DELETE', 1),
('accounting', 'CREATE_GLCLOSURE', 'GLCLOSURE', 'CREATE', 1),
('accounting', 'UPDATE_GLCLOSURE', 'GLCLOSURE', 'UPDATE', 1),
('accounting', 'DELETE_GLCLOSURE', 'GLCLOSURE', 'DELETE', 1),
('accounting', 'CREATE_JOURNALENTRY', 'JOURNALENTRY', 'CREATE', 1),
('accounting', 'REVERSE_JOURNALENTRY', 'JOURNALENTRY', 'REVERSE', 1);
INSERT INTO `m_role` (`id`, `name`, `description`)
VALUES
(1,'Super user','This role provides all application permissions.');
/* role 1 is super user, give it ALL_FUNCTIONS */
INSERT INTO m_role_permission(role_id, permission_id)
select 1, id
from m_permission
where code = 'ALL_FUNCTIONS';
INSERT INTO `m_appuser` (`id`, `office_id`, `username`, `firstname`, `lastname`, `password`, `email`,
`firsttime_login_remaining`, `nonexpired`, `nonlocked`, `nonexpired_credentials`, `enabled`)
VALUES
(1,1,'mifos','App','Administrator','5787039480429368bf94732aacc771cd0a3ea02bcf504ffe1185ab94213bc63a','demomfi@mifos.org','\0','','','','');
INSERT INTO `m_appuser_role` (`appuser_id`, `role_id`) VALUES (1,1);
-- Add in permissions for any special datatables added in base reference data
-- This needs to always happen at end of the script
/* add a create, read, update and delete permission for each registered datatable */
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('CREATE_', r.registered_table_name), r.registered_table_name, 'CREATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('READ_', r.registered_table_name), r.registered_table_name, 'READ'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('UPDATE_', r.registered_table_name), r.registered_table_name, 'UPDATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('DELETE_', r.registered_table_name), r.registered_table_name, 'DELETE'
from x_registered_table r;
/* regardless of inserted permission settings above, no permissions (transactions) are preselected as being part of the maker-checker process
so, just set the flag to false... the end-user can decide which permissions should be maker-checkerable
*/
update m_permission set can_maker_checker = false;
File diff suppressed because one or more lines are too long
@@ -0,0 +1,11 @@
ALTER TABLE `m_savings_product`
DROP COLUMN `nominal_interest_rate_period_frequency_enum`,
CHANGE COLUMN `nominal_interest_rate_per_period` `nominal_annual_interest_rate` DECIMAL(19,6) NOT NULL,
CHANGE COLUMN `interest_period_enum` `interest_compounding_period_enum` SMALLINT(5) NOT NULL;
ALTER TABLE `m_savings_account`
DROP COLUMN `annual_nominal_interest_rate`,
DROP COLUMN `nominal_interest_rate_period_frequency_enum`,
CHANGE COLUMN `nominal_interest_rate_per_period` `nominal_annual_interest_rate` DECIMAL(19,6) NOT NULL,
CHANGE COLUMN `interest_period_enum` `interest_compounding_period_enum` SMALLINT(5) NOT NULL;
@@ -0,0 +1,7 @@
ALTER TABLE `m_product_loan`
ADD COLUMN `min_principal_amount` DECIMAL(19,6) NOT NULL AFTER `principal_amount`,
ADD COLUMN `max_principal_amount` DECIMAL(19,6) NOT NULL AFTER `min_principal_amount`;
ALTER TABLE `m_loan`
ADD COLUMN `min_principal_amount` DECIMAL(19,6) NOT NULL AFTER `principal_amount`,
ADD COLUMN `max_principal_amount` DECIMAL(19,6) NOT NULL AFTER `min_principal_amount`;
@@ -0,0 +1,15 @@
/*
Remove READ_MAKERCHECKER permission as no longer used.
*/
delete from m_role_permission
where exists
(select 'f' from m_permission p
where p.id = m_role_permission.permission_id and p.code = 'READ_MAKERCHECKER');
delete from m_permission
where code = 'READ_MAKERCHECKER';
@@ -0,0 +1,3 @@
delete from m_permission where grouping = 'transaction_deposit';
@@ -0,0 +1,37 @@
ALTER TABLE `m_product_loan`
ADD COLUMN `min_nominal_interest_rate_per_period` DECIMAL(19,6) NOT NULL AFTER `nominal_interest_rate_per_period`,
ADD COLUMN `max_nominal_interest_rate_per_period` DECIMAL(19,6) NOT NULL AFTER `min_nominal_interest_rate_per_period`,
ADD COLUMN `min_number_of_repayments` SMALLINT(5) NOT NULL AFTER `number_of_repayments`,
ADD COLUMN `max_number_of_repayments` SMALLINT(5) NOT NULL AFTER `min_number_of_repayments`;
ALTER TABLE `m_loan`
ADD COLUMN `min_nominal_interest_rate_per_period` DECIMAL(19,6) NOT NULL AFTER `nominal_interest_rate_per_period`,
ADD COLUMN `max_nominal_interest_rate_per_period` DECIMAL(19,6) NOT NULL AFTER `min_nominal_interest_rate_per_period`,
ADD COLUMN `min_number_of_repayments` SMALLINT(5) NOT NULL AFTER `number_of_repayments`,
ADD COLUMN `max_number_of_repayments` SMALLINT(5) NOT NULL AFTER `min_number_of_repayments`;
ALTER TABLE `m_loan`
ALTER `min_principal_amount` DROP DEFAULT,
ALTER `max_principal_amount` DROP DEFAULT;
ALTER TABLE `m_loan`
CHANGE COLUMN `min_principal_amount` `min_principal_amount` DECIMAL(19,6) NULL AFTER `principal_amount`,
CHANGE COLUMN `max_principal_amount` `max_principal_amount` DECIMAL(19,6) NULL AFTER `min_principal_amount`,
CHANGE COLUMN `min_nominal_interest_rate_per_period` `min_nominal_interest_rate_per_period` DECIMAL(19,6) NULL AFTER `nominal_interest_rate_per_period`,
CHANGE COLUMN `max_nominal_interest_rate_per_period` `max_nominal_interest_rate_per_period` DECIMAL(19,6) NULL AFTER `min_nominal_interest_rate_per_period`,
CHANGE COLUMN `min_number_of_repayments` `min_number_of_repayments` SMALLINT(5) NULL AFTER `number_of_repayments`,
CHANGE COLUMN `max_number_of_repayments` `max_number_of_repayments` SMALLINT(5) NULL AFTER `min_number_of_repayments`;
ALTER TABLE `m_product_loan`
ALTER `min_principal_amount` DROP DEFAULT,
ALTER `max_principal_amount` DROP DEFAULT,
ALTER `min_nominal_interest_rate_per_period` DROP DEFAULT,
ALTER `max_nominal_interest_rate_per_period` DROP DEFAULT,
ALTER `min_number_of_repayments` DROP DEFAULT,
ALTER `max_number_of_repayments` DROP DEFAULT;
ALTER TABLE `m_product_loan`
CHANGE COLUMN `min_principal_amount` `min_principal_amount` DECIMAL(19,6) NULL AFTER `principal_amount`,
CHANGE COLUMN `max_principal_amount` `max_principal_amount` DECIMAL(19,6) NULL AFTER `min_principal_amount`,
CHANGE COLUMN `min_nominal_interest_rate_per_period` `min_nominal_interest_rate_per_period` DECIMAL(19,6) NULL AFTER `nominal_interest_rate_per_period`,
CHANGE COLUMN `max_nominal_interest_rate_per_period` `max_nominal_interest_rate_per_period` DECIMAL(19,6) NULL AFTER `min_nominal_interest_rate_per_period`,
CHANGE COLUMN `min_number_of_repayments` `min_number_of_repayments` SMALLINT(5) NULL AFTER `number_of_repayments`,
CHANGE COLUMN `max_number_of_repayments` `max_number_of_repayments` SMALLINT(5) NULL AFTER `min_number_of_repayments`;
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,21 @@
Bare Bones Demo
======
This demo database contains:
- DDL of latest schema
- Minimum reference data required for deployment of platform which is:
- Its mandatory to have one selected currency so we default to US Dollar
- Its mandatory to have one root or head office, so we have one created by default called a 'Head Office'
- Permissions supported/needed by latest release of software are setup
- Its mandatory to have at least one role when creating new users so we have one role created by default called 'Super user' which has the special permission 'Full Authorisation'. Any user with this role can do anything in the system.
- Its required to have at least one application user setup so remaining setup can be done through ui so we have on application user created by default with username 'mifos' with a password of 'password'. Application users must be associated with an office and a role so this user is associated with 'Head office' and 'Super user' role allowing this user to do any operation in any office(branch).
- Configuration
- No 'additional data' through the 'datatables' approach is setup
- One 'code' is setup called 'Client Identifier' with default values of {'Passport number'} - (required for Client Identity Document functionalty)
- Enable/Disable configuration has one entry named 'maker-checker' to allow people to enable disable this feature at global level. It is off or disabled by default.
- No products (loans, deposit, savings) are setup
- No Charges (fees or penalties) are setup
- No Staff (employees) are setup (loan officers are optional when submiting new loan application)
- No Portfolio data (no clients, groups, loan accounts, deposit accounts, savings accounts)
- No Accounting data (no chart of accounts is setup, by default accounting with respect to portfolio items is off unless enabled when creating a loan product.)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
CEDA Microfinance (Kampala, Uganda)
======
This demo database contains:
- DDL of latest schema
- Minimum reference data required for deployment of platform
- Customisatons for CEDA on m_code/m_code_value tables, extra datatables for client and loan data capture
- Extra reports over and beyond core reports customisation for CEDA operations
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,344 @@
DELETE FROM `ref_loan_transaction_processing_strategy` WHERE id in (1, 3, 4);
INSERT INTO `m_code` (`code_name`, `is_system_defined`)
VALUES
('FieldOfEmployment', '0'),
('EducationLevel', '0'),
('MaritalStatus', '0'),
('PovertyStatus', '0');
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Banker', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "FieldOfEmployment";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.SoftwareDeveloper', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "FieldOfEmployment";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.University', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "EducationLevel";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Secondary', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "EducationLevel";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Primary', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "EducationLevel";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Married', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "MaritalStatus";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Single', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "MaritalStatus";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Divorced', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "MaritalStatus";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Widow', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "MaritalStatus";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.PovertyStatus.Band1', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "PovertyStatus";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.PovertyStatus.Band2', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "PovertyStatus";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.PovertyStatus.Band3', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "PovertyStatus";
-- ======= ADD in loan purspose and collateral values to enable this functionality
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.House', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "LoanCollateral";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Television', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "LoanCollateral";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Gold', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "LoanCollateral";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Agriculture', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "LoanPurpose";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Manufacturing', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "LoanPurpose";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.HousingImprovement', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "LoanPurpose";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Male', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "Gender";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Female', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "Gender";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Yes', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "YesNo";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.No', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "YesNo";
DROP TABLE IF EXISTS `client additional data`;
CREATE TABLE `client additional data` (
`client_id` bigint(20) NOT NULL,
`Gender_cd` int(11) NOT NULL,
`Date of Birth` date NOT NULL,
`Home address` text NOT NULL,
`Telephone number` varchar(20) NOT NULL,
`Telephone number (2nd)` varchar(20) NOT NULL,
`Email address` varchar(50) NOT NULL,
`EducationLevel_cd` int(11) NOT NULL,
`MaritalStatus_cd` int(11) NOT NULL,
`Number of children` int(11) NOT NULL,
`Citizenship` varchar(50) NOT NULL,
`PovertyStatus_cd` int(11) NOT NULL,
`YesNo_cd_Employed` int(11) NOT NULL,
`FieldOfEmployment_cd_Field of employment` int(11) DEFAULT NULL,
`Employer name` varchar(50) DEFAULT NULL,
`Number of years` int(11) DEFAULT NULL,
`Monthly salary` decimal(19,6) DEFAULT NULL,
`YesNo_cd_Self employed` int(11) NOT NULL,
`FieldOfEmployment_cd_Field of self-employment` int(11) DEFAULT NULL,
`Business address` text,
`Number of employees` int(11) DEFAULT NULL,
`Monthly salaries paid` decimal(19,6) DEFAULT NULL,
`Monthly net income of business activity` decimal(19,6) DEFAULT NULL,
`Monthly rent` decimal(19,6) DEFAULT NULL,
`Other income generating activities` varchar(100) DEFAULT NULL,
`YesNo_cd_Bookkeeping` int(11) DEFAULT NULL,
`YesNo_cd_Loans with other institutions` int(11) NOT NULL,
`From whom` varchar(100) DEFAULT NULL,
`Amount` decimal(19,6) DEFAULT NULL,
`Interest rate pa` decimal(19,6) DEFAULT NULL,
`Number of people depending on overal income` int(11) NOT NULL,
`YesNo_cd_Bank account` int(11) NOT NULL,
`YesNo_cd_Business plan provided` int(11) NOT NULL,
`YesNo_cd_Access to internet` int(11) DEFAULT NULL,
`Introduced by` varchar(100) DEFAULT NULL,
`Known to introducer since` varchar(100) NOT NULL,
`Last visited by` varchar(100) DEFAULT NULL,
`Last visited on` date NOT NULL,
PRIMARY KEY (`client_id`),
CONSTRAINT `FK_client_additional_data` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `impact measurement`;
CREATE TABLE `impact measurement` (
`loan_id` bigint(20) NOT NULL,
`YesNo_cd_RepaidOnSchedule` int(11) NOT NULL,
`ReasonNotRepaidOnSchedule` text DEFAULT NULL,
`How was Loan Amount Invested` text NOT NULL,
`Additional Income Generated` decimal(19,6) NOT NULL,
`Additional Income Used For` text NOT NULL,
`YesNo_cd_NewJobsCreated` int(11) NOT NULL,
`Number of Jobs Created` bigint(20) DEFAULT NULL,
PRIMARY KEY (`loan_id`),
CONSTRAINT `FK_impact measurement` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `loan additional data`;
CREATE TABLE `loan additional data` (
`loan_id` bigint(20) NOT NULL,
`PurposeOfLoan_cd` int(11) NOT NULL,
`CollateralType_cd` int(11) NOT NULL,
`Collateral notes` text NOT NULL,
`YesNo_cd_Guarantor` int(11) NOT NULL,
`Guarantor name` varchar(100) DEFAULT NULL,
`Guarantor relation` varchar(100) DEFAULT NULL,
`Guarantor address` varchar(100) DEFAULT NULL,
`Guarantor telephone number` varchar(20) DEFAULT NULL,
PRIMARY KEY (`loan_id`),
CONSTRAINT `FK_loan_additional_data` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- datatables mapping
INSERT INTO `x_registered_table`
(`registered_table_name`,
`application_table_name`)
VALUES
('client additional data', 'm_client'),
('impact measurement', 'm_loan'),
('loan additional data', 'm_loan');
-- make sure permissions created for registered datatables
/* add a create, read, update and delete permission for each registered datatable */
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('CREATE_', r.registered_table_name), r.registered_table_name, 'CREATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('READ_', r.registered_table_name), r.registered_table_name, 'READ'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('UPDATE_', r.registered_table_name), r.registered_table_name, 'UPDATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('DELETE_', r.registered_table_name), r.registered_table_name, 'DELETE'
from x_registered_table r;
-- ==== Chart of Accounts =====
truncate `acc_gl_account`;
INSERT INTO `acc_gl_account` VALUES
(1,'Petty Cash Balances',NULL,'11100',0,1,2,1,NULL),
(2,'Cash in Valut 1',NULL,'11101',0,1,1,1,NULL),
(3,'Bank Balances',NULL,'11200',0,1,2,1,NULL),
(4,'Centenary Opening Account',NULL,'11201',0,1,1,1,NULL),
(5,'Centenary Expense Account',NULL,'11202',0,1,1,1,NULL),
(6,'Centenary USD Account',NULL,'11203',0,1,1,1,NULL),
(7,'Loans and Advances',NULL,'13100',0,1,2,1,NULL),
(8,'Loans to Clients',NULL,'13101',0,1,1,1,NULL),
(9,'Outstanding Interest',NULL,'13102',0,1,1,1,NULL),
(10,'Outstanding Late Payment Interest',NULL,'13103',0,1,1,1,NULL),
(11,'Outstanding Bank Fees to be collected',NULL,'13104',0,1,1,1,NULL),
(12,'WriteOff Accounts',NULL,'13200',0,1,2,1,NULL),
(13,'Write-offs (use for funds coming in)',NULL,'13201',0,1,1,1,NULL),
(14,'Write-offs outstanding principal',NULL,'13202',0,1,1,1,NULL),
(15,'Write-offs outstanding interest',NULL,'13203',0,1,1,1,NULL),
(16,'Write-offs collected bank fees',NULL,'13204',0,1,1,1,NULL),
(17,'Write-offs hardware/furniture',NULL,'13205',0,1,1,1,NULL),
(18,'Fixed Assets',NULL,'14100',0,1,2,1,NULL),
(19,'Office Equipment',NULL,'14101',0,1,1,1,NULL),
(20,'Suspense Items (unidentified deposits)',NULL,'15000',0,1,2,1,NULL),
(21,'Assets',NULL,'10000',0,1,2,1,NULL),
(22,'Liabilities',NULL,'20000',0,1,2,2,NULL),
(23,'Shares Account',NULL,'26100',0,1,2,2,NULL),
(24,'Shares Captial',NULL,'26101',0,1,1,2,NULL),
(25,'Donated Equity',NULL,'26300',0,1,2,2,NULL),
(26,'Donated Equity Ameropa Foundation',NULL,'26301',0,1,1,2,NULL),
(27,'Donated Equity e.h',NULL,'26302',0,1,1,2,NULL),
(28,'Overpaid Amounts',NULL,'27000',0,1,2,2,NULL),
(29,'Loss Provision',NULL,'28000',0,1,2,2,NULL),
(30,'Provision Outstanding Principal',NULL,'28001',0,1,1,2,NULL),
(31,'Provision Oustanding Interest',NULL,'28002',0,1,1,2,NULL),(32,'Income',NULL,'30000',0,1,2,4,NULL),
(33,'Interest Income from Loans',NULL,'31100',0,1,2,4,NULL),
(34,'Interest on Loans',NULL,'31101',0,1,1,4,NULL),
(35,'Late Payment Interest',NULL,'31102',0,1,1,4,NULL),
(36,'Income from Micro credit & Lending Activities',NULL,'31300',0,1,2,4,NULL),
(37,'Collected Bank Fees Receivable',NULL,'6201',0,1,1,4,NULL),
(38,'Deposits from Loans Write Off',NULL,'31400',0,1,2,4,NULL),
(39,'Expenditure',NULL,'40000',0,1,2,5,NULL),
(40,'Office Expenditure Account',NULL,'42100',0,1,2,5,NULL),
(41,'Water Charges',NULL,'42102',0,1,1,5,NULL),
(42,'Electricity Charges',NULL,'42103',0,1,1,5,NULL),
(43,'Printing and Stationary',NULL,'42105',0,1,1,5,NULL),
(44,'Office Rent',NULL,'42107',0,1,1,5,NULL),
(45,'Marketing Expense',NULL,'42109',0,1,1,5,NULL),
(46,'Office utilities',NULL,'42112',0,1,1,5,'(supplies, toiletries, kitchen)'),
(47,'Furniture',NULL,'42113',0,1,1,5,NULL),
(48,'CEDA Meeting Expense',NULL,'42114',0,1,1,5,NULL),
(49,'Employee Personal Expsense Account',NULL,'42200',0,1,2,5,NULL),
(50,'Salary Alice',NULL,'42201',0,1,1,5,NULL),
(51,'Salary Irene',NULL,'42202',0,1,1,5,NULL),
(52,'Salary Richard',NULL,'42203',0,1,1,5,NULL),
(53,'Salary Loan Officer TBA',NULL,'42204',0,1,1,5,NULL),
(54,'Medical Insurance Alice & Family',NULL,'42205',0,1,1,5,NULL),
(55,'Medical Insurance Irene',NULL,'42206',0,1,1,5,NULL),
(56,'Medical Insurance Richard',NULL,'42207',0,1,1,5,NULL),
(57,'Medical Insurance Loan Officer TBA',NULL,'42208',0,1,1,5,NULL),
(58,'PAYE all employees',NULL,'42209',0,1,1,5,NULL),
(59,'NSSF all employees',NULL,'42210',0,1,1,5,NULL),
(60,'Lunch Allowances all employees',NULL,'42211',0,1,1,5,NULL),
(61,'IT software and maintenance',NULL,'42300',0,1,2,5,NULL),
(62,'Mifos maintenance contract 12 months',NULL,'42301',0,1,1,5,NULL),
(63,'VPS Contract 12 months',NULL,'42302',0,1,1,5,NULL),
(64,'Bulk SMS Service',NULL,'42303',0,1,1,5,NULL),
(65,'Support Accounting Software',NULL,'42304',0,1,1,5,NULL),
(66,'Mifos Instance Setup',NULL,'42305',0,1,1,5,NULL),
(67,'Misc support expense',NULL,'42306',0,1,1,5,NULL),
(68,'Warid Mobile Line',NULL,'42307',0,1,1,5,NULL),
(69,'Landline',NULL,'42308',0,1,1,5,NULL),
(70,'Modem Alice',NULL,'42309',0,1,1,5,NULL),
(71,'Modem Irene',NULL,'42310',0,1,1,5,NULL),
(72,'Modem Richard',NULL,'42311',0,1,1,5,NULL),
(73,'Repairs',NULL,'42312',0,1,1,5,NULL),
(74,'Airtime Expenses',NULL,'42400',0,1,2,5,NULL),
(75,'Airtime Alice',NULL,'42401',0,1,1,5,NULL),
(76,'Airtime Richard',NULL,'42402',0,1,1,5,NULL),
(77,'Airtime Loan Office TBA',NULL,'42403',0,1,1,5,NULL),
(78,'Special Airtime Alice',NULL,'42404',0,1,1,5,NULL),
(79,'Transportation',NULL,'42500',0,1,2,5,NULL),
(80,'Flat monthly transportation cost',NULL,'42501',0,1,1,5,NULL),
(81,'Faciliation cost for Richard',NULL,'42502',0,1,1,5,NULL),
(82,'Faciliation cost for Loan Officer TBA',NULL,'42503',0,1,1,5,NULL),
(83,'Consultancy Expenses',NULL,'42600',0,1,2,5,NULL),
(84,'Audit Fees',NULL,'42601',0,1,1,5,NULL),
(85,'Legal Fees',NULL,'42602',0,1,1,5,NULL),
(86,'Miscellaneous Expenses Account',NULL,'42700',0,1,2,5,NULL),
(87,'MFI License',NULL,'42703',0,1,1,5,NULL),
(88,'Sundy Expenses',NULL,'42704',0,1,1,5,NULL),
(89,'Bank Fees',NULL,'42800',0,1,2,5,NULL),
(90,'Bank Charges Operating Account',NULL,'42801',0,1,1,5,NULL),
(91,'Bank Charges Expense Account',NULL,'42802',0,1,1,5,NULL),
(92,'E.H Account',NULL,'42900',0,1,2,5,NULL),
(93,'Airtime',NULL,'42901',0,1,1,5,NULL),
(94,'Modem',NULL,'42902',0,1,1,5,NULL),
(95,'Meals',NULL,'42903',0,1,1,5,NULL),
(96,'Transportation',NULL,'42904',0,1,1,5,NULL),
(97,'Miscellaneous',NULL,'42905',0,1,1,5,NULL);
@@ -0,0 +1,104 @@
DELETE FROM `m_organisation_currency` WHERE id>0;
INSERT INTO `m_organisation_currency`
(
`code`,
`decimal_places`,
`name`,
`display_symbol`,
`internationalized_name_code`)
VALUES
('UGX', 2, 'Uganda Shilling', 'USh', 'currency.UGX');
UPDATE `m_appuser` SET `username` = 'admin' WHERE id=1;
INSERT INTO `m_appuser`
(`is_deleted`,
`office_id`,
`username`,
`firstname`,
`lastname`,
`password`,
`email`,
`firsttime_login_remaining`,
`nonexpired`,
`nonlocked`,
`nonexpired_credentials`,
`enabled`)
VALUES
(0, 1, 'keithwoodlock', 'Keith', 'Woodlock',
'4f607e9b6cffbe7d3db92d4bfa3391c7aa751727b4ea29d08fddf9dd72e6e7e3', 'keithwoodlock@gmail.com', 0, 1, 1, 1, 1);
INSERT INTO `m_appuser_role`
(`appuser_id`,`role_id`) VALUES (2,1);
UPDATE `m_office` SET `name` = 'CEDA Microfinance Ltd.' WHERE id=1;
INSERT INTO `m_office`
(
`parent_id`,
`hierarchy`,
`external_id`,
`name`,
`opening_date`)
VALUES
(1, '.2.', 2, 'Uganda (Kampala)', '2009-01-01');
INSERT INTO `m_staff`
(
`is_loan_officer`,
`office_id`,
`firstname`,
`lastname`,
`display_name`)
VALUES
(1, 1, 'CEDA HO', 'LoanOfficer', 'LoanOfficer, CEDA HO'),
(1, 2, 'Kampala', 'LoanOfficer', 'LoanOfficer, Kampala');
INSERT INTO `m_charge`
(
`name`,
`currency_code`,
`charge_applies_to_enum`,
`charge_time_enum`,
`charge_calculation_enum`,
`amount`,
`is_penalty`,
`is_active`,
`is_deleted`)
VALUES ('Bank Fee (per installment)', 'UGX', 1, 2, 1, 1500.000000, 0, 1, 0);
INSERT INTO `m_product_loan`
(
`currency_code`,
`currency_digits`,
`principal_amount`,
`min_principal_amount`,
`max_principal_amount`,
`arrearstolerance_amount`,
`name`,
`description`,
`fund_id`,
`nominal_interest_rate_per_period`,
`interest_period_frequency_enum`,
`annual_nominal_interest_rate`,
`interest_method_enum`,
`interest_calculated_in_period_enum`,
`repay_every`,
`repayment_period_frequency_enum`,
`number_of_repayments`,
`amortization_method_enum`,
`accounting_type`,
`loan_transaction_strategy_id`)
VALUES
('UGX', 2, 1000000.000000, 0, 1000000000000.000000, null , 'Kampala Product (with cash accounting)',
'Typical Kampala loan product with cash accounting enabled for testing.', null ,
24.000000, 3, 24.000000, 1, 1, 1, 2, 12, 1, 2, 2);
-- mapping of that loan product to GL Accounts
INSERT INTO `acc_product_mapping`
VALUES (1,4,1,1,1),(2,8,1,1,2),(3,34,1,1,3),(4,37,1,1,4),(5,35,1,1,5),(6,97,1,1,6);
@@ -0,0 +1,15 @@
default Demo
======
This demo database contains:
- DDL of latest schema
- Minimum reference data required for deployment of platform which is:
- Its mandatory to have one selected currency so we default to several of latin-america currencies
- Its mandatory to have one root or head office, so we have one created by default called a 'Latam HO'
- Permissions supported/needed by latest release of software are setup
- Its mandatory to have at least one role when creating new users so we have one role created by default called 'Super user' which has the special permission 'Full Authorisation'. Any user with this role can do anything in the system.
- Its required to have at least one application user setup so remaining setup can be done through ui so we have on application user created by default with username 'quipo' with a password of 'quipo'. Application users must be associated with an office and a role so this user is associated with 'Latam HO' and 'Super user' role allowing this user to do any operation in any office(branch).
Minimum amount of data to support api-docs interaction.
File diff suppressed because one or more lines are too long
@@ -0,0 +1,221 @@
-- add code and code values for datatables dropdowns
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Male', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "Gender";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Female', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "Gender";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.Yes', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "YesNo";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'option.No', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "YesNo";
INSERT INTO `m_code`
(`code_name`, `is_system_defined`)
VALUES
('Education',1);
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Primary', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "Education";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Secondary', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "Education";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'University', ifnull(max(mv.id), 1)
from m_code mc
join m_code_value mv on mv.code_id = mc.id
where mc.`code_name` = "Education";
-- ========= datatables=======
DROP TABLE IF EXISTS `extra_client_details`;
CREATE TABLE `extra_client_details` (
`client_id` bigint(20) NOT NULL,
`Business Description` varchar(100) DEFAULT NULL,
`Years in Business` int(11) DEFAULT NULL,
`Gender_cd` int(11) DEFAULT NULL,
`Education_cv` varchar(60) DEFAULT NULL,
`Next Visit` date DEFAULT NULL,
`Highest Rate Paid` decimal(19,6) DEFAULT NULL,
`Comment` text,
PRIMARY KEY (`client_id`),
CONSTRAINT `FK_extra_client_details` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `extra_family_details`;
CREATE TABLE `extra_family_details` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`client_id` bigint(20) NOT NULL,
`Name` varchar(40) DEFAULT NULL,
`Date of Birth` date DEFAULT NULL,
`Points Score` int(11) DEFAULT NULL,
`Education_cd_Highest` int(11) DEFAULT NULL,
`Other Notes` text,
PRIMARY KEY (`id`),
KEY `FK_Extra Family Details Data_1` (`client_id`),
CONSTRAINT `FK_family_details` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `extra_loan_details`;
CREATE TABLE `extra_loan_details` (
`loan_id` bigint(20) NOT NULL,
`Business Description` varchar(100) DEFAULT NULL,
`Years in Business` int(11) DEFAULT NULL,
`Gender_cd` int(11) DEFAULT NULL,
`Education_cv` varchar(60) DEFAULT NULL,
`Next Visit` date DEFAULT NULL,
`Highest Rate Paid` decimal(19,6) DEFAULT NULL,
`Comment` text,
PRIMARY KEY (`loan_id`),
CONSTRAINT `FK_extra_loan_details` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- datatables mapping
INSERT INTO `x_registered_table`
(`registered_table_name`,`application_table_name`)
VALUES
('extra_client_details', 'm_client'),
('extra_family_details', 'm_client'),
('extra_loan_details', 'm_loan');
-- make sure permissions created for registered datatables
/* add a create, read, update and delete permission for each registered datatable */
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('CREATE_', r.registered_table_name), r.registered_table_name, 'CREATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('READ_', r.registered_table_name), r.registered_table_name, 'READ'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('UPDATE_', r.registered_table_name), r.registered_table_name, 'UPDATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('DELETE_', r.registered_table_name), r.registered_table_name, 'DELETE'
from x_registered_table r;
-- ==== Chart of Accounts =====
truncate `acc_gl_account`;
INSERT INTO `acc_gl_account` VALUES
(1,'Petty Cash Balances',NULL,'11100',0,1,2,1,NULL),
(2,'Cash in Valut 1',NULL,'11101',0,1,1,1,NULL),
(3,'Bank Balances',NULL,'11200',0,1,2,1,NULL),
(4,'Centenary Opening Account',NULL,'11201',0,1,1,1,NULL),
(5,'Centenary Expense Account',NULL,'11202',0,1,1,1,NULL),
(6,'Centenary USD Account',NULL,'11203',0,1,1,1,NULL),
(7,'Loans and Advances',NULL,'13100',0,1,2,1,NULL),
(8,'Loans to Clients',NULL,'13101',0,1,1,1,NULL),
(9,'Outstanding Interest',NULL,'13102',0,1,1,1,NULL),
(10,'Outstanding Late Payment Interest',NULL,'13103',0,1,1,1,NULL),
(11,'Outstanding Bank Fees to be collected',NULL,'13104',0,1,1,1,NULL),
(12,'WriteOff Accounts',NULL,'13200',0,1,2,1,NULL),
(13,'Write-offs (use for funds coming in)',NULL,'13201',0,1,1,1,NULL),
(14,'Write-offs outstanding principal',NULL,'13202',0,1,1,1,NULL),
(15,'Write-offs outstanding interest',NULL,'13203',0,1,1,1,NULL),
(16,'Write-offs collected bank fees',NULL,'13204',0,1,1,1,NULL),
(17,'Write-offs hardware/furniture',NULL,'13205',0,1,1,1,NULL),
(18,'Fixed Assets',NULL,'14100',0,1,2,1,NULL),
(19,'Office Equipment',NULL,'14101',0,1,1,1,NULL),
(20,'Suspense Items (unidentified deposits)',NULL,'15000',0,1,2,1,NULL),
(21,'Assets',NULL,'10000',0,1,2,1,NULL),
(22,'Liabilities',NULL,'20000',0,1,2,2,NULL),
(23,'Shares Account',NULL,'26100',0,1,2,2,NULL),
(24,'Shares Captial',NULL,'26101',0,1,1,2,NULL),
(25,'Donated Equity',NULL,'26300',0,1,2,2,NULL),
(26,'Donated Equity Ameropa Foundation',NULL,'26301',0,1,1,2,NULL),
(27,'Donated Equity e.h',NULL,'26302',0,1,1,2,NULL),
(28,'Overpaid Amounts',NULL,'27000',0,1,2,2,NULL),
(29,'Loss Provision',NULL,'28000',0,1,2,2,NULL),
(30,'Provision Outstanding Principal',NULL,'28001',0,1,1,2,NULL),
(31,'Provision Oustanding Interest',NULL,'28002',0,1,1,2,NULL),(32,'Income',NULL,'30000',0,1,2,4,NULL),
(33,'Interest Income from Loans',NULL,'31100',0,1,2,4,NULL),
(34,'Interest on Loans',NULL,'31101',0,1,1,4,NULL),
(35,'Late Payment Interest',NULL,'31102',0,1,1,4,NULL),
(36,'Income from Micro credit & Lending Activities',NULL,'31300',0,1,2,4,NULL),
(37,'Collected Bank Fees Receivable',NULL,'6201',0,1,1,4,NULL),
(38,'Deposits from Loans Write Off',NULL,'31400',0,1,2,4,NULL),
(39,'Expenditure',NULL,'40000',0,1,2,5,NULL),
(40,'Office Expenditure Account',NULL,'42100',0,1,2,5,NULL),
(41,'Water Charges',NULL,'42102',0,1,1,5,NULL),
(42,'Electricity Charges',NULL,'42103',0,1,1,5,NULL),
(43,'Printing and Stationary',NULL,'42105',0,1,1,5,NULL),
(44,'Office Rent',NULL,'42107',0,1,1,5,NULL),
(45,'Marketing Expense',NULL,'42109',0,1,1,5,NULL),
(46,'Office utilities',NULL,'42112',0,1,1,5,'(supplies, toiletries, kitchen)'),
(47,'Furniture',NULL,'42113',0,1,1,5,NULL),
(48,'CEDA Meeting Expense',NULL,'42114',0,1,1,5,NULL),
(49,'Employee Personal Expsense Account',NULL,'42200',0,1,2,5,NULL),
(50,'Salary Alice',NULL,'42201',0,1,1,5,NULL),
(51,'Salary Irene',NULL,'42202',0,1,1,5,NULL),
(52,'Salary Richard',NULL,'42203',0,1,1,5,NULL),
(53,'Salary Loan Officer TBA',NULL,'42204',0,1,1,5,NULL),
(54,'Medical Insurance Alice & Family',NULL,'42205',0,1,1,5,NULL),
(55,'Medical Insurance Irene',NULL,'42206',0,1,1,5,NULL),
(56,'Medical Insurance Richard',NULL,'42207',0,1,1,5,NULL),
(57,'Medical Insurance Loan Officer TBA',NULL,'42208',0,1,1,5,NULL),
(58,'PAYE all employees',NULL,'42209',0,1,1,5,NULL),
(59,'NSSF all employees',NULL,'42210',0,1,1,5,NULL),
(60,'Lunch Allowances all employees',NULL,'42211',0,1,1,5,NULL),
(61,'IT software and maintenance',NULL,'42300',0,1,2,5,NULL),
(62,'Mifos maintenance contract 12 months',NULL,'42301',0,1,1,5,NULL),
(63,'VPS Contract 12 months',NULL,'42302',0,1,1,5,NULL),
(64,'Bulk SMS Service',NULL,'42303',0,1,1,5,NULL),
(65,'Support Accounting Software',NULL,'42304',0,1,1,5,NULL),
(66,'Mifos Instance Setup',NULL,'42305',0,1,1,5,NULL),
(67,'Misc support expense',NULL,'42306',0,1,1,5,NULL),
(68,'Warid Mobile Line',NULL,'42307',0,1,1,5,NULL),
(69,'Landline',NULL,'42308',0,1,1,5,NULL),
(70,'Modem Alice',NULL,'42309',0,1,1,5,NULL),
(71,'Modem Irene',NULL,'42310',0,1,1,5,NULL),
(72,'Modem Richard',NULL,'42311',0,1,1,5,NULL),
(73,'Repairs',NULL,'42312',0,1,1,5,NULL),
(74,'Airtime Expenses',NULL,'42400',0,1,2,5,NULL),
(75,'Airtime Alice',NULL,'42401',0,1,1,5,NULL),
(76,'Airtime Richard',NULL,'42402',0,1,1,5,NULL),
(77,'Airtime Loan Office TBA',NULL,'42403',0,1,1,5,NULL),
(78,'Special Airtime Alice',NULL,'42404',0,1,1,5,NULL),
(79,'Transportation',NULL,'42500',0,1,2,5,NULL),
(80,'Flat monthly transportation cost',NULL,'42501',0,1,1,5,NULL),
(81,'Faciliation cost for Richard',NULL,'42502',0,1,1,5,NULL),
(82,'Faciliation cost for Loan Officer TBA',NULL,'42503',0,1,1,5,NULL),
(83,'Consultancy Expenses',NULL,'42600',0,1,2,5,NULL),
(84,'Audit Fees',NULL,'42601',0,1,1,5,NULL),
(85,'Legal Fees',NULL,'42602',0,1,1,5,NULL),
(86,'Miscellaneous Expenses Account',NULL,'42700',0,1,2,5,NULL),
(87,'MFI License',NULL,'42703',0,1,1,5,NULL),
(88,'Sundy Expenses',NULL,'42704',0,1,1,5,NULL),
(89,'Bank Fees',NULL,'42800',0,1,2,5,NULL),
(90,'Bank Charges Operating Account',NULL,'42801',0,1,1,5,NULL),
(91,'Bank Charges Expense Account',NULL,'42802',0,1,1,5,NULL),
(92,'E.H Account',NULL,'42900',0,1,2,5,NULL),
(93,'Airtime',NULL,'42901',0,1,1,5,NULL),
(94,'Modem',NULL,'42902',0,1,1,5,NULL),
(95,'Meals',NULL,'42903',0,1,1,5,NULL),
(96,'Transportation',NULL,'42904',0,1,1,5,NULL),
(97,'Miscellaneous',NULL,'42905',0,1,1,5,NULL);
@@ -0,0 +1,16 @@
latam Demo
======
This demo database contains:
- DDL of latest schema
- Minimum reference data required for deployment of platform which is:
- Its mandatory to have one selected currency so we default to several of latin-america currencies
- Its mandatory to have one root or head office, so we have one created by default called a 'Latam HO'
- Permissions supported/needed by latest release of software are setup
- Its mandatory to have at least one role when creating new users so we have one role created by default called 'Super user' which has the special permission 'Full Authorisation'. Any user with this role can do anything in the system.
- Its required to have at least one application user setup so remaining setup can be done through ui so we have on application user created by default with username 'quipo' with a password of 'quipo'. Application users must be associated with an office and a role so this user is associated with 'Latam HO' and 'Super user' role allowing this user to do any operation in any office(branch).
- Configuration
- No 'additional data' through the 'datatables' approach is setup
- One 'code' is setup called 'Client Identifier' with default values of {'Passport number'} - (required for Client Identity Document functionalty)
- Enable/Disable configuration has one entry named 'maker-checker' to allow people to enable disable this feature at global level. It is off or disabled by default.
File diff suppressed because one or more lines are too long
@@ -0,0 +1,49 @@
DROP TABLE IF EXISTS `latam_extra_client_details`;
CREATE TABLE `latam_extra_client_details` (
`client_id` bigint(20) NOT NULL,
`Business Description` varchar(100) DEFAULT NULL,
`Years in Business` int(11) DEFAULT NULL,
`Gender_cd` int(11) DEFAULT NULL,
`Education_cv` varchar(60) DEFAULT NULL,
`Next Visit` date DEFAULT NULL,
`Highest Rate Paid` decimal(19,6) DEFAULT NULL,
`Comment` text,
PRIMARY KEY (`client_id`),
CONSTRAINT `FK_latam_extra_client_details` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `latam_family_details`;
CREATE TABLE `latam_family_details` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`client_id` bigint(20) NOT NULL,
`Name` varchar(40) DEFAULT NULL,
`Date of Birth` date DEFAULT NULL,
`Points Score` int(11) DEFAULT NULL,
`Education_cd_Highest` int(11) DEFAULT NULL,
`Other Notes` text,
PRIMARY KEY (`id`),
KEY `FK_Extra Family Details Data_1` (`client_id`),
CONSTRAINT `FK_latam_family_details` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `latam_extra_loan_details`;
CREATE TABLE `latam_extra_loan_details` (
`loan_id` bigint(20) NOT NULL,
`Business Description` varchar(100) DEFAULT NULL,
`Years in Business` int(11) DEFAULT NULL,
`Gender_cd` int(11) DEFAULT NULL,
`Education_cv` varchar(60) DEFAULT NULL,
`Next Visit` date DEFAULT NULL,
`Highest Rate Paid` decimal(19,6) DEFAULT NULL,
`Comment` text,
PRIMARY KEY (`loan_id`),
CONSTRAINT `FK_latam_extra_loan_details` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `mifostenant-latam`.`m_code` (`code_name`, `is_system_defined`) VALUES ('Gender', 1);
INSERT INTO `mifostenant-latam`.`m_code_value` (`code_id`, `code_value`, `order_position`) VALUES (2, 'Male', 1); INSERT INTO `mifostenant-latam`.`m_code_value` (`code_id`, `code_value`, `order_position`) VALUES (2, 'Female', 2);
INSERT INTO `mifostenant-latam`.`m_code` (`code_name`, `is_system_defined`) VALUES ('Education', 1);
INSERT INTO `mifostenant-latam`.`m_code_value` (`code_id`, `code_value`, `order_position`) VALUES (3, 'Primary', 1); INSERT INTO `mifostenant-latam`.`m_code_value` (`code_id`, `code_value`, `order_position`) VALUES (3, 'Secondary', 2); INSERT INTO `mifostenant-latam`.`m_code_value` (`code_id`, `code_value`, `order_position`) VALUES (3, 'University', 3);
@@ -1,14 +1,18 @@
-- drop tables in base-schema
-- drop tables in base-schema
SET foreign_key_checks = 0;
-- drop accounting subsystem
DROP TABLE IF EXISTS `acc_gl_account`;
DROP TABLE IF EXISTS `acc_gl_closure`;
DROP TABLE IF EXISTS `acc_gl_journal_entry`;
DROP TABLE IF EXISTS `acc_product_mapping`;
-- drop portfolio subsystem
DROP TABLE IF EXISTS `c_configuration`;
DROP TABLE IF EXISTS `m_appuser`;
DROP TABLE IF EXISTS `m_appuser_role`;
DROP TABLE IF EXISTS `m_calendar`;
DROP TABLE IF EXISTS `m_calendar_instance`;
DROP TABLE IF EXISTS `m_charge`;
DROP TABLE IF EXISTS `m_client`;
DROP TABLE IF EXISTS `m_client_identifier`;
@@ -20,9 +24,13 @@ DROP TABLE IF EXISTS `m_deposit_account_transaction`;
DROP TABLE IF EXISTS `m_document`;
DROP TABLE IF EXISTS `m_fund`;
DROP TABLE IF EXISTS `m_group`;
DROP TABLE IF EXISTS `m_group_level`;
DROP TABLE IF EXISTS `m_group_client`;
DROP TABLE IF EXISTS `m_guarantor`;
DROP TABLE IF EXISTS `m_loan`;
DROP TABLE IF EXISTS `m_loan_charge`;
DROP TABLE IF EXISTS `m_loan_arrears_aging`;
DROP TABLE IF EXISTS `m_loan_collateral`;
DROP TABLE IF EXISTS `m_loan_officer_assignment_history`;
DROP TABLE IF EXISTS `m_loan_repayment_schedule`;
DROP TABLE IF EXISTS `m_loan_transaction`;
@@ -35,11 +43,11 @@ DROP TABLE IF EXISTS `m_portfolio_command_source`;
DROP TABLE IF EXISTS `m_product_deposit`;
DROP TABLE IF EXISTS `m_product_loan`;
DROP TABLE IF EXISTS `m_product_loan_charge`;
DROP TABLE IF EXISTS `m_product_savings`;
DROP TABLE IF EXISTS `m_role`;
DROP TABLE IF EXISTS `m_role_permission`;
DROP TABLE IF EXISTS `m_saving_account`;
DROP TABLE IF EXISTS `m_saving_schedule`;
DROP TABLE IF EXISTS `m_savings_account`;
DROP TABLE IF EXISTS `m_savings_account_transaction`;
DROP TABLE IF EXISTS `m_savings_product`;
DROP TABLE IF EXISTS `m_staff`;
DROP TABLE IF EXISTS `ref_loan_transaction_processing_strategy`;
DROP TABLE IF EXISTS `x_registered_table`;
@@ -51,19 +59,6 @@ DROP TABLE IF EXISTS `stretchy_parameter`;
DROP TABLE IF EXISTS `stretchy_report`;
DROP TABLE IF EXISTS `stretchy_report_parameter`;
-- drop deprecated 'stretchydata tables' which were used previously for 'additional data'
DROP TABLE IF EXISTS `stretchydata_dataset`;
DROP TABLE IF EXISTS `stretchydata_dataset_fields`;
DROP TABLE IF EXISTS `stretchydata_datasettype`;
-- drop deprecated a 'additional data' tables
drop table IF EXISTS `m_client_xadditional information`;
drop table IF EXISTS `m_client_xhighly improbable info`;
drop table IF EXISTS `m_loan_xadditional information`;
-- drop deprecated a 'accounting' tables
DROP TABLE IF EXISTS `m_acc_coa`;
SET foreign_key_checks = 1;
-- DDL for reference/lookup tables
@@ -85,10 +80,6 @@ CREATE TABLE `m_organisation_currency` (
`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 DEFAULT CHARSET=utf8;
@@ -104,6 +95,13 @@ CREATE TABLE `ref_loan_transaction_processing_strategy` (
UNIQUE KEY `ltp_strategy_code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `c_configuration` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_code` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code_name` varchar(100) DEFAULT NULL,
@@ -133,10 +131,6 @@ CREATE TABLE `m_document` (
`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;
@@ -158,6 +152,37 @@ CREATE TABLE `x_registered_table` (
PRIMARY KEY (`registered_table_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_calendar` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(50) NOT NULL,
`description` varchar(100) DEFAULT NULL,
`location` varchar(50) DEFAULT NULL,
`start_date` date NOT NULL,
`end_date` date DEFAULT NULL,
`duration` smallint(6) DEFAULT NULL,
`calendar_type_enum` smallint(5) NOT NULL,
`repeating` tinyint(1) NOT NULL DEFAULT '0',
`recurrence` varchar(100) DEFAULT NULL,
`remind_by_enum` smallint(5) DEFAULT NULL,
`first_reminder` smallint(11) DEFAULT NULL,
`second_reminder` smallint(11) 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`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `m_calendar_instance` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`calendar_id` bigint(20) NOT NULL,
`entity_id` bigint(20) NOT NULL,
`entity_type_enum` smallint(5) NOT NULL,
PRIMARY KEY (`id`),
KEY `FK_m_calendar_m_calendar_instance` (`calendar_id`),
CONSTRAINT `FK_m_calendar_m_calendar_instance` FOREIGN KEY (`calendar_id`) REFERENCES `m_calendar` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ================= end of reference/lookup tables =============
-- DDL for office related tables
@@ -168,10 +193,6 @@ CREATE TABLE `m_office` (
`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`),
@@ -188,10 +209,6 @@ CREATE TABLE `m_office_transaction` (
`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`),
@@ -217,11 +234,8 @@ 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`)
PRIMARY KEY (`id`),
UNIQUE KEY `unq_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_role_permission` (
@@ -248,10 +262,6 @@ CREATE TABLE `m_appuser` (
`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`),
@@ -275,10 +285,13 @@ CREATE TABLE `m_portfolio_command_source` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`action_name` varchar(50) NOT NULL,
`entity_name` varchar(50) NOT NULL,
`api_operation` varchar(30) NOT NULL,
`api_resource` varchar(100) NOT NULL,
`office_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`client_id` bigint(20) DEFAULT NULL,
`loan_id` bigint(20) DEFAULT NULL,
`savings_account_id` bigint(20) DEFAULT NULL,
`api_get_url` varchar(100) NOT NULL,
`resource_id` bigint(20) DEFAULT NULL,
`api_subresource` varchar(100) DEFAULT NULL,
`subresource_id` bigint(20) DEFAULT NULL,
`command_as_json` text NOT NULL,
`maker_id` bigint(20) NOT NULL,
@@ -289,6 +302,15 @@ CREATE TABLE `m_portfolio_command_source` (
PRIMARY KEY (`id`),
KEY `FK_m_maker_m_appuser` (`maker_id`),
KEY `FK_m_checker_m_appuser` (`checker_id`),
KEY `action_name` (`action_name`),
KEY `entity_name` (`entity_name`,`resource_id`),
KEY `made_on_date` (`made_on_date`),
KEY `checked_on_date` (`checked_on_date`),
KEY `processing_result_enum` (`processing_result_enum`),
KEY `office_id` (`office_id`),
KEY `group_id` (`office_id`),
KEY `client_id` (`office_id`),
KEY `loan_id` (`office_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 DEFAULT CHARSET=utf8;
@@ -304,10 +326,6 @@ CREATE TABLE `m_charge` (
`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 DEFAULT CHARSET=utf8;
@@ -316,10 +334,6 @@ 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`)
@@ -332,10 +346,6 @@ CREATE TABLE `m_staff` (
`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`),
@@ -345,48 +355,56 @@ CREATE TABLE `m_staff` (
-- ============ end of organisation wide related tables ===========
-- DDL client/group related tables
CREATE TABLE `m_group_level` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`parent_id` INT(11) NULL DEFAULT NULL,
`super_parent` TINYINT(1) NOT NULL,
`level_name` VARCHAR(100) NOT NULL,
`recursable` TINYINT(1) NOT NULL,
`can_have_clients` TINYINT(1) NOT NULL,
PRIMARY KEY (`id`),
INDEX `Parent_levelId_reference` (`parent_id`),
CONSTRAINT `Parent_levelId_reference` FOREIGN KEY (`parent_id`) REFERENCES `m_group_level` (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_group` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`office_id` bigint(20) NOT NULL,
`name` varchar(100) DEFAULT NULL,
`staff_id` BIGINT(20) DEFAULT NULL,
`parent_id` BIGINT(20) NULL DEFAULT NULL,
`level_Id` INT(11) NOT NULL,
`hierarchy` VARCHAR(100) NULL DEFAULT NULL,
`name` varchar(100) NOT 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`),
UNIQUE KEY `name` (`name`, `level_id`),
UNIQUE KEY `external_id` (`external_id`, `level_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`)
KEY `staff_id` (`staff_id`),
CONSTRAINT `m_group_ibfk_1` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`),
CONSTRAINT `Parent_Id_reference` FOREIGN KEY (`parent_id`) REFERENCES `m_group` (`id`),
CONSTRAINT `FK_m_group_level` FOREIGN KEY (`level_Id`) REFERENCES `m_group_level` (`id`),
CONSTRAINT `FK_m_group_m_staff` FOREIGN KEY (`staff_id`) REFERENCES `m_staff` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_client` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_no` varchar(20) NOT NULL,
`office_id` bigint(20) NOT NULL,
`external_id` varchar(100) DEFAULT NULL,
`firstname` varchar(50) DEFAULT NULL,
`middlename` varchar(50) DEFAULT NULL,
`lastname` varchar(50) DEFAULT NULL,
`fullname` varchar(100) DEFAULT NULL,
`display_name` varchar(100) NOT NULL,
`image_key` varchar(500) DEFAULT NULL,
`joined_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 `account_no_UNIQUE` (`account_no`),
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 DEFAULT CHARSET=utf8;
@@ -420,78 +438,7 @@ CREATE TABLE `m_group_client` (
-- ==== end of client/group related tables ==========
-- DDL for financial products and related tables
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;
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,
`deposit_every` bigint(20) 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;
-- DDL for loan and loan related tables
CREATE TABLE `m_product_loan` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`currency_code` varchar(3) NOT NULL,
@@ -510,19 +457,13 @@ CREATE TABLE `m_product_loan` (
`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,
`accounting_type` smallint(5) NOT NULL,
`loan_transaction_strategy_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKAUD0000000000003` (`createdby_id`),
KEY `FKAUD0000000000004` (`lastmodifiedby_id`),
UNIQUE KEY `unq_name` (`name`),
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 DEFAULT CHARSET=utf8;
@@ -535,18 +476,16 @@ CREATE TABLE `m_product_loan_charge` (
CONSTRAINT `m_product_loan_charge_ibfk_2` FOREIGN KEY (`product_loan_id`) REFERENCES `m_product_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ============ end of financial product related tables ===========
-- DDL for loan and loan related tables
CREATE TABLE `m_loan` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`account_no` varchar(20) NOT NULL,
`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,
`loanpurpose_cv_id` int(11) DEFAULT NULL,
`loan_status_id` smallint(5) NOT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
@@ -563,43 +502,120 @@ CREATE TABLE `m_loan` (
`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,
`submittedon_date` date DEFAULT NULL,
`submittedon_userid` bigint(20) DEFAULT NULL,
`approvedon_date` date DEFAULT NULL,
`approvedon_userid` bigint(20) 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,
`disbursedon_userid` bigint(20) 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,
`closedon_date` date DEFAULT NULL,
`closedon_userid` bigint(20) DEFAULT NULL,
`total_charges_due_at_disbursement_derived` decimal(19,6) DEFAULT NULL,
`principal_disbursed_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`principal_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`principal_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`principal_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_charged_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_charged_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_charged_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_repaid_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_expected_repayment_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_repayment_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_expected_costofloan_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_costofloan_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_waived_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_writtenoff_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_outstanding_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`rejectedon_date` date DEFAULT NULL,
`rejectedon_userid` bigint(20) DEFAULT NULL,
`rescheduledon_date` date DEFAULT NULL,
`withdrawnon_date` date DEFAULT NULL,
`withdrawnon_userid` bigint(20) DEFAULT NULL,
`writtenoffon_date` date DEFAULT NULL,
`loan_transaction_strategy_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `org_id` (`external_id`),
UNIQUE KEY `loan_account_no_UNIQUE` (`account_no`),
UNIQUE KEY `loan_externalid_UNIQUE` (`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`),
KEY `FK_m_loanpurpose_codevalue` (`loanpurpose_cv_id`),
KEY `FK_submittedon_userid` (`submittedon_userid`),
KEY `FK_approvedon_userid` (`approvedon_userid`),
KEY `FK_rejectedon_userid` (`rejectedon_userid`),
KEY `FK_withdrawnon_userid` (`withdrawnon_userid`),
KEY `FK_disbursedon_userid` (`disbursedon_userid`),
KEY `FK_closedon_userid` (`closedon_userid`),
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_approvedon_userid` FOREIGN KEY (`approvedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_closedon_userid` FOREIGN KEY (`closedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_disbursedon_userid` FOREIGN KEY (`disbursedon_userid`) REFERENCES `m_appuser` (`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_loanpurpose_codevalue` FOREIGN KEY (`loanpurpose_cv_id`) REFERENCES `m_code_value` (`id`),
CONSTRAINT `FK_m_loan_m_staff` FOREIGN KEY (`loan_officer_id`) REFERENCES `m_staff` (`id`),
CONSTRAINT `FK_rejectedon_userid` FOREIGN KEY (`rejectedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_submittedon_userid` FOREIGN KEY (`submittedon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_withdrawnon_userid` FOREIGN KEY (`withdrawnon_userid`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `m_loan_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_loan_arrears_aging` (
`loan_id` bigint(20) NOT NULL AUTO_INCREMENT,
`principal_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`interest_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`fee_charges_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`penalty_charges_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`total_overdue_derived` decimal(19,6) NOT NULL DEFAULT '0.000000',
`overdue_since_date_derived` date DEFAULT NULL,
PRIMARY KEY (`loan_id`),
CONSTRAINT `m_loan_arrears_aging_ibfk_1` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_guarantor` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`loan_id` BIGINT(20) NOT NULL,
`client_reln_cv_id` INT(11) DEFAULT NULL,
`type_enum` SMALLINT(5) NOT NULL,
`entity_id` BIGINT(20) NULL DEFAULT NULL,
`firstname` VARCHAR(50) NULL DEFAULT NULL,
`lastname` VARCHAR(50) NULL DEFAULT NULL,
`dob` DATE NULL DEFAULT NULL,
`address_line_1` VARCHAR(500) NULL DEFAULT NULL,
`address_line_2` VARCHAR(500) NULL DEFAULT NULL,
`city` VARCHAR(50) NULL DEFAULT NULL,
`state` VARCHAR(50) NULL DEFAULT NULL,
`country` VARCHAR(50) NULL DEFAULT NULL,
`zip` VARCHAR(20) NULL DEFAULT NULL,
`house_phone_number` VARCHAR(20) NULL DEFAULT NULL,
`mobile_number` VARCHAR(20) NULL DEFAULT NULL,
`comment` VARCHAR(500) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_guarantor_m_loan` (`loan_id`),
CONSTRAINT `FK_m_guarantor_m_code_value` FOREIGN KEY (`client_reln_cv_id`) REFERENCES `m_code_value` (`id`)
CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_loan_charge` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`loan_id` bigint(20) NOT NULL,
@@ -616,6 +632,7 @@ CREATE TABLE `m_loan_charge` (
`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',
`waived` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `charge_id` (`charge_id`),
KEY `m_loan_charge_ibfk_2` (`loan_id`),
@@ -623,6 +640,19 @@ CREATE TABLE `m_loan_charge` (
CONSTRAINT `m_loan_charge_ibfk_2` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_loan_collateral` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`loan_id` bigint(20) NOT NULL,
`type_cv_id` int(11) NOT NULL,
`value` DECIMAL(19,6) DEFAULT NULL,
`description` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK_collateral_m_loan` (`loan_id`),
KEY `FK_collateral_code_value` (`type_cv_id`),
CONSTRAINT `FK_collateral_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `FK_collateral_code_value` FOREIGN KEY (`type_cv_id`) REFERENCES `m_code_value` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_loan_officer_assignment_history` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`loan_id` bigint(20) NOT NULL,
@@ -674,172 +704,100 @@ CREATE TABLE `m_loan_repayment_schedule` (
CREATE TABLE `m_loan_transaction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`loan_id` bigint(20) NOT NULL,
`is_reversed` TINYINT(1) 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`)
CONSTRAINT `FKCFCEA42640BE0710` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ======== end of loan related tables ==========
-- DDL for deposit account related tables
CREATE TABLE `m_deposit_account` (
CREATE TABLE `m_savings_product` (
`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,
`name` varchar(100) NOT NULL,
`description` varchar(500) 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',
`available_interest` decimal(19,6) DEFAULT '0.000000',
`interest_posted_amount` decimal(19,6) DEFAULT '0.000000',
`last_interest_posted_date` date DEFAULT NULL,
`next_interest_posting_date` date DEFAULT NULL,
`is_renewal_allowed` tinyint(1) NOT NULL DEFAULT '0',
`renewed_account_id` bigint(20) DEFAULT NULL,
`is_preclosure_allowed` tinyint(1) NOT NULL DEFAULT '0',
`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,
`nominal_interest_rate_per_period` decimal(19,6) NOT NULL,
`nominal_interest_rate_period_frequency_enum` smallint(5) NOT NULL,
`interest_period_enum` SMALLINT(5) NOT NULL,
`interest_calculation_type_enum` SMALLINT(5) NOT NULL,
`interest_calculation_days_in_year_type_enum` SMALLINT(5) NOT NULL,
`min_required_opening_balance` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency_enum` smallint(5) 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`)
UNIQUE KEY `sp_unq_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_deposit_account_transaction` (
CREATE TABLE `m_savings_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`deposit_account_id` bigint(20) NOT NULL,
`account_no` varchar(20) NOT NULL,
`external_id` varchar(100) DEFAULT NULL,
`client_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`product_id` bigint(20) DEFAULT NULL,
`status_enum` SMALLINT(5) NOT NULL DEFAULT 300,
`activation_date` DATE DEFAULT NULL,
`currency_code` varchar(3) NOT NULL,
`currency_digits` smallint(5) NOT NULL,
`nominal_interest_rate_per_period` decimal(19,6) NOT NULL,
`nominal_interest_rate_period_frequency_enum` smallint(5) NOT NULL,
`annual_nominal_interest_rate` decimal(19,6) NOT NULL,
`interest_period_enum` SMALLINT(5) NOT NULL,
`interest_calculation_type_enum` SMALLINT(5) NOT NULL,
`interest_calculation_days_in_year_type_enum` SMALLINT(5) NOT NULL,
`min_required_opening_balance` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency` decimal(19,6) DEFAULT NULL,
`lockin_period_frequency_enum` smallint(5) DEFAULT NULL,
`lockedin_until_date_derived` DATE DEFAULT NULL,
`total_deposits_derived` decimal(19,6) DEFAULT NULL,
`total_withdrawals_derived` decimal(19,6) DEFAULT NULL,
`total_interest_earned_derived` decimal(19,6) DEFAULT NULL,
`total_interest_posted_derived` decimal(19,6) DEFAULT NULL,
`account_balance_derived` decimal(19,6) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `sa_account_no_UNIQUE` (`account_no`),
UNIQUE KEY `sa_externalid_UNIQUE` (`external_id`),
KEY `FKSA00000000000001` (`client_id`),
KEY `FKSA00000000000002` (`group_id`),
KEY `FKSA00000000000003` (`product_id`),
CONSTRAINT `FKSA00000000000001` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FKSA00000000000002` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`),
CONSTRAINT `FKSA00000000000003` FOREIGN KEY (`product_id`) REFERENCES `m_savings_product` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `m_savings_account_transaction` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`savings_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,
`is_reversed` tinyint(1) NOT NULL,
`running_balance_derived` DECIMAL(19,6) NULL,
`balance_number_of_days_derived` INT NULL,
`balance_end_date_derived` DATE NULL,
`cumulative_balance_derived` DECIMAL(19,6) 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`)
KEY `FKSAT0000000001` (`savings_account_id`),
CONSTRAINT `FKSAT0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ======= end of deposit account related tables
-- DDL for savings account related tables
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,
`deposit_every` bigint(20) 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;
CREATE TABLE `m_saving_schedule` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`saving_account_id` bigint(20) NOT NULL,
`duedate` date NOT NULL,
`installment` smallint(5) NOT NULL,
`deposit` decimal(21,4) NOT NULL,
`payment_date` date DEFAULT NULL,
`deposit_paid` decimal(21,4) DEFAULT NULL,
`completed_derived` bit(1) NOT NULL,
`createdby_id` bigint(20) DEFAULT NULL,
`created_date` datetime DEFAULT NULL,
`lastmodified_date` datetime DEFAULT NULL,
`lastmodifiedby_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKSS00000000001` (`saving_account_id`),
CONSTRAINT `FKSS00000000001` FOREIGN KEY (`saving_account_id`) REFERENCES `m_saving_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- end of savings account related tables
-- DDL for notes associated with all client/group and financial accounts
CREATE TABLE `m_note` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`client_id` bigint(20) NOT NULL,
`client_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT 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,
@@ -850,18 +808,17 @@ CREATE TABLE `m_note` (
KEY `FK7C9708924D26803` (`loan_transaction_id`),
KEY `FK7C97089541F0A56` (`createdby_id`),
KEY `FK7C970897179A0CB` (`client_id`),
KEY `FK_m_note_m_group` (`group_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`)
CONSTRAINT `FK_m_note_m_group` FOREIGN KEY (`group_id`) REFERENCES `m_group` (`id`),
CONSTRAINT `FK7C970898F889C3F` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- DDL for accounting sub system related tables
CREATE TABLE `acc_gl_account` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
@@ -870,8 +827,8 @@ CREATE TABLE `acc_gl_account` (
`gl_code` varchar(45) NOT NULL,
`disabled` tinyint(1) NOT NULL DEFAULT '0',
`manual_journal_entries_allowed` tinyint(1) NOT NULL DEFAULT '1',
`header_account` tinyint(1) NOT NULL DEFAULT '0',
`classification` varchar(45) NOT NULL,
`account_usage` tinyint(1) NOT NULL DEFAULT '2',
`classification_enum` smallint(5) NOT NULL,
`description` varchar(500) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `acc_gl_code` (`gl_code`),
@@ -879,7 +836,6 @@ CREATE TABLE `acc_gl_account` (
CONSTRAINT `FK_ACC_0000000001` FOREIGN KEY (`parent_id`) REFERENCES `acc_gl_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `acc_gl_closure` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`office_id` bigint(20) NOT NULL,
@@ -907,12 +863,12 @@ CREATE TABLE `acc_gl_journal_entry` (
`reversal_id` bigint(20) DEFAULT NULL,
`transaction_id` varchar(50) NOT NULL,
`reversed` tinyint(1) NOT NULL DEFAULT '0',
`portfolio_generated` tinyint(1) NOT NULL DEFAULT '0',
`manual_entry` TINYINT(1) NOT NULL DEFAULT '0',
`entry_date` date NOT NULL,
`type` varchar(50) NOT NULL,
`type_enum` smallint(5) NOT NULL,
`amount` decimal(19,6) NOT NULL,
`description` varchar(500) DEFAULT NULL,
`entity_type` varchar(50) DEFAULT NULL,
`entity_type_enum` smallint(5) DEFAULT NULL,
`entity_id` bigint(20) DEFAULT NULL,
`createdby_id` bigint(20) NOT NULL,
`lastmodifiedby_id` bigint(20) NOT NULL,
@@ -930,6 +886,15 @@ CREATE TABLE `acc_gl_journal_entry` (
CONSTRAINT `FK_acc_gl_journal_entry_m_appuser_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_acc_gl_journal_entry_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `acc_product_mapping` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`gl_account_id` bigint(20) DEFAULT NULL,
`product_id` bigint(20) DEFAULT NULL,
`product_type` smallint(5) DEFAULT NULL,
`financial_account_type` smallint(5) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- =========== end of accounting related tables ==========
-- DDL for reporting related tables
@@ -950,8 +915,11 @@ CREATE TABLE `stretchy_parameter` (
`selectOne` varchar(1) DEFAULT NULL,
`selectAll` varchar(1) DEFAULT NULL,
`parameter_sql` text,
`parent_parameter_id` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`parameter_id`),
UNIQUE KEY `name_UNIQUE` (`parameter_name`)
UNIQUE KEY `name_UNIQUE` (`parameter_name`),
INDEX `fk_stretchy_parameter_0001_idx` (`parent_parameter_id`),
CONSTRAINT `fk_stretchy_parameter_0001` FOREIGN KEY (`parent_parameter_id`) REFERENCES `stretchy_parameter` (`parameter_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `stretchy_report` (
@@ -0,0 +1,321 @@
-- currency symbols may not apply through command line on windows so use a different client like mysql workbench
INSERT INTO `ref_loan_transaction_processing_strategy`
(`id`,`code`,`name`)
VALUES
(1, 'mifos-standard-strategy', 'Mifos style'),
(2, 'heavensfamily-strategy', 'Heavensfamily'),
(3, 'creocore-strategy', 'Creocore'),
(4, 'rbi-india-strategy', 'RBI (India)');
INSERT INTO `c_configuration`
(`name`, `enabled`)
VALUES
('maker-checker', 0);
INSERT INTO `r_enum_value`
VALUES
('amortization_method_enum',0,'Equal principle payments','Equal principle payments'),
('amortization_method_enum',1,'Equal installments','Equal installments'),
('interest_calculated_in_period_enum',0,'Daily','Daily'),
('interest_calculated_in_period_enum',1,'Same as repayment period','Same as repayment period'),
('interest_method_enum',0,'Declining Balance','Declining Balance'),
('interest_method_enum',1,'Flat','Flat'),
('interest_period_frequency_enum',2,'Per month','Per month'),
('interest_period_frequency_enum',3,'Per year','Per year'),
('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',601,'Written-Off','Written-Off'),
('loan_status_id',602,'Rescheduled','Rescheduled'),
('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)'),
('processing_result_enum',0,'invalid','Invalid'),
('processing_result_enum',1,'processed','Processed'),
('processing_result_enum',2,'awaiting.approval','Awaiting Approval'),
('processing_result_enum',3,'rejected','Rejected'),
('repayment_period_frequency_enum',0,'Days','Days'),
('repayment_period_frequency_enum',1,'Weeks','Weeks'),
('repayment_period_frequency_enum',2,'Months','Months'),
('term_period_frequency_enum',0,'Days','Days'),
('term_period_frequency_enum',1,'Weeks','Weeks'),
('term_period_frequency_enum',2,'Months','Months'),
('term_period_frequency_enum',3,'Years','Years');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '1', 'Disbursement', 'Disbursement');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '2', 'Repayment', 'Repayment');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '3', 'Contra', 'Contra');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '4', 'Waive Interest', 'Waive Interest');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '5', 'Repayment At Disbursement', 'Repayment At Disbursement');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '6', 'Write-Off', 'Write-Off');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '7', 'Marked for Rescheduling', 'Marked for Rescheduling');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '8', 'Recovery Repayment', 'Recovery Repayment');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '9', 'Waive Charges', 'Waive Charges');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '10', 'Apply Charges', 'Apply Charges');
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`)
VALUES ('transaction_type_enum', '11', 'Apply Interest', 'Apply Interest');
INSERT INTO `m_currency`
(`id`,`code`,`decimal_places`,`display_symbol`,`name`, `internationalized_name_code`)
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,'$','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,'Bs.','Bolivian Boliviano','currency.BOB'),
(20,'BRL',2,'R$','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,'BZ$','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,'$','Chilean Peso','currency.CLP'),
(30,'CNY',2,NULL,'Chinese Yuan Renminbi','currency.CNY'),
(31,'COP',2,'$','Colombian Peso','currency.COP'),
(32,'CRC',2,'₡','Costa Rican Colon','currency.CRC'),
(33,'CSD',2,NULL,'Serbian Dinar','currency.CSD'),
(34,'CUP',2,'$MN','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,'RD$','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 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'),
(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,'Q','Guatemala Quetzal','currency.GTQ'),
(56,'GYD',2,NULL,'Guyana Dollar','currency.GYD'),
(57,'HKD',2,NULL,'Hong Kong Dollar','currency.HKD'),
(58,'HNL',2,'L','Honduras Lempira','currency.HNL'),
(59,'HRK',2,NULL,'Croatian Kuna','currency.HRK'),
(60,'HTG',2,'G','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,'$','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,'C$','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,'B/.','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,'₲','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 Pound','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,'$U','Peso Uruguayo','currency.UYU'),
(150,'UZS',2,NULL,'Uzbekistan Sum','currency.UZS'),
(151,'VEB',2,'Bs.F.','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');
-- ======== end of currencies ==
INSERT INTO `m_organisation_currency` (`id`, `code`, `decimal_places`, `name`, `display_symbol`, `internationalized_name_code`)
VALUES (21,'USD',2,'US Dollar','$','currency.USD');
INSERT INTO `m_office` (`id`, `parent_id`, `hierarchy`, `external_id`, `name`, `opening_date`)
VALUES
(1,NULL,'.','1','Head Office','2009-01-01');
INSERT INTO `m_group_level` (`id`, `parent_id`, `super_parent`, `level_name`, `recursable`, `can_have_clients`)
VALUES (1, NULL, 1, 'Center', 1, 0);
INSERT INTO `m_group_level` (`id`, `parent_id`, `super_parent`, `level_name`, `recursable`, `can_have_clients`)
VALUES (2, 1, 0, 'Group', 0, 1);
-- create single code and code value for client identifiers
INSERT INTO `m_code`
(`code_name`, `is_system_defined`)
VALUES
('Customer Identifier',1),
('LoanCollateral',1),
('LoanPurpose',1),
('Gender',1),
('YesNo',1),
('GuarantorRelationship',1);
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Passport', 1
from m_code mc
where mc.`code_name` = "Customer Identifier";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Id', 2
from m_code mc
where mc.`code_name` = "Customer Identifier";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Drivers License', 3
from m_code mc
where mc.`code_name` = "Customer Identifier";
INSERT INTO `m_code_value`(`code_id`,`code_value`,`order_position`)
select mc.id, 'Any Other Id Type', 4
from m_code mc
where mc.`code_name` = "Customer Identifier";
-- Adding a few Default Guarantor Relationships
insert into m_code_value (code_id,code_value,order_position)
select id,"Spouse",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Parent",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Sibling",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Business Associate",0
from m_code
where m_code.code_name="GuarantorRelationship";
insert into m_code_value (code_id,code_value,order_position)
select id,"Other",0
from m_code
where m_code.code_name="GuarantorRelationship";
@@ -0,0 +1,334 @@

-- ========= roles and permissions =========
/*
this scripts removes all current m_role_permission and m_permission entries
and then inserts new m_permission entries and just one m_role_permission entry
which gives the role (id 1 - super user) an ALL_FUNCTIONS permission
If you had other roles set up with specific permissions you will have to set up their permissions again.
*/
-- truncate `m_role_permission`;
-- truncate `m_permission`;
-- truncate `x_registered_table`;
INSERT INTO `m_permission`
(`grouping`,`code`,`entity_name`,`action_name`,`can_maker_checker`) VALUES
('special','ALL_FUNCTIONS',NULL,NULL,0),
('special','ALL_FUNCTIONS_READ',NULL,NULL,0),
('special', 'CHECKER_SUPER_USER', NULL, NULL, '0'),
('special','REPORTING_SUPER_USER',NULL,NULL,0),
('authorisation','READ_PERMISSION','PERMISSION','READ',0),
('authorisation','PERMISSIONS_ROLE','ROLE','PERMISSIONS',1),
('authorisation','CREATE_ROLE','ROLE','CREATE',1),
('authorisation','CREATE_ROLE_CHECKER','ROLE','CREATE',0),
('authorisation','READ_ROLE','ROLE','READ',0),
('authorisation','UPDATE_ROLE','ROLE','UPDATE',1),
('authorisation','UPDATE_ROLE_CHECKER','ROLE','UPDATE',0),
('authorisation','DELETE_ROLE','ROLE','DELETE',1),
('authorisation','DELETE_ROLE_CHECKER','ROLE','DELETE',0),
('authorisation','CREATE_USER','USER','CREATE',1),
('authorisation','CREATE_USER_CHECKER','USER','CREATE',0),
('authorisation','READ_USER','USER','READ',0),
('authorisation','UPDATE_USER','USER','UPDATE',1),
('authorisation','UPDATE_USER_CHECKER','USER','UPDATE',0),
('authorisation','DELETE_USER','USER','DELETE',1),
('authorisation','DELETE_USER_CHECKER','USER','DELETE',0),
('configuration','READ_CONFIGURATION','CONFIGURATION','READ',1),
('configuration','UPDATE_CONFIGURATION','CONFIGURATION','UPDATE',1),
('configuration','UPDATE_CONFIGURATION_CHECKER','CONFIGURATION','UPDATE',0),
('configuration','READ_CODE','CODE','READ',0),
('configuration','CREATE_CODE','CODE','CREATE',1),
('configuration','CREATE_CODE_CHECKER','CODE','CREATE',0),
('configuration','UPDATE_CODE','CODE','UPDATE',1),
('configuration','UPDATE_CODE_CHECKER','CODE','UPDATE',0),
('configuration','DELETE_CODE','CODE','DELETE',1),
('configuration','DELETE_CODE_CHECKER','CODE','DELETE',0),
('configuration', 'READ_CODEVALUE', 'CODEVALUE', 'READ', '0'),
('configuration', 'CREATE_CODEVALUE', 'CODEVALUE', 'CREATE', '1'),
('configuration', 'CREATE_CODEVALUE_CHECKER', 'CODEVALUE', 'CREATE', '0'),
('configuration', 'UPDATE_CODEVALUE', 'CODEVALUE', 'UPDATE', '1'),
('configuration', 'UPDATE_CODEVALUE_CHECKER', 'CODEVALUE', 'UPDATE', '0'),
('configuration', 'DELETE_CODEVALUE', 'CODEVALUE', 'DELETE', '1'),
('configuration', 'DELETE_CODEVALUE_CHECKER', 'CODEVALUE', 'DELETE', '0'),
('configuration','READ_CURRENCY','CURRENCY','READ',0),
('configuration','UPDATE_CURRENCY','CURRENCY','UPDATE',1),
('configuration','UPDATE_CURRENCY_CHECKER','CURRENCY','UPDATE',0),
('configuration', 'UPDATE_PERMISSION', 'PERMISSION', 'UPDATE', '1'),
('configuration', 'UPDATE_PERMISSION_CHECKER', 'PERMISSION', 'UPDATE', '0'),
('configuration', 'READ_DATATABLE', 'DATATABLE', 'READ', '0'),
('configuration', 'REGISTER_DATATABLE', 'DATATABLE', 'REGISTER', '1'),
('configuration', 'REGISTER_DATATABLE_CHECKER', 'DATATABLE', 'REGISTER', '0'),
('configuration', 'DEREGISTER_DATATABLE', 'DATATABLE', 'DEREGISTER', '1'),
('configuration', 'DEREGISTER_DATATABLE_CHECKER', 'DATATABLE', 'DEREGISTER', '0'),
('configuration', 'READ_AUDIT', 'AUDIT', 'READ', '0'),
('configuration', 'CREATE_CALENDAR', 'CALENDAR', 'CREATE', '0'),
('configuration', 'READ_CALENDAR', 'CALENDAR', 'READ', '0'),
('configuration', 'UPDATE_CALENDAR', 'CALENDAR', 'UPDATE', '0'),
('configuration', 'DELETE_CALENDAR', 'CALENDAR', 'DELETE', '0'),
('configuration', 'CREATE_CALENDAR_CHECKER', 'CALENDAR', 'CREATE', '0'),
('configuration', 'UPDATE_CALENDAR_CHECKER', 'CALENDAR', 'UPDATE', '0'),
('configuration', 'DELETE_CALENDAR_CHECKER', 'CALENDAR', 'DELETE', '0'),
('organisation', 'READ_MAKERCHECKER', 'MAKERCHECKER', 'READ', '0'),
('organisation', 'READ_CHARGE', 'CHARGE', 'READ', '0'),
('organisation', 'CREATE_CHARGE', 'CHARGE', 'CREATE', '1'),
('organisation', 'CREATE_CHARGE_CHECKER', 'CHARGE', 'CREATE', '0'),
('organisation', 'UPDATE_CHARGE', 'CHARGE', 'UPDATE', '1'),
('organisation', 'UPDATE_CHARGE_CHECKER', 'CHARGE', 'UPDATE', '0'),
('organisation', 'DELETE_CHARGE', 'CHARGE', 'DELETE', '1'),
('organisation', 'DELETE_CHARGE_CHECKER', 'CHARGE', 'DELETE', '0'),
('organisation', 'READ_FUND', 'FUND', 'READ', '0'),
('organisation', 'CREATE_FUND', 'FUND', 'CREATE', '1'),
('organisation', 'CREATE_FUND_CHECKER', 'FUND', 'CREATE', '0'),
('organisation', 'UPDATE_FUND', 'FUND', 'UPDATE', '1'),
('organisation', 'UPDATE_FUND_CHECKER', 'FUND', 'UPDATE', '0'),
('organisation', 'DELETE_FUND', 'FUND', 'DELETE', '1'),
('organisation', 'DELETE_FUND_CHECKER', 'FUND', 'DELETE', '0'),
('organisation', 'READ_LOANPRODUCT', 'LOANPRODUCT', 'READ', '0'),
('organisation', 'CREATE_LOANPRODUCT', 'LOANPRODUCT', 'CREATE', '1'),
('organisation', 'CREATE_LOANPRODUCT_CHECKER', 'LOANPRODUCT', 'CREATE', '0'),
('organisation', 'UPDATE_LOANPRODUCT', 'LOANPRODUCT', 'UPDATE', '1'),
('organisation', 'UPDATE_LOANPRODUCT_CHECKER', 'LOANPRODUCT', 'UPDATE', '0'),
('organisation', 'DELETE_LOANPRODUCT', 'LOANPRODUCT', 'DELETE', '1'),
('organisation', 'DELETE_LOANPRODUCT_CHECKER', 'LOANPRODUCT', 'DELETE', '0'),
('organisation', 'READ_OFFICE', 'OFFICE', 'READ', '0'),
('organisation', 'CREATE_OFFICE', 'OFFICE', 'CREATE', '1'),
('organisation', 'CREATE_OFFICE_CHECKER', 'OFFICE', 'CREATE', '0'),
('organisation', 'UPDATE_OFFICE', 'OFFICE', 'UPDATE', '1'),
('organisation', 'UPDATE_OFFICE_CHECKER', 'OFFICE', 'UPDATE', '0'),
('organisation', 'READ_OFFICETRANSACTION', 'OFFICETRANSACTION', 'READ', '0'),
('organisation', 'DELETE_OFFICE_CHECKER', 'OFFICE', 'DELETE', '0'),
('organisation', 'CREATE_OFFICETRANSACTION', 'OFFICETRANSACTION', 'CREATE', '1'),
('organisation', 'CREATE_OFFICETRANSACTION_CHECKER', 'OFFICETRANSACTION', 'CREATE', '0'),
('organisation', 'DELETE_OFFICETRANSACTION', 'OFFICETRANSACTION', 'DELETE', 1),
('organisation', 'DELETE_OFFICETRANSACTION_CHECKER', 'OFFICETRANSACTION', 'DELETE', 0),
('organisation', 'READ_STAFF', 'STAFF', 'READ', '0'),
('organisation', 'CREATE_STAFF', 'STAFF', 'CREATE', '1'),
('organisation', 'CREATE_STAFF_CHECKER', 'STAFF', 'CREATE', '0'),
('organisation', 'UPDATE_STAFF', 'STAFF', 'UPDATE', '1'),
('organisation', 'UPDATE_STAFF_CHECKER', 'STAFF', 'UPDATE', '0'),
('organisation', 'DELETE_STAFF', 'STAFF', 'DELETE', '1'),
('organisation', 'DELETE_STAFF_CHECKER', 'STAFF', 'DELETE', '0'),
('organisation', 'READ_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'READ', '0'),
('organisation', 'CREATE_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'CREATE', '1'),
('organisation', 'CREATE_SAVINGSPRODUCT_CHECKER', 'SAVINGSPRODUCT', 'CREATE', '0'),
('organisation', 'UPDATE_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'UPDATE', '1'),
('organisation', 'UPDATE_SAVINGSPRODUCT_CHECKER', 'SAVINGSPRODUCT', 'UPDATE', '0'),
('organisation', 'DELETE_SAVINGSPRODUCT', 'SAVINGSPRODUCT', 'DELETE', '1'),
('organisation', 'DELETE_SAVINGSPRODUCT_CHECKER', 'SAVINGSPRODUCT', 'DELETE', '0'),
('portfolio', 'READ_LOAN', 'LOAN', 'READ', '0'),
('portfolio', 'CREATE_LOAN', 'LOAN', 'CREATE', '1'),
('portfolio', 'CREATE_LOAN_CHECKER', 'LOAN', 'CREATE', '0'),
('portfolio', 'UPDATE_LOAN', 'LOAN', 'UPDATE', '1'),
('portfolio', 'UPDATE_LOAN_CHECKER', 'LOAN', 'UPDATE', '0'),
('portfolio', 'DELETE_LOAN', 'LOAN', 'DELETE', '1'),
('portfolio', 'DELETE_LOAN_CHECKER', 'LOAN', 'DELETE', '0'),
-- ('portfolio', 'CREATEHISTORIC_LOAN', 'LOAN', 'CREATEHISTORIC', '1'),
-- ('portfolio', 'CREATEHISTORIC_LOAN_CHECKER', 'LOAN', 'CREATEHISTORIC', '0'),
-- ('portfolio', 'UPDATEHISTORIC_LOAN', 'LOAN', 'UPDATEHISTORIC', '1'),
-- ('portfolio', 'UPDATEHISTORIC_LOAN_CHECKER', 'LOAN', 'UPDATEHISTORIC', '0'),
('portfolio', 'READ_CLIENT', 'CLIENT', 'READ', '0'),
('portfolio', 'CREATE_CLIENT', 'CLIENT', 'CREATE', '1'),
('portfolio', 'CREATE_CLIENT_CHECKER', 'CLIENT', 'CREATE', '0'),
('portfolio', 'UPDATE_CLIENT', 'CLIENT', 'UPDATE', '1'),
('portfolio', 'UPDATE_CLIENT_CHECKER', 'CLIENT', 'UPDATE', '0'),
('portfolio', 'DELETE_CLIENT', 'CLIENT', 'DELETE', '1'),
('portfolio', 'DELETE_CLIENT_CHECKER', 'CLIENT', 'DELETE', '0'),
('portfolio', 'READ_CLIENTIMAGE', 'CLIENTIMAGE', 'READ', '0'),
('portfolio', 'CREATE_CLIENTIMAGE', 'CLIENTIMAGE', 'CREATE', '1'),
('portfolio', 'CREATE_CLIENTIMAGE_CHECKER', 'CLIENTIMAGE', 'CREATE', '0'),
('portfolio', 'DELETE_CLIENTIMAGE', 'CLIENTIMAGE', 'DELETE', '1'),
('portfolio', 'DELETE_CLIENTIMAGE_CHECKER', 'CLIENTIMAGE', 'DELETE', '0'),
('portfolio', 'READ_CLIENTNOTE', 'CLIENTNOTE', 'READ', '0'),
('portfolio', 'CREATE_CLIENTNOTE', 'CLIENTNOTE', 'CREATE', '1'),
('portfolio', 'CREATE_CLIENTNOTE_CHECKER', 'CLIENTNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_CLIENTNOTE', 'CLIENTNOTE', 'UPDATE', '1'),
('portfolio', 'UPDATE_CLIENTNOTE_CHECKER', 'CLIENTNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_CLIENTNOTE', 'CLIENTNOTE', 'DELETE', '1'),
('portfolio', 'DELETE_CLIENTNOTE_CHECKER', 'CLIENTNOTE', 'DELETE', '0'),
('portfolio', 'READ_GROUPNOTE', 'GROUPNOTE', 'READ', '0'),
('portfolio', 'CREATE_GROUPNOTE', 'GROUPNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_GROUPNOTE', 'GROUPNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_GROUPNOTE', 'GROUPNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_GROUPNOTE_CHECKER', 'GROUPNOTE', 'DELETE', '0'),
('portfolio', 'READ_LOANNOTE', 'LOANNOTE', 'READ', '0'),
('portfolio', 'CREATE_LOANNOTE', 'LOANNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_LOANNOTE', 'LOANNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_LOANNOTE', 'LOANNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_LOANNOTE_CHECKER', 'LOANNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_LOANNOTE_CHECKER', 'LOANNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_LOANNOTE_CHECKER', 'LOANNOTE', 'DELETE', '0'),
('portfolio', 'READ_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'READ', '0'),
('portfolio', 'CREATE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_LOANTRANSACTIONNOTE', 'LOANTRANSACTIONNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_LOANTRANSACTIONNOTE_CHECKER', 'LOANTRANSACTIONNOTE', 'DELETE', '0'),
('portfolio', 'READ_SAVINGNOTE', 'SAVINGNOTE', 'READ', '0'),
('portfolio', 'CREATE_SAVINGNOTE', 'SAVINGNOTE', 'CREATE', '1'),
('portfolio', 'UPDATE_SAVINGNOTE', 'SAVINGNOTE', 'UPDATE', '1'),
('portfolio', 'DELETE_SAVINGNOTE', 'SAVINGNOTE', 'DELETE', '1'),
('portfolio', 'CREATE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'CREATE', '0'),
('portfolio', 'UPDATE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'UPDATE', '0'),
('portfolio', 'DELETE_SAVINGNOTE_CHECKER', 'SAVINGNOTE', 'DELETE', '0'),
('portfolio', 'READ_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'READ', '0'),
('portfolio', 'CREATE_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'CREATE', '1'),
('portfolio', 'CREATE_CLIENTIDENTIFIER_CHECKER', 'CLIENTIDENTIFIER', 'CREATE', '0'),
('portfolio', 'UPDATE_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'UPDATE', '1'),
('portfolio', 'UPDATE_CLIENTIDENTIFIER_CHECKER', 'CLIENTIDENTIFIER', 'UPDATE', '0'),
('portfolio', 'DELETE_CLIENTIDENTIFIER', 'CLIENTIDENTIFIER', 'DELETE', '1'),
('portfolio', 'DELETE_CLIENTIDENTIFIER_CHECKER', 'CLIENTIDENTIFIER', 'DELETE', '0'),
('portfolio', 'READ_DOCUMENT', 'DOCUMENT', 'READ', '0'),
('portfolio', 'CREATE_DOCUMENT', 'DOCUMENT', 'CREATE', '1'),
('portfolio', 'CREATE_DOCUMENT_CHECKER', 'DOCUMENT', 'CREATE', '0'),
('portfolio', 'UPDATE_DOCUMENT', 'DOCUMENT', 'UPDATE', '1'),
('portfolio', 'UPDATE_DOCUMENT_CHECKER', 'DOCUMENT', 'UPDATE', '0'),
('portfolio', 'DELETE_DOCUMENT', 'DOCUMENT', 'DELETE', '1'),
('portfolio', 'DELETE_DOCUMENT_CHECKER', 'DOCUMENT', 'DELETE', '0'),
('portfolio', 'READ_GROUP', 'GROUP', 'READ', '0'),
('portfolio', 'CREATE_GROUP', 'GROUP', 'CREATE', '1'),
('portfolio', 'CREATE_GROUP_CHECKER', 'GROUP', 'CREATE', '0'),
('portfolio', 'UPDATE_GROUP', 'GROUP', 'UPDATE', '1'),
('portfolio', 'UPDATE_GROUP_CHECKER', 'GROUP', 'UPDATE', '0'),
('portfolio', 'DELETE_GROUP', 'GROUP', 'DELETE', '1'),
('portfolio', 'DELETE_GROUP_CHECKER', 'GROUP', 'DELETE', '0'),
('portfolio', 'UNASSIGNSTAFF_GROUP', 'GROUP', 'UNASSIGNSTAFF', 1),
('portfolio', 'UNASSIGNSTAFF_GROUP_CHECKER', 'GROUP', 'UNASSIGNSTAFF', 0),
('portfolio', 'CREATE_LOANCHARGE', 'LOANCHARGE', 'CREATE', '1'),
('portfolio', 'CREATE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'CREATE', '0'),
('portfolio', 'UPDATE_LOANCHARGE', 'LOANCHARGE', 'UPDATE', '1'),
('portfolio', 'UPDATE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'UPDATE', '0'),
('portfolio', 'DELETE_LOANCHARGE', 'LOANCHARGE', 'DELETE', '1'),
('portfolio', 'DELETE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'DELETE', '0'),
('portfolio', 'WAIVE_LOANCHARGE', 'LOANCHARGE', 'WAIVE', '1'),
('portfolio', 'WAIVE_LOANCHARGE_CHECKER', 'LOANCHARGE', 'WAIVE', '0'),
('portfolio', 'READ_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'READ', '0'),
('portfolio', 'CREATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'CREATE', '1'),
('portfolio', 'CREATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'CREATE', '0'),
('portfolio', 'UPDATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'UPDATE', '1'),
('portfolio', 'UPDATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'UPDATE', '0'),
('portfolio', 'DELETE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'DELETE', '1'),
('portfolio', 'DELETE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'DELETE', '0'),
('portfolio', 'READ_GUARANTOR', 'GUARANTOR', 'READ', 0),
('portfolio', 'CREATE_GUARANTOR', 'GUARANTOR', 'CREATE', 1),
('portfolio', 'CREATE_GUARANTOR_CHECKER', 'GUARANTOR', 'CREATE', 0),
('portfolio', 'UPDATE_GUARANTOR', 'GUARANTOR', 'UPDATE', 1),
('portfolio', 'UPDATE_GUARANTOR_CHECKER', 'GUARANTOR', 'UPDATE', 0),
('portfolio', 'DELETE_GUARANTOR', 'GUARANTOR', 'DELETE', 1),
('portfolio', 'DELETE_GUARANTOR_CHECKER', 'GUARANTOR', 'DELETE', 0),
('portfolio', 'READ_COLLATERAL', 'COLLATERAL', 'READ', '0'),
('portfolio', 'CREATE_COLLATERAL', 'COLLATERAL', 'CREATE', '1'),
('portfolio', 'UPDATE_COLLATERAL', 'COLLATERAL', 'UPDATE', '1'),
('portfolio', 'DELETE_COLLATERAL', 'COLLATERAL', 'DELETE', '1'),
('portfolio', 'CREATE_COLLATERAL_CHECKER', 'COLLATERAL', 'CREATE', '0'),
('portfolio', 'UPDATE_COLLATERAL_CHECKER', 'COLLATERAL', 'UPDATE', '0'),
('portfolio', 'DELETE_COLLATERAL_CHECKER', 'COLLATERAL', 'DELETE', '0'),
('transaction_loan', 'APPROVE_LOAN', 'LOAN', 'APPROVE', '1'),
('transaction_loan', 'APPROVEINPAST_LOAN', 'LOAN', 'APPROVEINPAST', '1'),
('transaction_loan', 'REJECT_LOAN', 'LOAN', 'REJECT', '1'),
('transaction_loan', 'REJECTINPAST_LOAN', 'LOAN', 'REJECTINPAST', '1'),
('transaction_loan', 'WITHDRAW_LOAN', 'LOAN', 'WITHDRAW', '1'),
('transaction_loan', 'WITHDRAWINPAST_LOAN', 'LOAN', 'WITHDRAWINPAST', '1'),
('transaction_loan', 'APPROVALUNDO_LOAN', 'LOAN', 'APPROVALUNDO', '1'),
('transaction_loan', 'DISBURSE_LOAN', 'LOAN', 'DISBURSE', '1'),
('transaction_loan', 'DISBURSEINPAST_LOAN', 'LOAN', 'DISBURSEINPAST', '1'),
('transaction_loan', 'DISBURSALUNDO_LOAN', 'LOAN', 'DISBURSALUNDO', '1'),
('transaction_loan', 'REPAYMENT_LOAN', 'LOAN', 'REPAYMENT', '1'),
('transaction_loan', 'REPAYMENTINPAST_LOAN', 'LOAN', 'REPAYMENTINPAST', '1'),
('transaction_loan', 'ADJUST_LOAN', 'LOAN', 'ADJUST', '1'),
('transaction_loan', 'WAIVEINTERESTPORTION_LOAN', 'LOAN', 'WAIVEINTERESTPORTION', '1'),
('transaction_loan', 'WRITEOFF_LOAN', 'LOAN', 'WRITEOFF', '1'),
('transaction_loan', 'CLOSE_LOAN', 'LOAN', 'CLOSE', '1'),
('transaction_loan', 'CLOSEASRESCHEDULED_LOAN', 'LOAN', 'CLOSEASRESCHEDULED', '1'),
('transaction_loan', 'UPDATELOANOFFICER_LOAN', 'LOAN', 'UPDATELOANOFFICER', 1),
('transaction_loan', 'UPDATELOANOFFICER_LOAN_CHECKER', 'LOAN', 'UPDATELOANOFFICER', 0),
('transaction_loan', 'REMOVELOANOFFICER_LOAN', 'LOAN', 'REMOVELOANOFFICER', 1),
('transaction_loan', 'REMOVELOANOFFICER_LOAN_CHECKER', 'LOAN', 'REMOVELOANOFFICER', 0),
('transaction_loan', 'BULKREASSIGN_LOAN', 'LOAN', 'BULKREASSIGN', '1'),
('transaction_loan', 'BULKREASSIGN_LOAN_CHECKER', 'LOAN', 'BULKREASSIGN', '0'),
('transaction_loan', 'APPROVE_LOAN_CHECKER', 'LOAN', 'APPROVE', '0'),
('transaction_loan', 'APPROVEINPAST_LOAN_CHECKER', 'LOAN', 'APPROVEINPAST', '0'),
('transaction_loan', 'REJECT_LOAN_CHECKER', 'LOAN', 'REJECT', '0'),
('transaction_loan', 'REJECTINPAST_LOAN_CHECKER', 'LOAN', 'REJECTINPAST', '0'),
('transaction_loan', 'WITHDRAW_LOAN_CHECKER', 'LOAN', 'WITHDRAW', '0'),
('transaction_loan', 'WITHDRAWINPAST_LOAN_CHECKER', 'LOAN', 'WITHDRAWINPAST', '0'),
('transaction_loan', 'APPROVALUNDO_LOAN_CHECKER', 'LOAN', 'APPROVALUNDO', '0'),
('transaction_loan', 'DISBURSE_LOAN_CHECKER', 'LOAN', 'DISBURSE', '0'),
('transaction_loan', 'DISBURSEINPAST_LOAN_CHECKER', 'LOAN', 'DISBURSEINPAST', '0'),
('transaction_loan', 'DISBURSALUNDO_LOAN_CHECKER', 'LOAN', 'DISBURSALUNDO', '0'),
('transaction_loan', 'REPAYMENT_LOAN_CHECKER', 'LOAN', 'REPAYMENT', '0'),
('transaction_loan', 'REPAYMENTINPAST_LOAN_CHECKER', 'LOAN', 'REPAYMENTINPAST', '0'),
('transaction_loan', 'ADJUST_LOAN_CHECKER', 'LOAN', 'ADJUST', '0'),
('transaction_loan', 'WAIVEINTERESTPORTION_LOAN_CHECKER', 'LOAN', 'WAIVEINTERESTPORTION', '0'),
('transaction_loan', 'WRITEOFF_LOAN_CHECKER', 'LOAN', 'WRITEOFF', '0'),
('transaction_loan', 'CLOSE_LOAN_CHECKER', 'LOAN', 'CLOSE', '0'),
('transaction_loan', 'CLOSEASRESCHEDULED_LOAN_CHECKER', 'LOAN', 'CLOSEASRESCHEDULED', '0'),
('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'DEPOSIT', '1'),
('transaction_savings', 'DEPOSIT_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'DEPOSIT', '0'),
('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'WITHDRAWAL', '1'),
('transaction_savings', 'WITHDRAWAL_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'WITHDRAWAL', '0'),
('transaction_savings', 'ACTIVATE_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'ACTIVATE', '1'),
('transaction_savings', 'ACTIVATE_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'ACTIVATE', '0'),
('transaction_savings', 'CALCULATEINTEREST_SAVINGSACCOUNT', 'SAVINGSACCOUNT', 'CALCULATEINTEREST', '1'),
('transaction_savings', 'CALCULATEINTEREST_SAVINGSACCOUNT_CHECKER', 'SAVINGSACCOUNT', 'CALCULATEINTEREST', '0');
-- == accounting related permissions
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES
('accounting', 'CREATE_GLACCOUNT', 'GLACCOUNT', 'CREATE', 1),
('accounting', 'UPDATE_GLACCOUNT', 'GLACCOUNT', 'UPDATE', 1),
('accounting', 'DELETE_GLACCOUNT', 'GLACCOUNT', 'DELETE', 1),
('accounting', 'CREATE_GLCLOSURE', 'GLCLOSURE', 'CREATE', 1),
('accounting', 'UPDATE_GLCLOSURE', 'GLCLOSURE', 'UPDATE', 1),
('accounting', 'DELETE_GLCLOSURE', 'GLCLOSURE', 'DELETE', 1),
('accounting', 'CREATE_JOURNALENTRY', 'JOURNALENTRY', 'CREATE', 1),
('accounting', 'REVERSE_JOURNALENTRY', 'JOURNALENTRY', 'REVERSE', 1);
INSERT INTO `m_role` (`id`, `name`, `description`)
VALUES
(1,'Super user','This role provides all application permissions.');
/* role 1 is super user, give it ALL_FUNCTIONS */
INSERT INTO m_role_permission(role_id, permission_id)
select 1, id
from m_permission
where code = 'ALL_FUNCTIONS';
INSERT INTO `m_appuser` (`id`, `office_id`, `username`, `firstname`, `lastname`, `password`, `email`,
`firsttime_login_remaining`, `nonexpired`, `nonlocked`, `nonexpired_credentials`, `enabled`)
VALUES
(1,1,'mifos','App','Administrator','5787039480429368bf94732aacc771cd0a3ea02bcf504ffe1185ab94213bc63a','demomfi@mifos.org','\0','','','','');
INSERT INTO `m_appuser_role` (`appuser_id`, `role_id`) VALUES (1,1);
-- Add in permissions for any special datatables added in base reference data
-- This needs to always happen at end of the script
/* add a create, read, update and delete permission for each registered datatable */
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('CREATE_', r.registered_table_name), r.registered_table_name, 'CREATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('READ_', r.registered_table_name), r.registered_table_name, 'READ'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('UPDATE_', r.registered_table_name), r.registered_table_name, 'UPDATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, entity_name, action_name)
select 'datatable', concat('DELETE_', r.registered_table_name), r.registered_table_name, 'DELETE'
from x_registered_table r;
/* regardless of inserted permission settings above, no permissions (transactions) are preselected as being part of the maker-checker process
so, just set the flag to false... the end-user can decide which permissions should be maker-checkerable
*/
update m_permission set can_maker_checker = false;
File diff suppressed because one or more lines are too long
@@ -1,3 +0,0 @@
alter table m_loan add column group_id bigint(20) after client_id;
alter table m_loan modify client_id bigint(20);
alter table m_loan add constraint foreign key (`group_id`) references `m_group` (`id`);
@@ -1,24 +0,0 @@
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(500) NOT NULL,
`description` VARCHAR(1000) NULL DEFAULT NULL,
`createdby_id` BIGINT(20) NULL DEFAULT NULL,
`lastmodifiedby_id` BIGINT(20) NULL DEFAULT NULL,
`created_date` DATETIME NULL DEFAULT NULL,
`lastmodified_date` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_client_document_m_client` (`client_id`),
INDEX `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 DEFAULT CHARSET=utf8;
insert into m_code values(9,'Customer Identifier');
insert into m_code_value values (null,'9','Driving Licence','1');
insert into m_code_value values (null,'9','Passport','2');
insert into m_code_value values (null,'9','PAN Card','3');
insert into m_code_value values (null,'9','Ration Card','4');
insert into m_code_value values (null,'9','Other','5');
@@ -1,3 +0,0 @@
alter table m_loan_repayment_schedule add column principal_writtenoff_derived decimal(19,6) DEFAULT NULL after principal_completed_derived;
alter table m_loan_repayment_schedule add column interest_writtenoff_derived decimal(19,6) DEFAULT NULL after interest_completed_derived;
@@ -1,9 +0,0 @@
ALTER TABLE `m_product_deposit`
ADD COLUMN `is_lock_in_period_allowed` tinyint(1) NOT NULL DEFAULT '0' AFTER `pre_closure_interest_rate`,
ADD COLUMN `lock_in_period` bigint(20) DEFAULT NULL AFTER `is_lock_in_period_allowed`,
ADD COLUMN `lock_in_period_type` smallint(5) NOT NULL DEFAULT '2' AFTER `lock_in_period`;
ALTER TABLE `m_deposit_account`
ADD COLUMN `is_lock_in_period_allowed` tinyint(1) NOT NULL DEFAULT '0' AFTER `pre_closure_interest_rate`,
ADD COLUMN `lock_in_period` bigint(20) DEFAULT NULL AFTER `is_lock_in_period_allowed`,
ADD COLUMN `lock_in_period_type` smallint(5) NOT NULL DEFAULT '2' AFTER `lock_in_period`;
@@ -1,17 +0,0 @@
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) NULL DEFAULT '0',
`type` VARCHAR(50) NULL DEFAULT NULL,
`description` VARCHAR(1000) NULL 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;
@@ -1 +0,0 @@
alter table m_loan_transaction drop column interest_waived_derived;
@@ -1,6 +0,0 @@
alter table m_product_loan drop column flexible_repayment_schedule;
alter table m_product_loan drop column interest_rebate;
alter table m_loan drop column flexible_repayment_schedule;
alter table m_loan drop column interest_rebate;
alter table m_loan drop column interest_rebate_amount;
@@ -1,8 +0,0 @@
alter table m_loan_transaction modify column principal_portion_derived decimal(19,6);
alter table m_loan_transaction modify column interest_portion_derived decimal(19,6);
alter table m_loan_transaction modify column charges_portion_derived decimal(19,6);
alter table m_product_loan modify column arrearstolerance_amount decimal(19,6);
@@ -1,20 +0,0 @@
drop table `m_client_identifier`;
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=0 DEFAULT CHARSET=utf8;
@@ -1,49 +0,0 @@
/* table used as an additional table for GK risk analysis
Also putting in default database as well for demos but not used for other tenants*/
DROP TABLE IF EXISTS `risk_analysis`;
CREATE TABLE `risk_analysis` (
`client_id` bigint(20) NOT NULL,
`proposed_loan_amount` decimal(19,6) DEFAULT NULL,
`assets_cash` decimal(19,6) DEFAULT NULL,
`assets_bank_accounts` decimal(19,6) DEFAULT NULL,
`assets_accounts_receivable` decimal(19,6) DEFAULT NULL,
`assets_inventory` decimal(19,6) DEFAULT NULL,
`assets_total_fixed_business` decimal(19,6) DEFAULT NULL,
`assets_total_business` decimal(19,6) DEFAULT NULL,
`assets_total_household` decimal(19,6) DEFAULT NULL,
`liabilities_accounts_payable` decimal(19,6) DEFAULT NULL,
`liabilities_business_debts` decimal(19,6) DEFAULT NULL,
`liabilities_total_business` decimal(19,6) DEFAULT NULL,
`liabilities_equity_working_capital` decimal(19,6) DEFAULT NULL,
`liabilities_total_household` decimal(19,6) DEFAULT NULL,
`liabilities_household_equity` decimal(19,6) DEFAULT NULL,
`cashflow_cash_sales` decimal(19,6) DEFAULT NULL,
`cashflow_cash_sales2` decimal(19,6) DEFAULT NULL,
`cashflow_cost_goods_sold` decimal(19,6) DEFAULT NULL,
`cashflow_cost_goods_sold2` decimal(19,6) DEFAULT NULL,
`cashflow_gross_profit` decimal(19,6) DEFAULT NULL,
`cashflow_other_income1` decimal(19,6) DEFAULT NULL,
`cashflow_total_income2` decimal(19,6) DEFAULT NULL,
`cashflow_household_expense` decimal(19,6) DEFAULT NULL,
`cashflow_payments_to_savings` decimal(19,6) DEFAULT NULL,
`cashflow_operational_expenses` decimal(19,6) DEFAULT NULL,
`cashflow_disposable_income` decimal(19,6) DEFAULT NULL,
`cashflow_amount_loan_installment` decimal(19,6) DEFAULT NULL,
`cashflow_available_surplus` decimal(19,6) DEFAULT NULL,
`fi_inventory_turnover` decimal(19,6) DEFAULT NULL,
`fi_gross_margin` decimal(19,6) DEFAULT NULL,
`fi_indebtedness` decimal(19,6) DEFAULT NULL,
`fi_loan_recommendation` decimal(19,6) DEFAULT NULL,
`fi_roe` decimal(19,6) DEFAULT NULL,
`fi_repayment_capacity` decimal(19,6) DEFAULT NULL,
PRIMARY KEY (`client_id`),
CONSTRAINT `FK_risk_analysis_1` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,2 +0,0 @@
ALTER TABLE `m_client`
ADD COLUMN `image_key` VARCHAR(500) NULL DEFAULT NULL AFTER `display_name`;
@@ -1,34 +0,0 @@
alter table m_loan_charge
add column due_for_collection_as_of_date date DEFAULT NULL after charge_time_enum;
alter table m_loan_repayment_schedule
add column fee_charges_amount decimal(19,6) DEFAULT NULL after interest_writtenoff_derived;
alter table m_loan_repayment_schedule
add column fee_charges_completed_derived decimal(19,6) DEFAULT NULL after fee_charges_amount;
alter table m_loan_repayment_schedule
add column fee_charges_writtenoff_derived decimal(19,6) DEFAULT NULL after fee_charges_completed_derived;
alter table m_loan_repayment_schedule
add column fee_charges_waived_derived decimal(19,6) DEFAULT NULL after fee_charges_writtenoff_derived;
alter table m_loan_repayment_schedule
add column penalty_charges_amount decimal(19,6) DEFAULT NULL after fee_charges_waived_derived;
alter table m_loan_repayment_schedule
add column penalty_charges_completed_derived decimal(19,6) DEFAULT NULL after penalty_charges_amount;
alter table m_loan_repayment_schedule
add column penalty_charges_writtenoff_derived decimal(19,6) DEFAULT NULL after penalty_charges_completed_derived;
alter table m_loan_repayment_schedule
add column penalty_charges_waived_derived decimal(19,6) DEFAULT NULL after penalty_charges_writtenoff_derived;
/**
modify existing columns
*/
alter table `m_loan_repayment_schedule` MODIFY `duedate` date NOT NULL;
alter table `m_loan_repayment_schedule` MODIFY `installment` smallint(5) NOT NULL;
alter table `m_loan_repayment_schedule` MODIFY `interest_waived_derived` decimal(19,6) DEFAULT NULL;
@@ -1,8 +0,0 @@
alter table m_loan_repayment_schedule
add column `fromdate` date DEFAULT NULL after `loan_id`;
alter table m_charge
add column `is_penalty` tinyint(1) NOT NULL DEFAULT '0' after `amount`;
alter table m_loan_charge
add column `is_penalty` tinyint(1) NOT NULL DEFAULT '0' after `charge_id`;
@@ -1,8 +0,0 @@
alter table m_loan_transaction
drop column `charges_portion_derived`;
alter table m_loan_transaction
add column `fee_charges_portion_derived` decimal(19,6) DEFAULT NULL after `interest_portion_derived`;
alter table m_loan_transaction
add column `penalty_charges_portion_derived` decimal(19,6) DEFAULT NULL after `fee_charges_portion_derived`;
@@ -1,33 +0,0 @@
DROP TABLE IF EXISTS `m_product_savings`;
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 AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
@@ -1,47 +0,0 @@
DROP TABLE if exists `m_saving_account`;
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 AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
@@ -1,17 +0,0 @@
DROP TABLE if exists `m_acc_coa`;
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 AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
@@ -1,6 +0,0 @@
alter table m_loan_charge
add column `amount_waived_derived` decimal(19,6) DEFAULT NULL after `amount_paid_derived`;
alter table m_loan_charge
add column `amount_writtenoff_derived` decimal(19,6) DEFAULT NULL after `amount_waived_derived`;
@@ -1,14 +0,0 @@
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`),
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;
@@ -1,25 +0,0 @@
CREATE TABLE `m_guarantor_external` (
`loan_id` BIGINT(20) NOT NULL,
`firstname` VARCHAR(50) NOT NULL,
`lastname` VARCHAR(50) NOT NULL,
`dob` DATE NULL,
`address_line_1` VARCHAR(500) NULL,
`address_line_2` VARCHAR(500) NULL,
`city` VARCHAR(50) NULL,
`state` VARCHAR(50) NULL,
`country` VARCHAR(50) NULL,
`zip` VARCHAR(20) NULL,
`house_phone_number` VARCHAR(20) NULL,
`mobile_number` VARCHAR(20) NULL,
`comment` VARCHAR(20) NULL,
PRIMARY KEY (`loan_id`),
CONSTRAINT `FK_m_guarantor_m_loan` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `m_loan`
ADD COLUMN `guarantor_id` BIGINT(20) NULL DEFAULT NULL AFTER `loan_officer_id`,
ADD CONSTRAINT `FK_m_loan_guarantor` FOREIGN KEY (`guarantor_id`) REFERENCES `m_client` (`id`);
insert into x_registered_table values ('m_guarantor_external','m_loan');
@@ -1,14 +0,0 @@
CREATE TABLE `m_maker_checker` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`task_name` varchar(100) NOT NULL,
`task_json` varchar(1000) 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_maker_m_appuser` FOREIGN KEY (`maker_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_m_checker_m_appuser` FOREIGN KEY (`checker_id`) REFERENCES `m_appuser` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
@@ -1,17 +0,0 @@
drop table `m_maker_checker`;
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(1000) 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_maker_m_appuser` FOREIGN KEY (`maker_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_m_checker_m_appuser` FOREIGN KEY (`checker_id`) REFERENCES `m_appuser` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
@@ -1,31 +0,0 @@
update m_permission p
join stretchy_report sr on p.code = concat('CAN_RUN_', sr.report_name)
set p.`code` = concat('READ_', sr.report_name),
p.default_description = concat('READ_', sr.report_name),
p.default_name = concat('READ_', sr.report_name);
update m_permission p
join x_registered_table r on p.code = concat('CAN_READ_', r.registered_table_name)
set p.`code` = concat('READ_', r.registered_table_name),
p.default_description = concat('READ_', r.registered_table_name),
p.default_name = concat('READ_', r.registered_table_name);
update m_permission p
join x_registered_table r on p.code = concat('CAN_UPDATE_', r.registered_table_name)
set p.`code` = concat('UPDATE_', r.registered_table_name),
p.default_description = concat('UPDATE_', r.registered_table_name),
p.default_name = concat('UPDATE_', r.registered_table_name);
update m_permission p
join x_registered_table r on p.code = concat('CAN_CREATE_', r.registered_table_name)
set p.`code` = concat('CREATE_', r.registered_table_name),
p.default_description = concat('CREATE_', r.registered_table_name),
p.default_name = concat('CREATE_', r.registered_table_name);
update m_permission p
join x_registered_table r on p.code = concat('CAN_DELETE_', r.registered_table_name)
set p.`code` = concat('DELETE_', r.registered_table_name),
p.default_description = concat('DELETE_', r.registered_table_name),
p.default_name = concat('DELETE_', r.registered_table_name);
@@ -1,10 +0,0 @@
UPDATE stretchy_parameter
SET `parameter_sql` = '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'
WHERE parameter_name = 'FullReportList';
UPDATE stretchy_parameter
SET `parameter_sql` = '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'
WHERE parameter_name = 'reportCategoryList';
@@ -1,5 +0,0 @@
ALTER TABLE m_permission
DROP COLUMN `group_enum` ,
ADD COLUMN `grouping` VARCHAR(45) NULL AFTER `id` ,
ADD COLUMN `order_in_grouping` INT NULL AFTER `grouping` ,
ADD UNIQUE INDEX `code` (`code` ASC) ;
@@ -1,55 +0,0 @@
ALTER TABLE m_permission
DROP COLUMN `order_in_grouping` ,
ADD COLUMN `entity_name` VARCHAR(100) NULL AFTER `default_name` ,
ADD COLUMN `action_name` VARCHAR(100) NULL AFTER `entity_name` ;
/*
this scripts removes all current m_role_permission and m_permission entries
and then inserts new m_permission entries and just one m_role_permission entry
which gives the role (id 1 - super user) an ALL_FUNCTIONS permission
If you had other roles set up with specific permissions you will have to set up their permissions again.
*/
delete from m_role_permission;
delete from m_permission;
/* System Supplied Permissons */
INSERT INTO `m_permission` VALUES (1,'special','USER_ADMINISTRATION_SUPER_USER','An application user will have permission to execute all tasks related to user administration.','User administration ALL',NULL,NULL),(2,'special','ORGANISATION_ADMINISTRATION_SUPER_USER','An application user will have permission to execute all tasks related to organisation administration.','Organisation adminsitration ALL',NULL,NULL),(3,'special','PORTFOLIO_MANAGEMENT_SUPER_USER','An application user will have permission to execute all tasks related to portfolio management.','Portfolio management ALL',NULL,NULL),(4,'special','REPORTING_SUPER_USER','An application user will have permission to execute and view all reports.','Reporting ALL',NULL,NULL),(5,'portfolio','CREATE_LOAN','Allows an application user to sumit new loan application.','Can submit new loan application','LOAN','CREATE'),(6,'portfolio','CREATEHISTORIC_LOAN','Allows an application user to sumit new loan application where the submitted on date is in the past.','Can submit historic loan application','LOAN','CREATEHISTORIC'),(7,'transaction_loan','APPROVE_LOAN','Allows an application user to approve a loan application.','Can approve loan application','LOAN','APPROVE'),(8,'transaction_loan','APPROVEINPAST_LOAN','Allows an application user to approve a loan application where the approval date is in the past.','Can approve loan application in the past','LOAN','APPROVEINPAST'),(9,'transaction_loan','REJECT_LOAN','Allows an application user to reject a loan application.','Can reject loan application','LOAN','REJECT'),(10,'transaction_loan','REJECTINPAST_LOAN','Allows an application user to reject a loan application where the rejected date is in the past.','Can reject loan application in the past','LOAN','REJECTINPAST'),
(11,'transaction_loan','WITHDRAW_LOAN','Allows an application user to mark loan application as withdrawn by client.','Can withdraw loan application','LOAN','WITHDRAW'),(12,'transaction_loan','WITHDRAWINPAST_LOAN','Allows an application user to mark loan application as withdrawn by client where the withdran on date is in the past.','Can withdraw loan application in the past','LOAN','WITHDRAWINPAST'),(13,'portfolio','DELETE_LOAN','Allows an application user to complete delete the loan application if it is submitted but not approved.','Can delete submitted loan application','LOAN','DELETE'),(14,'transaction_loan','APPROVALUNDO_LOAN','Allows an application user to undo a loan approval.','Can undo loan approval','LOAN','APPROVALUNDO'),(15,'transaction_loan','DISBURSE_LOAN','Allows an application user to disburse a loan application.','Can disburse loan','LOAN','DISBURSE'),(16,'transaction_loan','DISBURSEINPAST_LOAN','Allows an application user to disburse a loan where the disbursement date is in the past.','Can disburse loan in the past','LOAN','DISBURSEINPAST'),(17,'transaction_loan','DISBURSALUNDO_LOAN','Allows an application user to undo a loan disbursal if not payments already made.','Can undo loan disbursal','LOAN','DISBURSALUNDO'),(18,'transaction_loan','REPAYMENT_LOAN','Allows an application user to enter a repayment on the loan.','Can enter a repayment against a loan','LOAN','REPAYMENT'),(19,'transaction_loan','REPAYMENTINPAST_LOAN','Allows an application user to enter a repayment on the loan where the repayment date is in the past.','Can enter a repayment against a loan in the past','LOAN','REPAYMENTINPAST'),(20,'portfolio','CREATE_CLIENT','Allows an application user to add a new client.','Can add a new client.','CLIENT','CREATE'),
(42,'special','ALL_FUNCTIONS','An application user will have permission to execute all tasks.','ALL',NULL,NULL),(43,'special','ALL_FUNCTIONS_READ','An application user will have permission to execute all read tasks.','ALL READ',NULL,NULL),(112,'organisation','CREATE_CHARGE','Create a Charge','Create a Charge','CHARGE','CREATE'),(113,'organisation','READ_CHARGE','Read Charges','Read Charges','CHARGE','READ'),(114,'organisation','UPDATE_CHARGE','Update a Charge','Update a Charge','CHARGE','UPDATE'),(115,'organisation','DELETE_CHARGE','Delete a Charge','Delete a Charge','CHARGE','DELETE'),(120,'portfolio','READ_CLIENT','Read Clients','Read Clients','CLIENT','READ'),(121,'portfolio','UPDATE_CLIENT','Update a Client','Update a Client','CLIENT','UPDATE'),(122,'portfolio','DELETE_CLIENT','Delete a Client','Delete a Client','CLIENT','DELETE'),(123,'portfolio','CREATE_CLIENTIMAGE','Create/Update Client Image','Create/Update Client Image','CLIENTIMAGE','CREATE'),(124,'portfolio','READ_CLIENTIMAGE','Read Client Images','Read Client Images','CLIENTIMAGE','READ'),(126,'portfolio','DELETE_CLIENTIMAGE','Delete Client Image','Delete Client Image','CLIENTIMAGE','DELETE'),(127,'portfolio','CREATE_CLIENTNOTE','Create a Client Note','Create a Client Note','CLIENTNOTE','CREATE'),(128,'portfolio','READ_CLIENTNOTE','Read Client Notes','Read Client Notes','CLIENTNOTE','READ'),(129,'portfolio','UPDATE_CLIENTNOTE','Update a Client Note','Update a Client Note','CLIENTNOTE','UPDATE'),(130,'portfolio','DELETE_CLIENTNOTE','Delete a Client Note','Delete a Client Note','CLIENTNOTE','DELETE'),(131,'portfolio','CREATE_CLIENTIDENTIFIER','Create a Client Identifier','Create a Client Identifier','CLIENTIDENTIFIER','CREATE'),
(132,'portfolio','READ_CLIENTIDENTIFIER','Read Client Identifiers','Read Client Identifiers','CLIENTIDENTIFIER','READ'),(133,'portfolio','UPDATE_CLIENTIDENTIFIER','Update a Client Identifier','Update a Client Identifier','CLIENTIDENTIFIER','UPDATE'),(134,'portfolio','DELETE_CLIENTIDENTIFIER','Delete a Client Identifier','Delete a Client Identifier','CLIENTIDENTIFIER','DELETE'),(135,'configuration','CREATE_CODE','Create a Code','Create a Code','CODE','CREATE'),(136,'configuration','READ_CODE','Read Codes','Read Codes','CODE','READ'),(137,'configuration','UPDATE_CODE','Update a Code','Update a Code','CODE','UPDATE'),(138,'configuration','DELETE_CODE','Delete a Code','Delete a Code','CODE','DELETE'),(139,'configuration','READ_CURRENCY','Read Currencies','Read Currencies','CURRENCY','READ'),(140,'configuration','UPDATE_CURRENCY','Update Currencies','Update Currencies','CURRENCY','UPDATE'),(141,'portfolio','CREATE_DOCUMENT','Create and Upload a Document','Create and Upload a Document','DOCUMENT','CREATE'),(142,'portfolio','READ_DOCUMENT','Read Documents','Read Documents','DOCUMENT','READ'),(143,'portfolio','UPDATE_DOCUMENT','Update and Upload a Document','Update and Upload a Document','DOCUMENT','UPDATE'),(144,'portfolio','DELETE_DOCUMENT','Delete a Document','Delete a Document','DOCUMENT','DELETE'),(145,'organisation','CREATE_FUND','Create a Fund','Create a Fund','FUND','CREATE'),(146,'organisation','READ_FUND','Read Funds','Read Funds','FUND','READ'),(147,'organisation','UPDATE_FUND','Update a Fund','Update a Fund','FUND','UPDATE'),(148,'organisation','DELETE_FUND','Delete Fund','Delete Fund','FUND','DELETE'),(149,'portfolio','CREATE_GROUP','Create a Group','Create a Group','GROUP','CREATE'),
(150,'portfolio','READ_GROUP','Read Groups','Read Groups','GROUP','READ'),(151,'portfolio','UPDATE_GROUP','Update a Group','Update a Group','GROUP','UPDATE'),(152,'portfolio','DELETE_GROUP','Delete a Group','Delete a Group','GROUP','DELETE'),(153,'organisation','CREATE_LOANPRODUCT','Create a Loan Product','Create a Loan Product','LOANPRODUCT','CREATE'),(154,'organisation','READ_LOANPRODUCT','Read Loan Products','Read Loan Products','LOANPRODUCT','READ'),(155,'organisation','UPDATE_LOANPRODUCT','Update a Loan Product','Update a Loan Product','LOANPRODUCT','UPDATE'),(156,'organisation','DELETE_LOANPRODUCT','Delete a Loan Product','Delete a Loan Product','LOANPRODUCT','DELETE'),(157,'portfolio','READ_LOAN','Read Loans','Read Loans','LOAN','READ'),(158,'portfolio','UPDATE_LOAN','Update a Loan','Update a Loan','LOAN','UPDATE'),(159,'portfolio','UPDATEHISTORIC_LOAN','Update a Loan that was Created Historically','Update a Loan that was Created Historically','LOAN','UPDATEHISTORIC'),(160,'portfolio','CREATE_LOANCHARGE','Create a Loan Charge','Create a Loan Charge','LOANCHARGE','CREATE'),(161,'portfolio','UPDATE_LOANCHARGE','Update a Loan Charge','Update a Loan Charge','LOANCHARGE','UPDATE'),(162,'portfolio','DELETE_LOANCHARGE','Delete a Loan Charge','Delete a Loan Charge','LOANCHARGE','DELETE'),(163,'portfolio','WAIVE_LOANCHARGE','Waive a Loan Charge','Waive a Loan Charge','LOANCHARGE','WAIVE'),(164,'transaction_loan','BULKREASSIGN_LOAN','Bulk Reassign Loans','Bulk Reassign Loans','LOAN','BULKREASSIGN'),(165,'transaction_loan','ADJUST_LOAN','Adjust a Loan Transaction','Adjust a Loan Transaction','LOAN','ADJUST'),(166,'transaction_loan','WAIVEINTERESTPORTION_LOAN','Waive Portion of Loan Interest','Waive Portion of Loan Interest','LOAN','WAIVEINTERESTPORTION'),
(167,'transaction_loan','WRITEOFF_LOAN','Write-Off a Loan','Write-Off a Loan','LOAN','WRITEOFF'),(168,'transaction_loan','CLOSE_LOAN','Close a Loan','Close a Loan','LOAN','CLOSE'),(169,'transaction_loan','CLOSEASRESCHEDULED_LOAN','Close a Loan (having been Rescheduled (Mifos Legacy Need)','Close a Loan (having been Rescheduled (Mifos Legacy Need)','LOAN','CLOSEASRESCHEDULED'),(170,'organisation','READ_MAKERCHECKER','Read Maker-Checker Entries','Read Maker-Checker Entries','MAKERCHECKER','READ'),(171,'organisation','CREATE_OFFICE','Create an Office','Create an Office','OFFICE','CREATE'),(172,'organisation','READ_OFFICE','Read Offices','Read Offices','OFFICE','READ'),(173,'organisation','UPDATE_OFFICE','Update an Office','Update an Office','OFFICE','UPDATE'),(174,'organisation','DELETE_OFFICE','Delete an Office','Delete an Office','OFFICE','DELETE'),(175,'organisation','READ_OFFICETRANSACTION','Read Office Transactions','Read Office Transactions','OFFICETRANSACTION','READ'),(176,'organisation','CREATE_OFFICETRANSACTION','Create an Office Transaction','Create an Office Transaction','OFFICETRANSACTION','CREATE'),(177,'authorisation','READ_PERMISSION','Read Permissions','Read Permissions','PERMISSION','READ'),(178,'authorisation','CREATE_ROLE','Create a Role','Create a Role','ROLE','CREATE'),(179,'authorisation','READ_ROLE','Read Roles','Read Roles','ROLE','READ'),(180,'authorisation','UPDATE_ROLE','Update a Role','Update a Role','ROLE','UPDATE'),(181,'authorisation','DELETE_ROLE','Delete a Role','Delete a Role','ROLE','DELETE'),(182,'authorisation','CREATE_USER','Create a User','Create a User','USER','CREATE'),(183,'authorisation','READ_USER','Read Users','Read Users','USER','READ'),(184,'authorisation','UPDATE_USER','Update a User','Update a User','USER','UPDATE'),
(185,'authorisation','DELETE_USER','Create a User','Create a User','USER','DELETE'),(186,'organisation','CREATE_STAFF','Create a Staff Member','Create a Staff Member','STAFF','CREATE'),(187,'organisation','READ_STAFF','Read Staff','Read Staff','STAFF','READ'),(188,'organisation','UPDATE_STAFF','Update a Staff Member','Update a Staff Member','STAFF','UPDATE'),(189,'organisation','DELETE_STAFF','Delete a Staff Member','Delete a Staff Member','STAFF','DELETE'),(190,'organisation','CREATE_SAVINGSPRODUCT','Create a Savings Product','Create a Savings Product','SAVINGSPRODUCT','CREATE'),(191,'organisation','READ_SAVINGSPRODUCT','Read Savings Products','Read Savings Products','SAVINGSPRODUCT','READ'),(192,'organisation','UPDATE_SAVINGSPRODUCT','Update a Savings Product','Update a Savings Product','SAVINGSPRODUCT','UPDATE'),(193,'organisation','DELETE_SAVINGSPRODUCT','Delete a Savings Product','Delete a Savings Product','SAVINGSPRODUCT','DELETE'),(194,'organisation','CREATE_DEPOSITPRODUCT','Create a Deposit Product','Create a Deposit Product','DEPOSITPRODUCT','CREATE'),(195,'organisation','READ_DEPOSITPRODUCT','Read Deposit Products','Read Deposit Products','DEPOSITPRODUCT','READ'),(196,'organisation','UPDATE_DEPOSITPRODUCT','Update a Deposit Product','Update a Deposit Product','DEPOSITPRODUCT','UPDATE'),(197,'organisation','DELETE_DEPOSITPRODUCT','Delete a Deposit Product','Delete a Deposit Product','DEPOSITPRODUCT','DELETE'),(198,'portfolio','CREATE_DEPOSITACCOUNT','Create a Deposit Account','Create a Deposit Account','DEPOSITACCOUNT','CREATE'),(199,'portfolio','READ_DEPOSITACCOUNT','Read Deposit Accounts','Read Deposit Accounts','DEPOSITACCOUNT','READ'),(200,'portfolio','UPDATE_DEPOSITACCOUNT','Update a Deposit Account','Update a Deposit Account','DEPOSITACCOUNT','UPDATE'),
(201,'portfolio','DELETE_DEPOSITACCOUNT','Delete a Deposit Account','Delete a Deposit Account','DEPOSITACCOUNT','DELETE'),(202,'transaction_deposit','APPROVE_DEPOSITACCOUNT','Approve a Deposit Account','Approve a Deposit Account','DEPOSITACCOUNT','APPROVE'),(203,'transaction_deposit','REJECT_DEPOSITACCOUNT','Reject Deposit Account','Reject Deposit Account','DEPOSITACCOUNT','REJECT'),(204,'transaction_deposit','WITHDRAW_DEPOSITACCOUNT','Withdraw Deposit Account','Withdraw Deposit Account','DEPOSITACCOUNT','WITHDRAW'),(205,'transaction_deposit','APPROVALUNDO_DEPOSITACCOUNT','Undo Approval of Deposit Account','Undo Approval of Deposit Account','DEPOSITACCOUNT','APPROVALUNDO'),(206,'transaction_deposit','WITHDRAWAL_DEPOSITACCOUNT','Make a Withdrawal From Deposit Account','Make a Withdrawal From Deposit Account','DEPOSITACCOUNT','WITHDRAWAL'),(207,'transaction_deposit','INTEREST_DEPOSITACCOUNT','Apply Interest to Deposit Accounts','Apply Interest to Deposit Accounts','DEPOSITACCOUNT','INTEREST'),(208,'transaction_deposit','RENEW_DEPOSITACCOUNT','Renew Deposit Account','Renew Deposit Account','DEPOSITACCOUNT','RENEW'),(209,'portfolio','CREATE_SAVINGSACCOUNT','Create a Savings Account','Create a Savings Account','SAVINGSACCOUNT','CREATE'),(210,'portfolio','READ_SAVINGSACCOUNT','Read Savings Accounts','Read Savings Accounts','SAVINGSACCOUNT','READ'),(211,'portfolio','UPDATE_SAVINGSACCOUNT','Update a Savings Account','Update a Savings Account','SAVINGSACCOUNT','UPDATE'),(212,'portfolio','DELETE_SAVINGSACCOUNT','Delete a Savings Account','Delete a Savings Account','SAVINGSACCOUNT','DELETE'),(213,'authorisation','PERMISSIONS_ROLE','Manage Permissions for a Role','Manage Permissions for a Role','ROLE','PERMISSIONS');
/* role 1 is super user, give it ALL_FUNCTIONS */
INSERT INTO m_role_permission(role_id, permission_id)
select 1, id
from m_permission
where code = 'ALL_FUNCTIONS';
/* add a read permission for each defined report */
insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name)
select 'report', concat('READ_', sr.report_name), concat('READ_', sr.report_name), concat('READ_', sr.report_name), sr.report_name, 'READ'
from stretchy_report sr;
/* add a create, read, update and delete permission for each registered datatable */
insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name)
select 'datatable', concat('CREATE_', r.registered_table_name), concat('CREATE_', r.registered_table_name), concat('CREATE_', r.registered_table_name), r.registered_table_name, 'CREATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name)
select 'datatable', concat('READ_', r.registered_table_name), concat('READ_', r.registered_table_name), concat('READ_', r.registered_table_name), r.registered_table_name, 'READ'
from x_registered_table r;
insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name)
select 'datatable', concat('UPDATE_', r.registered_table_name), concat('UPDATE_', r.registered_table_name), concat('UPDATE_', r.registered_table_name), r.registered_table_name, 'UPDATE'
from x_registered_table r;
insert into m_permission(grouping, `code`, default_description, default_name, entity_name, action_name)
select 'datatable', concat('DELETE_', r.registered_table_name), concat('DELETE_', r.registered_table_name), concat('DELETE_', r.registered_table_name), r.registered_table_name, 'DELETE'
from x_registered_table r;
@@ -1,6 +0,0 @@
ALTER TABLE m_code
ADD COLUMN `is_system_defined` TINYINT(1) NOT NULL DEFAULT '0' AFTER `code_name` ;
update m_code
set is_system_defined = true
where code_name = 'Customer Identifier';
@@ -1 +0,0 @@
ALTER TABLE `m_portfolio_command_source` CHANGE COLUMN `command_as_json` `command_as_json` VARCHAR(5000) NOT NULL;
@@ -1,13 +0,0 @@
ALTER TABLE `m_permission`
DROP COLUMN `default_name` ,
DROP COLUMN `default_description` ,
ADD COLUMN `is_maker_checker` TINYINT(1) NOT NULL AFTER `action_name` ;
update m_permission
set is_maker_checker = false;
update m_permission
set is_maker_checker = true
where grouping not in ('special', 'report')
and action_name != 'READ';
@@ -1 +0,0 @@
ALTER TABLE `m_loan` CHANGE COLUMN `arrearstolerance_amount` `arrearstolerance_amount` DECIMAL(19,6) NULL;
@@ -1,9 +0,0 @@
SET foreign_key_checks = 0;
drop table IF EXISTS `stretchydata_dataset_fields`;
drop table IF EXISTS `stretchydata_datasettype`;
drop table IF EXISTS `stretchydata_dataset`;
drop table IF EXISTS `m_client_xadditional information`;
drop table IF EXISTS `m_client_xhighly improbable info`;
drop table IF EXISTS `m_loan_xadditional information`;
SET foreign_key_checks = 1;
@@ -1,19 +0,0 @@
ALTER TABLE m_permission
CHANGE COLUMN `is_maker_checker` `can_maker_checker` TINYINT(1) NOT NULL DEFAULT '1' ;
/*
add all checker permissions
*/
insert into m_permission(grouping, code, entity_name, action_name, can_maker_checker)
select grouping, concat(code, '_CHECKER'), entity_name, action_name, false
from m_permission
where code not like 'READ_%'
and grouping != 'special';
/* 5k not enough for command json */
ALTER TABLE m_portfolio_command_source
CHANGE COLUMN `command_as_json` `command_as_json` TEXT NOT NULL ;
@@ -1,43 +0,0 @@
DROP TABLE IF EXISTS `m_acc_coa`;
DROP TABLE IF EXISTS `acc_gl_account`;
CREATE TABLE `acc_gl_account` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`parent_id` BIGINT(20) NULL DEFAULT NULL,
`gl_code` VARCHAR(45) NOT NULL,
`disabled` TINYINT(1) NOT NULL DEFAULT '0',
`manual_journal_entries_allowed` TINYINT(1) NOT NULL DEFAULT '1',
`header_account` TINYINT(1) NOT NULL DEFAULT '0',
`classification` VARCHAR(45) NOT NULL,
`description` VARCHAR(500) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `acc_gl_code` (`gl_code`),
INDEX `FK_ACC_0000000001` (`parent_id`),
CONSTRAINT `FK_ACC_0000000001` FOREIGN KEY (`parent_id`) REFERENCES `acc_gl_account` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `acc_gl_closure`;
CREATE TABLE `acc_gl_closure` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`office_id` BIGINT(20) NOT NULL,
`closing_date` DATE NOT NULL,
`is_deleted` INT(20) NOT NULL DEFAULT '0',
`createdby_id` BIGINT(20) NULL DEFAULT NULL,
`lastmodifiedby_id` BIGINT(20) NULL DEFAULT NULL,
`created_date` DATETIME NULL DEFAULT NULL,
`lastmodified_date` DATETIME NULL DEFAULT NULL,
`comments` VARCHAR(500) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_acc_gl_closure_m_office` (`office_id`),
INDEX `FK_acc_gl_closure_m_appuser` (`createdby_id`),
INDEX `FK_acc_gl_closure_m_appuser_2` (`lastmodifiedby_id`),
UNIQUE INDEX `office_id_closing_date` (`office_id`, `closing_date`),
CONSTRAINT `FK_acc_gl_closure_m_appuser` FOREIGN KEY (`createdby_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_acc_gl_closure_m_appuser_2` FOREIGN KEY (`lastmodifiedby_id`) REFERENCES `m_appuser` (`id`),
CONSTRAINT `FK_acc_gl_closure_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,19 +0,0 @@
DROP TABLE IF EXISTS `m_saving_schedule`;
CREATE TABLE `m_saving_schedule` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`saving_account_id` bigint(20) NOT NULL,
`duedate` date NOT NULL,
`installment` smallint(5) NOT NULL,
`deposit` decimal(21,4) NOT NULL,
`payment_date` date DEFAULT NULL,
`deposit_paid` decimal(21,4) DEFAULT NULL,
`completed_derived` bit(1) NOT NULL,
`createdby_id` bigint(20) DEFAULT NULL,
`created_date` datetime DEFAULT NULL,
`lastmodified_date` datetime DEFAULT NULL,
`lastmodifiedby_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKSS00000000001` (`saving_account_id`),
CONSTRAINT `FKSS00000000001` FOREIGN KEY (`saving_account_id`) REFERENCES `m_saving_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@@ -1,30 +0,0 @@
/* some addition permissions and alterations */
INSERT INTO m_permission (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'UPDATE_PERMISSION', 'PERMISSION', 'UPDATE', '0');
INSERT INTO m_permission (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'UPDATE_PERMISSION_CHECKER', 'PERMISSION', 'UPDATE', '0');
INSERT INTO m_permission (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'READ_DATATABLE', 'DATATABLE', 'READ', '0');
INSERT INTO m_permission (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'REGISTER_DATATABLE', 'DATATABLE', 'REGISTER', '0');
INSERT INTO m_permission (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'REGISTER_DATATABLE_CHECKER', 'DATATABLE', 'REGISTER', '0');
INSERT INTO m_permission (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'DEREGISTER_DATATABLE', 'DATATABLE', 'DEREGISTER', '0');
INSERT INTO m_permission (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'DEREGISTER_DATATABLE_CHECKER', 'DATATABLE', 'DEREGISTER', '0');
INSERT INTO m_permission (`grouping`, `code`, `can_maker_checker`)
VALUES ('special', 'CHECKER_SUPER_USER', '0');
update m_permission
set grouping = 'configuration'
where code like '%permission%';
@@ -1,5 +0,0 @@
update m_permission
set grouping = "authorisation"
where code like 'PERMISSIONS_ROLE%';

Some files were not shown because too many files have changed in this diff Show More