Compare commits
500
Commits
5240d308b8
...
1f7cd4d293
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f7cd4d293 | ||
|
|
a7556b17d8 | ||
|
|
9220129142 | ||
|
|
09bddb7bf7 | ||
|
|
a3a40f5a45 | ||
|
|
44cef96643 | ||
|
|
51d63b6db7 | ||
|
|
c742ca0519 | ||
|
|
f93cf1b620 | ||
|
|
46c5565fb9 | ||
|
|
db35e26d0a | ||
|
|
a46c9be5b8 | ||
|
|
52ceaf9f98 | ||
|
|
1ee775998d | ||
|
|
1068fe5870 | ||
|
|
fe5c68d1e4 | ||
|
|
14306f44a7 | ||
|
|
ea0ee84967 | ||
|
|
500767a400 | ||
|
|
4b43b09651 | ||
|
|
2762463311 | ||
|
|
dff53b9318 | ||
|
|
604f07f13e | ||
|
|
a6dcba11cf | ||
|
|
0e54ca5fa2 | ||
|
|
53b5e3c7be | ||
|
|
abc6e5a42a | ||
|
|
c3b91d84f0 | ||
|
|
fec8d16e6d | ||
|
|
a7c72a89b0 | ||
|
|
9a8476b6cd | ||
|
|
a7c5c5ae67 | ||
|
|
8f18f847f5 | ||
|
|
f212b78b99 | ||
|
|
1180200ca3 | ||
|
|
3001cc3582 | ||
|
|
e5b0c31200 | ||
|
|
ae4d669434 | ||
|
|
3f9c47821e | ||
|
|
b9994713fc | ||
|
|
cd082fc2af | ||
|
|
0f6079b8e9 | ||
|
|
06cd8cd940 | ||
|
|
a6e655761f | ||
|
|
436f77c3a8 | ||
|
|
97d7104c93 | ||
|
|
c4ba4c54ca | ||
|
|
cd81798270 | ||
|
|
38b1d10f62 | ||
|
|
4b80393d4a | ||
|
|
b71e659420 | ||
|
|
b41661cca4 | ||
|
|
4104150bd1 | ||
|
|
654b31f75e | ||
|
|
e777491d76 | ||
|
|
9cc6abd6c4 | ||
|
|
72bcb78b09 | ||
|
|
8e99a2ef36 | ||
|
|
debce5655f | ||
|
|
45bf43de5e | ||
|
|
850981d4a9 | ||
|
|
6274217e9d | ||
|
|
3014fbccd5 | ||
|
|
232ccdf715 | ||
|
|
33c7e9f7d5 | ||
|
|
b7f72b2943 | ||
|
|
dbed6037f3 | ||
|
|
efe0379258 | ||
|
|
9ee3280b7a | ||
|
|
a8c10facd9 | ||
|
|
fdc0767f7f | ||
|
|
e15a72eab1 | ||
|
|
c2a462aede | ||
|
|
e97695c2c9 | ||
|
|
59dec0097a | ||
|
|
14aa62073e | ||
|
|
8730976f99 | ||
|
|
cd744d9f2d | ||
|
|
7174b82f9d | ||
|
|
f2ce84db46 | ||
|
|
ec87116ddf | ||
|
|
3d9c949f6a | ||
|
|
87ee45a592 | ||
|
|
9011f5568c | ||
|
|
e0b856ba69 | ||
|
|
4df690b501 | ||
|
|
20f010cbc3 | ||
|
|
2446a0f05e | ||
|
|
c28ad6b18c | ||
|
|
cdef41924b | ||
|
|
7b422c956c | ||
|
|
409c48dd78 | ||
|
|
694658daa8 | ||
|
|
7dfcb76e4b | ||
|
|
d458f90c3d | ||
|
|
d98360dd39 | ||
|
|
0ade90b70c | ||
|
|
da12288024 | ||
|
|
8aacc1bb53 | ||
|
|
af79fd0790 | ||
|
|
8b135f769a | ||
|
|
4bda6f3d43 | ||
|
|
3e1ef6dafd | ||
|
|
8956ef35a3 | ||
|
|
9652844889 | ||
|
|
81233724a2 | ||
|
|
371973466d | ||
|
|
98faa19b8e | ||
|
|
1666b2b452 | ||
|
|
2ae603dcc2 | ||
|
|
af8219de29 | ||
|
|
08542b9034 | ||
|
|
f077733cfb | ||
|
|
979308e41c | ||
|
|
12f799fe6b | ||
|
|
8e274b2d4a | ||
|
|
4f4fb982e5 | ||
|
|
c32ba579cd | ||
|
|
a9eb946ecd | ||
|
|
ec810d9485 | ||
|
|
41b31ded07 | ||
|
|
1a5ef94def | ||
|
|
18d02396b6 | ||
|
|
7f90f0861c | ||
|
|
0dab99ecdb | ||
|
|
571174e10d | ||
|
|
a9a190827e | ||
|
|
a70712d8fc | ||
|
|
be32e0b7eb | ||
|
|
a66ef5cfbf | ||
|
|
f6fbbbb7d2 | ||
|
|
e13daf0d29 | ||
|
|
4e4b2138d4 | ||
|
|
6c46026b5a | ||
|
|
ccedf5bfdc | ||
|
|
d0576c4488 | ||
|
|
596bc82bbe | ||
|
|
7cf6c20b38 | ||
|
|
f0b526aa53 | ||
|
|
110d183176 | ||
|
|
c45b41e21a | ||
|
|
8465664f89 | ||
|
|
513f6f2764 | ||
|
|
3924fafe88 | ||
|
|
4b53161ac4 | ||
|
|
49eb712a5d | ||
|
|
f08da673f2 | ||
|
|
419f127cd8 | ||
|
|
5c73a46f2a | ||
|
|
23ed73316d | ||
|
|
d58fa92f3e | ||
|
|
4a2f7a0597 | ||
|
|
e555666ac2 | ||
|
|
02a3934e9f | ||
|
|
56829c2036 | ||
|
|
98472b3e59 | ||
|
|
860caa76a0 | ||
|
|
d7c2af3538 | ||
|
|
c7c02448e5 | ||
|
|
d39047e36e | ||
|
|
5d4bbf191e | ||
|
|
ed95612b3f | ||
|
|
3471475c94 | ||
|
|
b4edfc4c34 | ||
|
|
0637fb2697 | ||
|
|
4883ce1b63 | ||
|
|
aa6dbd6fd4 | ||
|
|
239933fe91 | ||
|
|
da6ff46f4c | ||
|
|
3b041ab507 | ||
|
|
f6bcd1fb8a | ||
|
|
ee5ffbc883 | ||
|
|
72eb99432a | ||
|
|
3df312a871 | ||
|
|
ddc2a6e852 | ||
|
|
ff9dc97316 | ||
|
|
3635ed411a | ||
|
|
030f379307 | ||
|
|
364941ca76 | ||
|
|
2662b692bf | ||
|
|
c362e0f19a | ||
|
|
e37f3cebfa | ||
|
|
e44d7e2c2e | ||
|
|
06a59b95f2 | ||
|
|
310a9e248e | ||
|
|
c0464a571b | ||
|
|
3711c5cfd8 | ||
|
|
715bc2cf17 | ||
|
|
ca038a8ebf | ||
|
|
c77f3e15f1 | ||
|
|
69d228a502 | ||
|
|
b8e4cf3dc9 | ||
|
|
2d405a14ab | ||
|
|
f579054c33 | ||
|
|
bf680a2dad | ||
|
|
82f97875a7 | ||
|
|
d4a5b55e71 | ||
|
|
17ad0984c0 | ||
|
|
e5a0b8b2cf | ||
|
|
ef223b346c | ||
|
|
be86537124 | ||
|
|
a38c1a69a0 | ||
|
|
63eba40115 | ||
|
|
3e36a8a3cb | ||
|
|
f2e4df94b8 | ||
|
|
0032939e9a | ||
|
|
d0e19c440e | ||
|
|
e67da73ebc | ||
|
|
28d66e39ec | ||
|
|
29c071d763 | ||
|
|
b0fca8c44d | ||
|
|
d34e1a01c8 | ||
|
|
ac2f5d60df | ||
|
|
ec6f5539b5 | ||
|
|
31bb3b3e28 | ||
|
|
c9223cd485 | ||
|
|
bb5e9598ea | ||
|
|
345d4e2811 | ||
|
|
59ec8a5669 | ||
|
|
1b4403e767 | ||
|
|
2374bf9402 | ||
|
|
b94dc4ebe2 | ||
|
|
ea9e24a270 | ||
|
|
58d5acda0a | ||
|
|
d24dc10818 | ||
|
|
32b2ed91b4 | ||
|
|
8300127522 | ||
|
|
577b32fd22 | ||
|
|
d811304841 | ||
|
|
043e8dc4fd | ||
|
|
ceb193af37 | ||
|
|
eec727db5b | ||
|
|
7ae32b346d | ||
|
|
13723f5e80 | ||
|
|
44aa60d237 | ||
|
|
587c03a277 | ||
|
|
324ae9acd9 | ||
|
|
3e8d9f1c13 | ||
|
|
2c8efb4977 | ||
|
|
eb7d616834 | ||
|
|
cce49b634f | ||
|
|
473b579df3 | ||
|
|
5145b242ae | ||
|
|
a5b52492d5 | ||
|
|
cb8b8e72d1 | ||
|
|
d7496593c1 | ||
|
|
f01e7e80c4 | ||
|
|
c85e10cfab | ||
|
|
d1896d43b1 | ||
|
|
198ec85d1b | ||
|
|
4caa564c4e | ||
|
|
c5e40ab744 | ||
|
|
b7e1ff3fa8 | ||
|
|
759b832360 | ||
|
|
f111f16660 | ||
|
|
d1ca092405 | ||
|
|
ea78f7b126 | ||
|
|
a65c15a09b | ||
|
|
ed323c00a3 | ||
|
|
e581be40be | ||
|
|
b9a6e3f410 | ||
|
|
0db309d692 | ||
|
|
f28e8a0533 | ||
|
|
11bd10ddeb | ||
|
|
f0bcbc2fc9 | ||
|
|
f5463ebb97 | ||
|
|
26f8fd3a4c | ||
|
|
903a958783 | ||
|
|
50b9839024 | ||
|
|
fe426352ff | ||
|
|
bfe3b18837 | ||
|
|
772fe35a36 | ||
|
|
5a48f88586 | ||
|
|
5ca8d6801d | ||
|
|
509daca905 | ||
|
|
52642045a2 | ||
|
|
f98b78a180 | ||
|
|
8ad52ca3a4 | ||
|
|
3c49134c17 | ||
|
|
55f828c0b9 | ||
|
|
6aebffcfeb | ||
|
|
d8dd0ac13e | ||
|
|
513cfeae77 | ||
|
|
f90bf403cf | ||
|
|
5717240ccf | ||
|
|
f3e686406d | ||
|
|
84747cb109 | ||
|
|
b3c77fe045 | ||
|
|
be011529de | ||
|
|
d310d4df3c | ||
|
|
cf81fe92b1 | ||
|
|
99ae901cc2 | ||
|
|
485182db45 | ||
|
|
84b4811e61 | ||
|
|
b975da0d45 | ||
|
|
b407f282d0 | ||
|
|
458d2a303c | ||
|
|
7ad92a0330 | ||
|
|
e3f03f1de3 | ||
|
|
47c8daf0df | ||
|
|
6593faca64 | ||
|
|
34e2bb3c4d | ||
|
|
80c3850e00 | ||
|
|
76d2dd6209 | ||
|
|
619ec9e8cc | ||
|
|
856f406e31 | ||
|
|
2b784cc0f9 | ||
|
|
66232baa01 | ||
|
|
a497aeec55 | ||
|
|
155339342a | ||
|
|
0fdfdd314e | ||
|
|
63da11993d | ||
|
|
fed9f6dc68 | ||
|
|
3850f22140 | ||
|
|
f846286858 | ||
|
|
da7caddd46 | ||
|
|
e251633960 | ||
|
|
c04b9a3444 | ||
|
|
bf6d06e5ce | ||
|
|
9ec9a0080e | ||
|
|
2d7bd6f171 | ||
|
|
0bca626252 | ||
|
|
0959a22ea8 | ||
|
|
23ab5f430d | ||
|
|
8d4aa69302 | ||
|
|
e491859cf5 | ||
|
|
6eafd7298f | ||
|
|
b6c09cab38 | ||
|
|
0e13d4982e | ||
|
|
d81316541d | ||
|
|
ecd9135965 | ||
|
|
fa9f40d3a2 | ||
|
|
f80c1dd5f2 | ||
|
|
3636ea7fcf | ||
|
|
1945109647 | ||
|
|
d90a07ba6c | ||
|
|
e6434aac8b | ||
|
|
57c3b58f95 | ||
|
|
fd9954a977 | ||
|
|
6e60f5baf8 | ||
|
|
d322e70649 | ||
|
|
998c9bb3b2 | ||
|
|
0bfaf2cbaf | ||
|
|
fdfaab1038 | ||
|
|
eb09a39a8e | ||
|
|
e08b0044da | ||
|
|
40f991c467 | ||
|
|
0cb9ab3c56 | ||
|
|
bddfa98c4a | ||
|
|
328f294e1a | ||
|
|
040c33d608 | ||
|
|
9f9378376b | ||
|
|
634a66cbe9 | ||
|
|
29360a8fd6 | ||
|
|
5e69f4a558 | ||
|
|
1effc7bbe4 | ||
|
|
726c1caac0 | ||
|
|
03c369b6d5 | ||
|
|
a94dcb6f50 | ||
|
|
fd2515c1ff | ||
|
|
3b636fcc2e | ||
|
|
22e1bef324 | ||
|
|
bb7662b995 | ||
|
|
7743563597 | ||
|
|
9cc9706df1 | ||
|
|
cad20ff7b5 | ||
|
|
2d9a42e04a | ||
|
|
c13632c47c | ||
|
|
77a44f7b19 | ||
|
|
8822ecea50 | ||
|
|
524206f0ff | ||
|
|
87eb0a6fe8 | ||
|
|
bb63d2cb2d | ||
|
|
4030608442 | ||
|
|
bf2bdde478 | ||
|
|
e20869ad9b | ||
|
|
cc27eccd79 | ||
|
|
8975d1ff58 | ||
|
|
7a2f3d10a2 | ||
|
|
abf075a0c0 | ||
|
|
7941b0dcf3 | ||
|
|
8e02d51b14 | ||
|
|
16ae622590 | ||
|
|
24a5012852 | ||
|
|
b50f463677 | ||
|
|
4f285063b0 | ||
|
|
05ab9dc233 | ||
|
|
ffed686144 | ||
|
|
949fa8b24f | ||
|
|
8cb35fdb26 | ||
|
|
285594e125 | ||
|
|
0ec56c32f8 | ||
|
|
d6431bffc1 | ||
|
|
ea854b8754 | ||
|
|
20cb05c708 | ||
|
|
e54ca69ce7 | ||
|
|
a1e1491167 | ||
|
|
6b593abd2b | ||
|
|
13cf9e98a2 | ||
|
|
e42453f276 | ||
|
|
37ed43588e | ||
|
|
1ac850157a | ||
|
|
720a8dc83d | ||
|
|
dd6fcb6309 | ||
|
|
cee0601edc | ||
|
|
a13a313718 | ||
|
|
63cddd9e23 | ||
|
|
3c6f5bb526 | ||
|
|
28e1548475 | ||
|
|
c66a7515aa | ||
|
|
3850cd9fb9 | ||
|
|
835b034926 | ||
|
|
91a3249c09 | ||
|
|
061872e4e6 | ||
|
|
cb8bc87bf7 | ||
|
|
86dd2bc9c3 | ||
|
|
9a33ca6fb6 | ||
|
|
e91c821d1c | ||
|
|
70185e086e | ||
|
|
169c1ce178 | ||
|
|
8776d1e13a | ||
|
|
b84abcee2e | ||
|
|
5f7a2f9f3a | ||
|
|
9cb3ce56f9 | ||
|
|
0ef0478d22 | ||
|
|
7839ec825a | ||
|
|
b7fef480d5 | ||
|
|
22698f09df | ||
|
|
059c2d4529 | ||
|
|
5b366b66a4 | ||
|
|
54535d90ac | ||
|
|
19108aab04 | ||
|
|
ce3978525c | ||
|
|
327dde7fc0 | ||
|
|
1c4b09dc3c | ||
|
|
8b6844a3c1 | ||
|
|
36197b4fe3 | ||
|
|
305ed1d1f3 | ||
|
|
0bb4fd282b | ||
|
|
58ee1847e3 | ||
|
|
f73dc7e742 | ||
|
|
27bb852e3a | ||
|
|
b711436c9e | ||
|
|
22ea9d4dff | ||
|
|
e7819f6c25 | ||
|
|
ba14e1bb01 | ||
|
|
82614f3fb4 | ||
|
|
f9f3b22858 | ||
|
|
c6b741651b | ||
|
|
6bef172c7f | ||
|
|
7ab3520738 | ||
|
|
297263f5a0 | ||
|
|
3305221870 | ||
|
|
986dbfb61f | ||
|
|
8321dc7c4d | ||
|
|
df637aa103 | ||
|
|
a00577a30c | ||
|
|
80138efb3e | ||
|
|
8c28634957 | ||
|
|
7676172fb9 | ||
|
|
614cd93b2a | ||
|
|
b5135b0d2d | ||
|
|
65e7563748 | ||
|
|
4a07e78171 | ||
|
|
359b62a550 | ||
|
|
b5e0e2982f | ||
|
|
07a4d7c476 | ||
|
|
dd9179dadd | ||
|
|
52ff4da563 | ||
|
|
08e804d03f | ||
|
|
e0036e8d2b | ||
|
|
5f4e1103c2 | ||
|
|
3445ad56ce | ||
|
|
036bb02df4 | ||
|
|
af7c9b7989 | ||
|
|
a99da667fb | ||
|
|
0bc06f9215 | ||
|
|
17f6e6ba66 | ||
|
|
495ca15fad | ||
|
|
b9ba666bfb | ||
|
|
abea5e3116 | ||
|
|
d5c09659ff | ||
|
|
1ff1e53fb5 | ||
|
|
071f5556f6 | ||
|
|
1639fe695e | ||
|
|
d1d12abd30 | ||
|
|
445e84fc79 | ||
|
|
c63db1ce40 | ||
|
|
216e493840 | ||
|
|
91d50831f2 | ||
|
|
47f8dc9bc7 | ||
|
|
4c90f3fd6e | ||
|
|
9b85e9b274 | ||
|
|
e8cc870f21 | ||
|
|
2ab7097b85 | ||
|
|
72e712de24 | ||
|
|
0a30e4e08c | ||
|
|
bc20ae399e | ||
|
|
0b9d76582f | ||
|
|
11e4a38796 |
@@ -16,3 +16,7 @@ repos
|
||||
*.ipr
|
||||
*.iws
|
||||
rebel.xml
|
||||
*.sublime-workspace
|
||||
*.DS_Store
|
||||
*.ini
|
||||
*~
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
language: java
|
||||
jdk:
|
||||
- openjdk6
|
||||
script: ./travis_build.sh
|
||||
notifications:
|
||||
email: true
|
||||
@@ -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)
|
||||
@@ -0,0 +1,4 @@
|
||||
Contributors
|
||||
=====
|
||||
|
||||
List of code contributors can be viewed @ https://github.com/openMF/mifosx/contributors
|
||||
@@ -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/.
|
||||
@@ -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
|
||||
=============================
|
||||
[](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
|
||||
|
||||
[](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
|
||||
|
||||
@@ -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.
|
||||
@@ -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
File diff suppressed because it is too large
Load Diff
+46
-33
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
@@ -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: "07 June 2012" " 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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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;
|
||||
@@ -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`;
|
||||
@@ -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` ;
|
||||
+4
@@ -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`;
|
||||
+7
@@ -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) ;
|
||||
+82
@@ -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';
|
||||
|
||||
|
||||
+37
@@ -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
+221
@@ -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);
|
||||
+289
-321
@@ -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');
|
||||
-3
@@ -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;
|
||||
|
||||
-9
@@ -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
@@ -1 +0,0 @@
|
||||
alter table m_loan_transaction drop column interest_waived_derived;
|
||||
-6
@@ -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;
|
||||
-8
@@ -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);
|
||||
-20
@@ -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;
|
||||
|
||||
-6
@@ -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`;
|
||||
|
||||
-14
@@ -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;
|
||||
-31
@@ -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);
|
||||
|
||||
-10
@@ -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';
|
||||
|
||||
|
||||
|
||||
-5
@@ -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) ;
|
||||
-55
@@ -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;
|
||||
|
||||
|
||||
-6
@@ -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;
|
||||
-13
@@ -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;
|
||||
-19
@@ -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;
|
||||
-30
@@ -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
Reference in New Issue
Block a user