TYPE=VIEW
query=select `co-operativebank`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank`.`headvoucher`.`htcode` AS `code`,`co-operativebank`.`headvoucher`.`head_type` AS `head_type`,(sum(`co-operativebank`.`headvoucher`.`cr`) - sum(`co-operativebank`.`headvoucher`.`dr`)) AS `cur_bal`,\'0\' AS `bal`,`co-operativebank`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank`.`headvoucher` where ((`co-operativebank`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19212\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19214\') and ((`co-operativebank`.`headvoucher`.`main_head` = 10000) or (`co-operativebank`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank`.`headvoucher`.`date` <= \'2023-03-31\') and ((`co-operativebank`.`headvoucher`.`cr` <> 0) or (`co-operativebank`.`headvoucher`.`dr` <> 0))) group by `co-operativebank`.`headvoucher`.`htcode` union select \'2\' AS `sl_no`,`co-operativebank`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,sum(`co-operativebank`.`approciation`.`amt`) AS `cur_bal`,0 AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank`.`approciation` where ((`co-operativebank`.`approciation`.`date` <= \'2023-03-31\') and (`co-operativebank`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank`.`approciation`.`main_head` union select `co-operativebank`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank`.`headvoucher`.`htcode` AS `code`,`co-operativebank`.`headvoucher`.`head_type` AS `head_type`,\'0\' AS `cur_bal`,(sum(`co-operativebank`.`headvoucher`.`cr`) - sum(`co-operativebank`.`headvoucher`.`dr`)) AS `bal`,`co-operativebank`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank`.`headvoucher` where ((`co-operativebank`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19212\') and ((`co-operativebank`.`headvoucher`.`main_head` = 10000) or (`co-operativebank`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank`.`headvoucher`.`date` < \'2022-04-01\') and ((`co-operativebank`.`headvoucher`.`cr` <> 0) or (`co-operativebank`.`headvoucher`.`dr` <> 0))) group by `co-operativebank`.`headvoucher`.`htcode` union all select \'2\' AS `sl_no`,`co-operativebank`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,\'0\' AS `cur_bal`,sum(`co-operativebank`.`approciation`.`amt`) AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank`.`approciation` where ((`co-operativebank`.`approciation`.`date` <= \'2022-04-01\') and (`co-operativebank`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank`.`approciation`.`main_head`
md5=276a69bfbedb83381e05819fc4c23f4a
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2023-05-20 11:02:28
create-version=1
source=select `hslno` AS `sl_no`,`htcode` AS `code`,`head_type` AS `head_type`,(sum(`cr`) - sum(`dr`)) AS `cur_bal`,\'0\' AS `bal`,`shcode` AS `shcode`,`main_head` AS `main_head` from ((headvoucher )) where ((`shcode` <> \'12301\') and (`shcode` <> \'12302\')    and (`shcode`<> \'19205\')  and (`shcode`<> \'19206\') and (`shcode`<> \'19216\')  and (`shcode`<> \'19203\') and (`shcode`<> \'19207\') and (`shcode`<> \'19211\')  and (`shcode`<> \'19212\') and (`shcode`<> \'19214\') and ((`main_head` = 10000) or (htcode=\'46000\'))   and (`date` <= \'2023-03-31\') and ((`cr` <> 0) or (`dr` <> 0))) group by `htcode` union all SELECT \'2\' as sl_no, main_head as code,\'\' as head_type,sum(amt) as cur_bal,0 bal,\'\' shcode,\'10000\' main_hyead FROM `approciation` where `date` <= \'2023-03-31\' and sub_head<>\'12301\' and main_head<>\'38000\' group by main_head union select `hslno` AS `sl_no`,`htcode` AS `code`,`head_type` AS `head_type`,\'0\' AS `cur_bal`,(sum(`cr`) - sum(`dr`)) AS `bal`,`shcode` AS `shcode`,`main_head` AS `main_head` from ((headvoucher )) where ((`shcode` <> \'12301\') and (`shcode` <> \'12302\')    and (`shcode`<> \'19205\')  and (`shcode`<> \'19206\') and (`shcode`<> \'19216\') and (`shcode`<> \'19203\') and (`shcode`<> \'19207\') and (`shcode`<> \'19211\') and (`shcode`<> \'19212\') and ((`main_head` = 10000) or (htcode=\'46000\'))   and (`date` < \'2022-04-01\') and ((`cr` <> 0) or (`dr` <> 0))) group by `htcode` union all SELECT \'2\' as sl_no,	main_head as code,\'\' as head_type,\'0\' as cur_bal,sum(amt) bal,\'\' shcode,\'10000\' main_hyead FROM `approciation` where `date` <= \'2022-04-01\' and sub_head<>\'12301\' and main_head<>\'38000\' group by main_head
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `co-operativebank`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank`.`headvoucher`.`htcode` AS `code`,`co-operativebank`.`headvoucher`.`head_type` AS `head_type`,(sum(`co-operativebank`.`headvoucher`.`cr`) - sum(`co-operativebank`.`headvoucher`.`dr`)) AS `cur_bal`,\'0\' AS `bal`,`co-operativebank`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank`.`headvoucher` where ((`co-operativebank`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19212\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19214\') and ((`co-operativebank`.`headvoucher`.`main_head` = 10000) or (`co-operativebank`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank`.`headvoucher`.`date` <= \'2023-03-31\') and ((`co-operativebank`.`headvoucher`.`cr` <> 0) or (`co-operativebank`.`headvoucher`.`dr` <> 0))) group by `co-operativebank`.`headvoucher`.`htcode` union select \'2\' AS `sl_no`,`co-operativebank`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,sum(`co-operativebank`.`approciation`.`amt`) AS `cur_bal`,0 AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank`.`approciation` where ((`co-operativebank`.`approciation`.`date` <= \'2023-03-31\') and (`co-operativebank`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank`.`approciation`.`main_head` union select `co-operativebank`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank`.`headvoucher`.`htcode` AS `code`,`co-operativebank`.`headvoucher`.`head_type` AS `head_type`,\'0\' AS `cur_bal`,(sum(`co-operativebank`.`headvoucher`.`cr`) - sum(`co-operativebank`.`headvoucher`.`dr`)) AS `bal`,`co-operativebank`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank`.`headvoucher` where ((`co-operativebank`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank`.`headvoucher`.`shcode` <> \'19212\') and ((`co-operativebank`.`headvoucher`.`main_head` = 10000) or (`co-operativebank`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank`.`headvoucher`.`date` < \'2022-04-01\') and ((`co-operativebank`.`headvoucher`.`cr` <> 0) or (`co-operativebank`.`headvoucher`.`dr` <> 0))) group by `co-operativebank`.`headvoucher`.`htcode` union all select \'2\' AS `sl_no`,`co-operativebank`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,\'0\' AS `cur_bal`,sum(`co-operativebank`.`approciation`.`amt`) AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank`.`approciation` where ((`co-operativebank`.`approciation`.`date` <= \'2022-04-01\') and (`co-operativebank`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank`.`approciation`.`main_head`
