TYPE=VIEW
query=select `d`.`acc_no` AS `acc_no`,concat(`a`.`fname`,\' \',`a`.`mname`,\' \',`a`.`lname`) AS `Name`,`d`.`lf_no` AS `lf_no`,(`d`.`amt` * if((`d`.`maturity_date` < (now() + interval -(10) day)),(timestampdiff(MONTH,(`d`.`date_open` + interval -(1) month),`d`.`maturity_date`) + 1),(timestampdiff(MONTH,(`d`.`date_open` + interval -(1) month),(now() + interval -(10) day)) + 1))) AS `Actual_Amt`,`d`.`date_open` AS `date_open`,`d`.`maturity_date` AS `maturity_date`,sum(`v`.`cr`) AS `Clear_Bal`,((`d`.`amt` * if((`d`.`maturity_date` < (now() + interval -(10) day)),(timestampdiff(MONTH,(`d`.`date_open` + interval -(1) month),`d`.`maturity_date`) + 1),(timestampdiff(MONTH,(`d`.`date_open` + interval -(1) month),(now() + interval -(10) day)) + 1))) - sum(`v`.`cr`)) AS `Pay_amt`,(sum(`v`.`cr`) / `d`.`amt`) AS `Premium_Cmpt`,((`d`.`Duration` * 3) - (sum(`v`.`cr`) / `d`.`amt`)) AS `total_due_premium`,`d`.`amt` AS `amt` from ((`co-operativebank-198`.`deposit_acc` `d` join `co-operativebank-198`.`voucher` `v`) join `co-operativebank-198`.`applicant` `a`) where ((`a`.`Acc_No` = `v`.`Acc_no`) and (`a`.`Acc_No` = `d`.`acc_no`) and (`v`.`Acc_no` = `d`.`acc_no`) and (`d`.`acc_type` = \'rd\') and (`d`.`status` = \'Active\')) group by `v`.`Acc_no`
md5=0684644c2ea97dc1ef0eeacc35b45b8f
updatable=0
algorithm=0
definer_user=root
definer_host=localhost
suid=1
with_check_option=0
timestamp=2022-07-28 05:49:39
create-version=1
source=select  `d`.`acc_no`  AS  `acc_no` ,\nconcat(  `a`.`fname` ,  \' \',  `a`.`mname` ,  \' \',  `a`.`lname`  )  AS  `Name` ,\n `d`.`lf_no`  AS  `lf_no` ,\n(  `d`.`amt`  * if( (  `d`.`maturity_date`  < ( now(  )  +  interval  - ( 10  )  day  )  ) ,\n( timestampdiff(  MONTH , (  `d`.`date_open`  +  interval  - ( 1  )  month  ) ,\n `d`.`maturity_date`  ) +1 ),\n( timestampdiff(  MONTH , (  `d`.`date_open`  +  interval  - ( 1  )  month  ) ,\n( now(  )  +  interval  - ( 10  )  day  ) ) +1 ) ) ) AS  `Actual_Amt` ,\n `d`.`date_open`  AS  `date_open` ,\n `d`.`maturity_date`  AS  `maturity_date` ,\nsum(  `v`.`cr`  )  AS  `Clear_Bal` ,\n( (  `d`.`amt`  * if( (  `d`.`maturity_date`  < ( now(  )  +  interval  - ( 10  )  day  )  ) ,\n( timestampdiff(  MONTH , (  `d`.`date_open`  +  interval  - ( 1  )  month  ) ,\n `d`.`maturity_date`  ) +1 ),\n( timestampdiff(  MONTH , (  `d`.`date_open`  +  interval  - ( 1  )  month  ) ,\n( now(  )  +  interval  - ( 10  )  day  ) ) +1 ) ) ) - sum(  `v`.`cr`  )  ) AS  `Pay_amt` ,\n( sum(  `v`.`cr`  )  /  `d`.`amt`  ) AS  `Premium_Cmpt` ,\n( (  `d`.`Duration`  *3 ) - ( sum(  `v`.`cr`  )  /  `d`.`amt`  )  ) AS  `total_due_premium` ,\n `d`.`amt`  AS  `amt`  from ( (  `co-operativebank-198`.`deposit_acc`  `d`  join  `co-operativebank-198`.`voucher`  `v`  ) join  `co-operativebank-198`.`applicant`  `a`  ) where ( (  `a`.`Acc_No`  =  `v`.`Acc_no`  ) and (  `a`.`Acc_No`  =  `d`.`acc_no`  ) and (  `v`.`Acc_no`  =  `d`.`acc_no`  ) and (  `d`.`acc_type`  =  \'rd\' ) and (  `d`.`status`  =  \'Active\' ) ) group  by  `v`.`Acc_no`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `d`.`acc_no` AS `acc_no`,concat(`a`.`fname`,\' \',`a`.`mname`,\' \',`a`.`lname`) AS `Name`,`d`.`lf_no` AS `lf_no`,(`d`.`amt` * if((`d`.`maturity_date` < (now() + interval -(10) day)),(timestampdiff(MONTH,(`d`.`date_open` + interval -(1) month),`d`.`maturity_date`) + 1),(timestampdiff(MONTH,(`d`.`date_open` + interval -(1) month),(now() + interval -(10) day)) + 1))) AS `Actual_Amt`,`d`.`date_open` AS `date_open`,`d`.`maturity_date` AS `maturity_date`,sum(`v`.`cr`) AS `Clear_Bal`,((`d`.`amt` * if((`d`.`maturity_date` < (now() + interval -(10) day)),(timestampdiff(MONTH,(`d`.`date_open` + interval -(1) month),`d`.`maturity_date`) + 1),(timestampdiff(MONTH,(`d`.`date_open` + interval -(1) month),(now() + interval -(10) day)) + 1))) - sum(`v`.`cr`)) AS `Pay_amt`,(sum(`v`.`cr`) / `d`.`amt`) AS `Premium_Cmpt`,((`d`.`Duration` * 3) - (sum(`v`.`cr`) / `d`.`amt`)) AS `total_due_premium`,`d`.`amt` AS `amt` from ((`co-operativebank-198`.`deposit_acc` `d` join `co-operativebank-198`.`voucher` `v`) join `co-operativebank-198`.`applicant` `a`) where ((`a`.`Acc_No` = `v`.`Acc_no`) and (`a`.`Acc_No` = `d`.`acc_no`) and (`v`.`Acc_no` = `d`.`acc_no`) and (`d`.`acc_type` = \'rd\') and (`d`.`status` = \'Active\')) group by `v`.`Acc_no`
