TYPE=VIEW
query=select `co-operativebank-243`.`voucher`.`sub_head` AS `sub_head`,`co-operativebank-243`.`head`.`code` AS `code`,`co-operativebank-243`.`head_type`.`code` AS `head_type`,(sum(`co-operativebank-243`.`voucher`.`dr`) - sum(`co-operativebank-243`.`voucher`.`cr`)) AS `bal` from (((`co-operativebank-243`.`voucher` join `co-operativebank-243`.`sub_head`) join `co-operativebank-243`.`head`) join `co-operativebank-243`.`head_type`) where ((`co-operativebank-243`.`voucher`.`sub_head` = `co-operativebank-243`.`sub_head`.`code`) and (`co-operativebank-243`.`sub_head`.`head` = `co-operativebank-243`.`head`.`code`) and (`co-operativebank-243`.`head`.`head_type` = `co-operativebank-243`.`head_type`.`code`) and (((`co-operativebank-243`.`voucher`.`sub_head` > \'60000\') and (`co-operativebank-243`.`voucher`.`sub_head` < \'70000\')) or (`co-operativebank-243`.`head_type`.`code` = \'23000\') or (`co-operativebank-243`.`head_type`.`code` = \'21000\')) and (`co-operativebank-243`.`voucher`.`date` < \'2016-04-01\')) group by `co-operativebank-243`.`voucher`.`sub_head` union all select `co-operativebank-243`.`voucher`.`sub_head` AS `sub_head`,`co-operativebank-243`.`head`.`code` AS `code`,`co-operativebank-243`.`head_type`.`code` AS `head_type`,(sum(`co-operativebank-243`.`voucher`.`cr`) - sum(`co-operativebank-243`.`voucher`.`dr`)) AS `(sum(cr)-sum(dr))` from (((`co-operativebank-243`.`voucher` join `co-operativebank-243`.`sub_head`) join `co-operativebank-243`.`head`) join `co-operativebank-243`.`head_type`) where ((`co-operativebank-243`.`voucher`.`sub_head` = `co-operativebank-243`.`sub_head`.`code`) and (`co-operativebank-243`.`sub_head`.`head` = `co-operativebank-243`.`head`.`code`) and (`co-operativebank-243`.`head`.`head_type` = `co-operativebank-243`.`head_type`.`code`) and (`co-operativebank-243`.`voucher`.`date` < \'2016-04-01\') and ((`co-operativebank-243`.`head_type`.`code` = \'22000\') or (`co-operativebank-243`.`head_type`.`code` = \'28000\'))) group by `co-operativebank-243`.`voucher`.`sub_head`
md5=eaa07c0efa07feb6c7fb01470bf6c623
updatable=0
algorithm=0
definer_user=admin
definer_host=%
suid=1
with_check_option=0
timestamp=2025-09-15 05:28:03
create-version=1
source=select  `co-operativebank-243`.`voucher`.`sub_head`  AS  `sub_head` ,\n `co-operativebank-243`.`head`.`code`  AS  `code` ,\n `co-operativebank-243`.`head_type`.`code`  AS  `head_type` ,\n( sum(  `co-operativebank-243`.`voucher`.`dr`  )  - sum(  `co-operativebank-243`.`voucher`.`cr`  )  ) AS  `bal`  from ( ( (  `co-operativebank-243`.`voucher`  join  `co-operativebank-243`.`sub_head`  ) join  `co-operativebank-243`.`head`  ) join  `co-operativebank-243`.`head_type`  ) where ( (  `co-operativebank-243`.`voucher`.`sub_head`  =  `co-operativebank-243`.`sub_head`.`code`  ) and (  `co-operativebank-243`.`sub_head`.`head`  =  `co-operativebank-243`.`head`.`code`  ) and (  `co-operativebank-243`.`head`.`head_type`  =  `co-operativebank-243`.`head_type`.`code`  ) and ( ( (  `co-operativebank-243`.`voucher`.`sub_head`  >  \'60000\' ) and (  `co-operativebank-243`.`voucher`.`sub_head`  <  \'70000\' ) ) or (  `co-operativebank-243`.`head_type`.`code`  =  \'23000\' ) or (  `co-operativebank-243`.`head_type`.`code`  =  \'21000\' ) ) and (  `co-operativebank-243`.`voucher`.`date`  <  \'2016-04-01\' ) ) group  by  `co-operativebank-243`.`voucher`.`sub_head`  union  all  select  `co-operativebank-243`.`voucher`.`sub_head`  AS  `sub_head` ,\n `co-operativebank-243`.`head`.`code`  AS  `code` ,\n `co-operativebank-243`.`head_type`.`code`  AS  `head_type` ,\n( sum(  `co-operativebank-243`.`voucher`.`cr`  )  - sum(  `co-operativebank-243`.`voucher`.`dr`  )  ) AS  `(sum(cr)-sum(dr))`  from ( ( (  `co-operativebank-243`.`voucher`  join  `co-operativebank-243`.`sub_head`  ) join  `co-operativebank-243`.`head`  ) join  `co-operativebank-243`.`head_type`  ) where ( (  `co-operativebank-243`.`voucher`.`sub_head`  =  `co-operativebank-243`.`sub_head`.`code`  ) and (  `co-operativebank-243`.`sub_head`.`head`  =  `co-operativebank-243`.`head`.`code`  ) and (  `co-operativebank-243`.`head`.`head_type`  =  `co-operativebank-243`.`head_type`.`code`  ) and (  `co-operativebank-243`.`voucher`.`date`  <  \'2016-04-01\' ) and ( (  `co-operativebank-243`.`head_type`.`code`  =  \'22000\' ) or (  `co-operativebank-243`.`head_type`.`code`  =  \'28000\' ) ) ) group  by  `co-operativebank-243`.`voucher`.`sub_head`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `co-operativebank-243`.`voucher`.`sub_head` AS `sub_head`,`co-operativebank-243`.`head`.`code` AS `code`,`co-operativebank-243`.`head_type`.`code` AS `head_type`,(sum(`co-operativebank-243`.`voucher`.`dr`) - sum(`co-operativebank-243`.`voucher`.`cr`)) AS `bal` from (((`co-operativebank-243`.`voucher` join `co-operativebank-243`.`sub_head`) join `co-operativebank-243`.`head`) join `co-operativebank-243`.`head_type`) where ((`co-operativebank-243`.`voucher`.`sub_head` = `co-operativebank-243`.`sub_head`.`code`) and (`co-operativebank-243`.`sub_head`.`head` = `co-operativebank-243`.`head`.`code`) and (`co-operativebank-243`.`head`.`head_type` = `co-operativebank-243`.`head_type`.`code`) and (((`co-operativebank-243`.`voucher`.`sub_head` > \'60000\') and (`co-operativebank-243`.`voucher`.`sub_head` < \'70000\')) or (`co-operativebank-243`.`head_type`.`code` = \'23000\') or (`co-operativebank-243`.`head_type`.`code` = \'21000\')) and (`co-operativebank-243`.`voucher`.`date` < \'2016-04-01\')) group by `co-operativebank-243`.`voucher`.`sub_head` union all select `co-operativebank-243`.`voucher`.`sub_head` AS `sub_head`,`co-operativebank-243`.`head`.`code` AS `code`,`co-operativebank-243`.`head_type`.`code` AS `head_type`,(sum(`co-operativebank-243`.`voucher`.`cr`) - sum(`co-operativebank-243`.`voucher`.`dr`)) AS `(sum(cr)-sum(dr))` from (((`co-operativebank-243`.`voucher` join `co-operativebank-243`.`sub_head`) join `co-operativebank-243`.`head`) join `co-operativebank-243`.`head_type`) where ((`co-operativebank-243`.`voucher`.`sub_head` = `co-operativebank-243`.`sub_head`.`code`) and (`co-operativebank-243`.`sub_head`.`head` = `co-operativebank-243`.`head`.`code`) and (`co-operativebank-243`.`head`.`head_type` = `co-operativebank-243`.`head_type`.`code`) and (`co-operativebank-243`.`voucher`.`date` < \'2016-04-01\') and ((`co-operativebank-243`.`head_type`.`code` = \'22000\') or (`co-operativebank-243`.`head_type`.`code` = \'28000\'))) group by `co-operativebank-243`.`voucher`.`sub_head`
