From 5481d2033a5d3f5edb853fad993620ea7eb27240 Mon Sep 17 00:00:00 2001 From: Madhukar Date: Wed, 25 Jun 2014 12:50:27 +0530 Subject: [PATCH] MIFOSX-1369 and update groupnamesbystaff report to core report --- ...for_disbursed_vs_awaitingdisbursal_and_groupnamesbystaff.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 mifosng-db/migrations/core_db/V180__update_report_schemas_for_disbursed_vs_awaitingdisbursal_and_groupnamesbystaff.sql diff --git a/mifosng-db/migrations/core_db/V180__update_report_schemas_for_disbursed_vs_awaitingdisbursal_and_groupnamesbystaff.sql b/mifosng-db/migrations/core_db/V180__update_report_schemas_for_disbursed_vs_awaitingdisbursal_and_groupnamesbystaff.sql new file mode 100644 index 000000000..c7ecafee7 --- /dev/null +++ b/mifosng-db/migrations/core_db/V180__update_report_schemas_for_disbursed_vs_awaitingdisbursal_and_groupnamesbystaff.sql @@ -0,0 +1,2 @@ +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'; \ No newline at end of file