forked from FITER1/fineract-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
550 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
fineract-provider/src/main/resources/db/changelog/tenant/commands/BACCOMMEDA/client_age.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
-- | ||
-- Licensed to the Apache Software Foundation (ASF) under one | ||
-- or more contributor license agreements. See the NOTICE file | ||
-- distributed with this work for additional information | ||
-- regarding copyright ownership. The ASF licenses this file | ||
-- to you under the Apache License, Version 2.0 (the | ||
-- "License"); you may not use this file except in compliance | ||
-- with the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, | ||
-- software distributed under the License is distributed on an | ||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
-- KIND, either express or implied. See the License for the | ||
-- specific language governing permissions and limitations | ||
-- under the License. | ||
-- | ||
|
||
SELECT @productId := (select id from m_product_loan where short_name='BCOMMEDA' limit 1); | ||
UPDATE stretchy_report SET report_sql = concat('SELECT mc.id, | ||
client_age.client_age AS client_age, | ||
mc.date_of_birth AS date_of_birth, | ||
CASE | ||
-- Banco Comunal normal | ||
WHEN (${loanProductId} = 2) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 70) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 2) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 71 AND 75) THEN ''YELLOW'' | ||
WHEN (${loanProductId} = 2) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
WHEN (${loanProductId} = 2) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 75) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 2) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
-- Banco Comunal normal meda | ||
WHEN (${loanProductId} = ',@productId,') AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 70) THEN ''GREEN'' | ||
WHEN (${loanProductId} = ',@productId,') AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 71 AND 75) THEN ''YELLOW'' | ||
WHEN (${loanProductId} = ',@productId,') AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
WHEN (${loanProductId} = ',@productId,') AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 75) THEN ''GREEN'' | ||
WHEN (${loanProductId} = ',@productId,') AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
-- Banco Comunal temporal | ||
WHEN (${loanProductId} = 9) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 70) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 9) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 71 AND 75) THEN ''YELLOW'' | ||
WHEN (${loanProductId} = 9) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
WHEN (${loanProductId} = 9) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 75) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 9) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
-- Banco Comunal Agricola | ||
WHEN (${loanProductId} = 8) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 70) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 8) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 71 AND 75) THEN ''YELLOW'' | ||
WHEN (${loanProductId} = 8) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
WHEN (${loanProductId} = 8) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 75) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 8) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
-- Grupo Solidario | ||
WHEN (${loanProductId} = 4) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 70) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 4) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 71 AND 75) THEN ''YELLOW'' | ||
WHEN (${loanProductId} = 4) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
WHEN (${loanProductId} = 4) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 75) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 4) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
-- Grupo Solidario Agricola | ||
WHEN (${loanProductId} = 5) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 70) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 5) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) BETWEEN 71 AND 75) THEN ''YELLOW'' | ||
WHEN (${loanProductId} = 5) AND (''${clientCategorization}'' = ''NEW'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
WHEN (${loanProductId} = 5) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) BETWEEN 18 AND 75) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 5) AND (''${clientCategorization}'' = ''RECURRING'') AND (IFNULL(client_age.client_age, 0) NOT BETWEEN 18 AND 75) THEN ''RED'' | ||
END AS color | ||
FROM m_client mc | ||
INNER JOIN ( | ||
SELECT mct.id AS client_id, mct.date_of_birth AS date_of_birth, IFNULL(TIMESTAMPDIFF(YEAR, mct.date_of_birth, CURDATE()), 0) AS client_age | ||
FROM m_client mct | ||
) client_age ON client_age.client_id = mc.id | ||
WHERE mc.id = ${clientId}') | ||
WHERE report_name = 'Client age Policy Check'; |
27 changes: 27 additions & 0 deletions
27
...t-provider/src/main/resources/db/changelog/tenant/commands/BACCOMMEDA/investment_plan.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- | ||
-- Licensed to the Apache Software Foundation (ASF) under one | ||
-- or more contributor license agreements. See the NOTICE file | ||
-- distributed with this work for additional information | ||
-- regarding copyright ownership. The ASF licenses this file | ||
-- to you under the Apache License, Version 2.0 (the | ||
-- "License"); you may not use this file except in compliance | ||
-- with the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, | ||
-- software distributed under the License is distributed on an | ||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
-- KIND, either express or implied. See the License for the | ||
-- specific language governing permissions and limitations | ||
-- under the License. | ||
-- | ||
|
||
SELECT @productId := (select id from m_product_loan where short_name='BCOMMEDA' limit 1); | ||
UPDATE stretchy_report SET report_sql = concat(' SELECT CASE | ||
WHEN (${loanProductId} IN (9)) AND ''${categorization}'' = ''RECREDITO'' AND ${requestedAmount} <= 6000 THEN ''GREEN'' | ||
WHEN (${loanProductId} IN (2,',@productId,',8)) AND ${requestedAmount} <= 6000 THEN ''GREEN'' | ||
WHEN (${loanProductId} IN (2,',@productId,',9,8,4,5,7)) AND (${photographs} <= 0 OR ${investmentPlan} <= 0) THEN ''RED'' | ||
ELSE ''GREEN'' | ||
END AS color') | ||
WHERE report_name = 'Mandatory to attach photographs and investment plan Policy Check'; |
58 changes: 58 additions & 0 deletions
58
.../src/main/resources/db/changelog/tenant/commands/BACCOMMEDA/maxium_and_minimum_amount.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
-- | ||
-- Licensed to the Apache Software Foundation (ASF) under one | ||
-- or more contributor license agreements. See the NOTICE file | ||
-- distributed with this work for additional information | ||
-- regarding copyright ownership. The ASF licenses this file | ||
-- to you under the Apache License, Version 2.0 (the | ||
-- "License"); you may not use this file except in compliance | ||
-- with the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, | ||
-- software distributed under the License is distributed on an | ||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
-- KIND, either express or implied. See the License for the | ||
-- specific language governing permissions and limitations | ||
-- under the License. | ||
-- | ||
|
||
SELECT @productId := (select id from m_product_loan where short_name='BCOMMEDA' limit 1); | ||
UPDATE stretchy_report SET report_sql = concat('SELECT | ||
CASE | ||
WHEN (${isTopup} = true) AND (${loanProductId} IN (2,8,9,',@productId,')) AND (${requestedAmount} BETWEEN 1500 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = true) AND (${loanProductId} IN (4,5)) AND (${requestedAmount} BETWEEN 5000 AND 25000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 2) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 1500 AND 5000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 2) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 1500 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 2) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 1500 AND 5000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 2) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 1500 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = ',@productId,') AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 1500 AND 5000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = ',@productId,') AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 1500 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = ',@productId,') AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 1500 AND 5000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = ',@productId,') AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 1500 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 8) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 1500 AND 5000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 8) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 1500 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 8) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 1500 AND 5000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 8) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 1500 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 9) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 1500 AND 5000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 9) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 1500 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 9) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 1500 AND 5000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 9) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 1500 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 4) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 5000 AND 10000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 4) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 5000 AND 25000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 4) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 5000 AND 10000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 4) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 5000 AND 25000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 5) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 5000 AND 10000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 5) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''URBAN'') AND (${requestedAmount} BETWEEN 5000 AND 20000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 5) AND (''${categorization}'' = ''NUEVO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 5000 AND 10000) THEN ''GREEN'' | ||
WHEN (${isTopup} = false) AND (${loanProductId} = 5) AND (''${categorization}'' = ''RECREDITO'') AND (''${clientArea}'' = ''RURAL'') AND (${requestedAmount} BETWEEN 5000 AND 20000) THEN ''GREEN'' | ||
ELSE ''RED'' | ||
END AS color') | ||
WHERE report_name = 'Minimum and maximum amount Policy Check'; |
35 changes: 35 additions & 0 deletions
35
...provider/src/main/resources/db/changelog/tenant/commands/BACCOMMEDA/number_of_members.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
-- | ||
-- Licensed to the Apache Software Foundation (ASF) under one | ||
-- or more contributor license agreements. See the NOTICE file | ||
-- distributed with this work for additional information | ||
-- regarding copyright ownership. The ASF licenses this file | ||
-- to you under the Apache License, Version 2.0 (the | ||
-- "License"); you may not use this file except in compliance | ||
-- with the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, | ||
-- software distributed under the License is distributed on an | ||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
-- KIND, either express or implied. See the License for the | ||
-- specific language governing permissions and limitations | ||
-- under the License. | ||
-- | ||
|
||
SELECT @productId := (select id from m_product_loan where short_name='BCOMMEDA' limit 1); | ||
UPDATE stretchy_report SET report_sql = concat('SELECT | ||
CASE | ||
WHEN (${loanProductId} = 2) AND (${numberOfMembers} >= 7) THEN ''GREEN'' | ||
WHEN (${loanProductId} = ',@productId,') AND (${numberOfMembers} >= 7) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 9) AND (''${categorization}'' = ''NUEVO'') AND (${recreditPercent} < 50) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 9) AND (''${categorization}'' = ''RECREDITO'') AND (${recreditPercent} >= 50) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 8) AND (${numberOfMembers} >= 7) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 8) AND (${numberOfMembers} < 7) THEN ''ORANGE'' | ||
ELSE ''RED'' | ||
END AS color') | ||
WHERE report_name = 'Number of members according to policy Policy Check'; |
40 changes: 40 additions & 0 deletions
40
...t-provider/src/main/resources/db/changelog/tenant/commands/BACCOMMEDA/own_home_policy.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
-- | ||
-- Licensed to the Apache Software Foundation (ASF) under one | ||
-- or more contributor license agreements. See the NOTICE file | ||
-- distributed with this work for additional information | ||
-- regarding copyright ownership. The ASF licenses this file | ||
-- to you under the Apache License, Version 2.0 (the | ||
-- "License"); you may not use this file except in compliance | ||
-- with the License. You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, | ||
-- software distributed under the License is distributed on an | ||
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
-- KIND, either express or implied. See the License for the | ||
-- specific language governing permissions and limitations | ||
-- under the License. | ||
-- | ||
|
||
SELECT @productId := (select id from m_product_loan where short_name='BCOMMEDA' limit 1); | ||
UPDATE stretchy_report SET report_sql = concat('SELECT | ||
housing_type.owner_percent, | ||
CASE | ||
WHEN (${loanProductId} = 2) AND (housing_type.owner_percent >=50) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 2) AND (housing_type.owner_percent <50) THEN ''YELLOW'' | ||
WHEN (${loanProductId} = ',@productId,') AND (housing_type.owner_percent >=50) THEN ''GREEN'' | ||
WHEN (${loanProductId} = ',@productId,') AND (housing_type.owner_percent <50) THEN ''YELLOW'' | ||
WHEN (${loanProductId} = 8) AND (housing_type.owner_percent >=50) THEN ''GREEN'' | ||
WHEN (${loanProductId} = 8) AND (housing_type.owner_percent <50) THEN ''YELLOW'' | ||
END AS color | ||
FROM m_prequalification_group mpg | ||
INNER JOIN ( select (((select count(*) from m_prequalification_group_members mpm INNER JOIN m_client mc on mc.dpi = mpm.dpi | ||
INNER JOIN m_client_contact_info mcinf on mcinf.client_id = mc.id INNER JOIN m_code_value mcv on mcv.id = mcinf.housing_type where mcv.code_value = ''Propia'' and mpm.group_id = ${prequalificationId})/ | ||
(select count(*) from m_prequalification_group_members mpg where mpg.group_id = ${prequalificationId}))*100) as owner_percent, ${prequalificationId} as grp_id ) | ||
housing_type ON housing_type.grp_id = mpg.id | ||
WHERE mpg.id = ${prequalificationId}') | ||
WHERE report_name = 'Percentage of members with their own home Policy Check'; |
Oops, something went wrong.