TYPE=VIEW
query=select `co-operativebank-simuldari`.`headvoucher`.`shcode` AS `SHCODE`,`co-operativebank-simuldari`.`headvoucher`.`htcode` AS `htcode`,if(((`co-operativebank-simuldari`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-simuldari`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-simuldari`.`headvoucher`.`htcode` = \'27000\') or (`co-operativebank-simuldari`.`headvoucher`.`main_head` = \'60000\')),(sum(`co-operativebank-simuldari`.`headvoucher`.`dr`) - sum(`co-operativebank-simuldari`.`headvoucher`.`cr`)),(sum(`co-operativebank-simuldari`.`headvoucher`.`cr`) - sum(`co-operativebank-simuldari`.`headvoucher`.`dr`))) AS `BAL`,`co-operativebank-simuldari`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-simuldari`.`headvoucher` where ((`co-operativebank-simuldari`.`headvoucher`.`date` < \'2017-04-01\') and (`co-operativebank-simuldari`.`headvoucher`.`shcode` <> \'17103\') and (`co-operativebank-simuldari`.`headvoucher`.`shcode` <> \'17109\') and (`co-operativebank-simuldari`.`headvoucher`.`shcode` <> \'17110\') and (`co-operativebank-simuldari`.`headvoucher`.`shcode` <> \'17111\')) group by `co-operativebank-simuldari`.`headvoucher`.`shcode` union all select \'17103\' AS `SHCODE`,`co-operativebank-simuldari`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-simuldari`.`headvoucher`.`cr`) - sum(`co-operativebank-simuldari`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-simuldari`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-simuldari`.`headvoucher` where ((`co-operativebank-simuldari`.`headvoucher`.`date` < \'2017-04-01\') and ((`co-operativebank-simuldari`.`headvoucher`.`shcode` = \'17103\') or (`co-operativebank-simuldari`.`headvoucher`.`shcode` = \'17109\') or (`co-operativebank-simuldari`.`headvoucher`.`shcode` = \'17110\') or (`co-operativebank-simuldari`.`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-simuldari`.`approciation`.`sub_head` AS `SHCODE`,`co-operativebank-simuldari`.`approciation`.`main_head` AS `htcode`,sum(`co-operativebank-simuldari`.`approciation`.`amt`) AS `BAL`,`co-operativebank-simuldari`.`approciation`.`head` AS `hcode` from `co-operativebank-simuldari`.`approciation` where ((`co-operativebank-simuldari`.`approciation`.`date` < \'2017-04-01\') and (`co-operativebank-simuldari`.`approciation`.`amt` > 0)) group by `co-operativebank-simuldari`.`approciation`.`sub_head`
md5=899c5cfe77c18a59eecb0b7f6dc1b216
updatable=0
algorithm=0
definer_user=admin
definer_host=%
suid=1
with_check_option=0
timestamp=2021-07-22 15:12:29
create-version=1
source=select  `co-operativebank-simuldari`.`headvoucher`.`shcode`  AS  `SHCODE` ,\n `co-operativebank-simuldari`.`headvoucher`.`htcode`  AS  `htcode` ,\nif( ( (  `co-operativebank-simuldari`.`headvoucher`.`htcode`  =  \'21000\' ) or (  `co-operativebank-simuldari`.`headvoucher`.`htcode`  =  \'23000\' ) or (  `co-operativebank-simuldari`.`headvoucher`.`htcode`  =  \'27000\' ) or (  `co-operativebank-simuldari`.`headvoucher`.`main_head`  =  \'60000\' ) ) ,\n( sum(  `co-operativebank-simuldari`.`headvoucher`.`dr`  )  - sum(  `co-operativebank-simuldari`.`headvoucher`.`cr`  )  ),\n( sum(  `co-operativebank-simuldari`.`headvoucher`.`cr`  )  - sum(  `co-operativebank-simuldari`.`headvoucher`.`dr`  )  ) ) AS  `BAL` ,\n `co-operativebank-simuldari`.`headvoucher`.`hcode`  AS  `hcode`  from  `co-operativebank-simuldari`.`headvoucher`  where ( (  `co-operativebank-simuldari`.`headvoucher`.`date`  <  \'2017-04-01\' ) and (  `co-operativebank-simuldari`.`headvoucher`.`shcode`  <>  \'17103\' ) and (  `co-operativebank-simuldari`.`headvoucher`.`shcode`  <>  \'17109\' ) and (  `co-operativebank-simuldari`.`headvoucher`.`shcode`  <>  \'17110\' ) and (  `co-operativebank-simuldari`.`headvoucher`.`shcode`  <>  \'17111\' ) ) group  by  `co-operativebank-simuldari`.`headvoucher`.`shcode`  union  all  select  \'17103\' AS  `SHCODE` ,\n `co-operativebank-simuldari`.`headvoucher`.`htcode`  AS  `htcode` ,\n( sum(  `co-operativebank-simuldari`.`headvoucher`.`cr`  )  - sum(  `co-operativebank-simuldari`.`headvoucher`.`dr`  )  ) AS  `BAL` ,\n `co-operativebank-simuldari`.`headvoucher`.`hcode`  AS  `hcode`  from  `co-operativebank-simuldari`.`headvoucher`  where ( (  `co-operativebank-simuldari`.`headvoucher`.`date`  <  \'2017-04-01\' ) and ( (  `co-operativebank-simuldari`.`headvoucher`.`shcode`  =  \'17103\' ) or (  `co-operativebank-simuldari`.`headvoucher`.`shcode`  =  \'17109\' ) or (  `co-operativebank-simuldari`.`headvoucher`.`shcode`  =  \'17110\' ) or (  `co-operativebank-simuldari`.`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-simuldari`.`approciation`.`sub_head`  AS  `SHCODE` ,\n `co-operativebank-simuldari`.`approciation`.`main_head`  AS  `htcode` ,\nsum(  `co-operativebank-simuldari`.`approciation`.`amt`  )  AS  `BAL` ,\n `co-operativebank-simuldari`.`approciation`.`head`  AS  `hcode`  from  `co-operativebank-simuldari`.`approciation`  where ( (  `co-operativebank-simuldari`.`approciation`.`date`  <  \'2017-04-01\' ) and (  `co-operativebank-simuldari`.`approciation`.`amt`  >0 ) ) group  by  `co-operativebank-simuldari`.`approciation`.`sub_head`
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `co-operativebank-simuldari`.`headvoucher`.`shcode` AS `SHCODE`,`co-operativebank-simuldari`.`headvoucher`.`htcode` AS `htcode`,if(((`co-operativebank-simuldari`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-simuldari`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-simuldari`.`headvoucher`.`htcode` = \'27000\') or (`co-operativebank-simuldari`.`headvoucher`.`main_head` = \'60000\')),(sum(`co-operativebank-simuldari`.`headvoucher`.`dr`) - sum(`co-operativebank-simuldari`.`headvoucher`.`cr`)),(sum(`co-operativebank-simuldari`.`headvoucher`.`cr`) - sum(`co-operativebank-simuldari`.`headvoucher`.`dr`))) AS `BAL`,`co-operativebank-simuldari`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-simuldari`.`headvoucher` where ((`co-operativebank-simuldari`.`headvoucher`.`date` < \'2017-04-01\') and (`co-operativebank-simuldari`.`headvoucher`.`shcode` <> \'17103\') and (`co-operativebank-simuldari`.`headvoucher`.`shcode` <> \'17109\') and (`co-operativebank-simuldari`.`headvoucher`.`shcode` <> \'17110\') and (`co-operativebank-simuldari`.`headvoucher`.`shcode` <> \'17111\')) group by `co-operativebank-simuldari`.`headvoucher`.`shcode` union all select \'17103\' AS `SHCODE`,`co-operativebank-simuldari`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-simuldari`.`headvoucher`.`cr`) - sum(`co-operativebank-simuldari`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-simuldari`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-simuldari`.`headvoucher` where ((`co-operativebank-simuldari`.`headvoucher`.`date` < \'2017-04-01\') and ((`co-operativebank-simuldari`.`headvoucher`.`shcode` = \'17103\') or (`co-operativebank-simuldari`.`headvoucher`.`shcode` = \'17109\') or (`co-operativebank-simuldari`.`headvoucher`.`shcode` = \'17110\') or (`co-operativebank-simuldari`.`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-simuldari`.`approciation`.`sub_head` AS `SHCODE`,`co-operativebank-simuldari`.`approciation`.`main_head` AS `htcode`,sum(`co-operativebank-simuldari`.`approciation`.`amt`) AS `BAL`,`co-operativebank-simuldari`.`approciation`.`head` AS `hcode` from `co-operativebank-simuldari`.`approciation` where ((`co-operativebank-simuldari`.`approciation`.`date` < \'2017-04-01\') and (`co-operativebank-simuldari`.`approciation`.`amt` > 0)) group by `co-operativebank-simuldari`.`approciation`.`sub_head`
