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-243`.`borrowing` `b` join `co-operativebank-243`.`voucher` `v`) join `co-operativebank-243`.`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=659323cc82db10e31e184b4983fa83b6
updatable=0
algorithm=0
definer_user=admin
definer_host=%
suid=1
with_check_option=0
timestamp=2025-09-15 05:27:52
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-243`.`borrowing`  `b`  join  `co-operativebank-243`.`voucher`  `v`  ) join  `co-operativebank-243`.`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-243`.`borrowing` `b` join `co-operativebank-243`.`voucher` `v`) join `co-operativebank-243`.`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`
