TYPE=VIEW
query=select (((select sum(`co-operativebank-henria`.`headvoucher`.`cr`) AS `bal` from `co-operativebank-henria`.`headvoucher` USE INDEX (`by_date`) USE INDEX (`by_main_head`) USE INDEX (`by_type`) USE INDEX (`by_htcode`) where (((`co-operativebank-henria`.`headvoucher`.`type` = \'CASH\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'11000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'13000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'14000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-henria`.`headvoucher`.`main_head` = \'50000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'41000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'42000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'43000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'44000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'46000\') or (`co-operativebank-henria`.`headvoucher`.`main_head` = \'60000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'34000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'35000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'37000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'32000\')) and (`co-operativebank-henria`.`headvoucher`.`htcode` <> \'64000\') and (`co-operativebank-henria`.`headvoucher`.`date` <= curdate()))) - (select sum(`co-operativebank-henria`.`headvoucher`.`dr`) AS `bal` from `co-operativebank-henria`.`headvoucher` USE INDEX (`by_date`) USE INDEX (`by_main_head`) USE INDEX (`by_type`) USE INDEX (`by_htcode`) where (((`co-operativebank-henria`.`headvoucher`.`type` = \'CASH\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'11000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'13000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'14000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-henria`.`headvoucher`.`main_head` = \'60000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'34000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'35000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'37000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'32000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-henria`.`headvoucher`.`main_head` = \'50000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'41000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'42000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'43000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'44000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-henria`.`headvoucher`.`htcode` <> \'64000\') and (`co-operativebank-henria`.`headvoucher`.`date` <= curdate())))) - (select (sum(`co-operativebank-henria`.`headvoucher`.`cr`) - sum(`co-operativebank-henria`.`headvoucher`.`dr`)) AS `bal` from `co-operativebank-henria`.`headvoucher` USE INDEX (`by_date`) USE INDEX (`by_main_head`) USE INDEX (`by_type`) USE INDEX (`by_htcode`) where (((`co-operativebank-henria`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'22000\')) and (`co-operativebank-henria`.`headvoucher`.`date` <= curdate())))) AS `opbal`
md5=fc2f417fea3fb8c1234eefce1c781137
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2022-05-19 03:36:39
create-version=1
source=SELECT ((SELECT  SUM( cr )  bal FROM headvoucher USE INDEX (by_htcode,by_type,by_main_head,by_date) WHERE ( type=\'CASH\' or htcode =  \'11000\' OR htcode =  \'13000\' OR htcode =  \'14000\' OR htcode = \'21000\' OR htcode =  \'23000\' OR main_head =  \'50000\' OR htcode =  \'41000\' OR htcode =  \'42000\' OR htcode =  \'43000\' OR htcode =  \'44000\' OR htcode =  \'46000\' OR main_head =  \'60000\' OR htcode =  \'34000\' OR htcode =  \'35000\' OR htcode =  \'37000\' OR htcode =  \'32000\'  ) and htcode<>\'64000\'  AND DATE <=CURDATE() )- ( SELECT  SUM( dr )  bal FROM headvoucher USE INDEX (by_htcode,by_type,by_main_head,by_date) WHERE ( type=\'CASH\'  or htcode =  \'11000\' OR htcode =  \'13000\' OR htcode =  \'14000\' OR htcode =  \'23000\' OR main_head =  \'60000\' OR htcode =  \'34000\' OR htcode =  \'35000\' OR htcode =  \'37000\' OR htcode =  \'32000\'   OR htcode = \'21000\' OR main_head =  \'50000\' OR htcode =  \'41000\' OR htcode =  \'42000\' OR htcode =  \'43000\' OR htcode =  \'44000\' OR htcode =  \'46000\' ) and htcode<>\'64000\'  AND DATE <=CURDATE() ) - (SELECT  SUM( cr ) - SUM( dr )  bal FROM headvoucher USE INDEX (by_htcode,by_type,by_main_head,by_date) WHERE ( htcode =  \'28000\' OR htcode =  \'22000\' ) AND DATE <=CURDATE())) as opbal
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select (((select sum(`co-operativebank-henria`.`headvoucher`.`cr`) AS `bal` from `co-operativebank-henria`.`headvoucher` USE INDEX (`by_date`) USE INDEX (`by_main_head`) USE INDEX (`by_type`) USE INDEX (`by_htcode`) where (((`co-operativebank-henria`.`headvoucher`.`type` = \'CASH\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'11000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'13000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'14000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-henria`.`headvoucher`.`main_head` = \'50000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'41000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'42000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'43000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'44000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'46000\') or (`co-operativebank-henria`.`headvoucher`.`main_head` = \'60000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'34000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'35000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'37000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'32000\')) and (`co-operativebank-henria`.`headvoucher`.`htcode` <> \'64000\') and (`co-operativebank-henria`.`headvoucher`.`date` <= curdate()))) - (select sum(`co-operativebank-henria`.`headvoucher`.`dr`) AS `bal` from `co-operativebank-henria`.`headvoucher` USE INDEX (`by_date`) USE INDEX (`by_main_head`) USE INDEX (`by_type`) USE INDEX (`by_htcode`) where (((`co-operativebank-henria`.`headvoucher`.`type` = \'CASH\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'11000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'13000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'14000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-henria`.`headvoucher`.`main_head` = \'60000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'34000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'35000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'37000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'32000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-henria`.`headvoucher`.`main_head` = \'50000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'41000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'42000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'43000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'44000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-henria`.`headvoucher`.`htcode` <> \'64000\') and (`co-operativebank-henria`.`headvoucher`.`date` <= curdate())))) - (select (sum(`co-operativebank-henria`.`headvoucher`.`cr`) - sum(`co-operativebank-henria`.`headvoucher`.`dr`)) AS `bal` from `co-operativebank-henria`.`headvoucher` USE INDEX (`by_date`) USE INDEX (`by_main_head`) USE INDEX (`by_type`) USE INDEX (`by_htcode`) where (((`co-operativebank-henria`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-henria`.`headvoucher`.`htcode` = \'22000\')) and (`co-operativebank-henria`.`headvoucher`.`date` <= curdate())))) AS `opbal`
