TYPE=VIEW
query=select `co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` AS `htcode`,if(((`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` = \'27000\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`main_head` = \'60000\')),(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`)),(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`))) AS `BAL`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` where ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`date` < \'2024-04-01\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17103\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17109\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17110\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17111\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17153\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17154\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17101\')) group by `co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` union all select \'17103\' AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` where ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`date` < \'2024-04-01\') and ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17103\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17109\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17110\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17111\'))) union all select \'17101\' AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` where ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`date` < \'2024-04-01\') and ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17101\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'171011\'))) union all select \'17154\' AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` where ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`date` < \'2024-04-01\') and ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17153\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17154\'))) union all select \'17153\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17154\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` 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-dekhaliannapurna`.`approciation`.`sub_head` AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`approciation`.`main_head` AS `htcode`,sum(`co-operativebank-dekhaliannapurna`.`approciation`.`amt`) AS `BAL`,`co-operativebank-dekhaliannapurna`.`approciation`.`head` AS `hcode` from `co-operativebank-dekhaliannapurna`.`approciation` where ((`co-operativebank-dekhaliannapurna`.`approciation`.`date` < \'2024-04-01\') and (`co-operativebank-dekhaliannapurna`.`approciation`.`amt` > 0)) group by `co-operativebank-dekhaliannapurna`.`approciation`.`sub_head`
md5=12a28c53ee081c4b17614680068e24a6
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2025-05-04 06:25:24
create-version=1
source=SELECT SHCODE,htcode,if(htcode=\'21000\' or htcode=\'23000\' or  htcode=\'27000\' or  `main_head`=\'60000\',(sum(`dr`) - sum(`cr`)),(sum(`cr`) - sum(`dr`))) as  BAL,hcode FROM headvoucher where date<\'2024-04-01\' and ((`headvoucher`.`shcode` <> \'17103\') and (`headvoucher`.`shcode` <> \'17109\') and (`headvoucher`.`shcode` <> \'17110\') and (`headvoucher`.`shcode` <> \'17111\') and (`headvoucher`.`shcode` <> \'17153\') and (`headvoucher`.`shcode` <> \'17154\') and (`headvoucher`.`shcode` <> \'17101\') ) group by shcode union all select \'17103\' AS `SHCODE`,htcode,(sum(`headvoucher`.`cr`) - sum(`headvoucher`.`dr`)) AS `BAL`,hcode from `headvoucher` where ((`headvoucher`.`date` < \'2024-04-01\') and ((`headvoucher`.`shcode` = \'17103\') or (`headvoucher`.`shcode` = \'17109\') or (`headvoucher`.`shcode` = \'17110\') or (`headvoucher`.`shcode` = \'17111\'))) union all select \'17101\' AS `SHCODE`,htcode,(sum(`headvoucher`.`cr`) - sum(`headvoucher`.`dr`)) AS `BAL`,hcode from `headvoucher` where ((`headvoucher`.`date` < \'2024-04-01\') and ((`headvoucher`.`shcode` = \'17101\') or (`headvoucher`.`shcode` = \'171011\'))) union all select \'17154\' AS `SHCODE`,htcode,(sum(`headvoucher`.`cr`) - sum(`headvoucher`.`dr`)) AS `BAL`,hcode from `headvoucher` where ((`headvoucher`.`date` < \'2024-04-01\') and ((`headvoucher`.`shcode` = \'17153\') or (`headvoucher`.`shcode` = \'17154\'))) union all select \'17153\' AS `SHCODE`,\'17000\' AS htcode,0 AS `BAL`,\'17100\' as hcode union all select \'17154\' AS `SHCODE`,\'17000\' AS htcode,0 AS `BAL`,\'17100\' as hcode 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 sub_head AS `SHCODE`,main_head AS htcode,sum(amt) AS `BAL`,head as hcode from approciation where date<\'2024-04-01\' and amt>0 group by sub_head
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` AS `htcode`,if(((`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` = \'21000\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` = \'23000\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` = \'27000\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`main_head` = \'60000\')),(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`)),(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`))) AS `BAL`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` where ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`date` < \'2024-04-01\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17103\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17109\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17110\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17111\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17153\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17154\') and (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` <> \'17101\')) group by `co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` union all select \'17103\' AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` where ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`date` < \'2024-04-01\') and ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17103\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17109\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17110\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17111\'))) union all select \'17101\' AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` where ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`date` < \'2024-04-01\') and ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17101\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'171011\'))) union all select \'17154\' AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`htcode` AS `htcode`,(sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`cr`) - sum(`co-operativebank-dekhaliannapurna`.`headvoucher`.`dr`)) AS `BAL`,`co-operativebank-dekhaliannapurna`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` where ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`date` < \'2024-04-01\') and ((`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17153\') or (`co-operativebank-dekhaliannapurna`.`headvoucher`.`shcode` = \'17154\'))) union all select \'17153\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17154\' AS `SHCODE`,\'17000\' AS `htcode`,0 AS `BAL`,\'17100\' AS `hcode` 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-dekhaliannapurna`.`approciation`.`sub_head` AS `SHCODE`,`co-operativebank-dekhaliannapurna`.`approciation`.`main_head` AS `htcode`,sum(`co-operativebank-dekhaliannapurna`.`approciation`.`amt`) AS `BAL`,`co-operativebank-dekhaliannapurna`.`approciation`.`head` AS `hcode` from `co-operativebank-dekhaliannapurna`.`approciation` where ((`co-operativebank-dekhaliannapurna`.`approciation`.`date` < \'2024-04-01\') and (`co-operativebank-dekhaliannapurna`.`approciation`.`amt` > 0)) group by `co-operativebank-dekhaliannapurna`.`approciation`.`sub_head`
