bulk auto reformat ca. 2900 files using ./gradlew :spotlessApply [FINERACT-1006]

This commit is contained in:
Michael Vorburger
2020-06-14 18:31:47 +02:00
committed by Michael Vorburger ⛑️
parent 89e321acaf
commit 9da5932307
2899 changed files with 44572 additions and 46101 deletions
@@ -22,17 +22,17 @@
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">
<persistence-unit-metadata>
<persistence-unit-defaults>
<entity-listeners>
<entity-listener
class="org.springframework.data.jpa.domain.support.AuditingEntityListener" />
</entity-listeners>
</persistence-unit-defaults>
</persistence-unit-metadata>
<persistence-unit-metadata>
<persistence-unit-defaults>
<entity-listeners>
<entity-listener
class="org.springframework.data.jpa.domain.support.AuditingEntityListener" />
</entity-listeners>
</persistence-unit-defaults>
</persistence-unit-metadata>
</entity-mappings>
@@ -22,17 +22,17 @@
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="jpa-pu" transaction-type="RESOURCE_LOCAL">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<properties>
<persistence-unit name="jpa-pu" transaction-type="RESOURCE_LOCAL">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
<properties>
<property name="openjpa.Compatibility" value="QuotedNumbersInQueries=true"/>
<property name="openjpa.jdbc.DBDictionary" value="org.apache.fineract.infrastructure.core.domain.MySQLDictionaryCustom"/>
<!--<property name="openjpa.InverseManager" value="true(Action=warn)"/> -->
<!-- <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>-->
<property name="openjpa.jdbc.MappingDefaults" value="ForeignKeyDeleteAction=CASCADE"/>
</properties>
</persistence-unit>
</persistence>
</properties>
</persistence-unit>
</persistence>
@@ -21,89 +21,89 @@
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:sec="http://www.springframework.org/schema/security"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:sec="http://www.springframework.org/schema/security"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
<sec:global-method-security
pre-post-annotations="enabled" />
<sec:global-method-security
pre-post-annotations="enabled" />
<context:component-scan
base-package="org.apache.fineract.accounting.*,
org.apache.fineract.commands.provider.*,
org.apache.fineract.commands.handler.*,
org.apache.fineract.commands.service.*,
org.apache.fineract.commands.*,
org.apache.fineract.audit.*,
org.apache.fineract.infrastructure.creditbureau.*,
org.apache.fineract.infrastructure.*,
org.apache.fineract.infrastructure.core.security*,
org.apache.fineract.scheduledjobs.*,
org.apache.fineract.organisation.*,
org.apache.fineract.interoperation.*,
org.apache.fineract.portfolio.loanaccount.*,
org.apache.fineract.portfolio.savingsaccount.*,
org.apache.fineract.portfolio.*,
org.apache.fineract.useradministration.*,
org.apache.fineract.mix.*,
org.apache.fineract.notification.*,
org.apache.fineract.template.*,
org.apache.fineract.template.service.*,
org.apache.fineract.useradministration.*,
org.apache.fineract.batch,
org.apache.fineract.adhocquery.*,
org.apache.fineract.infrastructure.campaigns.**">
<context:exclude-filter expression="org.springframework.stereotype.Controller"
type="annotation" />
<context:component-scan
base-package="org.apache.fineract.accounting.*,
org.apache.fineract.commands.provider.*,
org.apache.fineract.commands.handler.*,
org.apache.fineract.commands.service.*,
org.apache.fineract.commands.*,
org.apache.fineract.audit.*,
org.apache.fineract.infrastructure.creditbureau.*,
org.apache.fineract.infrastructure.*,
org.apache.fineract.infrastructure.core.security*,
org.apache.fineract.scheduledjobs.*,
org.apache.fineract.organisation.*,
org.apache.fineract.interoperation.*,
org.apache.fineract.portfolio.loanaccount.*,
org.apache.fineract.portfolio.savingsaccount.*,
org.apache.fineract.portfolio.*,
org.apache.fineract.useradministration.*,
org.apache.fineract.mix.*,
org.apache.fineract.notification.*,
org.apache.fineract.template.*,
org.apache.fineract.template.service.*,
org.apache.fineract.useradministration.*,
org.apache.fineract.batch,
org.apache.fineract.adhocquery.*,
org.apache.fineract.infrastructure.campaigns.**">
<context:exclude-filter expression="org.springframework.stereotype.Controller"
type="annotation" />
<!-- We do NOT want all @Configuration "beans" to be auto-detected by ComponentScan,
but we want to use / import them explicitly in Tests & Spring Boot applications,
or other import in other @Configuration, so that we could have mutually exclusive ones.
-->
<context:exclude-filter expression="org.springframework.context.annotation.Configuration"
type="annotation" />
</context:component-scan>
<!-- We do NOT want all @Configuration "beans" to be auto-detected by ComponentScan,
but we want to use / import them explicitly in Tests & Spring Boot applications,
or other import in other @Configuration, so that we could have mutually exclusive ones.
-->
<context:exclude-filter expression="org.springframework.context.annotation.Configuration"
type="annotation" />
</context:component-scan>
<bean id="auditorAware"
class="org.apache.fineract.infrastructure.core.domain.AuditorAwareImpl" />
<jpa:auditing auditor-aware-ref="auditorAware" />
<jpa:repositories base-package="org.apache.fineract.commands.domain" />
<jpa:repositories base-package="org.apache.fineract.infrastructure.*.domain" />
<jpa:repositories base-package="org.apache.fineract.accounting.*.domain" />
<jpa:repositories base-package="org.apache.fineract.useradministration.domain" />
<jpa:repositories base-package="org.apache.fineract.organisation.*.domain" />
<jpa:repositories base-package="org.apache.fineract.portfolio.*" />
<jpa:repositories base-package="org.apache.fineract.mix.domain" />
<jpa:repositories base-package="org.apache.fineract.scheduledjobs.domain" />
<jpa:repositories base-package="org.apache.fineract.template.domain" />
<jpa:repositories base-package="org.apache.fineract.infrastructure.campaigns.sms.domain" />
<jpa:repositories base-package="org.apache.fineract.adhocquery.domain" />
<jpa:repositories base-package="org.apache.fineract.notification.domain"/>
<jpa:repositories base-package="org.apache.fineract.infrastructure.campaigns.email.domain"/>
<jpa:repositories base-package="org.apache.fineract.interoperation.domain"/>
<bean id="auditorAware"
class="org.apache.fineract.infrastructure.core.domain.AuditorAwareImpl" />
<jpa:auditing auditor-aware-ref="auditorAware" />
<jpa:repositories base-package="org.apache.fineract.commands.domain" />
<jpa:repositories base-package="org.apache.fineract.infrastructure.*.domain" />
<jpa:repositories base-package="org.apache.fineract.accounting.*.domain" />
<jpa:repositories base-package="org.apache.fineract.useradministration.domain" />
<jpa:repositories base-package="org.apache.fineract.organisation.*.domain" />
<jpa:repositories base-package="org.apache.fineract.portfolio.*" />
<jpa:repositories base-package="org.apache.fineract.mix.domain" />
<jpa:repositories base-package="org.apache.fineract.scheduledjobs.domain" />
<jpa:repositories base-package="org.apache.fineract.template.domain" />
<jpa:repositories base-package="org.apache.fineract.infrastructure.campaigns.sms.domain" />
<jpa:repositories base-package="org.apache.fineract.adhocquery.domain" />
<jpa:repositories base-package="org.apache.fineract.notification.domain"/>
<jpa:repositories base-package="org.apache.fineract.infrastructure.campaigns.email.domain"/>
<jpa:repositories base-package="org.apache.fineract.interoperation.domain"/>
<import resource="infrastructure.xml" />
<import resource="infrastructure.xml" />
<import resource="securityContext.xml" />
<import resource="securityContext.xml" />
<import resource="cache.xml" />
<import resource="cache.xml" />
<bean id="applicationEventMulticaster" class="org.springframework.context.event.SimpleApplicationEventMulticaster">
<property name="taskExecutor">
<bean class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>
</property>
</bean>
<!-- The application events (for importing) rely on the inheritable thread local security context strategy
This is NOT compatible with threadpools so if we use threadpools the below will need to be reworked -->
<bean
<bean id="applicationEventMulticaster" class="org.springframework.context.event.SimpleApplicationEventMulticaster">
<property name="taskExecutor">
<bean class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>
</property>
</bean>
<!-- The application events (for importing) rely on the inheritable thread local security context strategy
This is NOT compatible with threadpools so if we use threadpools the below will need to be reworked -->
<bean
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass"
value="org.springframework.security.core.context.SecurityContextHolder" />
@@ -111,7 +111,7 @@
<property name="arguments" value="MODE_INHERITABLETHREADLOCAL" />
</bean>
<import resource="spmContext.xml"/>
<import resource="spmContext.xml"/>
<import resource="swagger.xml"/>
<import resource="swagger.xml"/>
</beans>
@@ -22,18 +22,18 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
<bean id="ehcacheManager" class="org.springframework.cache.jcache.JCacheCacheManager"
p:cacheManager-ref="ehcacheInstance" />
<bean id="ehcacheManager" class="org.springframework.cache.jcache.JCacheCacheManager"
p:cacheManager-ref="ehcacheInstance" />
<bean id="ehcacheInstance"
class="org.springframework.cache.jcache.JCacheManagerFactoryBean"/>
<bean id="ehcacheInstance"
class="org.springframework.cache.jcache.JCacheManagerFactoryBean"/>
</beans>
</beans>
@@ -22,35 +22,35 @@
<config xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://www.ehcache.org/v3'
xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.7.xsd">
xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.7.xsd">
<defaultCache eternal="true" maxEntriesLocalHeap="100"
overflowToDisk="false" />
<defaultCache eternal="true" maxEntriesLocalHeap="100"
overflowToDisk="false" />
<cache name="users" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="usersByUsername" maxEntriesLocalHeap="10000"
eternal="true" overflowToDisk="false" />
<cache name="tenantsById" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="offices" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="officesForDropdown" maxEntriesLocalHeap="10000"
eternal="true" overflowToDisk="false" />
<cache name="officesById" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="charges" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="funds" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="code_values" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="codes" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="hooks" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="userTFAccessToken" maxEntriesLocalHeap="10000"
overflowToDisk="false" timeToIdleSeconds="7200" />
<cache name="tfConfig" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
</config>
<cache name="users" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="usersByUsername" maxEntriesLocalHeap="10000"
eternal="true" overflowToDisk="false" />
<cache name="tenantsById" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="offices" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="officesForDropdown" maxEntriesLocalHeap="10000"
eternal="true" overflowToDisk="false" />
<cache name="officesById" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="charges" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="funds" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="code_values" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="codes" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="hooks" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
<cache name="userTFAccessToken" maxEntriesLocalHeap="10000"
overflowToDisk="false" timeToIdleSeconds="7200" />
<cache name="tfConfig" maxEntriesLocalHeap="10000" eternal="true"
overflowToDisk="false" />
</config>
@@ -22,13 +22,13 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
<!-- HikariCP Database bean -->
<!-- HikariCP Database bean -->
<bean id="hikariTenantDataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close">
<constructor-arg ref="hikariConfig" />
</bean>
@@ -47,7 +47,7 @@
<!-- These are the properties for the all Tenants DB; the same configuration is also (hard-coded) in the TomcatJdbcDataSourcePerTenantService class -->
<property name="dataSourceProperties">
<props>
<!-- https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration -->
<!-- https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration -->
<prop key="cachePrepStmts">true</prop>
<prop key="prepStmtCacheSize">250</prop>
<prop key="prepStmtCacheSqlLimit">2048</prop>
@@ -22,29 +22,29 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
depends-on="tenantDatabaseUpgradeService">
<property name="dataSource" ref="routingDataSource" />
<property name="persistenceUnitName" value="jpa-pu" />
<property name="jpaVendorAdapter">
<bean class="org.apache.fineract.infrastructure.openjpa.OpenJpaVendorAdapter"/>
</property>
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
depends-on="tenantDatabaseUpgradeService">
<property name="dataSource" ref="routingDataSource" />
<property name="persistenceUnitName" value="jpa-pu" />
<property name="jpaVendorAdapter">
<bean class="org.apache.fineract.infrastructure.openjpa.OpenJpaVendorAdapter"/>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<!-- Create instance of transaction template for programmatic transaction manipulation -->
<bean id="txTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager" ref="transactionManager"></property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<!-- Create instance of transaction template for programmatic transaction manipulation -->
<bean id="txTemplate" class="org.springframework.transaction.support.TransactionTemplate">
<property name="transactionManager" ref="transactionManager"></property>
</bean>
</beans>
@@ -24,4 +24,4 @@ SUB_PROTOCOL:mysql:thin
fineract_tenants_driver:org.drizzle.jdbc.DrizzleDriver
fineract_tenants_url:jdbc:mysql:thin://localhost:3306/fineract_tenants
fineract_tenants_uid:root
fineract_tenants_pwd:mysql
fineract_tenants_pwd:mysql
@@ -21,9 +21,9 @@
-->
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xsi:schemaLocation="
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:oauth="http://www.springframework.org/schema/security/oauth2"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/security/oauth2
@@ -31,201 +31,201 @@
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security.xsd">
<beans:beans profile="basicauth">
<http create-session="stateless" use-expressions="true" pattern="/api/**"
entry-point-ref="basicAuthenticationEntryPoint">
<csrf disabled="true"/>
<intercept-url pattern="/api/*/echo" access="permitAll" />
<intercept-url pattern="/api/*/authentication" access="permitAll"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/self/authentication" access="permitAll"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/self/registration" access="permitAll"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/self/registration/user" access="permitAll"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor" access="isFullyAuthenticated()"
method="GET" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor" access="isFullyAuthenticated()"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor/validate" access="isFullyAuthenticated()"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="GET" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="PUT" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="DELETE" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="HEAD" requires-channel="https" />
<custom-filter after="SECURITY_CONTEXT_FILTER" ref="basicAuthenticationProcessingFilter" />
<custom-filter ref="twoFactorAuthFilter" after="BASIC_AUTH_FILTER" />
</http>
<beans:bean id="basicAuthenticationEntryPoint"
class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
<beans:property name="realmName" value="Fineract Platform API" />
</beans:bean>
<beans:bean id="passwordEncoder" class="org.springframework.security.crypto.factory.PasswordEncoderFactories"
factory-method="createDelegatingPasswordEncoder">
</beans:bean>
<beans:bean id="customAuthenticationProvider"
class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<beans:property name="userDetailsService" ref="userDetailsService" />
<beans:property name="passwordEncoder" ref="passwordEncoder" />
</beans:bean>
<authentication-manager alias="authenticationManager"
erase-credentials="false">
<authentication-provider ref="customAuthenticationProvider" />
</authentication-manager>
</beans:beans>
<beans:beans profile="oauth">
<http create-session="stateless" use-expressions="true" pattern="/api/v1/**"
entry-point-ref="oauthAuthenticationEntryPoint"
access-decision-manager-ref="accessDecisionManager">
<csrf disabled="true"/>
<anonymous enabled="false" />
<intercept-url pattern="/api//v1/**" method="OPTIONS"
access="permitAll" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor" access="isFullyAuthenticated()"
method="GET" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor" access="isFullyAuthenticated()"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor/validate" access="isFullyAuthenticated()"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="GET" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="PUT" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="DELETE" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="HEAD" requires-channel="https" />
<custom-filter ref="tenantIdentifierProcessingFilter"
position="FIRST" />
<custom-filter before="PRE_AUTH_FILTER" ref="resourceServerFilter" />
<custom-filter ref="twoFactorAuthFilter" after="BASIC_AUTH_FILTER" />
<access-denied-handler ref="oauthAccessDeniedHandler" />
</http>
<http pattern="/api/oauth/token" create-session="stateless"
entry-point-ref="oauthAuthenticationEntryPoint" use-expressions="true"
authentication-manager-ref="clientAuthenticationManager">
<beans:beans profile="basicauth">
<http create-session="stateless" use-expressions="true" pattern="/api/**"
entry-point-ref="basicAuthenticationEntryPoint">
<csrf disabled="true"/>
<intercept-url pattern="/api/oauth/token" method="OPTIONS"
access="permitAll" requires-channel="https" />
<intercept-url pattern="/api/oauth/token" method="POST"
access="isFullyAuthenticated()" requires-channel="https" />
<anonymous enabled="false" />
<intercept-url pattern="/api/*/echo" access="permitAll" />
<intercept-url pattern="/api/*/authentication" access="permitAll"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/self/authentication" access="permitAll"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/self/registration" access="permitAll"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/self/registration/user" access="permitAll"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor" access="isFullyAuthenticated()"
method="GET" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor" access="isFullyAuthenticated()"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor/validate" access="isFullyAuthenticated()"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="GET" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="PUT" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="DELETE" requires-channel="https" />
<intercept-url pattern="/api/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="HEAD" requires-channel="https" />
<custom-filter ref="tenantIdentifierProcessingFilter"
position="FIRST" />
<custom-filter ref="clientCredentialsTokenEndpointFilter"
before="BASIC_AUTH_FILTER" />
<access-denied-handler ref="oauthAccessDeniedHandler" />
</http>
<custom-filter after="SECURITY_CONTEXT_FILTER" ref="basicAuthenticationProcessingFilter" />
<custom-filter ref="twoFactorAuthFilter" after="BASIC_AUTH_FILTER" />
</http>
<beans:bean id="basicAuthenticationEntryPoint"
class="org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint">
<beans:property name="realmName" value="Fineract Platform API" />
</beans:bean>
<beans:bean id="passwordEncoder" class="org.springframework.security.crypto.factory.PasswordEncoderFactories"
factory-method="createDelegatingPasswordEncoder">
</beans:bean>
<beans:bean id="oauthAuthenticationEntryPoint"
class="org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint">
<beans:property name="realmName" value="Fineract Platform API" />
</beans:bean>
<beans:bean id="customAuthenticationProvider"
class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<beans:property name="userDetailsService" ref="userDetailsService" />
<beans:property name="passwordEncoder" ref="passwordEncoder" />
</beans:bean>
<beans:bean id="oauthAccessDeniedHandler"
class="org.springframework.security.oauth2.provider.error.OAuth2AccessDeniedHandler" />
<beans:bean id="clientCredentialsTokenEndpointFilter"
class="org.springframework.security.oauth2.provider.client.ClientCredentialsTokenEndpointFilter">
<beans:constructor-arg value="/api/oauth/token" />
<beans:property name="authenticationManager" ref="clientAuthenticationManager" />
</beans:bean>
<beans:bean id="accessDecisionManager"
class="org.springframework.security.access.vote.UnanimousBased">
<beans:constructor-arg>
<beans:list>
<beans:bean
class="org.springframework.security.oauth2.provider.vote.ScopeVoter" />
<beans:bean class="org.springframework.security.access.vote.RoleVoter" />
<beans:bean
class="org.springframework.security.access.vote.AuthenticatedVoter" />
<beans:bean
class="org.springframework.security.web.access.expression.WebExpressionVoter" />
<beans:bean
class="org.apache.fineract.infrastructure.security.vote.SelfServiceUserAccessVote" />
</beans:list>
</beans:constructor-arg>
</beans:bean>
<authentication-manager id="clientAuthenticationManager" erase-credentials="false">
<authentication-provider user-service-ref="clientDetailsUserService" />
<authentication-manager alias="authenticationManager"
erase-credentials="false">
<authentication-provider ref="customAuthenticationProvider" />
</authentication-manager>
</authentication-manager>
</beans:beans>
<beans:beans profile="oauth">
<http create-session="stateless" use-expressions="true" pattern="/api/v1/**"
entry-point-ref="oauthAuthenticationEntryPoint"
access-decision-manager-ref="accessDecisionManager">
<csrf disabled="true"/>
<anonymous enabled="false" />
<intercept-url pattern="/api//v1/**" method="OPTIONS"
access="permitAll" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor" access="isFullyAuthenticated()"
method="GET" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor" access="isFullyAuthenticated()"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/*/twofactor/validate" access="isFullyAuthenticated()"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="GET" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="POST" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="PUT" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="DELETE" requires-channel="https" />
<intercept-url pattern="/api/v1/**" access="isFullyAuthenticated() and hasAuthority('TWOFACTOR_AUTHENTICATED')"
method="HEAD" requires-channel="https" />
<custom-filter ref="tenantIdentifierProcessingFilter"
position="FIRST" />
<custom-filter before="PRE_AUTH_FILTER" ref="resourceServerFilter" />
<custom-filter ref="twoFactorAuthFilter" after="BASIC_AUTH_FILTER" />
<access-denied-handler ref="oauthAccessDeniedHandler" />
</http>
<beans:bean id="clientDetailsUserService"
class="org.springframework.security.oauth2.provider.client.ClientDetailsUserDetailsService">
<beans:constructor-arg ref="clientDetailsService" />
</beans:bean>
<http pattern="/api/oauth/token" create-session="stateless"
entry-point-ref="oauthAuthenticationEntryPoint" use-expressions="true"
authentication-manager-ref="clientAuthenticationManager">
<csrf disabled="true"/>
<intercept-url pattern="/api/oauth/token" method="OPTIONS"
access="permitAll" requires-channel="https" />
<intercept-url pattern="/api/oauth/token" method="POST"
access="isFullyAuthenticated()" requires-channel="https" />
<anonymous enabled="false" />
<beans:bean id="customAuthenticationProvider"
class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<beans:property name="userDetailsService" ref="userDetailsService" />
<beans:property name="passwordEncoder" ref="passwordEncoder" />
</beans:bean>
<custom-filter ref="tenantIdentifierProcessingFilter"
position="FIRST" />
<custom-filter ref="clientCredentialsTokenEndpointFilter"
before="BASIC_AUTH_FILTER" />
<access-denied-handler ref="oauthAccessDeniedHandler" />
</http>
<beans:bean id="clientDetailsService"
class="org.springframework.security.oauth2.provider.client.JdbcClientDetailsService">
<beans:constructor-arg ref="routingDataSource" />
</beans:bean>
<beans:bean id="passwordEncoder" class="org.springframework.security.crypto.factory.PasswordEncoderFactories"
factory-method="createDelegatingPasswordEncoder">
</beans:bean>
<beans:bean id="tokenStore"
class="org.springframework.security.oauth2.provider.token.store.JdbcTokenStore">
<beans:constructor-arg ref="routingDataSource" />
</beans:bean>
<beans:bean id="oauthAuthenticationEntryPoint"
class="org.springframework.security.oauth2.provider.error.OAuth2AuthenticationEntryPoint">
<beans:property name="realmName" value="Fineract Platform API" />
</beans:bean>
<beans:bean id="tokenServices"
class="org.springframework.security.oauth2.provider.token.DefaultTokenServices">
<beans:property name="tokenStore" ref="tokenStore" />
<beans:property name="clientDetailsService" ref="clientDetailsService" />
<beans:property name="supportRefreshToken" value="true" />
<beans:property name="refreshTokenValiditySeconds"
value="86400" />
<beans:property name="accessTokenValiditySeconds"
value="3600" />
</beans:bean>
<beans:bean id="oauthAccessDeniedHandler"
class="org.springframework.security.oauth2.provider.error.OAuth2AccessDeniedHandler" />
<beans:bean id="userApprovalHandler"
class="org.springframework.security.oauth2.provider.approval.TokenStoreUserApprovalHandler">
<beans:property name="tokenStore" ref="tokenStore" />
<beans:property name="clientDetailsService" ref="clientDetailsService" />
<beans:property name="requestFactory" ref="oAuth2RequestFactory" />
</beans:bean>
<beans:bean id="clientCredentialsTokenEndpointFilter"
class="org.springframework.security.oauth2.provider.client.ClientCredentialsTokenEndpointFilter">
<beans:constructor-arg value="/api/oauth/token" />
<beans:property name="authenticationManager" ref="clientAuthenticationManager" />
</beans:bean>
<beans:bean id="oAuth2RequestFactory"
class="org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestFactory">
<beans:constructor-arg ref="clientDetailsService" />
</beans:bean>
<beans:bean id="accessDecisionManager"
class="org.springframework.security.access.vote.UnanimousBased">
<beans:constructor-arg>
<beans:list>
<beans:bean
class="org.springframework.security.oauth2.provider.vote.ScopeVoter" />
<beans:bean class="org.springframework.security.access.vote.RoleVoter" />
<beans:bean
class="org.springframework.security.access.vote.AuthenticatedVoter" />
<beans:bean
class="org.springframework.security.web.access.expression.WebExpressionVoter" />
<beans:bean
class="org.apache.fineract.infrastructure.security.vote.SelfServiceUserAccessVote" />
</beans:list>
</beans:constructor-arg>
</beans:bean>
<oauth:authorization-server
client-details-service-ref="clientDetailsService" token-services-ref="tokenServices"
user-approval-handler-ref="userApprovalHandler" token-endpoint-url="/api/oauth/token"
authorization-endpoint-url="/api/oauth/authorize">
<oauth:refresh-token />
<oauth:password />
</oauth:authorization-server>
<authentication-manager id="clientAuthenticationManager" erase-credentials="false">
<authentication-provider user-service-ref="clientDetailsUserService" />
<authentication-provider ref="customAuthenticationProvider" />
</authentication-manager>
<oauth:resource-server id="resourceServerFilter" stateless="false"
token-services-ref="tokenServices" />
</beans:beans>
<beans:bean id="clientDetailsUserService"
class="org.springframework.security.oauth2.provider.client.ClientDetailsUserDetailsService">
<beans:constructor-arg ref="clientDetailsService" />
</beans:bean>
<beans:bean id="customAuthenticationProvider"
class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
<beans:property name="userDetailsService" ref="userDetailsService" />
<beans:property name="passwordEncoder" ref="passwordEncoder" />
</beans:bean>
<beans:bean id="clientDetailsService"
class="org.springframework.security.oauth2.provider.client.JdbcClientDetailsService">
<beans:constructor-arg ref="routingDataSource" />
</beans:bean>
<beans:bean id="tokenStore"
class="org.springframework.security.oauth2.provider.token.store.JdbcTokenStore">
<beans:constructor-arg ref="routingDataSource" />
</beans:bean>
<beans:bean id="tokenServices"
class="org.springframework.security.oauth2.provider.token.DefaultTokenServices">
<beans:property name="tokenStore" ref="tokenStore" />
<beans:property name="clientDetailsService" ref="clientDetailsService" />
<beans:property name="supportRefreshToken" value="true" />
<beans:property name="refreshTokenValiditySeconds"
value="86400" />
<beans:property name="accessTokenValiditySeconds"
value="3600" />
</beans:bean>
<beans:bean id="userApprovalHandler"
class="org.springframework.security.oauth2.provider.approval.TokenStoreUserApprovalHandler">
<beans:property name="tokenStore" ref="tokenStore" />
<beans:property name="clientDetailsService" ref="clientDetailsService" />
<beans:property name="requestFactory" ref="oAuth2RequestFactory" />
</beans:bean>
<beans:bean id="oAuth2RequestFactory"
class="org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestFactory">
<beans:constructor-arg ref="clientDetailsService" />
</beans:bean>
<oauth:authorization-server
client-details-service-ref="clientDetailsService" token-services-ref="tokenServices"
user-approval-handler-ref="userApprovalHandler" token-endpoint-url="/api/oauth/token"
authorization-endpoint-url="/api/oauth/authorize">
<oauth:refresh-token />
<oauth:password />
</oauth:authorization-server>
<oauth:resource-server id="resourceServerFilter" stateless="false"
token-services-ref="tokenServices" />
</beans:beans>
</beans:beans>
@@ -26,9 +26,9 @@
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="org.apache.fineract.spm.**"/>
@@ -71,4 +71,4 @@
<property name="scan" value="true"/>
</bean>
</beans>
</beans>
@@ -17,4 +17,4 @@
-- under the License.
--
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('GroupSavingSummary', 'Table', NULL, NULL, 'select ifnull(cur.display_symbol, sa.currency_code) as currency,\ncount(sa.id) as totalSavingAccounts, ifnull(sum(sa.account_balance_derived),0) as totalSavings\nfrom m_group topgroup\njoin m_office o on o.id = topgroup.office_id and o.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\njoin m_group g on g.hierarchy like concat(topgroup.hierarchy, \'%\')\njoin m_savings_account sa on sa.group_id = g.id\nleft join m_currency cur on cur.code = sa.currency_code\nwhere topgroup.id = ${groupId}\nand sa.activatedon_date is not null\ngroup by sa.currency_code', 'Utility query for getting group or center saving summary details for a group_id', 1, 0);
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('GroupSavingSummary', 'Table', NULL, NULL, 'select ifnull(cur.display_symbol, sa.currency_code) as currency,\ncount(sa.id) as totalSavingAccounts, ifnull(sum(sa.account_balance_derived),0) as totalSavings\nfrom m_group topgroup\njoin m_office o on o.id = topgroup.office_id and o.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\njoin m_group g on g.hierarchy like concat(topgroup.hierarchy, \'%\')\njoin m_savings_account sa on sa.group_id = g.id\nleft join m_currency cur on cur.code = sa.currency_code\nwhere topgroup.id = ${groupId}\nand sa.activatedon_date is not null\ngroup by sa.currency_code', 'Utility query for getting group or center saving summary details for a group_id', 1, 0);
@@ -18,4 +18,4 @@
--
ALTER TABLE `m_savings_account_transfer`
ADD COLUMN `currency_multiplesof` SMALLINT NULL DEFAULT NULL AFTER `currency_digits`;
ADD COLUMN `currency_multiplesof` SMALLINT NULL DEFAULT NULL AFTER `currency_digits`;
@@ -18,26 +18,26 @@
--
CREATE TABLE `m_meeting` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`calendar_instance_id` BIGINT NOT NULL,
`meeting_date` DATE NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_calendar_instance_id_meeting_date` (`calendar_instance_id`, `meeting_date`),
CONSTRAINT `FK_m_calendar_instance_m_meeting` FOREIGN KEY (`calendar_instance_id`) REFERENCES `m_calendar_instance` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`calendar_instance_id` BIGINT NOT NULL,
`meeting_date` DATE NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_calendar_instance_id_meeting_date` (`calendar_instance_id`, `meeting_date`),
CONSTRAINT `FK_m_calendar_instance_m_meeting` FOREIGN KEY (`calendar_instance_id`) REFERENCES `m_calendar_instance` (`id`)
)
COLLATE='latin1_swedish_ci'
ENGINE=InnoDB;
CREATE TABLE `m_client_attendance` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`client_id` BIGINT NOT NULL DEFAULT '0',
`meeting_id` BIGINT NOT NULL,
`attendance_type_enum` SMALLINT NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_client_meeting_attendance` (`client_id`, `meeting_id`),
INDEX `FK_m_meeting_m_client_attendance` (`meeting_id`),
CONSTRAINT `FK_m_client_m_client_attendance` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FK_m_meeting_m_client_attendance` FOREIGN KEY (`meeting_id`) REFERENCES `m_meeting` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`client_id` BIGINT NOT NULL DEFAULT '0',
`meeting_id` BIGINT NOT NULL,
`attendance_type_enum` SMALLINT NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_client_meeting_attendance` (`client_id`, `meeting_id`),
INDEX `FK_m_meeting_m_client_attendance` (`meeting_id`),
CONSTRAINT `FK_m_client_m_client_attendance` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FK_m_meeting_m_client_attendance` FOREIGN KEY (`meeting_id`) REFERENCES `m_meeting` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
@@ -18,14 +18,14 @@
--
ALTER TABLE `job`
ADD COLUMN `is_misfired` tinyint NOT NULL DEFAULT '0' AFTER `scheduler_group`;
ADD COLUMN `is_misfired` tinyint NOT NULL DEFAULT '0' AFTER `scheduler_group`;
CREATE TABLE `scheduler_detail` (
`id` SMALLINT NOT NULL AUTO_INCREMENT,
`is_suspended` tinyint NOT NULL DEFAULT '0',
`execute_misfired_jobs` tinyint NOT NULL DEFAULT '1',
`reset_scheduler_on_bootup` tinyint NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
`id` SMALLINT NOT NULL AUTO_INCREMENT,
`is_suspended` tinyint NOT NULL DEFAULT '0',
`execute_misfired_jobs` tinyint NOT NULL DEFAULT '1',
`reset_scheduler_on_bootup` tinyint NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
@@ -27,4 +27,4 @@ INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `c
VALUES ('portfolio', 'TRANSFER_CLIENT', 'CLIENT', 'TRANSFER', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('portfolio', 'TRANSFER_CLIENT_CHECKER', 'CLIENT', 'TRANSFER', 0);
VALUES ('portfolio', 'TRANSFER_CLIENT_CHECKER', 'CLIENT', 'TRANSFER', 0);
@@ -31,4 +31,4 @@ ALTER TABLE `m_loan_transaction`
CHANGE COLUMN `office_id` `office_id` BIGINT NOT NULL AFTER `loan_id`;
ALTER TABLE `m_loan_transaction`
ADD CONSTRAINT `FK_m_loan_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`);
ADD CONSTRAINT `FK_m_loan_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`);
@@ -46,4 +46,4 @@ INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `c
VALUES ('portfolio', 'WITHDRAWTRANSFER_CLIENT', 'CLIENT', 'WITHDRAWTRANSFER', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('portfolio', 'WITHDRAWTRANSFER_CLIENT_CHECKER', 'CLIENT', 'WITHDRAWTRANSFER', 0);
VALUES ('portfolio', 'WITHDRAWTRANSFER_CLIENT_CHECKER', 'CLIENT', 'WITHDRAWTRANSFER', 0);
@@ -18,11 +18,11 @@
--
CREATE TABLE `x_table_cloumn_code_mappings` (
`column_alias_name` VARCHAR(50) NOT NULL,
`code_id` INT NOT NULL,
PRIMARY KEY (`column_alias_name`),
INDEX `FK_x_code_id` (`code_id`),
CONSTRAINT `FK_x_code_id` FOREIGN KEY (`code_id`) REFERENCES `m_code` (`id`)
`column_alias_name` VARCHAR(50) NOT NULL,
`code_id` INT NOT NULL,
PRIMARY KEY (`column_alias_name`),
INDEX `FK_x_code_id` (`code_id`),
CONSTRAINT `FK_x_code_id` FOREIGN KEY (`code_id`) REFERENCES `m_code` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
@@ -19,9 +19,9 @@
/***Store destination office Id while client is pending transfers and effective joining date in a particular branch**/
ALTER TABLE `m_client`
ADD COLUMN `office_joining_date` DATE NULL AFTER `activation_date`,
ADD COLUMN `transfer_to_office_id` BIGINT NULL AFTER `office_id`,
ADD CONSTRAINT `FK_m_client_m_office` FOREIGN KEY (`transfer_to_office_id`) REFERENCES `m_office` (`id`);
ADD COLUMN `office_joining_date` DATE NULL AFTER `activation_date`,
ADD COLUMN `transfer_to_office_id` BIGINT NULL AFTER `office_id`,
ADD CONSTRAINT `FK_m_client_m_office` FOREIGN KEY (`transfer_to_office_id`) REFERENCES `m_office` (`id`);
/**For current Clients, set the office joining date to activation date**/
@@ -18,7 +18,7 @@
--
ALTER TABLE `m_savings_product`
ADD COLUMN `withdrawal_fee_for_transfer` TINYINT NULL DEFAULT '1' AFTER `withdrawal_fee_type_enum`;
ADD COLUMN `withdrawal_fee_for_transfer` TINYINT NULL DEFAULT '1' AFTER `withdrawal_fee_type_enum`;
ALTER TABLE `m_savings_account`
ADD COLUMN `withdrawal_fee_for_transfer` TINYINT NULL DEFAULT '1' AFTER `withdrawal_fee_type_enum`;
ADD COLUMN `withdrawal_fee_for_transfer` TINYINT NULL DEFAULT '1' AFTER `withdrawal_fee_type_enum`;
@@ -28,4 +28,4 @@ ADD COLUMN `interest_posting_period_enum` SMALLINT NOT NULL DEFAULT 4 AFTER `int
ALTER TABLE `m_savings_account`
ADD COLUMN `interest_posting_period_enum` SMALLINT NOT NULL DEFAULT 4 AFTER `interest_compounding_period_enum`;
ADD COLUMN `interest_posting_period_enum` SMALLINT NOT NULL DEFAULT 4 AFTER `interest_compounding_period_enum`;
@@ -20,4 +20,4 @@
INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`payment_type`,`charge_id`,`financial_account_type`)
select mapping.gl_account_id,mapping.product_id,mapping.product_type,mapping.payment_type,mapping.charge_id, 10
from acc_product_mapping mapping
where mapping.financial_account_type = 1 and mapping.product_type=1;
where mapping.financial_account_type = 1 and mapping.product_type=1;
@@ -17,4 +17,4 @@
-- under the License.
--
update c_configuration set enabled=0 where name="constraint_approach_for_datatables";
update c_configuration set enabled=0 where name="constraint_approach_for_datatables";
@@ -37,54 +37,54 @@ LOCK TABLES `mix_taxonomy` WRITE;
INSERT INTO `mix_taxonomy` (`id`, `name`, `namespace_id`, `dimension`, `type`, `description`, `need_mapping`)
VALUES
(1,'AdministrativeExpense',1,NULL,3,NULL,1),
(2,'Assets',3,NULL,1,'All outstanding principals due for all outstanding client loans. This includes current, delinquent, and renegotiated loans, but not loans that have been written off. It does not include interest receivable.',1),
(3,'Assets',3,'MaturityDimension:LessThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',1),
(4,'Assets',3,'MaturityDimension:MoreThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',1),
(5,'CashAndCashEquivalents',1,NULL,1,NULL,1),
(6,'Deposits',3,NULL,1,'The total value of funds placed in an account with an MFI that are payable to a depositor. This item includes any current, checking, or savings accounts that are payable on demand. It also includes time deposits which have a fixed maturity date and compulsory deposits.',1),
(7,'Deposits',3,'DepositProductsDimension:CompulsoryMember',1,'The value of deposits that an MFI\'s clients are required to maintain as a condition of an existing or future loan.',NULL),
(8,'Deposits',3,'DepositProductsDimension:VoluntaryMember',1,'The value of deposits that an MFI\'s clients are not required to maintain as a condition of an existing or future loan.',NULL),
(9,'Deposits',3,'LocationDimension:RuralMember',1,'Located in rural areas. Segmentation based on location.',NULL),
(10,'Deposits',3,'LocationDimension:UrbanMember',1,'Located in urban areas. Segmentation based on location.',NULL),
(11,'Deposits',3,'MaturityDimension:LessThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL),
(12,'Deposits',3,'MaturityDimension:MoreThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL),
(13,'EmployeeBenefitsExpense',1,NULL,3,NULL,NULL),
(14,'Equity',1,NULL,1,NULL,NULL),
(15,'Expense',1,NULL,3,NULL,NULL),
(16,'FinancialExpense',3,NULL,3,'All costs All costs incurred in raising funds from third parties, fee expenses from non-financial services, net gains (losses) due to changes in fair value of financial liabilities, impairment losses net of reversals of financial assets other than loan portfolio and net gains (losses) from restatement of financial statements in terms of the measuring unit current at the end of the reporting period.',NULL),
(17,'FinancialRevenueOnLoans',3,NULL,2,'Interest and non-interest income generated by the provision of credit services to the clients. Fees and commissions for late payment are also included.',NULL),
(18,'ImpairmentLossAllowanceGrossLoanPortfolio',3,NULL,2,'An allowance for the risk of losses in the gross loan portfolio due to default .',NULL),
(19,'Liabilities',1,NULL,1,NULL,NULL),
(20,'Liabilities',3,'MaturityDimension:LessThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL),
(21,'Liabilities',3,'MaturityDimension:MoreThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL),
(22,'LoanPortfolioGross',3,NULL,2,'All outstanding principals due for all outstanding client loans. This includes current, delinquent, and renegotiated loans, but not loans that have been written off. It does not include interest receivable.',NULL),
(23,'LoanPortfolioGross',3,'CreditProductsDimension:MicroenterpriseMember',2,'Loans that finance the production or trade of goods and services for an individual\'s microenterprise, whether or not the microenterprise is legally registered. Segmentation based on loan product.',NULL),
(24,'LoanPortfolioGross',3,'DelinquencyDimension:OneMonthOrMoreMember',2,'Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated. Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated.',NULL),
(25,'LoanPortfolioGross',3,'DelinquencyDimension:ThreeMonthsOrMoreMember',2,'Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated.? Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated.',NULL),
(26,'LoanPortfolioGross',3,'LocationDimension:RuralMember',2,'Located in rural areas. Segmentation based on geographic location.',NULL),
(27,'LoanPortfolioGross',3,'LocationDimension:UrbanMember',2,'Located in urbal areas. Segmentation based on geographic location.',NULL),
(28,'LoanPortfolioGross',3,'MaturityDimension:LessThanOneYearMember',2,'Segmentation based on the life of an asset or liability.',NULL),
(29,'LoanPortfolioGross',3,'MaturityDimension:MoreThanOneYearMember',2,'Segmentation based on the life of an asset or liability.',NULL),
(30,'NetLoanLoss',3,'',3,'Referred to the value of delinquency loans written off net of any principal recovery.',NULL),
(31,'NetLoanLossProvisionExpense',3,NULL,3,'Represent the net value of loan portfolio impairment loss considering any reversal on impairment loss and any recovery on loans written off recognized as a income during the accounting period.',NULL),
(32,'NetOperatingIncome',3,NULL,2,'Total operating revenue less all expenses related to the MFI\'s core financial service operation including total financial expense, impairment loss and operating expense. Donations are excluded.',NULL),
(33,'NetOperatingIncomeNetOfTaxExpense',3,NULL,3,'Net operating income reported incorporating the effect of taxes. Taxes include all domestic and foreign taxes which are based on taxable profits, other taxes related to personnel, financial transactions or value-added taxes are not considered in calculation of this value.',NULL),
(34,'NumberOfActiveBorrowers',3,NULL,0,'The number of individuals who currently have an outstanding loan balance with the MFI or are primarily responsible for repaying any portion of the gross loan portfolio. Individuals who have multiple loans with an MFI should be counted as a single borrower.',NULL),
(35,'NumberOfActiveBorrowers',3,'GenderDimension:FemaleMember',0,'The number of individuals who currently have an outstanding loan balance with the MFI or are primarily responsible for repaying any portion of the gross loan portfolio. Individuals who have multiple loans with an MFI should be counted as a single borrower.',NULL),
(36,'NumberOfBoardMembers',3,'GenderDimension:FemaleMember',0,'The number of members that comprise the board of directors at the end of the reporting period who are female.',NULL),
(37,'NumberOfDepositAccounts',3,NULL,0,'The number of individuals who currently have funds on deposit with the MFI on a voluntary basis; i.e., they are not required to maintain the deposit account to access a loan. This number applies only to deposits held by an MFI, not to those deposits held in other institutions by the MFI\'s clients. The number should be based on the number of individuals rather than the number of groups. A single deposit account may represent multiple depositors.',NULL),
(38,'NumberOfDepositors',3,'',0,'The number of deposit accounts, both voluntary and compulsory, opened at the MFI whose balances the institution is liable to repay. The number should be based on the number of individual accounts rather than on the number of groups.',NULL),
(39,'NumberOfEmployees',3,NULL,0,'The number of individuals who are actively employed by an entity. This number includes contract employees or advisors who dedicate a substantial portion of their time to the entity, even if they are not on the entity\'s employees roster.',NULL),
(40,'NumberOfEmployees',3,'GenderDimension:FemaleMember',0,'The number of individuals who are actively employed by an entity. This number includes contract employees or advisors who dedicate a substantial portion of their time to the entity, even if they are not on the entity\'s employees roster.',NULL),
(41,'NumberOfLoanOfficers',3,NULL,0,'The number of employees whose main activity is to manage a portion of the gross loan portfolio. A loan officer is a staff member of record who is directly responsible for arranging and monitoring client loans.',NULL),
(42,'NumberOfLoanOfficers',3,'GenderDimension:FemaleMember',0,'The number of employees whose main activity is to manage a portion of the gross loan portfolio. A loan officer is a staff member of record who is directly responsible for arranging and monitoring client loans.',NULL),
(43,'NumberOfManagers',3,'GenderDimension:FemaleMember',0,'The number of members that comprise the management of the institution who are female.',NULL),
(44,'NumberOfOffices',3,NULL,0,'The number of staffed points of service and administrative sites used to deliver or support the delivery of financial services to microfinance clients.',NULL),
(45,'NumberOfOutstandingLoans',3,NULL,0,'The number of loans in the gross loan portfolio. For MFIs using a group lending methodology, the number of loans should refer to the number of individuals receiving loans as part of a group or as part of a group loan.',NULL),
(46,'OperatingExpense',3,NULL,3,'Includes expenses not related to financial and credit loss impairment, such as personnel expenses, depreciation, amortization and administrative expenses.',NULL),
(47,'OperatingIncome',3,NULL,2,'Includes all financial income and other operating revenue which is generated from non-financial services. Operating income also includes net gains (losses) from holding financial assets (changes on their values during the period and foreign exchange differences). Donations or any revenue not related with an MFI\'s core business of making loans and providing financial services are not considered under this category.',NULL),
(48,'WriteOffsOnGrossLoanPortfolio',3,NULL,2,'The value of loans that have been recognized as uncollectible for accounting purposes. A write-off is an accounting procedure that removes the outstanding balance of the loan from the gross loan portfolio and impairment loss allowance. Thus, the write-off does not affect the net loan portfolio, total assets, or any equity account. If the impairment loss allowance is insufficient to cover the amount written off, the excess amount will result in an additional impairment loss on loans recognised in profit or loss of the period.',NULL);
(1,'AdministrativeExpense',1,NULL,3,NULL,1),
(2,'Assets',3,NULL,1,'All outstanding principals due for all outstanding client loans. This includes current, delinquent, and renegotiated loans, but not loans that have been written off. It does not include interest receivable.',1),
(3,'Assets',3,'MaturityDimension:LessThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',1),
(4,'Assets',3,'MaturityDimension:MoreThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',1),
(5,'CashAndCashEquivalents',1,NULL,1,NULL,1),
(6,'Deposits',3,NULL,1,'The total value of funds placed in an account with an MFI that are payable to a depositor. This item includes any current, checking, or savings accounts that are payable on demand. It also includes time deposits which have a fixed maturity date and compulsory deposits.',1),
(7,'Deposits',3,'DepositProductsDimension:CompulsoryMember',1,'The value of deposits that an MFI\'s clients are required to maintain as a condition of an existing or future loan.',NULL),
(8,'Deposits',3,'DepositProductsDimension:VoluntaryMember',1,'The value of deposits that an MFI\'s clients are not required to maintain as a condition of an existing or future loan.',NULL),
(9,'Deposits',3,'LocationDimension:RuralMember',1,'Located in rural areas. Segmentation based on location.',NULL),
(10,'Deposits',3,'LocationDimension:UrbanMember',1,'Located in urban areas. Segmentation based on location.',NULL),
(11,'Deposits',3,'MaturityDimension:LessThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL),
(12,'Deposits',3,'MaturityDimension:MoreThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL),
(13,'EmployeeBenefitsExpense',1,NULL,3,NULL,NULL),
(14,'Equity',1,NULL,1,NULL,NULL),
(15,'Expense',1,NULL,3,NULL,NULL),
(16,'FinancialExpense',3,NULL,3,'All costs All costs incurred in raising funds from third parties, fee expenses from non-financial services, net gains (losses) due to changes in fair value of financial liabilities, impairment losses net of reversals of financial assets other than loan portfolio and net gains (losses) from restatement of financial statements in terms of the measuring unit current at the end of the reporting period.',NULL),
(17,'FinancialRevenueOnLoans',3,NULL,2,'Interest and non-interest income generated by the provision of credit services to the clients. Fees and commissions for late payment are also included.',NULL),
(18,'ImpairmentLossAllowanceGrossLoanPortfolio',3,NULL,2,'An allowance for the risk of losses in the gross loan portfolio due to default .',NULL),
(19,'Liabilities',1,NULL,1,NULL,NULL),
(20,'Liabilities',3,'MaturityDimension:LessThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL),
(21,'Liabilities',3,'MaturityDimension:MoreThanOneYearMember',1,'Segmentation based on the life of an asset or liability.',NULL),
(22,'LoanPortfolioGross',3,NULL,2,'All outstanding principals due for all outstanding client loans. This includes current, delinquent, and renegotiated loans, but not loans that have been written off. It does not include interest receivable.',NULL),
(23,'LoanPortfolioGross',3,'CreditProductsDimension:MicroenterpriseMember',2,'Loans that finance the production or trade of goods and services for an individual\'s microenterprise, whether or not the microenterprise is legally registered. Segmentation based on loan product.',NULL),
(24,'LoanPortfolioGross',3,'DelinquencyDimension:OneMonthOrMoreMember',2,'Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated. Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated.',NULL),
(25,'LoanPortfolioGross',3,'DelinquencyDimension:ThreeMonthsOrMoreMember',2,'Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated.? Segmentation based on the principal balance of all loans outstanding that have one or more installments of principal past due or renegotiated.',NULL),
(26,'LoanPortfolioGross',3,'LocationDimension:RuralMember',2,'Located in rural areas. Segmentation based on geographic location.',NULL),
(27,'LoanPortfolioGross',3,'LocationDimension:UrbanMember',2,'Located in urbal areas. Segmentation based on geographic location.',NULL),
(28,'LoanPortfolioGross',3,'MaturityDimension:LessThanOneYearMember',2,'Segmentation based on the life of an asset or liability.',NULL),
(29,'LoanPortfolioGross',3,'MaturityDimension:MoreThanOneYearMember',2,'Segmentation based on the life of an asset or liability.',NULL),
(30,'NetLoanLoss',3,'',3,'Referred to the value of delinquency loans written off net of any principal recovery.',NULL),
(31,'NetLoanLossProvisionExpense',3,NULL,3,'Represent the net value of loan portfolio impairment loss considering any reversal on impairment loss and any recovery on loans written off recognized as a income during the accounting period.',NULL),
(32,'NetOperatingIncome',3,NULL,2,'Total operating revenue less all expenses related to the MFI\'s core financial service operation including total financial expense, impairment loss and operating expense. Donations are excluded.',NULL),
(33,'NetOperatingIncomeNetOfTaxExpense',3,NULL,3,'Net operating income reported incorporating the effect of taxes. Taxes include all domestic and foreign taxes which are based on taxable profits, other taxes related to personnel, financial transactions or value-added taxes are not considered in calculation of this value.',NULL),
(34,'NumberOfActiveBorrowers',3,NULL,0,'The number of individuals who currently have an outstanding loan balance with the MFI or are primarily responsible for repaying any portion of the gross loan portfolio. Individuals who have multiple loans with an MFI should be counted as a single borrower.',NULL),
(35,'NumberOfActiveBorrowers',3,'GenderDimension:FemaleMember',0,'The number of individuals who currently have an outstanding loan balance with the MFI or are primarily responsible for repaying any portion of the gross loan portfolio. Individuals who have multiple loans with an MFI should be counted as a single borrower.',NULL),
(36,'NumberOfBoardMembers',3,'GenderDimension:FemaleMember',0,'The number of members that comprise the board of directors at the end of the reporting period who are female.',NULL),
(37,'NumberOfDepositAccounts',3,NULL,0,'The number of individuals who currently have funds on deposit with the MFI on a voluntary basis; i.e., they are not required to maintain the deposit account to access a loan. This number applies only to deposits held by an MFI, not to those deposits held in other institutions by the MFI\'s clients. The number should be based on the number of individuals rather than the number of groups. A single deposit account may represent multiple depositors.',NULL),
(38,'NumberOfDepositors',3,'',0,'The number of deposit accounts, both voluntary and compulsory, opened at the MFI whose balances the institution is liable to repay. The number should be based on the number of individual accounts rather than on the number of groups.',NULL),
(39,'NumberOfEmployees',3,NULL,0,'The number of individuals who are actively employed by an entity. This number includes contract employees or advisors who dedicate a substantial portion of their time to the entity, even if they are not on the entity\'s employees roster.',NULL),
(40,'NumberOfEmployees',3,'GenderDimension:FemaleMember',0,'The number of individuals who are actively employed by an entity. This number includes contract employees or advisors who dedicate a substantial portion of their time to the entity, even if they are not on the entity\'s employees roster.',NULL),
(41,'NumberOfLoanOfficers',3,NULL,0,'The number of employees whose main activity is to manage a portion of the gross loan portfolio. A loan officer is a staff member of record who is directly responsible for arranging and monitoring client loans.',NULL),
(42,'NumberOfLoanOfficers',3,'GenderDimension:FemaleMember',0,'The number of employees whose main activity is to manage a portion of the gross loan portfolio. A loan officer is a staff member of record who is directly responsible for arranging and monitoring client loans.',NULL),
(43,'NumberOfManagers',3,'GenderDimension:FemaleMember',0,'The number of members that comprise the management of the institution who are female.',NULL),
(44,'NumberOfOffices',3,NULL,0,'The number of staffed points of service and administrative sites used to deliver or support the delivery of financial services to microfinance clients.',NULL),
(45,'NumberOfOutstandingLoans',3,NULL,0,'The number of loans in the gross loan portfolio. For MFIs using a group lending methodology, the number of loans should refer to the number of individuals receiving loans as part of a group or as part of a group loan.',NULL),
(46,'OperatingExpense',3,NULL,3,'Includes expenses not related to financial and credit loss impairment, such as personnel expenses, depreciation, amortization and administrative expenses.',NULL),
(47,'OperatingIncome',3,NULL,2,'Includes all financial income and other operating revenue which is generated from non-financial services. Operating income also includes net gains (losses) from holding financial assets (changes on their values during the period and foreign exchange differences). Donations or any revenue not related with an MFI\'s core business of making loans and providing financial services are not considered under this category.',NULL),
(48,'WriteOffsOnGrossLoanPortfolio',3,NULL,2,'The value of loans that have been recognized as uncollectible for accounting purposes. A write-off is an accounting procedure that removes the outstanding balance of the loan from the gross loan portfolio and impairment loss allowance. Thus, the write-off does not affect the net loan portfolio, total assets, or any equity account. If the impairment loss allowance is insufficient to cover the amount written off, the excess amount will result in an additional impairment loss on loans recognised in profit or loss of the period.',NULL);
UNLOCK TABLES;
@@ -122,11 +122,11 @@ LOCK TABLES `mix_xbrl_namespace` WRITE;
INSERT INTO `mix_xbrl_namespace` (`id`, `prefix`, `url`)
VALUES
(1,'ifrs','http://xbrl.iasb.org/taxonomy/2009-04-01/ifrs'),
(2,'iso4217','http://www.xbrl.org/2003/iso4217'),
(3,'mix','http://www.themix.org/INT/fr/ifrs/basi/YYYY-MM-DD/mx-cor'),
(4,'xbrldi','http://xbrl.org/2006/xbrldi'),
(5,'xbrli','http://www.xbrl.org/2003/instance'),
(6,'link','http://www.xbrl.org/2003/linkbase'),
(7,'dc-all','http://www.themix.org/INT/fr/ifrs/basi/2010-08-31/dc-all');
UNLOCK TABLES;
(1,'ifrs','http://xbrl.iasb.org/taxonomy/2009-04-01/ifrs'),
(2,'iso4217','http://www.xbrl.org/2003/iso4217'),
(3,'mix','http://www.themix.org/INT/fr/ifrs/basi/YYYY-MM-DD/mx-cor'),
(4,'xbrldi','http://xbrl.org/2006/xbrldi'),
(5,'xbrli','http://www.xbrl.org/2003/instance'),
(6,'link','http://www.xbrl.org/2003/linkbase'),
(7,'dc-all','http://www.themix.org/INT/fr/ifrs/basi/2010-08-31/dc-all');
UNLOCK TABLES;
@@ -31,4 +31,4 @@ ALTER TABLE `m_savings_account_transaction`
CHANGE COLUMN `office_id` `office_id` BIGINT NOT NULL AFTER `savings_account_id`;
ALTER TABLE `m_savings_account_transaction`
ADD CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`);
ADD CONSTRAINT `FK_m_savings_account_transaction_m_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`);
@@ -20,4 +20,4 @@
INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`payment_type`,`charge_id`,`financial_account_type`)
select mapping.gl_account_id,mapping.product_id,mapping.product_type,mapping.payment_type,mapping.charge_id, 10
from acc_product_mapping mapping
where mapping.financial_account_type = 1 and mapping.product_type=2;
where mapping.financial_account_type = 1 and mapping.product_type=2;
@@ -35,4 +35,4 @@ INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `c
VALUES ('configuration', 'READ_CACHE', 'CACHE', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('configuration', 'UPDATE_CACHE', 'CACHE', 'UPDATE', 0);
VALUES ('configuration', 'UPDATE_CACHE', 'CACHE', 'UPDATE', 0);
@@ -19,7 +19,7 @@
/**Add currency code**/
ALTER TABLE `acc_gl_journal_entry`
ADD COLUMN `currency_code` VARCHAR(3) NULL DEFAULT NULL AFTER `reversal_id`;
ADD COLUMN `currency_code` VARCHAR(3) NULL DEFAULT NULL AFTER `reversal_id`;
/**Update currency codes for loans**/
@@ -43,6 +43,6 @@ where acc_gl_journal_entry.currency_code is NULL;
/**Make currency code not null**/
ALTER TABLE `acc_gl_journal_entry`
ALTER `currency_code` DROP DEFAULT;
ALTER `currency_code` DROP DEFAULT;
ALTER TABLE `acc_gl_journal_entry`
CHANGE COLUMN `currency_code` `currency_code` VARCHAR(3) NOT NULL AFTER `reversal_id`;
CHANGE COLUMN `currency_code` `currency_code` VARCHAR(3) NOT NULL AFTER `reversal_id`;
@@ -18,28 +18,26 @@
--
CREATE TABLE `m_portfolio_account_associations` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_account_id` BIGINT NULL DEFAULT NULL,
`savings_account_id` BIGINT NULL DEFAULT NULL,
`linked_loan_account_id` BIGINT NULL DEFAULT NULL,
`linked_savings_account_id` BIGINT NULL DEFAULT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `account_association_loan_fk` FOREIGN KEY (`loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `account_association_savings_fk` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`),
CONSTRAINT `linked_loan_fk` FOREIGN KEY (`linked_loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `linked_savings_fk` FOREIGN KEY (`linked_savings_account_id`) REFERENCES `m_savings_account` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_account_id` BIGINT NULL DEFAULT NULL,
`savings_account_id` BIGINT NULL DEFAULT NULL,
`linked_loan_account_id` BIGINT NULL DEFAULT NULL,
`linked_savings_account_id` BIGINT NULL DEFAULT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `account_association_loan_fk` FOREIGN KEY (`loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `account_association_savings_fk` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`),
CONSTRAINT `linked_loan_fk` FOREIGN KEY (`linked_loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `linked_savings_fk` FOREIGN KEY (`linked_savings_account_id`) REFERENCES `m_savings_account` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
ALTER TABLE `m_charge`
ADD COLUMN `charge_payment_mode_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `charge_calculation_enum`;
ADD COLUMN `charge_payment_mode_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `charge_calculation_enum`;
ALTER TABLE `m_loan_charge`
ADD COLUMN `charge_payment_mode_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `charge_calculation_enum`;
ADD COLUMN `charge_payment_mode_enum` SMALLINT NOT NULL DEFAULT '0' AFTER `charge_calculation_enum`;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'PAY_LOANCHARGE', 'LOANCHARGE', 'PAY', 0);
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Transfer Fee For Loans From Savings', 'Transfer Fee For Loans From Savings', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
@@ -18,5 +18,5 @@
--
ALTER TABLE `m_savings_account`
ADD COLUMN `total_fees_charge_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_withdrawal_fees_derived`,
ADD COLUMN `total_penalty_charge_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_fees_charge_derived`;
ADD COLUMN `total_fees_charge_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_withdrawal_fees_derived`,
ADD COLUMN `total_penalty_charge_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `total_fees_charge_derived`;
@@ -17,4 +17,4 @@
-- under the License.
--
delete from acc_product_mapping where financial_account_type=10 and payment_type is not null;
delete from acc_product_mapping where financial_account_type=10 and payment_type is not null;
@@ -24,4 +24,4 @@ delete from acc_product_mapping where financial_account_type=10 and product_type
INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`payment_type`,`charge_id`,`financial_account_type`)
select mapping.gl_account_id,mapping.product_id,mapping.product_type,mapping.payment_type,mapping.charge_id, 10
from acc_product_mapping mapping
where mapping.financial_account_type = 2 and mapping.product_type=2;
where mapping.financial_account_type = 2 and mapping.product_type=2;
@@ -21,4 +21,4 @@
INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`payment_type`,`charge_id`,`financial_account_type`)
select mapping.gl_account_id,mapping.product_id,mapping.product_type,mapping.payment_type,mapping.charge_id, 5
from acc_product_mapping mapping
where mapping.financial_account_type = 4 and mapping.product_type=2;
where mapping.financial_account_type = 4 and mapping.product_type=2;
@@ -18,233 +18,233 @@
--
ALTER TABLE `m_savings_account_charge`
CHANGE COLUMN `due_for_collection_as_of_date` `charge_due_date` DATE NULL DEFAULT NULL AFTER `charge_time_enum`;
CHANGE COLUMN `due_for_collection_as_of_date` `charge_due_date` DATE NULL DEFAULT NULL AFTER `charge_time_enum`;
ALTER TABLE `m_savings_account_charge`
ADD COLUMN `fee_on_month` SMALLINT NULL DEFAULT NULL AFTER `charge_due_date`,
ADD COLUMN `fee_on_day` SMALLINT NULL DEFAULT NULL AFTER `fee_on_month`,
ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1' AFTER `waived`;
ADD COLUMN `fee_on_month` SMALLINT NULL DEFAULT NULL AFTER `charge_due_date`,
ADD COLUMN `fee_on_day` SMALLINT NULL DEFAULT NULL AFTER `fee_on_month`,
ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1' AFTER `waived`;
delimiter //
CREATE PROCEDURE migrate_withdrwal_fees()
begin
declare no_more_rows boolean default false;
declare v_currency_code VARCHAR(3);
declare v_withdrawal_fee_type_enum SMALLINT;
declare v_withdrawal_fee_amount_charge_def DECIMAL(19,6);
declare v_account_id BIGINT;
declare v_withdrawal_fee_amount DECIMAL(19,6);
declare t_calculation_percentage DECIMAL(19,6);
declare t_calculation_on_amount DECIMAL(19,6);
declare t_withdrawal_fee_name VARCHAR(100);
declare no_more_rows boolean default false;
declare v_currency_code VARCHAR(3);
declare v_withdrawal_fee_type_enum SMALLINT;
declare v_withdrawal_fee_amount_charge_def DECIMAL(19,6);
declare v_account_id BIGINT;
declare v_withdrawal_fee_amount DECIMAL(19,6);
declare t_calculation_percentage DECIMAL(19,6);
declare t_calculation_on_amount DECIMAL(19,6);
declare t_withdrawal_fee_name VARCHAR(100);
declare t_charge_id BIGINT;
declare t_savings_charge_id BIGINT;
declare t_charge_id BIGINT;
declare t_savings_charge_id BIGINT;
-- savings transaction variables
declare v_savings_transaction_id BIGINT;
declare v_transaction_amount DECIMAL(19,6);
-- savings transaction variables
declare v_savings_transaction_id BIGINT;
declare v_transaction_amount DECIMAL(19,6);
declare cursor1 cursor for
declare cursor1 cursor for
select sa.currency_code, sa.withdrawal_fee_type_enum, sa.withdrawal_fee_amount
from m_savings_account sa where sa.withdrawal_fee_amount is not null and sa.withdrawal_fee_amount > 0 group by sa.currency_code, sa.withdrawal_fee_type_enum, sa.withdrawal_fee_amount;
declare cursor2 cursor for
declare cursor2 cursor for
select sa.id, sa.withdrawal_fee_amount from m_savings_account sa where sa.currency_code=v_currency_code and sa.withdrawal_fee_type_enum=v_withdrawal_fee_type_enum and sa.withdrawal_fee_amount is not null and sa.withdrawal_fee_amount > 0;
declare cursor3 cursor for
select sat.id, sat.amount from m_savings_account_transaction sat
where sat.savings_account_id=v_account_id and sat.transaction_type_enum=4;
declare continue handler for not found
declare continue handler for not found
set no_more_rows := true;
open cursor1;
open cursor1;
LOOP1: loop
fetch cursor1 into v_currency_code, v_withdrawal_fee_type_enum, v_withdrawal_fee_amount_charge_def;
if no_more_rows then
close cursor1;
leave LOOP1;
end if;
-- set withdrawal fee name
if(v_withdrawal_fee_type_enum = 1) then
set t_withdrawal_fee_name = CONCAT('Withdrawal fee-Flat-',v_currency_code);
else
set t_withdrawal_fee_name = CONCAT('Withdrawal fee-Percentage-',v_currency_code);
end if;
fetch cursor1 into v_currency_code, v_withdrawal_fee_type_enum, v_withdrawal_fee_amount_charge_def;
if no_more_rows then
close cursor1;
leave LOOP1;
end if;
-- set withdrawal fee name
if(v_withdrawal_fee_type_enum = 1) then
set t_withdrawal_fee_name = CONCAT('Withdrawal fee-Flat-',v_currency_code);
else
set t_withdrawal_fee_name = CONCAT('Withdrawal fee-Percentage-',v_currency_code);
end if;
-- get charge id if already exists
set t_charge_id = (select id from m_charge where name = t_withdrawal_fee_name);
-- get charge id if already exists
set t_charge_id = (select id from m_charge where name = t_withdrawal_fee_name);
if t_charge_id is null then
-- add withdrawal fee to charges
INSERT INTO `m_charge` (`name`, `currency_code`, `charge_applies_to_enum`, `charge_time_enum`, `charge_calculation_enum`, `charge_payment_mode_enum`, `amount`, `is_penalty`, `is_active`, `is_deleted`) VALUES (t_withdrawal_fee_name , v_currency_code, 2, 5, v_withdrawal_fee_type_enum, 0, v_withdrawal_fee_amount_charge_def, 0, 1, 0);
if t_charge_id is null then
-- add withdrawal fee to charges
INSERT INTO `m_charge` (`name`, `currency_code`, `charge_applies_to_enum`, `charge_time_enum`, `charge_calculation_enum`, `charge_payment_mode_enum`, `amount`, `is_penalty`, `is_active`, `is_deleted`) VALUES (t_withdrawal_fee_name , v_currency_code, 2, 5, v_withdrawal_fee_type_enum, 0, v_withdrawal_fee_amount_charge_def, 0, 1, 0);
-- get inserted charge id
set t_charge_id = last_insert_id();
end if;
-- get inserted charge id
set t_charge_id = last_insert_id();
end if;
open cursor2;
open cursor2;
LOOP2: loop
fetch cursor2 into v_account_id, v_withdrawal_fee_amount;
if no_more_rows then
set no_more_rows := false;
close cursor2;
leave LOOP2;
fetch cursor2 into v_account_id, v_withdrawal_fee_amount;
if no_more_rows then
set no_more_rows := false;
close cursor2;
leave LOOP2;
end if;
if (v_withdrawal_fee_type_enum=1) then
set t_calculation_percentage = NULL;
set t_calculation_on_amount = NULL;
set t_calculation_percentage = NULL;
set t_calculation_on_amount = NULL;
else
set t_calculation_percentage = v_withdrawal_fee_amount;
set v_withdrawal_fee_amount = 0;
set t_calculation_on_amount = 0;
set t_calculation_percentage = v_withdrawal_fee_amount;
set v_withdrawal_fee_amount = 0;
set t_calculation_on_amount = 0;
end if;
if not exists (select id from m_savings_account_charge sac where
sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=5) then
sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=5) then
-- attach withdrawal charge to savings
INSERT INTO `m_savings_account_charge` (`savings_account_id`, `charge_id`, `is_penalty`, `charge_time_enum`, `charge_due_date`, `fee_on_month`, `fee_on_day`, `charge_calculation_enum`, `calculation_percentage`, `calculation_on_amount`, `amount`, `amount_paid_derived`, `amount_waived_derived`, `amount_writtenoff_derived`, `amount_outstanding_derived`, `is_paid_derived`, `waived`, `is_active`) VALUES (v_account_id, t_charge_id, 0, 5, NULL, NULL, NULL, v_withdrawal_fee_type_enum, t_calculation_percentage, t_calculation_on_amount, v_withdrawal_fee_amount, NULL, NULL, NULL, 0.000000, 0, 0, 1);
-- attach withdrawal charge to savings
INSERT INTO `m_savings_account_charge` (`savings_account_id`, `charge_id`, `is_penalty`, `charge_time_enum`, `charge_due_date`, `fee_on_month`, `fee_on_day`, `charge_calculation_enum`, `calculation_percentage`, `calculation_on_amount`, `amount`, `amount_paid_derived`, `amount_waived_derived`, `amount_writtenoff_derived`, `amount_outstanding_derived`, `is_paid_derived`, `waived`, `is_active`) VALUES (v_account_id, t_charge_id, 0, 5, NULL, NULL, NULL, v_withdrawal_fee_type_enum, t_calculation_percentage, t_calculation_on_amount, v_withdrawal_fee_amount, NULL, NULL, NULL, 0.000000, 0, 0, 1);
-- set savings account charge id
set t_savings_charge_id = last_insert_id();
-- set savings account charge id
set t_savings_charge_id = last_insert_id();
else
else
set t_savings_charge_id = (select id from m_savings_account_charge sac where sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=5);
set t_savings_charge_id = (select id from m_savings_account_charge sac where sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=5);
end if;
end if;
open cursor3;
LOOP3: loop
fetch cursor3 into v_savings_transaction_id, v_transaction_amount;
fetch cursor3 into v_savings_transaction_id, v_transaction_amount;
if no_more_rows then
set no_more_rows := false;
close cursor3;
leave LOOP3;
end if;
if no_more_rows then
set no_more_rows := false;
close cursor3;
leave LOOP3;
end if;
if not exists (select id from m_savings_account_charge_paid_by sacp where
sacp.savings_account_transaction_id=v_savings_transaction_id and sacp.savings_account_charge_id=t_savings_charge_id) then
if not exists (select id from m_savings_account_charge_paid_by sacp where
sacp.savings_account_transaction_id=v_savings_transaction_id and sacp.savings_account_charge_id=t_savings_charge_id) then
-- insert a record into savings account charge paid by
INSERT INTO `m_savings_account_charge_paid_by` (`savings_account_transaction_id`, `savings_account_charge_id`, `amount`) VALUES(v_savings_transaction_id, t_savings_charge_id, v_transaction_amount);
-- insert a record into savings account charge paid by
INSERT INTO `m_savings_account_charge_paid_by` (`savings_account_transaction_id`, `savings_account_charge_id`, `amount`) VALUES(v_savings_transaction_id, t_savings_charge_id, v_transaction_amount);
end if;
end if;
end loop LOOP3;
end loop LOOP3;
end loop LOOP2;
end loop LOOP1;
end //
CREATE PROCEDURE migrate_annual_fees()
begin
declare no_more_rows boolean default false;
declare v_currency_code VARCHAR(3);
declare v_annual_fee_amount_charge_def DECIMAL(19,6);
declare v_account_id BIGINT;
declare v_annual_fee_amount DECIMAL(19,6);
declare v_annual_fee_on_month SMALLINT;
declare v_annual_fee_on_day SMALLINT;
declare v_annual_fee_next_due_date DATE;
declare t_annual_fee_name VARCHAR(100);
declare t_charge_id BIGINT;
declare t_savings_charge_id BIGINT;
declare no_more_rows boolean default false;
declare v_currency_code VARCHAR(3);
declare v_annual_fee_amount_charge_def DECIMAL(19,6);
declare v_account_id BIGINT;
declare v_annual_fee_amount DECIMAL(19,6);
declare v_annual_fee_on_month SMALLINT;
declare v_annual_fee_on_day SMALLINT;
declare v_annual_fee_next_due_date DATE;
declare t_annual_fee_name VARCHAR(100);
declare t_charge_id BIGINT;
declare t_savings_charge_id BIGINT;
-- savings transaction variables
declare v_savings_transaction_id BIGINT;
declare v_transaction_amount DECIMAL(19,6);
-- savings transaction variables
declare v_savings_transaction_id BIGINT;
declare v_transaction_amount DECIMAL(19,6);
declare cursor1 cursor for
declare cursor1 cursor for
select sa.currency_code, sa.annual_fee_amount
from m_savings_account sa where sa.annual_fee_amount is not null and sa.annual_fee_on_month is not null and sa.annual_fee_on_day is not null group by sa.currency_code, sa.annual_fee_amount;
declare cursor2 cursor for
declare cursor2 cursor for
select sa.id, sa.annual_fee_amount, sa.annual_fee_on_month, sa.annual_fee_on_day, sa.annual_fee_next_due_date from m_savings_account sa where sa.currency_code=v_currency_code and sa.annual_fee_amount is not null and sa.annual_fee_on_month is not null and sa.annual_fee_on_day is not null;
declare cursor3 cursor for
select sat.id, sat.amount from m_savings_account_transaction sat
where sat.savings_account_id=v_account_id and sat.transaction_type_enum=5;
declare continue handler for not found
declare continue handler for not found
set no_more_rows := true;
open cursor1;
open cursor1;
LOOP1: loop
fetch cursor1 into v_currency_code, v_annual_fee_amount_charge_def;
fetch cursor1 into v_currency_code, v_annual_fee_amount_charge_def;
if no_more_rows then
close cursor1;
leave LOOP1;
end if;
if no_more_rows then
close cursor1;
leave LOOP1;
end if;
-- set annual fee name
set t_annual_fee_name = CONCAT('Annual fee - ',v_currency_code);
-- set annual fee name
set t_annual_fee_name = CONCAT('Annual fee - ',v_currency_code);
-- get charge id if already exists
set t_charge_id = (select id from m_charge where name = t_annual_fee_name);
-- get charge id if already exists
set t_charge_id = (select id from m_charge where name = t_annual_fee_name);
if t_charge_id is null then
if t_charge_id is null then
-- add annual fee to charges
INSERT INTO `m_charge` (`name`, `currency_code`, `charge_applies_to_enum`, `charge_time_enum`, `charge_calculation_enum`, `charge_payment_mode_enum`, `amount`, `is_penalty`, `is_active`, `is_deleted`) VALUES (t_annual_fee_name, v_currency_code, 2, 6, 1, 0, v_annual_fee_amount_charge_def, 0, 1, 0);
-- add annual fee to charges
INSERT INTO `m_charge` (`name`, `currency_code`, `charge_applies_to_enum`, `charge_time_enum`, `charge_calculation_enum`, `charge_payment_mode_enum`, `amount`, `is_penalty`, `is_active`, `is_deleted`) VALUES (t_annual_fee_name, v_currency_code, 2, 6, 1, 0, v_annual_fee_amount_charge_def, 0, 1, 0);
-- get inserted charge id
set t_charge_id = last_insert_id();
-- get inserted charge id
set t_charge_id = last_insert_id();
end if;
end if;
open cursor2;
open cursor2;
LOOP2: loop
fetch cursor2 into v_account_id, v_annual_fee_amount, v_annual_fee_on_month, v_annual_fee_on_day, v_annual_fee_next_due_date;
fetch cursor2 into v_account_id, v_annual_fee_amount, v_annual_fee_on_month, v_annual_fee_on_day, v_annual_fee_next_due_date;
if no_more_rows then
set no_more_rows := false;
close cursor2;
leave LOOP2;
if no_more_rows then
set no_more_rows := false;
close cursor2;
leave LOOP2;
end if;
if not exists (select id from m_savings_account_charge sac where
sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=6) then
sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=6) then
-- attach annual charge to savings
INSERT INTO `m_savings_account_charge` (`savings_account_id`, `charge_id`, `is_penalty`, `charge_time_enum`, `charge_due_date`, `fee_on_month`, `fee_on_day`, `charge_calculation_enum`, `calculation_percentage`, `calculation_on_amount`, `amount`, `amount_paid_derived`, `amount_waived_derived`, `amount_writtenoff_derived`, `amount_outstanding_derived`, `is_paid_derived`, `waived`, `is_active`) VALUES (v_account_id, t_charge_id, 0, 6, v_annual_fee_next_due_date, v_annual_fee_on_month, v_annual_fee_on_day, 1, NULL, NULL, v_annual_fee_amount, NULL, NULL, NULL, v_annual_fee_amount, 0, 0, 1);
-- attach annual charge to savings
INSERT INTO `m_savings_account_charge` (`savings_account_id`, `charge_id`, `is_penalty`, `charge_time_enum`, `charge_due_date`, `fee_on_month`, `fee_on_day`, `charge_calculation_enum`, `calculation_percentage`, `calculation_on_amount`, `amount`, `amount_paid_derived`, `amount_waived_derived`, `amount_writtenoff_derived`, `amount_outstanding_derived`, `is_paid_derived`, `waived`, `is_active`) VALUES (v_account_id, t_charge_id, 0, 6, v_annual_fee_next_due_date, v_annual_fee_on_month, v_annual_fee_on_day, 1, NULL, NULL, v_annual_fee_amount, NULL, NULL, NULL, v_annual_fee_amount, 0, 0, 1);
-- set savings account charge id
set t_savings_charge_id = last_insert_id();
-- set savings account charge id
set t_savings_charge_id = last_insert_id();
else
else
set t_savings_charge_id = (select id from m_savings_account_charge sac where sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=6);
set t_savings_charge_id = (select id from m_savings_account_charge sac where sac.savings_account_id=v_account_id and sac.charge_id=t_charge_id and sac.charge_time_enum=6);
end if;
end if;
open cursor3;
LOOP3: loop
fetch cursor3 into v_savings_transaction_id, v_transaction_amount;
fetch cursor3 into v_savings_transaction_id, v_transaction_amount;
if no_more_rows then
set no_more_rows := false;
close cursor3;
leave LOOP3;
end if;
if no_more_rows then
set no_more_rows := false;
close cursor3;
leave LOOP3;
end if;
if not exists (select id from m_savings_account_charge_paid_by sacp where
sacp.savings_account_transaction_id=v_savings_transaction_id and sacp.savings_account_charge_id=t_savings_charge_id) then
if not exists (select id from m_savings_account_charge_paid_by sacp where
sacp.savings_account_transaction_id=v_savings_transaction_id and sacp.savings_account_charge_id=t_savings_charge_id) then
-- insert a record into savings account charge paid by
INSERT INTO `m_savings_account_charge_paid_by` (`savings_account_transaction_id`, `savings_account_charge_id`, `amount`) VALUES(v_savings_transaction_id, t_savings_charge_id, v_transaction_amount);
-- insert a record into savings account charge paid by
INSERT INTO `m_savings_account_charge_paid_by` (`savings_account_transaction_id`, `savings_account_charge_id`, `amount`) VALUES(v_savings_transaction_id, t_savings_charge_id, v_transaction_amount);
end if;
end if;
end loop LOOP3;
end loop LOOP3;
end loop LOOP2;
end loop LOOP1;
end //
@@ -259,14 +259,14 @@ drop procedure if exists migrate_withdrwal_fees;
ALTER TABLE `m_savings_account`
DROP COLUMN `annual_fee_amount`,
DROP COLUMN `annual_fee_on_month`,
DROP COLUMN `annual_fee_on_day`,
DROP COLUMN `annual_fee_next_due_date`,
DROP COLUMN `withdrawal_fee_amount`,
DROP COLUMN `withdrawal_fee_type_enum`;
DROP COLUMN `annual_fee_amount`,
DROP COLUMN `annual_fee_on_month`,
DROP COLUMN `annual_fee_on_day`,
DROP COLUMN `annual_fee_next_due_date`,
DROP COLUMN `withdrawal_fee_amount`,
DROP COLUMN `withdrawal_fee_type_enum`;
ALTER TABLE `m_savings_product`
DROP COLUMN `annual_fee_amount`,
DROP COLUMN `annual_fee_on_month`,
DROP COLUMN `annual_fee_on_day`;
DROP COLUMN `annual_fee_amount`,
DROP COLUMN `annual_fee_on_month`,
DROP COLUMN `annual_fee_on_day`;
@@ -19,7 +19,7 @@
/***Set defaults for income from Penalties for existing Saving Products**/
ALTER TABLE `m_loan_transaction`
ADD COLUMN `overpayment_portion_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `penalty_charges_portion_derived`;
ADD COLUMN `overpayment_portion_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `penalty_charges_portion_derived`;
/**Add dummy liability account if organization already has a loan product with accounting enabled**/
INSERT INTO `acc_gl_account` (`name`, `hierarchy`, `gl_code`,`account_usage`, `classification_enum`,`description`)
@@ -32,4 +32,4 @@ limit 1;
INSERT INTO `acc_product_mapping` (`gl_account_id`,`product_id`,`product_type`,`financial_account_type`)
select (select max(id) from acc_gl_account where classification_enum=2 and account_usage=1 LIMIT 1), mapping.product_id, mapping.product_type, 11
from acc_product_mapping mapping
where mapping.financial_account_type = 2 and mapping.product_type=1;
where mapping.financial_account_type = 2 and mapping.product_type=1;
@@ -18,38 +18,38 @@
--
CREATE TABLE `m_savings_account_charge` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`savings_account_id` BIGINT NOT NULL,
`charge_id` BIGINT NOT NULL,
`is_penalty` tinyint NOT NULL DEFAULT '0',
`charge_time_enum` SMALLINT NOT NULL,
`due_for_collection_as_of_date` DATE NULL DEFAULT NULL,
`charge_calculation_enum` SMALLINT NOT NULL,
`calculation_percentage` DECIMAL(19,6) NULL DEFAULT NULL,
`calculation_on_amount` DECIMAL(19,6) NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`amount_paid_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_waived_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_writtenoff_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT '0.000000',
`is_paid_derived` tinyint NOT NULL DEFAULT '0',
`waived` tinyint NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
INDEX `charge_id` (`charge_id`),
INDEX `m_savings_account_charge_ibfk_2` (`savings_account_id`),
CONSTRAINT `m_savings_account_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`),
CONSTRAINT `m_savings_account_charge_ibfk_2` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`savings_account_id` BIGINT NOT NULL,
`charge_id` BIGINT NOT NULL,
`is_penalty` tinyint NOT NULL DEFAULT '0',
`charge_time_enum` SMALLINT NOT NULL,
`due_for_collection_as_of_date` DATE NULL DEFAULT NULL,
`charge_calculation_enum` SMALLINT NOT NULL,
`calculation_percentage` DECIMAL(19,6) NULL DEFAULT NULL,
`calculation_on_amount` DECIMAL(19,6) NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`amount_paid_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_waived_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_writtenoff_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT '0.000000',
`is_paid_derived` tinyint NOT NULL DEFAULT '0',
`waived` tinyint NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
INDEX `charge_id` (`charge_id`),
INDEX `m_savings_account_charge_ibfk_2` (`savings_account_id`),
CONSTRAINT `m_savings_account_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`),
CONSTRAINT `m_savings_account_charge_ibfk_2` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
)
ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
CREATE TABLE `m_savings_product_charge` (
`savings_product_id` BIGINT NOT NULL,
`charge_id` BIGINT NOT NULL,
PRIMARY KEY (`savings_product_id`, `charge_id`),
INDEX `charge_id` (`charge_id`),
CONSTRAINT `m_savings_product_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`),
CONSTRAINT `m_savings_product_charge_ibfk_2` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`)
`savings_product_id` BIGINT NOT NULL,
`charge_id` BIGINT NOT NULL,
PRIMARY KEY (`savings_product_id`, `charge_id`),
INDEX `charge_id` (`charge_id`),
CONSTRAINT `m_savings_product_charge_ibfk_1` FOREIGN KEY (`charge_id`) REFERENCES `m_charge` (`id`),
CONSTRAINT `m_savings_product_charge_ibfk_2` FOREIGN KEY (`savings_product_id`) REFERENCES `m_savings_product` (`id`)
)
ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
@@ -69,15 +69,15 @@ INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `c
CREATE TABLE `m_savings_account_charge_paid_by` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`savings_account_transaction_id` BIGINT NOT NULL,
`savings_account_charge_id` BIGINT NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK__m_savings_account_transaction` (`savings_account_transaction_id`),
INDEX `FK__m_savings_account_charge` (`savings_account_charge_id`),
CONSTRAINT `FK__m_savings_account_charge` FOREIGN KEY (`savings_account_charge_id`) REFERENCES `m_savings_account_charge` (`id`),
CONSTRAINT `FK__m_savings_account_transaction` FOREIGN KEY (`savings_account_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`savings_account_transaction_id` BIGINT NOT NULL,
`savings_account_charge_id` BIGINT NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK__m_savings_account_transaction` (`savings_account_transaction_id`),
INDEX `FK__m_savings_account_charge` (`savings_account_charge_id`),
CONSTRAINT `FK__m_savings_account_charge` FOREIGN KEY (`savings_account_charge_id`) REFERENCES `m_savings_account_charge` (`id`),
CONSTRAINT `FK__m_savings_account_transaction` FOREIGN KEY (`savings_account_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
@@ -48,6 +48,6 @@ CREATE TABLE `m_template_m_templatemappers` (
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('organistion', 'DELETE_TEMPLATE', 'TEMPLATE', 'DELETE', 0),
('organistion', 'CREATE_TEMPLATE', 'TEMPLATE', 'CREATE', 0),
('organistion', 'UPDATE_TEMPLATE', 'TEMPLATE', 'UPDATE', 0),
('organistion', 'READ_TEMPLATE', 'TEMPLATE', 'READ', 0);
('organistion', 'CREATE_TEMPLATE', 'TEMPLATE', 'CREATE', 0),
('organistion', 'UPDATE_TEMPLATE', 'TEMPLATE', 'UPDATE', 0),
('organistion', 'READ_TEMPLATE', 'TEMPLATE', 'READ', 0);
@@ -22,14 +22,14 @@ New table for storing transaction details (for both loan and savings)
*/
CREATE TABLE `m_payment_detail` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`payment_type_enum` SMALLINT 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`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`payment_type_enum` SMALLINT 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='utf8mb4_general_ci'
ENGINE=InnoDB;
@@ -39,5 +39,5 @@ Update loan transaction to add a link to transaction detail table
*/
ALTER TABLE `m_loan_transaction`
ADD COLUMN `payment_detail_id` BIGINT NULL AFTER `loan_id`,
ADD CONSTRAINT `FK_m_loan_transaction_m_payment_detail` FOREIGN KEY (`payment_detail_id`) REFERENCES `m_payment_detail` (`id`);
ADD COLUMN `payment_detail_id` BIGINT NULL AFTER `loan_id`,
ADD CONSTRAINT `FK_m_loan_transaction_m_payment_detail` FOREIGN KEY (`payment_detail_id`) REFERENCES `m_payment_detail` (`id`);
@@ -18,7 +18,7 @@
--
ALTER TABLE `acc_gl_journal_entry`
ADD COLUMN `is_running_balance_caculated` TINYINT NOT NULL DEFAULT '0' AFTER `lastmodified_date`,
ADD COLUMN `office_running_balance` DECIMAL(19,6) NOT NULL DEFAULT '0.000000' AFTER `is_running_balance_caculated`;
ADD COLUMN `is_running_balance_caculated` TINYINT NOT NULL DEFAULT '0' AFTER `lastmodified_date`,
ADD COLUMN `office_running_balance` DECIMAL(19,6) NOT NULL DEFAULT '0.000000' AFTER `is_running_balance_caculated`;
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Update Accounting Running Balances', 'Update Accounting Running Balances', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
@@ -18,6 +18,6 @@
--
ALTER TABLE `acc_gl_journal_entry`
ADD COLUMN `organization_running_balance` DECIMAL(19,6) NOT NULL DEFAULT '0.000000' AFTER `office_running_balance`;
ADD COLUMN `organization_running_balance` DECIMAL(19,6) NOT NULL DEFAULT '0.000000' AFTER `office_running_balance`;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'UPDATERUNNINGBALANCE_JOURNALENTRY', 'JOURNALENTRY', 'UPDATERUNNINGBALANCE', 0);
@@ -18,10 +18,10 @@
--
ALTER TABLE `m_charge`
ADD COLUMN `fee_on_day` SMALLINT NULL AFTER `amount`,
ADD COLUMN `fee_interval` SMALLINT NULL AFTER `fee_on_day`,
ADD COLUMN `fee_on_month` SMALLINT NULL AFTER `fee_interval`;
ADD COLUMN `fee_on_day` SMALLINT NULL AFTER `amount`,
ADD COLUMN `fee_interval` SMALLINT NULL AFTER `fee_on_day`,
ADD COLUMN `fee_on_month` SMALLINT NULL AFTER `fee_interval`;
ALTER TABLE `m_savings_account_charge`
ADD COLUMN `fee_interval` SMALLINT NULL DEFAULT NULL AFTER `fee_on_day`;
ADD COLUMN `fee_interval` SMALLINT NULL DEFAULT NULL AFTER `fee_on_day`;
@@ -18,4 +18,4 @@
--
ALTER TABLE `m_charge`
CHANGE COLUMN `charge_payment_mode_enum` `charge_payment_mode_enum` SMALLINT NULL DEFAULT NULL AFTER `charge_calculation_enum`;
CHANGE COLUMN `charge_payment_mode_enum` `charge_payment_mode_enum` SMALLINT NULL DEFAULT NULL AFTER `charge_calculation_enum`;
@@ -18,4 +18,4 @@
--
ALTER TABLE `m_loan_charge`
ADD COLUMN `charge_amount_or_percentage` DECIMAL(19,6) NULL DEFAULT NULL AFTER `calculation_on_amount`;
ADD COLUMN `charge_amount_or_percentage` DECIMAL(19,6) NULL DEFAULT NULL AFTER `calculation_on_amount`;
@@ -52,4 +52,4 @@ VALUES ('organisation', 'UPDATE_SMS_CHECKER', 'SMS', 'UPDATE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('organisation', 'DELETE_SMS', 'SMS', 'DELETE', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('organisation', 'DELETE_SMS_CHECKER', 'SMS', 'DELETE', 0);
VALUES ('organisation', 'DELETE_SMS_CHECKER', 'SMS', 'DELETE', 0);
@@ -24,4 +24,4 @@ ADD UNIQUE INDEX `mobile_no_UNIQUE` (`mobile_no` ASC);
ALTER TABLE `m_staff`
ADD COLUMN `mobile_no` VARCHAR(50) NULL DEFAULT NULL AFTER `display_name`,
ADD UNIQUE INDEX `mobile_no_UNIQUE` (`mobile_no` ASC);
ADD UNIQUE INDEX `mobile_no_UNIQUE` (`mobile_no` ASC);
@@ -18,21 +18,21 @@
--
CREATE TABLE `m_loan_installment_charge` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_charge_id` BIGINT NOT NULL,
`loan_schedule_id` BIGINT NOT NULL,
`due_date` DATE NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`amount_paid_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_waived_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_writtenoff_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT '0.000000',
`is_paid_derived` tinyint NOT NULL DEFAULT '0',
`waived` tinyint NOT NULL DEFAULT '0',
`amount_through_charge_payment` DECIMAL(19,6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_loan_charge_id_charge_schedule` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`),
CONSTRAINT `FK_loan_schedule_id_charge_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_charge_id` BIGINT NOT NULL,
`loan_schedule_id` BIGINT NOT NULL,
`due_date` DATE NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`amount_paid_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_waived_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_writtenoff_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`amount_outstanding_derived` DECIMAL(19,6) NOT NULL DEFAULT '0.000000',
`is_paid_derived` tinyint NOT NULL DEFAULT '0',
`waived` tinyint NOT NULL DEFAULT '0',
`amount_through_charge_payment` DECIMAL(19,6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_loan_charge_id_charge_schedule` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`),
CONSTRAINT `FK_loan_schedule_id_charge_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
@@ -25,4 +25,4 @@ ADD `closedon_userid` BIGINT NULL DEFAULT NULL ;
ALTER TABLE `m_group` ADD `activatedon_userid` BIGINT NULL ,
ADD `submittedon_date` DATE NULL ,
ADD `submittedon_userid` BIGINT NULL ,
ADD `closedon_userid` BIGINT NULL ;
ADD `closedon_userid` BIGINT NULL ;
@@ -19,15 +19,15 @@
ALTER TABLE m_group
ADD UNIQUE INDEX `external_id_UNIQUE` (`external_id` ASC) ;
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) ;
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) ;
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
@@ -38,8 +38,8 @@ ALTER TABLE m_staff
*/
ALTER TABLE m_client
ADD COLUMN `status_id` INT NOT NULL DEFAULT 300 AFTER `is_deleted` ;
ADD COLUMN `status_id` INT NOT NULL DEFAULT 300 AFTER `is_deleted` ;
ALTER TABLE m_group
ADD COLUMN `status_id` INT NOT NULL DEFAULT 300 AFTER `is_deleted` ;
ADD COLUMN `status_id` INT NOT NULL DEFAULT 300 AFTER `is_deleted` ;
@@ -18,21 +18,21 @@
--
CREATE TABLE `m_calendar_history` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`calendar_id` BIGINT NOT NULL,
`title` VARCHAR(50) NOT NULL,
`description` VARCHAR(100) NULL DEFAULT NULL,
`location` VARCHAR(50) NULL DEFAULT NULL,
`start_date` DATE NOT NULL,
`end_date` DATE NULL DEFAULT NULL,
`duration` SMALLINT NULL DEFAULT NULL,
`calendar_type_enum` SMALLINT NOT NULL,
`repeating` tinyint NOT NULL DEFAULT '0',
`recurrence` VARCHAR(100) NULL DEFAULT NULL,
`remind_by_enum` SMALLINT NULL DEFAULT NULL,
`first_reminder` SMALLint NULL DEFAULT NULL,
`second_reminder` SMALLint NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_calendar_m_calendar_history` (`calendar_id`),
CONSTRAINT `FK_m_calendar_m_calendar_history` FOREIGN KEY (`calendar_id`) REFERENCES `m_calendar` (`id`)
);
`id` BIGINT NOT NULL AUTO_INCREMENT,
`calendar_id` BIGINT NOT NULL,
`title` VARCHAR(50) NOT NULL,
`description` VARCHAR(100) NULL DEFAULT NULL,
`location` VARCHAR(50) NULL DEFAULT NULL,
`start_date` DATE NOT NULL,
`end_date` DATE NULL DEFAULT NULL,
`duration` SMALLINT NULL DEFAULT NULL,
`calendar_type_enum` SMALLINT NOT NULL,
`repeating` tinyint NOT NULL DEFAULT '0',
`recurrence` VARCHAR(100) NULL DEFAULT NULL,
`remind_by_enum` SMALLINT NULL DEFAULT NULL,
`first_reminder` SMALLint NULL DEFAULT NULL,
`second_reminder` SMALLint NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_calendar_m_calendar_history` (`calendar_id`),
CONSTRAINT `FK_m_calendar_m_calendar_history` FOREIGN KEY (`calendar_id`) REFERENCES `m_calendar` (`id`)
);
@@ -18,11 +18,11 @@
--
ALTER TABLE `m_holiday`
ADD COLUMN `status_enum` INT NOT NULL DEFAULT '100' AFTER `repayments_rescheduled_to`;
ADD COLUMN `status_enum` INT NOT NULL DEFAULT '100' AFTER `repayments_rescheduled_to`;
ALTER TABLE `m_holiday`
DROP INDEX `holiday_name`,
ADD UNIQUE INDEX `holiday_name` (`name`, `from_date`);
DROP INDEX `holiday_name`,
ADD UNIQUE INDEX `holiday_name` (`name`, `from_date`);
UPDATE `m_holiday` set `status_enum`=300;
@@ -18,21 +18,21 @@
--
CREATE TABLE `m_product_loan_variations_borrower_cycle` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_product_id` BIGINT NOT NULL DEFAULT '0',
`borrower_cycle_number` INT NOT NULL DEFAULT '0',
`value_condition` INT NOT NULL DEFAULT '0',
`param_type` INT NOT NULL DEFAULT '0',
`default_value` DECIMAL(19,6) NOT NULL DEFAULT '0.000000',
`max_value` DECIMAL(19,6) NULL DEFAULT NULL,
`min_value` DECIMAL(19,6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `borrower_cycle_loan_product_FK` (`loan_product_id`),
CONSTRAINT `borrower_cycle_loan_product_FK` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_product_id` BIGINT NOT NULL DEFAULT '0',
`borrower_cycle_number` INT NOT NULL DEFAULT '0',
`value_condition` INT NOT NULL DEFAULT '0',
`param_type` INT NOT NULL DEFAULT '0',
`default_value` DECIMAL(19,6) NOT NULL DEFAULT '0.000000',
`max_value` DECIMAL(19,6) NULL DEFAULT NULL,
`min_value` DECIMAL(19,6) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `borrower_cycle_loan_product_FK` (`loan_product_id`),
CONSTRAINT `borrower_cycle_loan_product_FK` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
ALTER TABLE `m_product_loan`
ADD COLUMN `use_borrower_cycle` tinyint NOT NULL DEFAULT '0' AFTER `include_in_borrower_cycle`;
ADD COLUMN `use_borrower_cycle` tinyint NOT NULL DEFAULT '0' AFTER `include_in_borrower_cycle`;
@@ -18,10 +18,10 @@
--
ALTER TABLE `acc_gl_journal_entry`
ADD COLUMN `loan_transaction_id` BIGINT NULL AFTER `transaction_id`,
ADD COLUMN `savings_transaction_id` BIGINT NULL AFTER `loan_transaction_id`,
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_savings_account_transaction` FOREIGN KEY (`savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`);
ADD COLUMN `loan_transaction_id` BIGINT NULL AFTER `transaction_id`,
ADD COLUMN `savings_transaction_id` BIGINT NULL AFTER `loan_transaction_id`,
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_loan_transaction` FOREIGN KEY (`loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_savings_account_transaction` FOREIGN KEY (`savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`);
UPDATE acc_gl_journal_entry je SET je.savings_transaction_id=je.transaction_id,je.transaction_id=Concat('S',je.transaction_id) WHERE je.entity_type_enum=2;
@@ -17,4 +17,4 @@
-- under the License.
--
UPDATE stretchy_parameter SET `parameter_sql`='select p.id, p.`name`\r\nfrom m_product_loan p\r\nwhere (p.currency_code = \'$\{currencyId}\' or \'-1\'= \'$\{currencyId}\')\r\norder by 2' WHERE parameter_name='loanProductIdSelectAll';
UPDATE stretchy_parameter SET `parameter_sql`='select p.id, p.`name`\r\nfrom m_product_loan p\r\nwhere (p.currency_code = \'$\{currencyId}\' or \'-1\'= \'$\{currencyId}\')\r\norder by 2' WHERE parameter_name='loanProductIdSelectAll';
@@ -17,4 +17,4 @@
-- under the License.
--
ALTER TABLE `m_staff` ADD COLUMN `is_active` tinyint DEFAULT '0' AFTER `organisational_role_parent_staff_id`;
ALTER TABLE `m_staff` ADD COLUMN `is_active` tinyint DEFAULT '0' AFTER `organisational_role_parent_staff_id`;
@@ -18,20 +18,20 @@
--
ALTER TABLE `m_product_loan`
ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `id`;
ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `id`;
update m_product_loan set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null;
ALTER TABLE `m_product_loan`
ALTER `short_name` DROP DEFAULT;
ALTER `short_name` DROP DEFAULT;
ALTER TABLE `m_product_loan`
CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `id`;
CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `id`;
ALTER TABLE `m_product_loan`
ADD UNIQUE INDEX `unq_short_name` (`short_name`);
ADD UNIQUE INDEX `unq_short_name` (`short_name`);
ALTER TABLE `m_savings_product`
ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `name`;
ADD COLUMN `short_name` VARCHAR(4) NULL DEFAULT NULL AFTER `name`;
update m_savings_product set short_name=concat(LEFT(name,2), RIGHT(id,2)) where short_name is null;
ALTER TABLE `m_savings_product`
ALTER `short_name` DROP DEFAULT;
ALTER `short_name` DROP DEFAULT;
ALTER TABLE `m_savings_product`
CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `name`,
ADD UNIQUE INDEX `sp_unq_short_name` (`short_name`);
CHANGE COLUMN `short_name` `short_name` VARCHAR(4) NOT NULL AFTER `name`,
ADD UNIQUE INDEX `sp_unq_short_name` (`short_name`);
@@ -18,5 +18,5 @@
--
ALTER TABLE `m_staff`
CHANGE COLUMN `is_active` `is_active` tinyint NOT NULL DEFAULT '1' AFTER `organisational_role_parent_staff_id`;
UPDATE `m_staff` SET `is_active`=1;
CHANGE COLUMN `is_active` `is_active` tinyint NOT NULL DEFAULT '1' AFTER `organisational_role_parent_staff_id`;
UPDATE `m_staff` SET `is_active`=1;
@@ -18,5 +18,5 @@
--
ALTER TABLE `acc_gl_journal_entry`
ADD COLUMN `payment_details_id` BIGINT NULL AFTER `organization_running_balance`,
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_payment_detail` FOREIGN KEY (`payment_details_id`) REFERENCES `m_payment_detail` (`id`);
ADD COLUMN `payment_details_id` BIGINT NULL AFTER `organization_running_balance`,
ADD CONSTRAINT `FK_acc_gl_journal_entry_m_payment_detail` FOREIGN KEY (`payment_details_id`) REFERENCES `m_payment_detail` (`id`);
@@ -18,4 +18,4 @@
--
ALTER TABLE `m_loan_charge`
ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1' AFTER `max_cap`;
ADD COLUMN `is_active` tinyint NOT NULL DEFAULT '1' AFTER `max_cap`;
@@ -20,4 +20,4 @@
RENAME TABLE `x_table_cloumn_code_mappings` TO `x_table_column_code_mappings`;
ALTER TABLE `acc_gl_journal_entry`
CHANGE COLUMN `is_running_balance_caculated` `is_running_balance_calculated` TINYINT NOT NULL DEFAULT '0' AFTER `lastmodified_date`;
CHANGE COLUMN `is_running_balance_caculated` `is_running_balance_calculated` TINYINT NOT NULL DEFAULT '0' AFTER `lastmodified_date`;
@@ -33,4 +33,4 @@ CREATE TABLE IF NOT EXISTS `m_appuser_previous_password` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
ALTER TABLE m_appuser_previous_password
ADD FOREIGN KEY (user_id) REFERENCES m_appuser(id);
ADD FOREIGN KEY (user_id) REFERENCES m_appuser(id);
@@ -18,40 +18,40 @@
--
ALTER TABLE `m_product_loan`
ADD COLUMN `multi_disburse_loan` tinyint NOT NULL DEFAULT '0' AFTER `close_date`,
ADD COLUMN `max_tranche_count` INT NULL DEFAULT NULL AFTER `multi_disburse_loan`,
ADD COLUMN `outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_tranche_count`;
ADD COLUMN `multi_disburse_loan` tinyint NOT NULL DEFAULT '0' AFTER `close_date`,
ADD COLUMN `max_tranche_count` INT NULL DEFAULT NULL AFTER `multi_disburse_loan`,
ADD COLUMN `outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_tranche_count`;
CREATE TABLE `m_loan_disbursement_detail` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_id` BIGINT NOT NULL,
`expected_disburse_date` DATETIME NOT NULL,
`disbursedon_date` DATETIME NULL,
`principal` DECIMAL(19,6) NOT NULL,
`approved_principal` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_loan_disbursement_detail_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_id` BIGINT NOT NULL,
`expected_disburse_date` DATETIME NOT NULL,
`disbursedon_date` DATETIME NULL,
`principal` DECIMAL(19,6) NOT NULL,
`approved_principal` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_loan_disbursement_detail_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
ALTER TABLE `m_loan`
ADD COLUMN `fixed_emi_amount` DECIMAL(19,6) NULL AFTER `loan_product_counter`,
ADD COLUMN `approved_principal` DECIMAL(19,6) NOT NULL AFTER `principal_amount`,
ADD COLUMN `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fixed_emi_amount`;
ADD COLUMN `fixed_emi_amount` DECIMAL(19,6) NULL AFTER `loan_product_counter`,
ADD COLUMN `approved_principal` DECIMAL(19,6) NOT NULL AFTER `principal_amount`,
ADD COLUMN `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fixed_emi_amount`;
UPDATE m_loan ml SET ml.approved_principal = ml.principal_amount;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATE_DISBURSEMENTDETAIL', 'DISBURSEMENTDETAIL', 'UPDATE', 0);
CREATE TABLE `m_loan_term_variations` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_id` BIGINT NOT NULL,
`term_type` SMALLINT NOT NULL,
`applicable_from` DATE NOT NULL,
`term_value` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_loan_id_m_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_id` BIGINT NOT NULL,
`term_type` SMALLINT NOT NULL,
`applicable_from` DATE NOT NULL,
`term_value` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_loan_id_m_loan_id` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
@@ -18,6 +18,6 @@
--
ALTER TABLE `m_product_loan`
CHANGE COLUMN `multi_disburse_loan` `allow_multiple_disbursals` tinyint NOT NULL DEFAULT '0' AFTER `close_date`,
CHANGE COLUMN `max_tranche_count` `max_disbursals` INT NULL DEFAULT NULL AFTER `allow_multiple_disbursals`,
CHANGE COLUMN `outstanding_loan_balance` `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_disbursals`;
CHANGE COLUMN `multi_disburse_loan` `allow_multiple_disbursals` tinyint NOT NULL DEFAULT '0' AFTER `close_date`,
CHANGE COLUMN `max_tranche_count` `max_disbursals` INT NULL DEFAULT NULL AFTER `allow_multiple_disbursals`,
CHANGE COLUMN `outstanding_loan_balance` `max_outstanding_loan_balance` DECIMAL(19,6) NULL DEFAULT NULL AFTER `max_disbursals`;
@@ -18,16 +18,16 @@
--
ALTER TABLE `m_savings_product`
ADD COLUMN `allow_overdraft` tinyint NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`,
ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`;
ADD COLUMN `allow_overdraft` tinyint NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`,
ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`;
ALTER TABLE `m_savings_account`
ADD COLUMN `allow_overdraft` tinyint NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`,
ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`;
ADD COLUMN `allow_overdraft` tinyint NOT NULL DEFAULT '0' AFTER `withdrawal_fee_for_transfer`,
ADD COLUMN `overdraft_limit` DECIMAL(19,6) NULL DEFAULT NULL AFTER `allow_overdraft`;
ALTER TABLE `m_savings_account_transaction`
ADD COLUMN `overdraft_amount_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `amount`;
ADD COLUMN `overdraft_amount_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `amount`;
ALTER TABLE `m_client`
ADD COLUMN `default_savings_product` BIGINT NULL DEFAULT NULL AFTER `closedon_userid`,
ADD CONSTRAINT `FK_m_client_m_savings_product` FOREIGN KEY (`default_savings_product`) REFERENCES `m_savings_product` (`id`);
ADD COLUMN `default_savings_product` BIGINT NULL DEFAULT NULL AFTER `closedon_userid`,
ADD CONSTRAINT `FK_m_client_m_savings_product` FOREIGN KEY (`default_savings_product`) REFERENCES `m_savings_product` (`id`);
@@ -18,6 +18,6 @@
--
ALTER TABLE `m_savings_account_transaction`
ADD COLUMN `created_date` DATETIME NOT NULL AFTER `cumulative_balance_derived`;
ADD COLUMN `created_date` DATETIME NOT NULL AFTER `cumulative_balance_derived`;
update m_savings_account_transaction sat set sat.created_date=sat.transaction_date;
update m_savings_account_transaction sat set sat.created_date=sat.transaction_date;
@@ -24,4 +24,4 @@ ALTER TABLE m_client CHANGE COLUMN `status_id` `status_enum` INT NOT NULL DEFAUL
update r_enum_value
set enum_name = 'status_enum'
where enum_name = 'status_id';
where enum_name = 'status_id';
@@ -32,7 +32,7 @@ INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_pa
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Savings Summary'), (select id from stretchy_parameter where parameter_name='savingsProductIdSelectAll'), 'selectProduct');
ALTER TABLE `r_enum_value`
ADD COLUMN `enum_type` tinyint NOT NULL AFTER `enum_value`;
ADD COLUMN `enum_type` tinyint NOT NULL AFTER `enum_value`;
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 1, 'deposit', 'deposit', 0);
INSERT INTO `r_enum_value` (`enum_name`, `enum_id`, `enum_message_property`, `enum_value`, `enum_type`) VALUES ('savings_transaction_type_enum', 2, 'withdrawal', 'withdrawal', 1);
@@ -18,7 +18,7 @@
--
ALTER TABLE `m_client`
ADD COLUMN `default_savings_account` BIGINT NULL DEFAULT NULL AFTER `default_savings_product`,
ADD CONSTRAINT `FK_m_client_m_savings_account` FOREIGN KEY (`default_savings_account`) REFERENCES `m_savings_account` (`id`);
ADD COLUMN `default_savings_account` BIGINT NULL DEFAULT NULL AFTER `default_savings_product`,
ADD CONSTRAINT `FK_m_client_m_savings_account` FOREIGN KEY (`default_savings_account`) REFERENCES `m_savings_account` (`id`);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'UPDATESAVINGSACCOUNT_CLIENT', 'CLIENT', 'UPDATESAVINGSACCOUNT', 0);
@@ -18,7 +18,7 @@
--
ALTER TABLE `m_product_loan`
ADD COLUMN `grace_on_arrears_ageing` SMALLINT NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`;
ADD COLUMN `grace_on_arrears_ageing` SMALLINT NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`;
ALTER TABLE `m_loan`
ADD COLUMN `grace_on_arrears_ageing` SMALLINT NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`;
ADD COLUMN `grace_on_arrears_ageing` SMALLINT NULL DEFAULT NULL AFTER `max_outstanding_loan_balance`;
@@ -25,4 +25,4 @@ INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `c
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'READ_SCHEDULER', 'SCHEDULER', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_PRODUCTMIX', 'PRODUCTMIX', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_MEETING', 'MEETING', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'EXECUTEJOB_SCHEDULER', 'SCHEDULER', 'EXECUTEJOB', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('jobs', 'EXECUTEJOB_SCHEDULER', 'SCHEDULER', 'EXECUTEJOB', 0);
@@ -17,4 +17,4 @@
-- under the License.
--
UPDATE `stretchy_report` SET `report_sql`='\r\nSELECT \r\nconcat(repeat("..", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as "Office/Branch",\r\nifnull(cur.display_symbol, ml.currency_code) as Currency, \r\nmc.account_no as "Client Account No.",\r\n mc.display_name AS "Client Name",\r\n ml.account_no AS "Account Number",\r\n ml.principal_amount AS "Loan Amount",\r\n ml.principal_disbursed_derived AS "Original Principal",\r\n ml.interest_charged_derived AS "Original Interest",\r\n ml.principal_repaid_derived AS "Principal Paid",\r\n ml.interest_repaid_derived AS "Interest Paid",\r\n laa.principal_overdue_derived AS "Principal Overdue",\r\n laa.interest_overdue_derived AS "Interest Overdue",\r\nDATEDIFF(CURDATE(), laa.overdue_since_date_derived) as "Days in Arrears",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<7, \'<1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<8, \' 1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<15, \'2\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<22, \' 3\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<29, \' 4\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<36, \' 5\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<43, \' 6\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<50, \' 7\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<57, \' 8\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<64, \' 9\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<71, \'10\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<78, \'11\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<85, \'12\', \'12+\')))))))))))) )AS "Weeks In Arrears Band",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<31, \'0 - 30\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<61, \'30 - 60\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<91, \'60 - 90\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<181, \'90 - 180\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<361, \'180 - 360\', \r\n \'> 360\'))))) AS "Days in Arrears Band"\r\n\r\n FROM m_office mo \r\n JOIN m_office ounder ON ounder.hierarchy like concat(mo.hierarchy, \'%\')\r\n AND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc ON mc.office_id=ounder.id\r\n INNER JOIN m_loan ml ON ml.client_id = mc.id\r\n INNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id AND rev.enum_name = \'loan_status_id\'\r\n INNER JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\n left join m_currency cur on cur.code = ml.currency_code\r\n WHERE ml.loan_status_id=300\r\n AND mo.id=${officeId}\r\nORDER BY ounder.hierarchy, ifnull(cur.display_symbol, ml.currency_code), ml.account_no\r\n' WHERE `report_name`='Aging Detail';
UPDATE `stretchy_report` SET `report_sql`='\r\nSELECT \r\nconcat(repeat("..", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as "Office/Branch",\r\nifnull(cur.display_symbol, ml.currency_code) as Currency, \r\nmc.account_no as "Client Account No.",\r\n mc.display_name AS "Client Name",\r\n ml.account_no AS "Account Number",\r\n ml.principal_amount AS "Loan Amount",\r\n ml.principal_disbursed_derived AS "Original Principal",\r\n ml.interest_charged_derived AS "Original Interest",\r\n ml.principal_repaid_derived AS "Principal Paid",\r\n ml.interest_repaid_derived AS "Interest Paid",\r\n laa.principal_overdue_derived AS "Principal Overdue",\r\n laa.interest_overdue_derived AS "Interest Overdue",\r\nDATEDIFF(CURDATE(), laa.overdue_since_date_derived) as "Days in Arrears",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<7, \'<1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<8, \' 1\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<15, \'2\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<22, \' 3\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<29, \' 4\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<36, \' 5\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<43, \' 6\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<50, \' 7\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<57, \' 8\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<64, \' 9\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<71, \'10\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<78, \'11\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<85, \'12\', \'12+\')))))))))))) )AS "Weeks In Arrears Band",\r\n\r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<31, \'0 - 30\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<61, \'30 - 60\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<91, \'60 - 90\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<181, \'90 - 180\', \r\n IF(DATEDIFF(CURDATE(), laa.overdue_since_date_derived)<361, \'180 - 360\', \r\n \'> 360\'))))) AS "Days in Arrears Band"\r\n\r\n FROM m_office mo \r\n JOIN m_office ounder ON ounder.hierarchy like concat(mo.hierarchy, \'%\')\r\n AND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\n INNER JOIN m_client mc ON mc.office_id=ounder.id\r\n INNER JOIN m_loan ml ON ml.client_id = mc.id\r\n INNER JOIN r_enum_value rev ON rev.enum_id=ml.loan_status_id AND rev.enum_name = \'loan_status_id\'\r\n INNER JOIN m_loan_arrears_aging laa ON laa.loan_id=ml.id\r\n left join m_currency cur on cur.code = ml.currency_code\r\n WHERE ml.loan_status_id=300\r\n AND mo.id=${officeId}\r\nORDER BY ounder.hierarchy, ifnull(cur.display_symbol, ml.currency_code), ml.account_no\r\n' WHERE `report_name`='Aging Detail';
@@ -733,5 +733,3 @@ VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off
VALUES ((select sr.id From stretchy_report sr where sr.report_name='Written-Off Loans(Pentaho)'),
(select sp.id from stretchy_parameter sp where sp.parameter_name='endDateSelect'),
'endDate');
@@ -25,4 +25,4 @@ INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_pa
INSERT INTO `stretchy_report` (`report_name`, `report_type`, `report_subtype`, `report_category`, `report_sql`, `description`, `core_report`, `use_report`) VALUES ('Client Loan Account Schedule', 'Pentaho', NULL, 'Loans', NULL, NULL, 0, 0);
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='startDateSelect'), 'startDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='endDateSelect'), 'endDate');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo');
INSERT INTO `stretchy_report_parameter` (`report_id`, `parameter_id`, `report_parameter_name`) VALUES ((select id from stretchy_report where report_name = 'Client Loan Account Schedule'), (select id from stretchy_parameter where parameter_name='selectAccount'), 'accountNo');
@@ -18,20 +18,20 @@
--
ALTER TABLE `m_charge`
ADD COLUMN `fee_frequency` SMALLINT NULL DEFAULT NULL AFTER `max_cap`;
ADD COLUMN `fee_frequency` SMALLINT NULL DEFAULT NULL AFTER `max_cap`;
CREATE TABLE `m_loan_overdue_installment_charge` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_charge_id` BIGINT NOT NULL,
`loan_schedule_id` BIGINT NOT NULL,
`frequency_number` INT NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_charge` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`),
CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_repayment_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`loan_charge_id` BIGINT NOT NULL,
`loan_schedule_id` BIGINT NOT NULL,
`frequency_number` INT NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_charge` FOREIGN KEY (`loan_charge_id`) REFERENCES `m_loan_charge` (`id`),
CONSTRAINT `FK_m_loan_overdue_installment_charge_m_loan_repayment_schedule` FOREIGN KEY (`loan_schedule_id`) REFERENCES `m_loan_repayment_schedule` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('grace-on-penalty-posting', 0, 1);
INSERT INTO m_loan_overdue_installment_charge (`loan_charge_id`, `loan_schedule_id`, `frequency_number`) SELECT mlc.id ,ls.id ,1 from m_loan_charge as mlc inner join m_charge mc on mc.id = mlc.charge_id inner join m_loan_repayment_schedule ls on ls.loan_id = mlc.loan_id and ls.duedate = mlc.due_for_collection_as_of_date where mc.charge_time_enum = 9 and mlc.is_active = 1;
INSERT INTO m_loan_overdue_installment_charge (`loan_charge_id`, `loan_schedule_id`, `frequency_number`) SELECT mlc.id ,ls.id ,1 from m_loan_charge as mlc inner join m_charge mc on mc.id = mlc.charge_id inner join m_loan_repayment_schedule ls on ls.loan_id = mlc.loan_id and ls.duedate = mlc.due_for_collection_as_of_date where mc.charge_time_enum = 9 and mlc.is_active = 1;
@@ -18,4 +18,4 @@
--
ALTER TABLE `m_portfolio_command_source`
ADD COLUMN `transaction_id` VARCHAR(100) NULL DEFAULT NULL AFTER `product_id`;
ADD COLUMN `transaction_id` VARCHAR(100) NULL DEFAULT NULL AFTER `product_id`;
@@ -23,4 +23,4 @@ INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `c
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);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'DELETE_CENTER_CHECKER', 'CENTER', 'DELETE', 0);
@@ -17,4 +17,4 @@
-- under the License.
--
ALTER TABLE `m_product_loan` CHANGE `principal_amount` `principal_amount` DECIMAL( 19, 6 ) NULL ;
ALTER TABLE `m_product_loan` CHANGE `principal_amount` `principal_amount` DECIMAL( 19, 6 ) NULL ;
@@ -18,98 +18,98 @@
--
CREATE TABLE `m_account_transfer_details` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`from_office_id` BIGINT NOT NULL,
`to_office_id` BIGINT NOT NULL,
`from_client_id` BIGINT NULL DEFAULT NULL,
`to_client_id` BIGINT NULL DEFAULT NULL,
`from_savings_account_id` BIGINT NULL DEFAULT NULL,
`to_savings_account_id` BIGINT NULL DEFAULT NULL,
`from_loan_account_id` BIGINT NULL DEFAULT NULL,
`to_loan_account_id` BIGINT NULL DEFAULT NULL,
`transfer_type` SMALLINT NULL DEFAULT NULL,
`from_savings_transaction_id` BIGINT NULL DEFAULT NULL,
`from_loan_transaction_id` BIGINT NULL DEFAULT NULL,
`to_savings_transaction_id` BIGINT NULL DEFAULT NULL,
`to_loan_transaction_id` BIGINT NULL DEFAULT NULL,
`is_reversed` tinyint NOT NULL,
`transaction_date` DATE NOT NULL,
`currency_code` VARCHAR(3) NOT NULL,
`currency_digits` SMALLINT NOT NULL,
`currency_multiplesof` SMALLINT NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`description` VARCHAR(200) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_account_transfer_details_from_office` (`from_office_id`),
INDEX `FK_m_account_transfer_details_to_office` (`to_office_id`),
INDEX `FK_m_account_transfer_details_from_client` (`from_client_id`),
INDEX `FK_m_account_transfer_details_to_client` (`to_client_id`),
INDEX `FK_m_account_transfer_details_from_savings_account` (`from_savings_account_id`),
INDEX `FK_m_account_transfer_details_to_savings_account` (`to_savings_account_id`),
INDEX `FK_m_account_transfer_details_from_loan_account` (`from_loan_account_id`),
INDEX `FK_m_account_transfer_details_to_loan_account` (`to_loan_account_id`),
CONSTRAINT `FK_m_account_transfer_details_from_client` FOREIGN KEY (`from_client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FK_m_account_transfer_details_from_loan_account` FOREIGN KEY (`from_loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `FK_m_account_transfer_details_from_office` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`),
CONSTRAINT `FK_m_account_transfer_details_from_savings_account` FOREIGN KEY (`from_savings_account_id`) REFERENCES `m_savings_account` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_client` FOREIGN KEY (`to_client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_loan_account` FOREIGN KEY (`to_loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_office` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_savings_account` FOREIGN KEY (`to_savings_account_id`) REFERENCES `m_savings_account` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`from_office_id` BIGINT NOT NULL,
`to_office_id` BIGINT NOT NULL,
`from_client_id` BIGINT NULL DEFAULT NULL,
`to_client_id` BIGINT NULL DEFAULT NULL,
`from_savings_account_id` BIGINT NULL DEFAULT NULL,
`to_savings_account_id` BIGINT NULL DEFAULT NULL,
`from_loan_account_id` BIGINT NULL DEFAULT NULL,
`to_loan_account_id` BIGINT NULL DEFAULT NULL,
`transfer_type` SMALLINT NULL DEFAULT NULL,
`from_savings_transaction_id` BIGINT NULL DEFAULT NULL,
`from_loan_transaction_id` BIGINT NULL DEFAULT NULL,
`to_savings_transaction_id` BIGINT NULL DEFAULT NULL,
`to_loan_transaction_id` BIGINT NULL DEFAULT NULL,
`is_reversed` tinyint NOT NULL,
`transaction_date` DATE NOT NULL,
`currency_code` VARCHAR(3) NOT NULL,
`currency_digits` SMALLINT NOT NULL,
`currency_multiplesof` SMALLINT NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`description` VARCHAR(200) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_account_transfer_details_from_office` (`from_office_id`),
INDEX `FK_m_account_transfer_details_to_office` (`to_office_id`),
INDEX `FK_m_account_transfer_details_from_client` (`from_client_id`),
INDEX `FK_m_account_transfer_details_to_client` (`to_client_id`),
INDEX `FK_m_account_transfer_details_from_savings_account` (`from_savings_account_id`),
INDEX `FK_m_account_transfer_details_to_savings_account` (`to_savings_account_id`),
INDEX `FK_m_account_transfer_details_from_loan_account` (`from_loan_account_id`),
INDEX `FK_m_account_transfer_details_to_loan_account` (`to_loan_account_id`),
CONSTRAINT `FK_m_account_transfer_details_from_client` FOREIGN KEY (`from_client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FK_m_account_transfer_details_from_loan_account` FOREIGN KEY (`from_loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `FK_m_account_transfer_details_from_office` FOREIGN KEY (`from_office_id`) REFERENCES `m_office` (`id`),
CONSTRAINT `FK_m_account_transfer_details_from_savings_account` FOREIGN KEY (`from_savings_account_id`) REFERENCES `m_savings_account` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_client` FOREIGN KEY (`to_client_id`) REFERENCES `m_client` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_loan_account` FOREIGN KEY (`to_loan_account_id`) REFERENCES `m_loan` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_office` FOREIGN KEY (`to_office_id`) REFERENCES `m_office` (`id`),
CONSTRAINT `FK_m_account_transfer_details_to_savings_account` FOREIGN KEY (`to_savings_account_id`) REFERENCES `m_savings_account` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
CREATE TABLE `m_account_transfer_standing_instructions` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(250) NOT NULL,
`account_transfer_details_id` BIGINT NOT NULL,
`priority` TINYINT NOT NULL,
`status` TINYINT NOT NULL,
`instruction_type` TINYINT NOT NULL,
`amount` DECIMAL(19,6) NULL DEFAULT NULL,
`valid_from` DATE NOT NULL,
`valid_till` DATE NULL DEFAULT NULL,
`recurrence_type` tinyint NOT NULL,
`recurrence_frequency` SMALLINT NULL DEFAULT NULL,
`recurrence_interval` SMALLINT NULL DEFAULT NULL,
`recurrence_on_day` SMALLINT NULL DEFAULT NULL,
`recurrence_on_month` SMALLINT NULL DEFAULT NULL,
`last_run_date` DATE NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `name` (`name`),
INDEX `FK_m_standing_instructions_account_transfer_details` (`account_transfer_details_id`),
CONSTRAINT `FK_m_standing_instructions_account_transfer_details` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(250) NOT NULL,
`account_transfer_details_id` BIGINT NOT NULL,
`priority` TINYINT NOT NULL,
`status` TINYINT NOT NULL,
`instruction_type` TINYINT NOT NULL,
`amount` DECIMAL(19,6) NULL DEFAULT NULL,
`valid_from` DATE NOT NULL,
`valid_till` DATE NULL DEFAULT NULL,
`recurrence_type` tinyint NOT NULL,
`recurrence_frequency` SMALLINT NULL DEFAULT NULL,
`recurrence_interval` SMALLINT NULL DEFAULT NULL,
`recurrence_on_day` SMALLINT NULL DEFAULT NULL,
`recurrence_on_month` SMALLINT NULL DEFAULT NULL,
`last_run_date` DATE NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `name` (`name`),
INDEX `FK_m_standing_instructions_account_transfer_details` (`account_transfer_details_id`),
CONSTRAINT `FK_m_standing_instructions_account_transfer_details` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
CREATE TABLE `m_account_transfer_transaction` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`account_transfer_details_id` BIGINT NOT NULL,
`from_savings_transaction_id` BIGINT NULL DEFAULT NULL,
`from_loan_transaction_id` BIGINT NULL DEFAULT NULL,
`to_savings_transaction_id` BIGINT NULL DEFAULT NULL,
`to_loan_transaction_id` BIGINT NULL DEFAULT NULL,
`is_reversed` tinyint NOT NULL,
`transaction_date` DATE NOT NULL,
`currency_code` VARCHAR(3) NOT NULL,
`currency_digits` SMALLINT NOT NULL,
`currency_multiplesof` SMALLINT NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`description` VARCHAR(200) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_account_transfer_transaction_from_m_savings_transaction` (`from_savings_transaction_id`),
INDEX `FK_m_account_transfer_transaction_to_m_savings_transaction` (`to_savings_transaction_id`),
INDEX `FK_m_account_transfer_transaction_to_m_loan_transaction` (`to_loan_transaction_id`),
INDEX `FK_m_account_transfer_transaction_from_m_loan_transaction` (`from_loan_transaction_id`),
INDEX `FK_m_account_transfer_transaction_account_detail` (`account_transfer_details_id`),
CONSTRAINT `FK_m_account_transfer_transaction_account_detail` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_from_m_loan_transaction` FOREIGN KEY (`from_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_from_m_savings_transaction` FOREIGN KEY (`from_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_to_m_loan_transaction` FOREIGN KEY (`to_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_to_m_savings_transaction` FOREIGN KEY (`to_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`account_transfer_details_id` BIGINT NOT NULL,
`from_savings_transaction_id` BIGINT NULL DEFAULT NULL,
`from_loan_transaction_id` BIGINT NULL DEFAULT NULL,
`to_savings_transaction_id` BIGINT NULL DEFAULT NULL,
`to_loan_transaction_id` BIGINT NULL DEFAULT NULL,
`is_reversed` tinyint NOT NULL,
`transaction_date` DATE NOT NULL,
`currency_code` VARCHAR(3) NOT NULL,
`currency_digits` SMALLINT NOT NULL,
`currency_multiplesof` SMALLINT NULL DEFAULT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`description` VARCHAR(200) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_account_transfer_transaction_from_m_savings_transaction` (`from_savings_transaction_id`),
INDEX `FK_m_account_transfer_transaction_to_m_savings_transaction` (`to_savings_transaction_id`),
INDEX `FK_m_account_transfer_transaction_to_m_loan_transaction` (`to_loan_transaction_id`),
INDEX `FK_m_account_transfer_transaction_from_m_loan_transaction` (`from_loan_transaction_id`),
INDEX `FK_m_account_transfer_transaction_account_detail` (`account_transfer_details_id`),
CONSTRAINT `FK_m_account_transfer_transaction_account_detail` FOREIGN KEY (`account_transfer_details_id`) REFERENCES `m_account_transfer_details` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_from_m_loan_transaction` FOREIGN KEY (`from_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_from_m_savings_transaction` FOREIGN KEY (`from_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_to_m_loan_transaction` FOREIGN KEY (`to_loan_transaction_id`) REFERENCES `m_loan_transaction` (`id`),
CONSTRAINT `FK_m_account_transfer_transaction_to_m_savings_transaction` FOREIGN KEY (`to_savings_transaction_id`) REFERENCES `m_savings_account_transaction` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
@@ -121,17 +121,17 @@ INSERT INTO `m_account_transfer_details` (`from_office_id`, `to_office_id`, `fro
INSERT INTO `m_account_transfer_transaction` (`account_transfer_details_id`, `from_savings_transaction_id`, `from_loan_transaction_id`, `to_savings_transaction_id`, `to_loan_transaction_id`, `is_reversed`, `transaction_date`, `currency_code`, `currency_digits`, `currency_multiplesof`, `amount`, `description`) select ad.id,ad.from_savings_transaction_id,ad.from_loan_transaction_id,ad.to_savings_transaction_id,ad.to_loan_transaction_id,ad.is_reversed,ad.transaction_date,ad.currency_code,ad.currency_digits,ad.currency_multiplesof,ad.amount,ad.description from m_account_transfer_details ad;
ALTER TABLE `m_account_transfer_details`
DROP COLUMN `from_savings_transaction_id`,
DROP COLUMN `from_loan_transaction_id`,
DROP COLUMN `to_savings_transaction_id`,
DROP COLUMN `to_loan_transaction_id`,
DROP COLUMN `is_reversed`,
DROP COLUMN `transaction_date`,
DROP COLUMN `currency_code`,
DROP COLUMN `currency_digits`,
DROP COLUMN `currency_multiplesof`,
DROP COLUMN `amount`,
DROP COLUMN `description`;
DROP COLUMN `from_savings_transaction_id`,
DROP COLUMN `from_loan_transaction_id`,
DROP COLUMN `to_savings_transaction_id`,
DROP COLUMN `to_loan_transaction_id`,
DROP COLUMN `is_reversed`,
DROP COLUMN `transaction_date`,
DROP COLUMN `currency_code`,
DROP COLUMN `currency_digits`,
DROP COLUMN `currency_multiplesof`,
DROP COLUMN `amount`,
DROP COLUMN `description`;
DROP TABLE `m_savings_account_transfer`;
@@ -18,8 +18,8 @@
--
ALTER TABLE `m_loan_repayment_schedule`
ADD COLUMN `accrual_interest_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `interest_waived_derived`,
ADD COLUMN `accrual_fee_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fee_charges_waived_derived`,
ADD COLUMN `accrual_penalty_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `penalty_charges_waived_derived`;
ADD COLUMN `accrual_interest_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `interest_waived_derived`,
ADD COLUMN `accrual_fee_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `fee_charges_waived_derived`,
ADD COLUMN `accrual_penalty_charges_derived` DECIMAL(19,6) NULL DEFAULT NULL AFTER `penalty_charges_waived_derived`;
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Add Accrual Transactions', 'Add Accrual Transactions', '0 1 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
@@ -17,4 +17,4 @@
-- under the License.
--
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Apply penalty to overdue loans', 'Apply penalty to overdue loans', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Apply penalty to overdue loans', 'Apply penalty to overdue loans', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
@@ -18,9 +18,9 @@
--
ALTER TABLE `m_product_loan`
ADD COLUMN `overdue_days_for_npa` SMALLINT NULL DEFAULT NULL AFTER `grace_on_arrears_ageing`;
ADD COLUMN `overdue_days_for_npa` SMALLINT NULL DEFAULT NULL AFTER `grace_on_arrears_ageing`;
ALTER TABLE `m_loan`
ADD COLUMN `is_npa` tinyint NOT NULL DEFAULT '0' AFTER `grace_on_arrears_ageing`;
ADD COLUMN `is_npa` tinyint NOT NULL DEFAULT '0' AFTER `grace_on_arrears_ageing`;
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`) VALUES ('Update Non Performing Assets', 'Update Non Performing Assets', '0 0 0 1/1 * ? *', now());
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`) VALUES ('Update Non Performing Assets', 'Update Non Performing Assets', '0 0 0 1/1 * ? *', now());
@@ -155,10 +155,10 @@ CREATE TABLE IF NOT EXISTS `m_deposit_account_term_and_preclosure` (
ALTER TABLE `m_savings_product`
ADD COLUMN `deposit_type_enum` SMALLINT NOT NULL DEFAULT '100' AFTER `description`;
ADD COLUMN `deposit_type_enum` SMALLINT NOT NULL DEFAULT '100' AFTER `description`;
ALTER TABLE `m_savings_account`
ADD COLUMN `deposit_type_enum` SMALLINT NOT NULL DEFAULT '100' AFTER `account_type_enum`;
ADD COLUMN `deposit_type_enum` SMALLINT NOT NULL DEFAULT '100' AFTER `account_type_enum`;
ALTER TABLE `m_client`
ADD COLUMN `gender_cv_id` INT NULL DEFAULT NULL AFTER `mobile_no`,
@@ -17,4 +17,4 @@
-- under the License.
--
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'DISBURSETOSAVINGS_LOAN', 'LOAN', 'DISBURSETOSAVINGS', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('transaction_loan', 'DISBURSETOSAVINGS_LOAN', 'LOAN', 'DISBURSETOSAVINGS', 0);
@@ -18,9 +18,9 @@
--
ALTER TABLE `m_deposit_product_term_and_preclosure`
ADD COLUMN `min_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `max_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL;
ADD COLUMN `min_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `max_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL;
ALTER TABLE m_deposit_account_term_and_preclosure
ADD COLUMN `expected_firstdepositon_date` DATE NULL DEFAULT NULL;
ADD COLUMN `expected_firstdepositon_date` DATE NULL DEFAULT NULL;
@@ -18,11 +18,11 @@
--
ALTER TABLE `job_run_history`
CHANGE COLUMN `error_message` `error_message` TEXT NULL DEFAULT NULL AFTER `status`;
CHANGE COLUMN `error_message` `error_message` TEXT NULL DEFAULT NULL AFTER `status`;
ALTER TABLE `m_deposit_account_term_and_preclosure`
ADD COLUMN `transfer_interest_to_linked_account` tinyint NOT NULL DEFAULT '0' AFTER `expected_firstdepositon_date`;
ADD COLUMN `transfer_interest_to_linked_account` tinyint NOT NULL DEFAULT '0' AFTER `expected_firstdepositon_date`;
UPDATE `job` SET `scheduler_group`=1 WHERE `name`='Post Interest For Savings';
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Transfer Interest To Savings', 'Transfer Interest To Savings', '0 2 0 1/1 * ? *', now(), 4, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 1, 0);
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Transfer Interest To Savings', 'Transfer Interest To Savings', '0 2 0 1/1 * ? *', now(), 4, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 1, 0);
@@ -17,4 +17,4 @@
-- under the License.
--
UPDATE stretchy_report SET core_report=1, use_report=0 WHERE report_name in ('ClientTrendsByDay','ClientTrendsByWeek','ClientTrendsByMonth','LoanTrendsByDay','LoanTrendsByWeek','LoanTrendsByMonth','Demand_Vs_Collection','Disbursal_Vs_Awaitingdisbursal');
UPDATE stretchy_report SET core_report=1, use_report=0 WHERE report_name in ('ClientTrendsByDay','ClientTrendsByWeek','ClientTrendsByMonth','LoanTrendsByDay','LoanTrendsByWeek','LoanTrendsByMonth','Demand_Vs_Collection','Disbursal_Vs_Awaitingdisbursal');
@@ -18,9 +18,9 @@
--
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`;
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`;
@@ -17,4 +17,4 @@
-- under the License.
--
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Update Deposit Accounts Maturity details', 'Update Deposit Accounts Maturity details', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `group_name`, `previous_run_start_time`, `next_run_time`, `job_key`, `initializing_errorlog`, `is_active`, `currently_running`, `updates_allowed`, `scheduler_group`, `is_misfired`) VALUES ('Update Deposit Accounts Maturity details', 'Update Deposit Accounts Maturity details', '0 0 0 1/1 * ? *', now(), 5, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, 0, 0);
@@ -22,69 +22,69 @@ INSERT INTO `c_configuration` (`name`, `value`, `enabled`) VALUES ('age_limit_fo
ALTER TABLE `m_interest_rate_slab`
ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`,
ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`,
ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`;
ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`,
ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`,
ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`;
ALTER TABLE `m_savings_account_interest_rate_slab`
ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`,
ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`,
ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`;
ADD COLUMN `interest_rate_for_female` DECIMAL(19,6) NULL AFTER `annual_interest_rate`,
ADD COLUMN `interest_rate_for_children` DECIMAL(19,6) NULL AFTER `interest_rate_for_female`,
ADD COLUMN `interest_rate_for_senior_citizen` DECIMAL(19,6) NULL AFTER `interest_rate_for_children`;
ALTER TABLE `m_deposit_account_recurring_detail`
CHANGE COLUMN `recurring_deposit_amount` `mandatory_recommended_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `is_mandatory` TINYINT NOT NULL DEFAULT '0',
ADD COLUMN `allow_withdrawal` TINYINT NOT NULL DEFAULT '0',
ADD COLUMN `adjust_advance_towards_future_payments` TINYINT NOT NULL DEFAULT '1',
ADD COLUMN `is_calendar_inherited` TINYINT NOT NULL DEFAULT '0',
ADD COLUMN `total_overdue_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `no_of_overdue_installments` INT NULL DEFAULT NULL,
DROP COLUMN `recurring_deposit_type_enum`,
DROP COLUMN `recurring_deposit_frequency`,
DROP COLUMN `recurring_deposit_frequency_type_enum`;
CHANGE COLUMN `recurring_deposit_amount` `mandatory_recommended_deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `is_mandatory` TINYINT NOT NULL DEFAULT '0',
ADD COLUMN `allow_withdrawal` TINYINT NOT NULL DEFAULT '0',
ADD COLUMN `adjust_advance_towards_future_payments` TINYINT NOT NULL DEFAULT '1',
ADD COLUMN `is_calendar_inherited` TINYINT NOT NULL DEFAULT '0',
ADD COLUMN `total_overdue_amount` DECIMAL(19,6) NULL DEFAULT NULL,
ADD COLUMN `no_of_overdue_installments` INT NULL DEFAULT NULL,
DROP COLUMN `recurring_deposit_type_enum`,
DROP COLUMN `recurring_deposit_frequency`,
DROP COLUMN `recurring_deposit_frequency_type_enum`;
ALTER TABLE `m_deposit_product_term_and_preclosure`
DROP COLUMN `interest_free_period_applicable`,
DROP COLUMN `interest_free_from_period`,
DROP COLUMN `interest_free_to_period`,
DROP COLUMN `interest_free_period_frequency_enum`;
DROP COLUMN `interest_free_period_applicable`,
DROP COLUMN `interest_free_from_period`,
DROP COLUMN `interest_free_to_period`,
DROP COLUMN `interest_free_period_frequency_enum`;
ALTER TABLE `m_deposit_product_recurring_detail`
ADD COLUMN `is_mandatory` tinyint NOT NULL DEFAULT '1',
ADD COLUMN `allow_withdrawal` tinyint NOT NULL DEFAULT '0',
ADD COLUMN `adjust_advance_towards_future_payments` tinyint NOT NULL DEFAULT '1',
DROP COLUMN `recurring_deposit_type_enum`,
DROP COLUMN `recurring_deposit_frequency`,
DROP COLUMN `recurring_deposit_frequency_type_enum`;
ADD COLUMN `is_mandatory` tinyint NOT NULL DEFAULT '1',
ADD COLUMN `allow_withdrawal` tinyint NOT NULL DEFAULT '0',
ADD COLUMN `adjust_advance_towards_future_payments` tinyint NOT NULL DEFAULT '1',
DROP COLUMN `recurring_deposit_type_enum`,
DROP COLUMN `recurring_deposit_frequency`,
DROP COLUMN `recurring_deposit_frequency_type_enum`;
ALTER TABLE `m_deposit_account_term_and_preclosure`
DROP COLUMN `interest_free_period_applicable`,
DROP COLUMN `interest_free_from_period`,
DROP COLUMN `interest_free_to_period`,
DROP COLUMN `interest_free_period_frequency_enum`;
DROP COLUMN `interest_free_period_applicable`,
DROP COLUMN `interest_free_from_period`,
DROP COLUMN `interest_free_to_period`,
DROP COLUMN `interest_free_period_frequency_enum`;
CREATE TABLE `m_mandatory_savings_schedule` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`savings_account_id` BIGINT NOT NULL,
`fromdate` DATE NULL DEFAULT NULL,
`duedate` DATE NOT NULL,
`installment` SMALLINT NOT NULL,
`deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
`deposit_amount_completed_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`total_paid_in_advance_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`total_paid_late_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`completed_derived` BIT(1) NOT NULL,
`obligations_met_on_date` DATE NULL DEFAULT NULL,
`createdby_id` BIGINT NULL DEFAULT NULL,
`created_date` DATETIME NULL DEFAULT NULL,
`lastmodified_date` DATETIME NULL DEFAULT NULL,
`lastmodifiedby_id` BIGINT NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FKMSS0000000001` (`savings_account_id`),
CONSTRAINT `FKMSS0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`savings_account_id` BIGINT NOT NULL,
`fromdate` DATE NULL DEFAULT NULL,
`duedate` DATE NOT NULL,
`installment` SMALLINT NOT NULL,
`deposit_amount` DECIMAL(19,6) NULL DEFAULT NULL,
`deposit_amount_completed_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`total_paid_in_advance_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`total_paid_late_derived` DECIMAL(19,6) NULL DEFAULT NULL,
`completed_derived` BIT(1) NOT NULL,
`obligations_met_on_date` DATE NULL DEFAULT NULL,
`createdby_id` BIGINT NULL DEFAULT NULL,
`created_date` DATETIME NULL DEFAULT NULL,
`lastmodified_date` DATETIME NULL DEFAULT NULL,
`lastmodifiedby_id` BIGINT NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FKMSS0000000001` (`savings_account_id`),
CONSTRAINT `FKMSS0000000001` FOREIGN KEY (`savings_account_id`) REFERENCES `m_savings_account` (`id`)
);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_RECURRINGDEPOSITPRODUCT', 'RECURRINGDEPOSITPRODUCT', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'READ', 0);
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('organisation', 'READ_FIXEDDEPOSITPRODUCT', 'FIXEDDEPOSITPRODUCT', 'READ', 0);
@@ -26,15 +26,15 @@ INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `c
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'UPDATE_OFFICEGLACCOUNT', 'OFFICEGLACCOUNT', 'UPDATE', 0);
CREATE TABLE `acc_gl_office_mapping` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`gl_account_id` BIGINT NOT NULL DEFAULT '0',
`office_id` BIGINT NOT NULL,
`financial_account_type` SMALLINT NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_office_mapping_acc_gl_account` (`gl_account_id`),
INDEX `FK_office_mapping_office` (`office_id`),
CONSTRAINT `FK_office_mapping_acc_gl_account` FOREIGN KEY (`gl_account_id`) REFERENCES `acc_gl_account` (`id`),
CONSTRAINT `FK_office_mapping_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`gl_account_id` BIGINT NOT NULL DEFAULT '0',
`office_id` BIGINT NOT NULL,
`financial_account_type` SMALLINT NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_office_mapping_acc_gl_account` (`gl_account_id`),
INDEX `FK_office_mapping_office` (`office_id`),
CONSTRAINT `FK_office_mapping_acc_gl_account` FOREIGN KEY (`gl_account_id`) REFERENCES `acc_gl_account` (`id`),
CONSTRAINT `FK_office_mapping_office` FOREIGN KEY (`office_id`) REFERENCES `m_office` (`id`)
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;
@@ -32,65 +32,65 @@ ENGINE=InnoDB;
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(0, 4);
(0, 4);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(5, 9);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(5, 9);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(10, 14);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(10, 14);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(15, 19);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(15, 19);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(20, 24);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(20, 24);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(25,29 );
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(25,29 );
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(30, 34);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(30, 34);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(35, 39);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(35, 39);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(40, 44);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(40, 44);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(45, 49);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(45, 49);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(50, 54);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(50, 54);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(55, 59);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(55, 59);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(60,64);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(60,64);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(65, 69);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(65, 69);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(70, 74);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(70, 74);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(75, 79);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(75, 79);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(80,84);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(80,84);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(85, 89);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(85, 89);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(90, 94);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
(90, 94);
INSERT INTO `ppi_scores` ( `score_from`, `score_to`)
VALUES
(95, 100);
(95, 100);
@@ -119,4 +119,4 @@ INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_nam
INSERT INTO `m_permission` (`id`, `grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES (NULL, 'survey', 'REGISTER_SURVEY', 'survey', 'CREATE', '0');
/**Registered table category**/
ALTER TABLE `x_registered_table` ADD `category` INT NOT NULL DEFAULT 100;
ALTER TABLE `x_registered_table` ADD `category` INT NOT NULL DEFAULT 100;
@@ -18,51 +18,51 @@
--
ALTER TABLE `m_client`
ADD COLUMN `client_type_cv_id` INT NULL DEFAULT NULL AFTER `default_savings_account`,
ADD COLUMN `client_classification_cv_id` INT NULL DEFAULT NULL AFTER `client_type_cv_id`,
ADD CONSTRAINT `FK_m_client_type_m_code_value` FOREIGN KEY (`client_type_cv_id`) REFERENCES `m_code_value` (`id`),
ADD CONSTRAINT `FK_m_client_classification_m_code_value` FOREIGN KEY (`client_classification_cv_id`) REFERENCES `m_code_value` (`id`),
ADD CONSTRAINT `FK1_m_client_gender_m_code_value` FOREIGN KEY (`gender_cv_id`) REFERENCES `m_code_value` (`id`);
ADD COLUMN `client_type_cv_id` INT NULL DEFAULT NULL AFTER `default_savings_account`,
ADD COLUMN `client_classification_cv_id` INT NULL DEFAULT NULL AFTER `client_type_cv_id`,
ADD CONSTRAINT `FK_m_client_type_m_code_value` FOREIGN KEY (`client_type_cv_id`) REFERENCES `m_code_value` (`id`),
ADD CONSTRAINT `FK_m_client_classification_m_code_value` FOREIGN KEY (`client_classification_cv_id`) REFERENCES `m_code_value` (`id`),
ADD CONSTRAINT `FK1_m_client_gender_m_code_value` FOREIGN KEY (`gender_cv_id`) REFERENCES `m_code_value` (`id`);
INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientType', 1);
INSERT INTO `m_code` (`code_name`, `is_system_defined`) VALUES ('ClientClassification', 1);
CREATE TABLE `m_interest_incentives` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`interest_rate_slab_id` BIGINT NOT NULL,
`entiry_type` SMALLINT NOT NULL,
`attribute_name` SMALLINT NOT NULL,
`condition_type` SMALLINT NOT NULL,
`attribute_value` VARCHAR(50) NOT NULL,
`incentive_type` SMALLINT NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_interest_incentives_m_interest_rate_slab` (`interest_rate_slab_id`),
CONSTRAINT `FK_m_interest_incentives_m_interest_rate_slab` FOREIGN KEY (`interest_rate_slab_id`) REFERENCES `m_interest_rate_slab` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`interest_rate_slab_id` BIGINT NOT NULL,
`entiry_type` SMALLINT NOT NULL,
`attribute_name` SMALLINT NOT NULL,
`condition_type` SMALLINT NOT NULL,
`attribute_value` VARCHAR(50) NOT NULL,
`incentive_type` SMALLINT NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_interest_incentives_m_interest_rate_slab` (`interest_rate_slab_id`),
CONSTRAINT `FK_m_interest_incentives_m_interest_rate_slab` FOREIGN KEY (`interest_rate_slab_id`) REFERENCES `m_interest_rate_slab` (`id`)
);
CREATE TABLE `m_savings_interest_incentives` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`deposit_account_interest_rate_slab_id` BIGINT NOT NULL,
`entiry_type` SMALLINT NOT NULL,
`attribute_name` SMALLINT NOT NULL,
`condition_type` SMALLINT NOT NULL,
`attribute_value` VARCHAR(50) NOT NULL,
`incentive_type` SMALLINT NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` (`deposit_account_interest_rate_slab_id`),
CONSTRAINT `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` FOREIGN KEY (`deposit_account_interest_rate_slab_id`) REFERENCES `m_savings_account_interest_rate_slab` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`deposit_account_interest_rate_slab_id` BIGINT NOT NULL,
`entiry_type` SMALLINT NOT NULL,
`attribute_name` SMALLINT NOT NULL,
`condition_type` SMALLINT NOT NULL,
`attribute_value` VARCHAR(50) NOT NULL,
`incentive_type` SMALLINT NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` (`deposit_account_interest_rate_slab_id`),
CONSTRAINT `FK_m_savings_interest_incentives_m_savings_interest_rate_slab` FOREIGN KEY (`deposit_account_interest_rate_slab_id`) REFERENCES `m_savings_account_interest_rate_slab` (`id`)
);
ALTER TABLE `m_interest_rate_slab`
DROP COLUMN `interest_rate_for_female`,
DROP COLUMN `interest_rate_for_children`,
DROP COLUMN `interest_rate_for_senior_citizen`;
DROP COLUMN `interest_rate_for_female`,
DROP COLUMN `interest_rate_for_children`,
DROP COLUMN `interest_rate_for_senior_citizen`;
ALTER TABLE `m_savings_account_interest_rate_slab`
DROP COLUMN `interest_rate_for_female`,
DROP COLUMN `interest_rate_for_children`,
DROP COLUMN `interest_rate_for_senior_citizen`;
DROP COLUMN `interest_rate_for_female`,
DROP COLUMN `interest_rate_for_children`,
DROP COLUMN `interest_rate_for_senior_citizen`;
@@ -22,13 +22,13 @@ ALTER TABLE acc_gl_office_mapping DROP FOREIGN KEY `FK_office_mapping_office`;
ALTER TABLE acc_gl_office_mapping DROP column office_id;
ALTER TABLE `acc_gl_office_mapping`
ALTER `financial_account_type` DROP DEFAULT;
ALTER `financial_account_type` DROP DEFAULT;
ALTER TABLE `acc_gl_office_mapping`
CHANGE COLUMN `financial_account_type` `financial_activity_type` SMALLINT NOT NULL;
CHANGE COLUMN `financial_account_type` `financial_activity_type` SMALLINT NOT NULL;
ALTER TABLE `acc_gl_office_mapping`
ADD UNIQUE INDEX `financial_activity_type` (`financial_activity_type`);
ADD UNIQUE INDEX `financial_activity_type` (`financial_activity_type`);
RENAME TABLE `acc_gl_office_mapping` TO `acc_gl_financial_activity_account`;
RENAME TABLE `acc_gl_office_mapping` TO `acc_gl_financial_activity_account`;
@@ -18,4 +18,4 @@
--
DELETE FROM `c_configuration` WHERE `name`='age_limit_for_senior_citizen';
DELETE FROM `c_configuration` WHERE `name`='age_limit_for_children';
DELETE FROM `c_configuration` WHERE `name`='age_limit_for_children';
@@ -32,4 +32,4 @@ limit 1;
INSERT INTO `acc_gl_financial_activity_account` (`gl_account_id`,`financial_activity_type`)
select (select max(id) from acc_gl_account where classification_enum=2 and account_usage=1 LIMIT 1), 200
FROM m_product_loan WHERE accounting_type != 1
limit 1;
limit 1;
@@ -19,4 +19,4 @@
UPDATE m_permission
SET action_name = CONCAT(action_name,'_CHECKER')
WHERE code LIKE "%_CHECKER";
WHERE code LIKE "%_CHECKER";
@@ -106,4 +106,4 @@ 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;
stretchy_report_parameter_tmp to stretchy_report_parameter;
@@ -18,4 +18,4 @@
--
UPDATE `stretchy_report` SET `report_sql`='select awaitinddisbursal.amount-disbursedAmount.amount as amountToBeDisburse, disbursedAmount.amount as disbursedAmount from \n(\nSELECT COUNT(ln.id) AS noOfLoans, \n IFNULL(SUM(ln.principal_amount),0) AS amount\nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nWHERE \nln.expected_disbursedon_date = DATE(NOW()) AND \n(ln.loan_status_id=200 OR ln.loan_status_id=300) AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" )\n) awaitinddisbursal,\n(\nSELECT COUNT(ltrxn.id) as count, \n IFNULL(SUM(ltrxn.amount),0) as amount \nFROM \nm_office of\nLEFT JOIN m_client cl ON cl.office_id = of.id\nLEFT JOIN m_loan ln ON cl.id = ln.client_id\nLEFT JOIN m_loan_transaction ltrxn ON ln.id = ltrxn.loan_id\nWHERE \nltrxn.transaction_date = DATE(NOW()) AND \nltrxn.is_reversed = 0 AND\nltrxn.transaction_type_enum=1 AND\n of.hierarchy like concat((select ino.hierarchy from m_office ino where ino.id = ${officeId}),"%" ) \n) disbursedAmount' WHERE `report_name`='Disbursal_Vs_Awaitingdisbursal';
UPDATE `stretchy_report` SET `core_report`=1, `use_report`=0 WHERE `report_name`='GroupNamesByStaff';
UPDATE `stretchy_report` SET `core_report`=1, `use_report`=0 WHERE `report_name`='GroupNamesByStaff';
@@ -18,13 +18,13 @@
--
CREATE TABLE `m_account_transfer_standing_instructions_history` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`standing_instruction_id` BIGINT NOT NULL,
`status` VARCHAR(20) NOT NULL,
`execution_time` DATETIME NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`error_log` VARCHAR(500) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_account_transfer_standing_instructions_history` (`standing_instruction_id`),
CONSTRAINT `FK_m_account_transfer_standing_instructions_m_history` FOREIGN KEY (`standing_instruction_id`) REFERENCES `m_account_transfer_standing_instructions` (`id`)
`id` BIGINT NOT NULL AUTO_INCREMENT,
`standing_instruction_id` BIGINT NOT NULL,
`status` VARCHAR(20) NOT NULL,
`execution_time` DATETIME NOT NULL,
`amount` DECIMAL(19,6) NOT NULL,
`error_log` VARCHAR(500) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX `FK_m_account_transfer_standing_instructions_history` (`standing_instruction_id`),
CONSTRAINT `FK_m_account_transfer_standing_instructions_m_history` FOREIGN KEY (`standing_instruction_id`) REFERENCES `m_account_transfer_standing_instructions` (`id`)
);
@@ -18,9 +18,9 @@
--
ALTER TABLE `m_savings_product`
ADD COLUMN `min_required_balance` DECIMAL(19,6) NULL AFTER `overdraft_limit`,
ADD COLUMN `allow_overdraft_min_balance` tinyint NOT NULL DEFAULT '0' AFTER `min_required_balance`;
ADD COLUMN `min_required_balance` DECIMAL(19,6) NULL AFTER `overdraft_limit`,
ADD COLUMN `allow_overdraft_min_balance` tinyint NOT NULL DEFAULT '0' AFTER `min_required_balance`;
ALTER TABLE `m_savings_account`
ADD COLUMN `min_required_balance` DECIMAL(19,6) NULL AFTER `account_balance_derived`,
ADD COLUMN `allow_overdraft_min_balance` tinyint NOT NULL DEFAULT '0' AFTER `min_required_balance`;
ADD COLUMN `min_required_balance` DECIMAL(19,6) NULL AFTER `account_balance_derived`,
ADD COLUMN `allow_overdraft_min_balance` tinyint NOT NULL DEFAULT '0' AFTER `min_required_balance`;

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