TYPE=VIEW
query=select if(((sum(`h1`.`dr`) - sum(`h1`.`cr`)) > -(100000)),(sum(`h1`.`dr`) - sum(`h1`.`cr`)),0) AS `mb`,if(((select if((sum(`h2`.`dr`) > 0),sum(`h2`.`dr`),0) AS `ln1` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h2` where ((`h2`.`htcode` = `h1`.`htcode`) and (`h2`.`htcode` = \'24000\') and (`h2`.`date` >= \'2024-04-01\') and (`h2`.`date` <= \'2025-03-31\')) group by `h2`.`htcode`) > 0),(select if((sum(`h2`.`dr`) > 0),sum(`h2`.`dr`),0) AS `ln1` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h2` where ((`h2`.`htcode` = `h1`.`htcode`) and (`h2`.`htcode` = \'24000\') and (`h2`.`date` >= \'2024-04-01\') and (`h2`.`date` <= \'2025-03-31\')) group by `h2`.`htcode`),0) AS `mb1`,\'51400\' AS `hcode`,(`h1`.`htcode` + 27000) AS `htcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h1` where ((`h1`.`htcode` = \'24000\') and (`h1`.`date` <= \'2024-03-31\') and (`h1`.`acc_no` <> \'\')) group by `h1`.`htcode`
md5=1d6522058942bf58ea91286cb485d95d
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2026-04-15 11:30:13
create-version=1
source=select if(sum(h1.dr)-sum(h1.cr)>-100000,sum(h1.dr)-sum(h1.cr),0) mb,if((select if(((sum(`h2`.`dr`) ) > 0),(sum(`h2`.`dr`) ),0) AS `ln1` from `headvoucher` `h2` where ((`h2`.`htcode` = `h1`.`htcode`) and h2.htcode=\'24000\' and (`h2`.`date` >= \'2024-04-01\') and (`h2`.`date` <= \'2025-03-31\')) group by `h2`.`htcode`)>0,(select if(((sum(`h2`.`dr`) ) > 0),(sum(`h2`.`dr`)),0) AS `ln1` from `headvoucher` `h2` where ((`h2`.`htcode` = `h1`.`htcode`) and h2.htcode=\'24000\' and (`h2`.`date` >= \'2024-04-01\') and (`h2`.`date` <= \'2025-03-31\')) group by `h2`.`htcode`),0) AS `mb1`,\'51400\' hcode, (h1.htcode+27000) as htcode from headvoucher h1 where  h1.htcode=\'24000\' and h1.date<=\'2024-03-31\' and acc_no<>\'\' group by htcode
client_cs_name=utf8mb4
connection_cl_name=utf8mb4_general_ci
view_body_utf8=select if(((sum(`h1`.`dr`) - sum(`h1`.`cr`)) > -(100000)),(sum(`h1`.`dr`) - sum(`h1`.`cr`)),0) AS `mb`,if(((select if((sum(`h2`.`dr`) > 0),sum(`h2`.`dr`),0) AS `ln1` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h2` where ((`h2`.`htcode` = `h1`.`htcode`) and (`h2`.`htcode` = \'24000\') and (`h2`.`date` >= \'2024-04-01\') and (`h2`.`date` <= \'2025-03-31\')) group by `h2`.`htcode`) > 0),(select if((sum(`h2`.`dr`) > 0),sum(`h2`.`dr`),0) AS `ln1` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h2` where ((`h2`.`htcode` = `h1`.`htcode`) and (`h2`.`htcode` = \'24000\') and (`h2`.`date` >= \'2024-04-01\') and (`h2`.`date` <= \'2025-03-31\')) group by `h2`.`htcode`),0) AS `mb1`,\'51400\' AS `hcode`,(`h1`.`htcode` + 27000) AS `htcode` from `co-operativebank-dekhaliannapurna`.`headvoucher` `h1` where ((`h1`.`htcode` = \'24000\') and (`h1`.`date` <= \'2024-03-31\') and (`h1`.`acc_no` <> \'\')) group by `h1`.`htcode`
