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