TYPE=VIEW
query=select `co-operativebank-kutubpur`.`headvoucher`.`shcode` AS `SHCODE`,`co-operativebank-kutubpur`.`headvoucher`.`htcode` AS `htcode`,if(((`co-operativebank-kutubpur`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-kutubpur`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-kutubpur`.`headvoucher`.`htcode` = \'27000\') or (`co-operativebank-kutubpur`.`headvoucher`.`main_head` = \'60000\')),(sum(`co-operativebank-kutubpur`.`headvoucher`.`dr`) - sum(`co-operativebank-kutubpur`.`headvoucher`.`cr`)),(sum(`co-operativebank-kutubpur`.`headvoucher`.`cr`) - sum(`co-operativebank-kutubpur`.`headvoucher`.`dr`))) AS `BAL`,`co-operativebank-kutubpur`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-kutubpur`.`headvoucher` where ((`co-operativebank-kutubpur`.`headvoucher`.`date` < \'2017-04-01\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17103\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17109\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17110\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17111\')) group by `co-operativebank-kutubpur`.`headvoucher`.`shcode` union all select \'17103\' AS `SHCODE`,`co-operativebank-kutubpur`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-kutubpur`.`headvoucher`.`cr`) - sum(`co-operativebank-kutubpur`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-kutubpur`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-kutubpur`.`headvoucher` where ((`co-operativebank-kutubpur`.`headvoucher`.`date` < \'2017-04-01\') and ((`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17103\') or (`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17109\') or (`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17110\') or (`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17111\'))) union all select \'17109\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17110\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17111\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` union all select `co-operativebank-kutubpur`.`approciation`.`sub_head` AS `SHCODE`,`co-operativebank-kutubpur`.`approciation`.`main_head` AS `htcode`,sum(`co-operativebank-kutubpur`.`approciation`.`amt`) AS `BAL`,`co-operativebank-kutubpur`.`approciation`.`head` AS `hcode` from `co-operativebank-kutubpur`.`approciation` where ((`co-operativebank-kutubpur`.`approciation`.`date` < \'2017-04-01\') and (`co-operativebank-kutubpur`.`approciation`.`amt` > 0)) group by `co-operativebank-kutubpur`.`approciation`.`sub_head`
md5=c69735d3acaaa0d1fc837ce28d3cde49
updatable=0
algorithm=0
definer_user=admin
definer_host=%
suid=1
with_check_option=0
timestamp=2021-08-20 14:29:19
create-version=1
source=select  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  AS  `SHCODE` ,\n `co-operativebank-kutubpur`.`headvoucher`.`htcode`  AS  `htcode` ,\nif( ( (  `co-operativebank-kutubpur`.`headvoucher`.`htcode`  =  \'21000\' ) or (  `co-operativebank-kutubpur`.`headvoucher`.`htcode`  =  \'23000\' ) or (  `co-operativebank-kutubpur`.`headvoucher`.`htcode`  =  \'27000\' ) or (  `co-operativebank-kutubpur`.`headvoucher`.`main_head`  =  \'60000\' ) ) ,\n( sum(  `co-operativebank-kutubpur`.`headvoucher`.`dr`  )  - sum(  `co-operativebank-kutubpur`.`headvoucher`.`cr`  )  ),\n( sum(  `co-operativebank-kutubpur`.`headvoucher`.`cr`  )  - sum(  `co-operativebank-kutubpur`.`headvoucher`.`dr`  )  ) ) AS  `BAL` ,\n `co-operativebank-kutubpur`.`headvoucher`.`hcode`  AS  `hcode`  from  `co-operativebank-kutubpur`.`headvoucher`  where ( (  `co-operativebank-kutubpur`.`headvoucher`.`date`  <  \'2017-04-01\' ) and (  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  <>  \'17103\' ) and (  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  <>  \'17109\' ) and (  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  <>  \'17110\' ) and (  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  <>  \'17111\' ) ) group  by  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  union  all  select  \'17103\' AS  `SHCODE` ,\n `co-operativebank-kutubpur`.`headvoucher`.`htcode`  AS  `htcode` ,\n( sum(  `co-operativebank-kutubpur`.`headvoucher`.`cr`  )  - sum(  `co-operativebank-kutubpur`.`headvoucher`.`dr`  )  ) AS  `BAL` ,\n `co-operativebank-kutubpur`.`headvoucher`.`hcode`  AS  `hcode`  from  `co-operativebank-kutubpur`.`headvoucher`  where ( (  `co-operativebank-kutubpur`.`headvoucher`.`date`  <  \'2017-04-01\' ) and ( (  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  =  \'17103\' ) or (  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  =  \'17109\' ) or (  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  =  \'17110\' ) or (  `co-operativebank-kutubpur`.`headvoucher`.`shcode`  =  \'17111\' ) ) ) union  all  select  \'17109\' AS  `SHCODE` ,\n \'17000\' AS  `htcode` ,\n0 AS  `BAL` ,\n \'17100\' AS  `hcode`  union  all  select  \'17110\' AS  `SHCODE` ,\n \'17000\' AS  `htcode` ,\n0 AS  `BAL` ,\n \'17100\' AS  `hcode`  union  all  select  \'17111\' AS  `SHCODE` ,\n \'17000\' AS  `htcode` ,\n0 AS  `BAL` ,\n \'17100\' AS  `hcode`  union  all  select  `co-operativebank-kutubpur`.`approciation`.`sub_head`  AS  `SHCODE` ,\n `co-operativebank-kutubpur`.`approciation`.`main_head`  AS  `htcode` ,\nsum(  `co-operativebank-kutubpur`.`approciation`.`amt`  )  AS  `BAL` ,\n `co-operativebank-kutubpur`.`approciation`.`head`  AS  `hcode`  from  `co-operativebank-kutubpur`.`approciation`  where ( (  `co-operativebank-kutubpur`.`approciation`.`date`  <  \'2017-04-01\' ) and (  `co-operativebank-kutubpur`.`approciation`.`amt`  >0 ) ) group  by  `co-operativebank-kutubpur`.`approciation`.`sub_head`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `co-operativebank-kutubpur`.`headvoucher`.`shcode` AS `SHCODE`,`co-operativebank-kutubpur`.`headvoucher`.`htcode` AS `htcode`,if(((`co-operativebank-kutubpur`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-kutubpur`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-kutubpur`.`headvoucher`.`htcode` = \'27000\') or (`co-operativebank-kutubpur`.`headvoucher`.`main_head` = \'60000\')),(sum(`co-operativebank-kutubpur`.`headvoucher`.`dr`) - sum(`co-operativebank-kutubpur`.`headvoucher`.`cr`)),(sum(`co-operativebank-kutubpur`.`headvoucher`.`cr`) - sum(`co-operativebank-kutubpur`.`headvoucher`.`dr`))) AS `BAL`,`co-operativebank-kutubpur`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-kutubpur`.`headvoucher` where ((`co-operativebank-kutubpur`.`headvoucher`.`date` < \'2017-04-01\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17103\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17109\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17110\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17111\')) group by `co-operativebank-kutubpur`.`headvoucher`.`shcode` union all select \'17103\' AS `SHCODE`,`co-operativebank-kutubpur`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-kutubpur`.`headvoucher`.`cr`) - sum(`co-operativebank-kutubpur`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-kutubpur`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-kutubpur`.`headvoucher` where ((`co-operativebank-kutubpur`.`headvoucher`.`date` < \'2017-04-01\') and ((`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17103\') or (`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17109\') or (`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17110\') or (`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17111\'))) union all select \'17109\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17110\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17111\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` union all select `co-operativebank-kutubpur`.`approciation`.`sub_head` AS `SHCODE`,`co-operativebank-kutubpur`.`approciation`.`main_head` AS `htcode`,sum(`co-operativebank-kutubpur`.`approciation`.`amt`) AS `BAL`,`co-operativebank-kutubpur`.`approciation`.`head` AS `hcode` from `co-operativebank-kutubpur`.`approciation` where ((`co-operativebank-kutubpur`.`approciation`.`date` < \'2017-04-01\') and (`co-operativebank-kutubpur`.`approciation`.`amt` > 0)) group by `co-operativebank-kutubpur`.`approciation`.`sub_head`
