TYPE=VIEW
query=select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`cr`) - sum(`v`.`dr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank-purbadekhali`.`voucher` `v` where (((`v`.`head` = \'14100\') or (`v`.`head` = \'14200\') or (`v`.`head` = \'14300\')) and (`v`.`date` <= \'2025-09-03\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no` union all select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`dr`) - sum(`v`.`cr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank-purbadekhali`.`voucher` `v` where (((`v`.`head` = \'23300\') or (`v`.`head` = \'23400\') or (`v`.`head` = \'23100\') or (`v`.`head` = \'23200\')) and (`v`.`date` <= \'2025-09-03\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no` union all select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`cr`) - sum(`v`.`dr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank-purbadekhali`.`voucher` `v` where (((`v`.`head` = \'11100\') or (`v`.`head` = \'11200\')) and (`v`.`date` <= \'2025-09-03\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no`
md5=bce7e3b5e748c715a6cbc6fc893e100b
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2025-09-03 07:27:12
create-version=1
source=select max(v.date) as date,v.acc_no,if(sum(cr)-sum(dr)>0,\'Active\',\'Close\') as Status from voucher v where  (head=\'14100\' or head=\'14200\' or head=\'14300\')  and date<=\'2025-09-03\' and (cr>0 or dr>0)  group by v.acc_no union all select max(v.date) as date,v.acc_no,if(sum(dr)-sum(cr)>0,\'Active\',\'Close\') as Status from voucher v where  (head=\'23300\' or head=\'23400\' or head=\'23100\' or head=\'23200\')  and date<=\'2025-09-03\' and (cr>0 or dr>0)  group by v.acc_no union all select max(v.date) as date,v.acc_no,if(sum(cr)-sum(dr)>0,\'Active\',\'Close\') as Status from voucher v where  (head=\'11100\' or head=\'11200\')  and date<=\'2025-09-03\' and (cr>0 or dr>0) group by v.acc_no
client_cs_name=utf8mb4
connection_cl_name=utf8mb4_general_ci
view_body_utf8=select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`cr`) - sum(`v`.`dr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank-purbadekhali`.`voucher` `v` where (((`v`.`head` = \'14100\') or (`v`.`head` = \'14200\') or (`v`.`head` = \'14300\')) and (`v`.`date` <= \'2025-09-03\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no` union all select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`dr`) - sum(`v`.`cr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank-purbadekhali`.`voucher` `v` where (((`v`.`head` = \'23300\') or (`v`.`head` = \'23400\') or (`v`.`head` = \'23100\') or (`v`.`head` = \'23200\')) and (`v`.`date` <= \'2025-09-03\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no` union all select max(`v`.`date`) AS `date`,`v`.`Acc_no` AS `acc_no`,if(((sum(`v`.`cr`) - sum(`v`.`dr`)) > 0),\'Active\',\'Close\') AS `Status` from `co-operativebank-purbadekhali`.`voucher` `v` where (((`v`.`head` = \'11100\') or (`v`.`head` = \'11200\')) and (`v`.`date` <= \'2025-09-03\') and ((`v`.`cr` > 0) or (`v`.`dr` > 0))) group by `v`.`Acc_no`
