10 lines
38 KiB
SQL
10 lines
38 KiB
SQL
truncate table stretchy_report;
|
|
truncate table stretchy_parameter;
|
|
truncate table stretchy_report_parameter;
|
|
|
|
|
|
INSERT INTO `stretchy_report` VALUES (1,'Client Listing','Table',NULL,'Client','select \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\n c.account_no as \"Client Account No.\", \r\nc.display_name as \"Name\", \n\nc.joined_date as \"Joined\", c.external_id as \"External Id\"\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand \n\nounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\nwhere o.id = ${officeId}\r\nand c.is_deleted=0\r\n\n\norder by ounder.hierarchy, c.account_no','Individual Client Report\r\n\r\nLists the small number of defined fields on the client table. Would expect to copy this \n\nreport and add any \'one to one\' additional data for specific tenant needs.\r\n\r\nCan be run for any size MFI but you\'d expect it only to be run within a branch for \n\nlarger ones. Depending on how many columns are displayed, there is probably is a limit of about 20/50k clients returned for html display (export to excel doesn\'t \n\nhave that client browser/memory impact).',1,1),(2,'Client Loans Listing','Table',NULL,'Client','select \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nc.account_no as \"Client \n\nAccount No.\", \r\nc.display_name as \"Name\", \r\nlo.display_name as \"Loan Officer\", l.account_no as \"Loan Account No.\", l.external_id as \"External Id\", \r\n\n\np.name as Loan, st.enum_message_property as \"Status\", \r\nf.`name` as Fund,\r\nifnull(cur.display_symbol, l.currency_code) as Currency, \r\nl.principal_amount,\n\n\r\nl.arrearstolerance_amount as \"Arrears Tolerance Amount\",\r\nl.number_of_repayments as \"Expected No. Repayments\",\r\nl.annual_nominal_interest_rate as \" Annual \n\nNominal Interest Rate\", \r\nl.nominal_interest_rate_per_period as \"Nominal Interest Rate Per Period\",\r\n\r\nipf.enum_message_property as \"Interest Rate Frequency\n\n\",\r\nim.enum_message_property as \"Interest Method\",\r\nicp.enum_message_property as \"Interest Calculated in Period\",\r\nl.term_frequency as \"Term Frequency\",\n\n\r\ntf.enum_message_property as \"Term Frequency Period\",\r\nl.repay_every as \"Repayment Frequency\",\r\nrf.enum_message_property as \"Repayment Frequency Period\",\n\n\r\nam.enum_message_property as \"Amortization\",\r\n\r\nl.total_charges_due_at_disbursement_derived as \"Total Charges Due At Disbursement\",\r\n\r\ndate( \n\nl.submittedon_date) as Submitted, date(l.approvedon_date) Approved, l.expected_disbursedon_date As \"Expected Disbursal\",\r\ndate(l.expected_firstrepaymenton_date) as \n\n\"Expected First Repayment\", date(l.interest_calculated_from_date) as \"Interest Calculated From\" ,\r\ndate(l.disbursedon_date) as Disbursed, date\n\n(l.expected_maturedon_date) \"Expected Maturity\",\r\ndate(l.maturedon_date) as \"Matured On\", date(l.closedon_date) as Closed,\r\ndate(l.rejectedon_date) as \n\nRejected, date(l.rescheduledon_date) as Rescheduled, \r\ndate(l.withdrawnon_date) as Withdrawn, date(l.writtenoffon_date) \"Written Off\"\r\nfrom m_office o \r\njoin \n\nm_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on \n\nc.office_id = ounder.id\r\nleft join m_loan l on l.client_id = c.id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_product_loan p on p.id = \n\nl.product_id\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join r_enum_value st on st.enum_name = \"loan_status_id\" and st.enum_id = l.loan_status_id\r\nleft join \n\nr_enum_value ipf on ipf.enum_name = \"interest_period_frequency_enum\" and ipf.enum_id = l.interest_period_frequency_enum\r\nleft join r_enum_value im on im.enum_name \n\n= \"interest_method_enum\" and im.enum_id = l.interest_method_enum\r\nleft join r_enum_value tf on tf.enum_name = \"term_period_frequency_enum\" and tf.enum_id = \n\nl.term_period_frequency_enum\r\nleft join r_enum_value icp on icp.enum_name = \"interest_calculated_in_period_enum\" and icp.enum_id = \n\nl.interest_calculated_in_period_enum\r\nleft join r_enum_value rf on rf.enum_name = \"repayment_period_frequency_enum\" and rf.enum_id = \n\nl.repayment_period_frequency_enum\r\nleft join r_enum_value am on am.enum_name = \"amortization_method_enum\" and am.enum_id = l.amortization_method_enum\r\n\r\nleft \n\njoin m_currency cur on cur.code = l.currency_code\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"${currencyId}\" or \"-1\" = \"${currencyId}\")\r\nand \n\n(l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \n\n\"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\norder by ounder.hierarchy, 2 , l.id','Individual Client Report\r\n\r\nPretty \n\nwide report that lists the basic details of client loans. \r\n\r\nCan be run for any size MFI but you\'d expect it only to be run within a branch for larger ones. \n\nThere is probably is a limit of about 20/50k clients returned for html display (export to excel doesn\'t have that client browser/memory impact).',1,1),(5,'Loans Awaiting Disbursal','Table',NULL,'Loan Portfolio','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\n lo.display_name as \"Loan Officer\", \r\nc.display_name as \"Name\", l.account_no as \"Loan Account No.\", pl.`name` as \"Product\", \r\nf.`name` as Fund, ifnull(cur.display_symbol, l.currency_code) as Currency, \r\nl.principal_amount as Principal, \r\ndate(l.approvedon_date) \"Approved\", l.expected_disbursedon_date \"Expected Disbursal\"\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"${currencyId}\" or \"-1\" = \"${currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand l.loan_status_id = 200\r\norder by ounder.hierarchy, l.expected_disbursedon_date, c.display_name','Individual Client Report',1,1),(6,'Loans Awaiting Disbursal Summary','Table',NULL,'Loan Portfolio','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\npl.`name` as \"Product\", \r\nifnull(cur.display_symbol, l.currency_code) as Currency, f.`name` as Fund,\r\nsum(l.principal_amount) as \n\nPrincipal\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat\n\n(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_product_loan pl on pl.id = \n\nl.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\n\n\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"${currencyId}\" or \"-1\" = \"${currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \n\n\"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 \n\n= ${fundId})\r\nand l.loan_status_id = 200\r\ngroup by ounder.hierarchy, pl.`name`, l.currency_code, f.`name`\r\norder by ounder.hierarchy, pl.`name`, \n\nl.currency_code, f.`name`','Individual Client Report',1,1),(7,'Loans Awaiting Disbursal Summary by Month','Table',NULL,'Loan Portfolio','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\npl.`name` as \"Product\", \r\nifnull(cur.display_symbol, l.currency_code) as Currency, \r\nyear(l.expected_disbursedon_date) as \"Year\", \n\nmonthname(l.expected_disbursedon_date) as \"Month\",\r\nsum(l.principal_amount) as Principal\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like \n\nconcat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on \n\nl.client_id = c.id\r\njoin m_product_loan pl on pl.id = l.product_id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = \n\nl.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"${currencyId}\" or \"-1\" = \"${currencyId}\")\r\nand \n\n(l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \n\n\"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand l.loan_status_id = 200\r\ngroup by ounder.hierarchy, pl.`name`, \n\nl.currency_code, year(l.expected_disbursedon_date), month(l.expected_disbursedon_date)\r\norder by ounder.hierarchy, pl.`name`, l.currency_code, year\n\n(l.expected_disbursedon_date), month(l.expected_disbursedon_date)','Individual Client Report',1,1),(10,'Active Loans Portfolio Status','Table',NULL,'Loan','select \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nlo.display_name as \"Loan Officer\", c.display_name as \"Name\", \r\np.`name` as Loan, f.`name` as Fund, l.account_no as \"Loan \n\nAccount No\",\r\nl.disbursedon_date as Disbursed, ifnull(cur.display_symbol, l.currency_code) as Currency,\r\nsum(r.principal_amount - ifnull\n\n(r.principal_completed_derived, 0)) as \"Principal Outstanding\",\r\nsum(r.interest_amount - ifnull(r.interest_completed_derived, 0)) as \"Interest Outstanding\",\r\n\n\n\r\nif(datediff(curdate(), min(r.duedate)) < 0, 0, datediff(curdate(), min(r.duedate))) as \"Days Overdue\", \r\nmin(r.installment) as \"First Overdue Installment\n\n\",\r\nmin(r.duedate) as \"First Overdue Installment Date\",\r\nsum(if(r.duedate <= curdate(), \r\n (r.principal_amount - ifnull(r.principal_completed_derived, \n\n0))\r\n , 0)) as \"Principal Overdue\",\r\nsum(if(r.duedate <= curdate(), \r\n (ifnull(r.interest_amount, 0) - ifnull(r.interest_completed_derived, \n\n0))\r\n , 0)) as \"Interest Overdue\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand \n\nounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\nleft join \n\nm_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_product_loan \n\np on p.id = l.product_id\r\nleft join m_loan_repayment_schedule r on r.loan_id = l.id\r\n and r.completed_derived is false\r\n\n\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"${currencyId}\" or \"-1\" = \"${currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \n\n\"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 \n\n= ${fundId})\r\nand l.loan_status_id = 300\r\ngroup by l.id\r\norder by ounder.hierarchy, p.`name`, l.currency_code, c.display_name, l.account_no','Individual Client \n\nReport',1,1),(11,'Active Loans Summary per Branch','Table',NULL,'Loan Portfolio','select \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nifnull(cur.display_symbol, l.currency_code) as Currency,\r\ncount(distinct(c.id)) as \"No. of Clients\", count(distinct(l.id)) as \"No. of Active Loans\",\r\ncount(distinct(if(r.duedate <= curdate(), \r\n if(r.principal_amount - ifnull(r.principal_completed_derived, 0) > 0, l.id, null), null)\r\n )) as \"No. of Loans in Arrears\",\r\n\r\nsum(l.principal_amount) as \"Total Loans Disbursed\",\r\nsum(ifnull(r.principal_completed_derived, 0)) as \"Total Principal Repaid\",\r\nsum(ifnull(r.interest_completed_derived, 0)) as \"Total Interest Repaid\",\r\nsum(r.principal_amount - ifnull(r.principal_completed_derived, 0)) as \"Total Principal Outstanding\",\r\nsum(ifnull(r.interest_amount, 0) - ifnull(r.interest_completed_derived, 0)) as \"Total Interest utstanding\",\r\nsum(if(r.duedate <= curdate(), \r\n (r.principal_amount - ifnull(r.principal_completed_derived, 0))\r\n , 0)) as \"Total Principal in Arrears\",\r\ncast(round((sum(if(r.duedate <= curdate(), \r\n (r.principal_amount - ifnull(r.principal_completed_derived, 0))\r\n , 0)) * 100) / \r\n sum(r.principal_amount - ifnull(r.principal_completed_derived, 0))\r\n , 2) as char)\r\n as \"Portfolio at Risk %\"\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_loan_repayment_schedule r on r.loan_id = l.id\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"${currencyId}\" or \"-1\" = \"${currencyId}\")\r\nand l.loan_status_id = 300\r\ngroup by ounder.hierarchy, l.currency_code\r\norder by ounder.hierarchy, l.currency_code',NULL,1,1),(15,'Portfolio at Risk','Table',NULL,'Loan Portfolio','select x.Currency, x.`Principal Outstanding`, x.`Principal Overdue`, x.`Interest Outstanding`, x.`Interest Overdue`, \r\nx.`Fees Outstanding`, x.`Fees Overdue`, x.`Penalties Outstanding`, x.`Penalties Overdue`,\r\n\r\n (case\r\n when ${parType} = 1 then\r\n cast(round((x.`Principal Overdue` * 100) / x.`Principal Outstanding`, 2) as char)\r\n when ${parType} = 2 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding`), 2) as char)\r\n when ${parType} = 3 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue` + x.`Fees Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding` + x.`Fees Outstanding`), 2) as char)\r\n when ${parType} = 4 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue` + x.`Fees Overdue` + x.`Penalties Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding` + x.`Fees Outstanding` + x.`Penalties Overdue`), 2) as char)\r\n else \"invalid PAR Type\"\r\n end) as \"Portfolio at Risk %\"\r\n from \r\n(select ifnull(cur.display_symbol, l.currency_code) as Currency, \r\nsum(ifnull(r.principal_amount,0) - (ifnull(r.principal_completed_derived, 0) + ifnull(r.principal_writtenoff_derived, 0))) as \"Principal Outstanding\",\r\nsum(if(r.duedate <= curdate(), \r\n (ifnull(r.principal_amount,0) - (ifnull(r.principal_completed_derived, 0) + ifnull(r.principal_writtenoff_derived, 0)))\r\n , 0)) as \"Principal Overdue\",\r\n\r\nsum(ifnull(r.interest_amount,0) - (ifnull(r.interest_completed_derived, 0) + ifnull(r.interest_waived_derived, 0) + ifnull(r.interest_writtenoff_derived, 0))) as \"Interest Outstanding\",\r\nsum(if(r.duedate <= curdate(), \r\n (ifnull(r.interest_amount,0) - (ifnull(r.interest_completed_derived, 0) + ifnull(r.interest_waived_derived, 0) + ifnull(r.interest_writtenoff_derived, 0)))\r\n , 0)) as \"Interest Overdue\",\r\n\r\nsum(ifnull(r.fee_charges_amount,0) - (ifnull(r.fee_charges_completed_derived, 0) + ifnull(r.fee_charges_waived_derived, 0) + ifnull(r.fee_charges_writtenoff_derived, 0))) as \"Fees Outstanding\",\r\nsum(if(r.duedate <= curdate(), \r\n (ifnull(r.fee_charges_amount,0) - (ifnull(r.fee_charges_completed_derived, 0) + ifnull(r.fee_charges_waived_derived, 0) + ifnull(r.fee_charges_writtenoff_derived, 0)))\r\n , 0)) as \"Fees Overdue\",\r\n\r\nsum(ifnull(r.penalty_charges_amount,0) - (ifnull(r.penalty_charges_completed_derived, 0) + ifnull(r.penalty_charges_waived_derived, 0) + ifnull(r.penalty_charges_writtenoff_derived, 0))) as \"Penalties Outstanding\",\r\nsum(if(r.duedate <= curdate(), \r\n (ifnull(r.penalty_charges_amount,0) - (ifnull(r.penalty_charges_completed_derived, 0) + ifnull(r.penalty_charges_waived_derived, 0) + ifnull(r.penalty_charges_writtenoff_derived, 0)))\r\n , 0)) as \"Penalties Overdue\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_product_loan p on p.id = l.product_id\r\nleft join m_loan_repayment_schedule r on r.loan_id = l.id\r\n and r.completed_derived is false\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"${currencyId}\" or \"-1\" = \"${currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand l.loan_status_id = 300\r\ngroup by l.currency_code\r\norder by l.currency_code) x',NULL,1,1),(16,'Portfolio at Risk by Branch','Table',NULL,'Loan Portfolio','select concat(repeat(\"..\", \r\n ((LENGTH(mo.`hierarchy`) - LENGTH(REPLACE(mo.`hierarchy`, \'.\', \'\')) - 1))), mo.`name`) as \"Office/Branch\",\r\nx.Currency, x.`Principal Outstanding`, x.`Principal Overdue`, x.`Interest Outstanding`, x.`Interest Overdue`, \r\nx.`Fees Outstanding`, x.`Fees Overdue`, x.`Penalties Outstanding`, x.`Penalties Overdue`,\r\n\r\n (case\r\n when ${parType} = 1 then\r\n cast(round((x.`Principal Overdue` * 100) / x.`Principal Outstanding`, 2) as char)\r\n when ${parType} = 2 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding`), 2) as char)\r\n when ${parType} = 3 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue` + x.`Fees Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding` + x.`Fees Outstanding`), 2) as char)\r\n when ${parType} = 4 then\r\n cast(round(((x.`Principal Overdue` + x.`Interest Overdue` + x.`Fees Overdue` + x.`Penalties Overdue`) * 100) / (x.`Principal Outstanding` + x.`Interest Outstanding` + x.`Fees Outstanding` + x.`Penalties Overdue`), 2) as char)\r\n else \"invalid PAR Type\"\r\n end) as \"Portfolio at Risk %\"\r\n from m_office mo\r\njoin \r\n(select ounder.id as \"branch\", ifnull(cur.display_symbol, l.currency_code) as Currency, \r\nsum(ifnull(r.principal_amount,0) - (ifnull(r.principal_completed_derived, 0) + ifnull(r.principal_writtenoff_derived, 0))) as \"Principal Outstanding\",\r\nsum(if(r.duedate <= curdate(), \r\n (ifnull(r.principal_amount,0) - (ifnull(r.principal_completed_derived, 0) + ifnull(r.principal_writtenoff_derived, 0)))\r\n , 0)) as \"Principal Overdue\",\r\n\r\nsum(ifnull(r.interest_amount,0) - (ifnull(r.interest_completed_derived, 0) + ifnull(r.interest_waived_derived, 0) + ifnull(r.interest_writtenoff_derived, 0))) as \"Interest Outstanding\",\r\nsum(if(r.duedate <= curdate(), \r\n (ifnull(r.interest_amount,0) - (ifnull(r.interest_completed_derived, 0) + ifnull(r.interest_waived_derived, 0) + ifnull(r.interest_writtenoff_derived, 0)))\r\n , 0)) as \"Interest Overdue\",\r\n\r\nsum(ifnull(r.fee_charges_amount,0) - (ifnull(r.fee_charges_completed_derived, 0) + ifnull(r.fee_charges_waived_derived, 0) + ifnull(r.fee_charges_writtenoff_derived, 0))) as \"Fees Outstanding\",\r\nsum(if(r.duedate <= curdate(), \r\n (ifnull(r.fee_charges_amount,0) - (ifnull(r.fee_charges_completed_derived, 0) + ifnull(r.fee_charges_waived_derived, 0) + ifnull(r.fee_charges_writtenoff_derived, 0)))\r\n , 0)) as \"Fees Overdue\",\r\n\r\nsum(ifnull(r.penalty_charges_amount,0) - (ifnull(r.penalty_charges_completed_derived, 0) + ifnull(r.penalty_charges_waived_derived, 0) + ifnull(r.penalty_charges_writtenoff_derived, 0))) as \"Penalties Outstanding\",\r\nsum(if(r.duedate <= curdate(), \r\n (ifnull(r.penalty_charges_amount,0) - (ifnull(r.penalty_charges_completed_derived, 0) + ifnull(r.penalty_charges_waived_derived, 0) + ifnull(r.penalty_charges_writtenoff_derived, 0)))\r\n , 0)) as \"Penalties Overdue\"\r\n\r\nfrom m_office o \r\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\nleft join m_staff lo on lo.id = l.loan_officer_id\r\nleft join m_currency cur on cur.code = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nleft join m_product_loan p on p.id = l.product_id\r\nleft join m_loan_repayment_schedule r on r.loan_id = l.id\r\n and r.completed_derived is false\r\nwhere o.id = ${officeId}\r\nand (l.currency_code = \"${currencyId}\" or \"-1\" = \"${currencyId}\")\r\nand (l.product_id = \"${loanProductId}\" or \"-1\" = \"${loanProductId}\")\r\nand (ifnull(l.loan_officer_id, -10) = \"${loanOfficerId}\" or \"-1\" = \"${loanOfficerId}\")\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand l.loan_status_id = 300\r\ngroup by ounder.id, l.currency_code) x on x.branch = mo.id\r\norder by mo.hierarchy, x.Currency',NULL,1,1),(20,'Funds Disbursed Between Dates Summary','Table',NULL,'Fund','select ifnull(f.`name`, \'-\') as Fund, ifnull(cur.display_symbol, l.currency_code) as Currency, \r\nround(sum(l.principal_amount), 4) as disbursed_amount\r\nfrom m_office ounder \r\njoin m_client c on c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_currency cur on cur.`code` = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\nwhere disbursedon_date between \'${startDate}\' and \'${endDate}\'\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand (l.currency_code = \'${currencyId}\' or \'-1\' = \'${currencyId}\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\ngroup by ifnull(f.`name`, \'-\') , ifnull(cur.display_symbol, l.currency_code)\r\norder by ifnull(f.`name`, \'-\') , ifnull(cur.display_symbol, l.currency_code)',NULL,1,1),(21,'Funds Disbursed Between Dates Summary by Office','Table',NULL,'Fund','select \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\n \n\nifnull(f.`name`, \'-\') as Fund, ifnull(cur.display_symbol, l.currency_code) as Currency, round(sum(l.principal_amount), 4) as disbursed_amount\r\nfrom m_office o\r\n\n\njoin m_office ounder on ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nand ounder.hierarchy like concat(\'${currentUserHierarchy}\', \'%\')\r\njoin m_client c \n\non c.office_id = ounder.id\r\njoin m_loan l on l.client_id = c.id\r\njoin m_currency cur on cur.`code` = l.currency_code\r\nleft join m_fund f on f.id = l.fund_id\r\n\n\nwhere disbursedon_date between \'${startDate}\' and \'${endDate}\'\r\nand o.id = ${officeId}\r\nand (ifnull(l.fund_id, -10) = ${fundId} or -1 = ${fundId})\r\nand \n\n(l.currency_code = \'${currencyId}\' or \'-1\' = \'${currencyId}\')\r\ngroup by ounder.`name`, ifnull(f.`name`, \'-\') , ifnull(cur.display_symbol, \n\nl.currency_code)\r\norder by ounder.`name`, ifnull(f.`name`, \'-\') , ifnull(cur.display_symbol, l.currency_code)',NULL,1,1),(48,'Balance Sheet','Pentaho',NULL,'Accounting',NULL,'Balance Sheet',1,0),(49,'Income Statement','Pentaho',NULL,'Accounting',NULL,'Profit and Loss Statement',1,0),(50,'Trial Balance','Pentaho',NULL,'Accounting',NULL,'Trial Balance Report',1,0),(51,'Written-Off Loans','Table',NULL,'Loan','SELECT \r\nconcat(repeat(\"..\", \r\n ((LENGTH(ounder.`hierarchy`) - LENGTH(REPLACE(ounder.`hierarchy`, \'.\', \'\')) - 1))), ounder.`name`) as \"Office/Branch\",\r\nc.display_name AS \'Client Name\',\r\nml.account_no AS \'Account Number\',\r\nmpl.name AS \'Product Name\',\r\nml.disbursedon_date AS \'Disbursed Date\',\r\nlt.transaction_date AS \'Written Off date\',\r\nifnull(cur.display_symbol, ml.currency_code) as Currency, \r\nlt.principal_portion_derived AS \'Written-Off Principal\',\r\nlt.interest_portion_derived AS \'Written-Off Interest\',\r\nn.note AS \'Reason For Write-Off\',\r\nIFNULL(ms.display_name,\'-\') AS \'Loan Officer Name\'\r\nFROM m_office o\r\nJOIN m_office ounder ON ounder.hierarchy like concat(o.hierarchy, \'%\')\r\nAND ounder.hierarchy like CONCAT(\'${currentUserHierarchy}\', \'%\')\r\nJOIN m_client c ON c.office_id = ounder.id\r\nJOIN m_loan ml ON ml.client_id = c.id\r\nJOIN m_product_loan mpl ON mpl.id=ml.product_id\r\nLEFT JOIN m_staff ms ON ms.id=ml.loan_officer_id\r\nJOIN m_loan_transaction lt ON lt.loan_id = ml.id\r\nLEFT JOIN m_note n ON n.loan_transaction_id = lt.id\r\nLEFT JOIN m_currency cur on cur.code = ml.currency_code\r\nWHERE lt.transaction_type_enum = 6 /*write-off */\r\nAND lt.contra_id is null \r\nAND ml.loan_status_id=601\r\nAND o.id=${officeId}\r\nAND (mpl.id=${loanProductId} OR ${loanProductId}=-1)\r\nAND lt.transaction_date BETWEEN \'${startDate}\' AND \'${endDate}\'\r\nAND (ml.currency_code = \"${currencyId}\" or \"-1\" = \"${currencyId}\")\r\nORDER BY ounder.hierarchy, ifnull(cur.display_symbol, ml.currency_code), ml.account_no','Written Off Loans',0,1),(52,'Aging Summary (Arrears in weeks)','Table',NULL,'Loan','SELECT \r\n arr.clientName AS \"Client Name\",\r\n arr.accNo AS \"Account Number\",\r\n arr.loanAmt AS \"Loan Amount\",\r\n loan.principal AS \"Original Principal\",\r\n loan.interest AS \"Original Interest\",\r\n loan.prinPaid AS \"Principal Paid\",\r\n loan.intPaid AS \"Interest Paid\",\r\n arr.prinOverdue AS \"Principal Overdue\",\r\n arr.intOverdue AS \"Interest Overdue\",\r\n arr.arrWeek AS \"Weeks In Arrears\"\r\nFROM \r\n (SELECT mr.loan_id loanId,\r\n mc.display_name AS clientName,\r\n ml.account_no AS accNo,\r\n ml.principal_amount AS loanAmt,\r\n SUM(mr.principal_amount - IFNULL(mr.principal_completed_derived, 0)) AS prinOverdue, \r\n SUM(mr.interest_amount - IFNULL(mr.interest_completed_derived, 0)) AS intOverdue,\r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<7, \'Less than a week in arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<8, \'1 Week in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<15, \'2 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<22, \'3 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<29, \'4 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<36, \'5 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<43, \'6 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<50, \'7 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<57, \'8 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<64, \'9 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<71, \'10 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<78, \'11 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), MIN(mr.duedate))<85, \'12 Weeks in Arrears\', \'12+ Weeks in Arrears\'))))))))))))) AS arrWeek\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\r\n INNER JOIN m_loan_repayment_schedule mr ON mr.loan_id=ml.id\r\n WHERE mr.completed_derived=0 \r\n AND mr.duedate <= CURDATE() \r\n AND ml.loan_status_id=300\r\n AND mo.id=${officeId}\r\n GROUP BY mr.loan_id\r\n ORDER BY mc.display_name) arr\r\nINNER JOIN \r\n (SELECT mr.loan_id loanId, \r\n SUM(mr.principal_amount) principal,\r\n SUM(mr.interest_amount) interest,\r\n SUM(IFNULL(mr.principal_completed_derived,0)) prinPaid,\r\n SUM(IFNULL(mr.interest_completed_derived,0)) intPaid\r\n FROM m_loan_repayment_schedule mr\r\n GROUP BY mr.loan_id) loan ON arr.loanId=loan.loanId','Loan arrears aging (Weeks)',0,1),(53,'Amount In Arrears','Table',NULL,'Loan','SELECT \r\n IFNULL(weeks.currencyName, weeks.currency) as currency, \r\n weeks.week_no \'Weeks In Arrears\', \r\n IFNULL(ars.loanId, 0) \'No Of Loans\', \r\n IFNULL(ars.principal,0.0) \'Original Principal\', \r\n IFNULL(ars.interest,0.0) \'Original Interest\', \r\n IFNULL(ars.prinPaid,0.0) \'Principal Paid\', \r\n IFNULL(ars.intPaid,0.0) \'Interest Paid\', \r\n IFNULL(ars.prinOverdue,0.0) \'Principal Overdue\', \r\n IFNULL(ars.intOverdue,0.0)\'Interest Overdue\'\r\nFROM \r\n /* full table of aging weeks/currencies used combo to ensure each line represented */\r\n (SELECT curs.code as currency, curs.name as currencyName, wks.* from\r\n (SELECT \'On Schedule\' week_no,0 wid UNION\r\n SELECT \'0 to 6 days arrears\',1 UNION\r\n SELECT \'1 Week in Arrears\',2 UNION\r\n SELECT \'2 Weeks in Arrears\',3 UNION\r\n SELECT \'3 Weeks in Arrears\',4 UNION\r\n SELECT \'4 Weeks in Arrears\',5 UNION\r\n SELECT \'5 Weeks in Arrears\',6 UNION\r\n SELECT \'6 Weeks in Arrears\',7 UNION\r\n SELECT \'7 Weeks in Arrears\',8 UNION\r\n SELECT \'8 Weeks in Arrears\',9 UNION\r\n SELECT \'9 Weeks in Arrears\',10 UNION\r\n SELECT \'10 Weeks in Arrears\',11 UNION\r\n SELECT \'11 Weeks in Arrears\',12 UNION\r\n SELECT \'12 Weeks in Arrears\',13 UNION\r\n SELECT \'12+ Weeks in Arrears\',14) wks,\r\n (SELECT distinctrow moc.code, moc.name\r\n FROM m_office mo2\r\n INNER JOIN m_office ounder2 ON ounder2.hierarchy \r\n LIKE CONCAT(mo2.hierarchy, \'%\')\r\n INNER JOIN m_client mc2 ON mc2.office_id=ounder2.id\r\n INNER JOIN m_loan ml2 ON ml2.client_id = mc2.id\r\n INNER JOIN m_organisation_currency moc ON moc.code = ml2.currency_code\r\n WHERE ml2.loan_status_id=300 /* active */\r\n AND mo2.id=${officeId}) curs) weeks\r\n\r\n\r\n\r\nLEFT JOIN /* table of aging weeks per currency with gaps if no applicable loans */\r\n(SELECT \r\n z.currency, z.arrWeek, \r\n COUNT(z.loanId) as loanId, SUM(z.principal) as principal, SUM(z.interest) as interest, \r\n SUM(z.prinPaid) as prinPaid, SUM(z.intPaid) as intPaid, \r\n SUM(z.prinOverdue) as prinOverdue, SUM(z.intOverdue) as intOverdue\r\nFROM\r\n /*derived table just used to get arrWeek value (was much slower to\r\n duplicate calc of minOverdueDate in inner query) */\r\n (SELECT x.loanId, x.currency, x.principal, x.interest, x.prinPaid, x.intPaid, x.prinOverdue, x.intOverdue,\r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<0, \'On Schedule\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<7, \'0 to 6 days arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<8, \'1 Week in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<15, \'2 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<22, \'3 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<29, \'4 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<36, \'5 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<43, \'6 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<50, \'7 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<57, \'8 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<64, \'9 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<71, \'10 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<78, \'11 Weeks in Arrears\', \r\n IF(DATEDIFF(CURDATE(), minOverdueDate)<85, \'12 Weeks in Arrears\',\r\n \'12+ Weeks in Arrears\')))))))))))))) AS arrWeek\r\n\r\n FROM /* get the individual loan details */\r\n (SELECT ml.id AS loanId, ml.currency_code as currency,\r\n SUM(mr.principal_amount) principal, \r\n SUM(mr.interest_amount) interest, \r\n SUM(IFNULL(mr.principal_completed_derived,0)) prinPaid, \r\n SUM(IFNULL(mr.interest_completed_derived,0)) intPaid,\r\n\r\n SUM(IF((mr.completed_derived is false) AND (mr.duedate <= CURDATE()), \r\n (mr.principal_amount - ifnull(mr.principal_completed_derived, 0))\r\n , 0)) as prinOverdue,\r\n SUM(IF((mr.completed_derived is false) AND (mr.duedate <= CURDATE()), \r\n (mr.interest_amount - ifnull(mr.interest_completed_derived, 0))\r\n , 0)) as intOverdue,\r\n\r\n CAST(MIN(\r\n IF((mr.completed_derived is false) AND (mr.duedate <= CURDATE()), mr.duedate, CURDATE() + 1)) as date) as minOverdueDate\r\n \r\n FROM m_office mo\r\n INNER JOIN m_office ounder ON ounder.hierarchy \r\n LIKE CONCAT(mo.hierarchy, \'%\')\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 m_loan_repayment_schedule mr on mr.loan_id = ml.id\r\n WHERE ml.loan_status_id=300 /* active */\r\n AND mo.id=${officeId}\r\n GROUP BY ml.id) x\r\n ) z \r\nGROUP BY z.currency, z.arrWeek ) ars ON ars.arrWeek=weeks.week_no and ars.currency = weeks.currency\r\nORDER BY weeks.currency, weeks.wid','Loan amount in arrears by branch',1,1);
|
|
INSERT INTO `stretchy_parameter` VALUES (1,'FullReportList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select r.report_id, r.report_name, r.report_type, r.report_subtype, r.report_category,\r\n \n\nrp.parameter_id, rp.report_parameter_name, p.parameter_name\r\n from stretchy_report r\r\n left join stretchy_report_parameter rp on rp.report_id = r.report_id\r\n \n\nleft join stretchy_parameter p on p.parameter_id = rp.parameter_id\r\n where r.use_report is true\r\n and exists\r\n (\r\n select \'f\'\r\n from m_appuser_role ur \n\n\r\n join m_role r on r.id = ur.role_id\r\n join m_role_permission rp on rp.role_id = r.id\r\n join m_permission p on p.id = rp.permission_id\r\n where \n\nur.appuser_id = ${currentUserId}\r\n and (p.code in (\'ALL_FUNCTIONS_READ\', \'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name))\r\n )\r\n order by \n\nr.report_category, r.report_name, rp.parameter_id'),(2,'FullParameterList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select parameter_name, parameter_variable, \n\nparameter_label, parameter_displayType, \r\nparameter_FormatType, parameter_default, selectOne, selectAll\r\nfrom stretchy_parameter p\r\nwhere special is null\r\n\n\norder by parameter_id'),(3,'reportCategoryList',NULL,'n/a','n/a','n/a','n/a','Y',NULL,NULL,'select r.report_id, r.report_name, r.report_type, r.report_subtype, \n\nr.report_category,\r\n rp.parameter_id, rp.report_parameter_name, p.parameter_name\r\n from stretchy_report r\r\n left join stretchy_report_parameter rp on \n\nrp.report_id = r.report_id\r\n left join stretchy_parameter p on p.parameter_id = rp.parameter_id\r\n where r.report_category = \'${reportCategory}\'\r\n and \n\nr.use_report is true\r\n and exists\r\n (\r\n select \'f\'\r\n from m_appuser_role ur \r\n join m_role r on r.id = ur.role_id\r\n join m_role_permission rp on \n\nrp.role_id = r.id\r\n join m_permission p on p.id = rp.permission_id\r\n where ur.appuser_id = ${currentUserId}\r\n and (p.code in (\'ALL_FUNCTIONS_READ\', \n\n\'ALL_FUNCTIONS\') or p.code = concat(\"READ_\", r.report_name))\r\n )\r\n order by r.report_category, r.report_name, rp.parameter_id'),(5,'OfficeIdSelectOne','officeId','Office','select','number','0',NULL,'Y',NULL,'select id, \r\nconcat(substring(\"........................................\", 1, \r\n \n\n((LENGTH(`hierarchy`) - LENGTH(REPLACE(`hierarchy`, \'.\', \'\')) - 1) * 4)), \r\n `name`) as tc\r\nfrom m_office\r\nwhere hierarchy like concat\n\n(\'${currentUserHierarchy}\', \'%\')\r\norder by hierarchy'),(6,'loanOfficerIdSelectAll','loanOfficerId','Loan Officer','select','number','0',NULL,'Y','Y','(select id, \n\ndisplay_name as `Name` from m_staff\nwhere is_loan_officer = true)\r\nunion all\r\n(select -10, \'-\')\r\norder by 2'),(10,'currencyIdSelectAll','currencyId','Currency','select','number','0',NULL,'Y','Y','select `code`, `name`\r\nfrom m_organisation_currency\r\norder by `code`'),(11,'currencyIdSelectOne','currencyId','Currency','select','number','0',NULL,'Y',NULL,'select `code`, `name`\r\nfrom m_organisation_currency\r\norder by `code`'),(20,'fundIdSelectAll','fundId','Fund','select','number','0',NULL,'Y','Y','(select id, `name`\r\nfrom m_fund)\r\nunion all\r\n(select -10, \'-\')\r\norder by 2'),(25,'loanProductIdSelectAll','loanProductId','Product','select','number','0',NULL,'Y','Y','select id, `name`\r\nfrom m_product_loan\r\norder by 2'),(40,'startDateSelect','startDate','startDate','date','date','today',NULL,NULL,NULL,NULL),(41,'endDateSelect','endDate','endDate','date','date','today',NULL,NULL,NULL,NULL),(100,'parTypeSelect','parType','parType','select','number','0',NULL,'Y',NULL,'select * from\r\n(select 1 as id, \"Principal Only\" as `name` union all\r\nselect 2, \"Principal + Interest\" union all\r\nselect 3, \"Principal + Interest + Fees\" union all\r\nselect 4, \"Principal + Interest + Fees + Penalties\") x\r\norder by x.`id`');
|
|
INSERT INTO `stretchy_report_parameter` VALUES (1,5,NULL),(2,5,NULL),(2,6,NULL),(2,10,NULL),(2,20,NULL),(2,25,NULL),(5,5,NULL),(5,6,NULL),(5,10,NULL),(5,20,NULL),(5,25,NULL),(6,5,NULL),(6,6,NULL),(6,10,NULL),(6,20,NULL),(6,25,NULL),(7,5,NULL),(7,6,NULL),(7,10,NULL),(7,20,NULL),(7,25,NULL),(10,5,NULL),(10,6,NULL),(10,10,NULL),(10,20,NULL),(10,25,NULL),(11,5,NULL),(11,10,NULL),(15,5,NULL),(15,6,NULL),(15,10,NULL),(15,20,NULL),(15,25,NULL),(15,100,NULL),(16,5,NULL),(16,6,NULL),(16,10,NULL),(16,20,NULL),(16,25,NULL),(16,100,NULL),(20,10,NULL),(20,20,NULL),(20,40,NULL),(20,41,NULL),(21,5,NULL),(21,10,NULL),(21,20,NULL),(21,40,NULL),(21,41,NULL),(48,5,'branch'),(48,41,'date'),(49,5,'branch'),(49,40,'fromDate'),(49,41,'toDate'),(50,5,'branch'),(50,40,'fromDate'),(50,41,'toDate'),(51,5,NULL),(51,10,NULL),(51,25,NULL),(51,40,NULL),(51,41,NULL),(52,5,NULL),(53,5,NULL);
|
|
|