TYPE=VIEW
query=select `co-operativebank-kutubpur`.`headvoucher`.`shcode` AS `SHCODE`,ifnull((sum(`co-operativebank-kutubpur`.`headvoucher`.`cr`) - sum(`co-operativebank-kutubpur`.`headvoucher`.`dr`)),0) AS `BAL`,`co-operativebank-kutubpur`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-kutubpur`.`headvoucher` where ((`co-operativebank-kutubpur`.`headvoucher`.`date` < \'2024-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\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17101\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'171011\')) group by `co-operativebank-kutubpur`.`headvoucher`.`shcode` union all select \'17101\' AS `SHCODE`,(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` < \'2024-04-01\') and ((`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17101\') or (`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'171011\'))) union all select \'17103\' AS `SHCODE`,(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` < \'2024-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`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17110\' AS `SHCODE`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17111\' AS `SHCODE`,0 AS `BAL`,\'17100\' AS `hcode` union all select `co-operativebank-kutubpur`.`approciation`.`sub_head` AS `SHCODE`,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` < \'2024-04-01\') group by `co-operativebank-kutubpur`.`approciation`.`sub_head`
md5=7e5ea30da4cdc10859aa405a83a27d5e
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2025-06-11 05:34:32
create-version=1
source=SELECT SHCODE,ifnull((sum(cr)-sum(dr)),0) 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 `shcode` <> \'17101\' and `shcode` <> \'171011\') group by shcode union all select \'17101\' AS `SHCODE`,(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 \'17103\' AS `SHCODE`,(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 \'17109\' AS `SHCODE`,0 AS `BAL`,\'17100\' as hcode union all select \'17110\' AS `SHCODE`,0 AS `BAL`,\'17100\' as hcode union all select \'17111\' AS `SHCODE`,0 AS `BAL`,\'17100\' as hcode  union all select sub_head AS `SHCODE`,	sum(amt) as  `BAL`, head as hcode from approciation where date<\'2024-04-01\'  group by sub_head
client_cs_name=utf8mb4
connection_cl_name=utf8mb4_general_ci
view_body_utf8=select `co-operativebank-kutubpur`.`headvoucher`.`shcode` AS `SHCODE`,ifnull((sum(`co-operativebank-kutubpur`.`headvoucher`.`cr`) - sum(`co-operativebank-kutubpur`.`headvoucher`.`dr`)),0) AS `BAL`,`co-operativebank-kutubpur`.`headvoucher`.`hcode` AS `hcode` from `co-operativebank-kutubpur`.`headvoucher` where ((`co-operativebank-kutubpur`.`headvoucher`.`date` < \'2024-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\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'17101\') and (`co-operativebank-kutubpur`.`headvoucher`.`shcode` <> \'171011\')) group by `co-operativebank-kutubpur`.`headvoucher`.`shcode` union all select \'17101\' AS `SHCODE`,(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` < \'2024-04-01\') and ((`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'17101\') or (`co-operativebank-kutubpur`.`headvoucher`.`shcode` = \'171011\'))) union all select \'17103\' AS `SHCODE`,(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` < \'2024-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`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17110\' AS `SHCODE`,0 AS `BAL`,\'17100\' AS `hcode` union all select \'17111\' AS `SHCODE`,0 AS `BAL`,\'17100\' AS `hcode` union all select `co-operativebank-kutubpur`.`approciation`.`sub_head` AS `SHCODE`,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` < \'2024-04-01\') group by `co-operativebank-kutubpur`.`approciation`.`sub_head`
