TYPE=VIEW
query=select `ht`.`code` AS `code`,`ht`.`head_type` AS `head_type`,if(((`ht`.`code` <> \'22000\') and (`ht`.`code` <> \'28000\')),(sum(`v`.`dr`) - sum(`v`.`cr`)),(sum(`v`.`cr`) - sum(`v`.`dr`))) AS `bal` from (((`co-club`.`voucher` `v` join `co-club`.`sub_head` `sh`) join `co-club`.`head` `h`) join `co-club`.`head_type` `ht`) where ((`v`.`sub_head` = `sh`.`code`) and (`sh`.`head` = `h`.`code`) and (`h`.`head_type` = `ht`.`code`) and (`v`.`sub_head` >= \'19000\') and (`v`.`sub_head` < \'30000\') and (`v`.`date` < \'2016-04-01\')) group by `ht`.`code`
md5=64b1b2271c469d9cf3102d0db87a3dda
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=1
with_check_option=0
timestamp=2018-11-01 09:34:21
create-version=1
source=select  `ht`.`code`  AS  `code` ,\n `ht`.`head_type`  AS  `head_type` ,\nif( ( (  `ht`.`code`  <>  \'22000\' ) and (  `ht`.`code`  <>  \'28000\' ) ) ,\n( sum(  `v`.`dr`  )  - sum(  `v`.`cr`  )  ),\n( sum(  `v`.`cr`  )  - sum(  `v`.`dr`  )  ) ) AS  `bal`  from ( ( (  `co-club`.`voucher`  `v`  join  `co-club`.`sub_head`  `sh`  ) join  `co-club`.`head`  `h`  ) join  `co-club`.`head_type`  `ht`  ) where ( (  `v`.`sub_head`  =  `sh`.`code`  ) and (  `sh`.`head`  =  `h`.`code`  ) and (  `h`.`head_type`  =  `ht`.`code`  ) and (  `v`.`sub_head`  >=  \'19000\' ) and (  `v`.`sub_head`  <  \'30000\' ) and (  `v`.`date`  <  \'2016-04-01\' ) ) group  by  `ht`.`code`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `ht`.`code` AS `code`,`ht`.`head_type` AS `head_type`,if(((`ht`.`code` <> \'22000\') and (`ht`.`code` <> \'28000\')),(sum(`v`.`dr`) - sum(`v`.`cr`)),(sum(`v`.`cr`) - sum(`v`.`dr`))) AS `bal` from (((`co-club`.`voucher` `v` join `co-club`.`sub_head` `sh`) join `co-club`.`head` `h`) join `co-club`.`head_type` `ht`) where ((`v`.`sub_head` = `sh`.`code`) and (`sh`.`head` = `h`.`code`) and (`h`.`head_type` = `ht`.`code`) and (`v`.`sub_head` >= \'19000\') and (`v`.`sub_head` < \'30000\') and (`v`.`date` < \'2016-04-01\')) group by `ht`.`code`
