TYPE=VIEW
query=select `sh`.`sub_head` AS `sub_head`,`b`.`date` AS `open_date`,`b`.`code` AS `acc_no`,`b`.`Amt` AS `amt`,(sum(`v`.`cr`) - sum(`v`.`dr`)) AS `cler_bal`,`b`.`interest` AS `interest`,round((((sum(`v`.`cr`) - sum(`v`.`dr`)) * (timestampdiff(DAY,max(`v`.`date`),\'2018-05-15\') / 365)) * (`b`.`interest` / 100)),0) AS `Int_pay`,timestampdiff(DAY,max(`v`.`date`),\'2018-05-15\') AS `days` from ((`co-operativebank-242`.`borrowing` `b` join `co-operativebank-242`.`voucher` `v`) join `co-operativebank-242`.`sub_head` `sh`) where ((`v`.`Acc_no` = `b`.`code`) and (`sh`.`code` = `v`.`sub_head`) and (`sh`.`code` = `b`.`sub_head`) and (`v`.`date` <= \'2018-05-14\')) group by `b`.`code`
md5=371513f035d5cf96defe4423a61d3439
updatable=0
algorithm=0
definer_user=admin
definer_host=%
suid=1
with_check_option=0
timestamp=2025-09-15 05:24:25
create-version=1
source=select  `sh`.`sub_head`  AS  `sub_head` ,\n `b`.`date`  AS  `open_date` ,\n `b`.`code`  AS  `acc_no` ,\n `b`.`Amt`  AS  `amt` ,\n( sum(  `v`.`cr`  )  - sum(  `v`.`dr`  )  ) AS  `cler_bal` ,\n `b`.`interest`  AS  `interest` ,\nround( ( ( ( sum(  `v`.`cr`  )  - sum(  `v`.`dr`  )  )  * ( timestampdiff(  DAY , max(  `v`.`date`  ) ,  \'2018-05-15\'  )  /365  )  ) * (  `b`.`interest`  /100  )  ),\n0 ) AS  `Int_pay` ,\ntimestampdiff(  DAY , max(  `v`.`date`  ) ,  \'2018-05-15\'  )  AS  `days`  from ( (  `co-operativebank-242`.`borrowing`  `b`  join  `co-operativebank-242`.`voucher`  `v`  ) join  `co-operativebank-242`.`sub_head`  `sh`  ) where ( (  `v`.`Acc_no`  =  `b`.`code`  ) and (  `sh`.`code`  =  `v`.`sub_head`  ) and (  `sh`.`code`  =  `b`.`sub_head`  ) and (  `v`.`date`  <=  \'2018-05-14\' ) ) group  by  `b`.`code`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `sh`.`sub_head` AS `sub_head`,`b`.`date` AS `open_date`,`b`.`code` AS `acc_no`,`b`.`Amt` AS `amt`,(sum(`v`.`cr`) - sum(`v`.`dr`)) AS `cler_bal`,`b`.`interest` AS `interest`,round((((sum(`v`.`cr`) - sum(`v`.`dr`)) * (timestampdiff(DAY,max(`v`.`date`),\'2018-05-15\') / 365)) * (`b`.`interest` / 100)),0) AS `Int_pay`,timestampdiff(DAY,max(`v`.`date`),\'2018-05-15\') AS `days` from ((`co-operativebank-242`.`borrowing` `b` join `co-operativebank-242`.`voucher` `v`) join `co-operativebank-242`.`sub_head` `sh`) where ((`v`.`Acc_no` = `b`.`code`) and (`sh`.`code` = `v`.`sub_head`) and (`sh`.`code` = `b`.`sub_head`) and (`v`.`date` <= \'2018-05-14\')) group by `b`.`code`
