TYPE=VIEW
query=select `co-operativebank-bajbajia`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `code`,`co-operativebank-bajbajia`.`headvoucher`.`head_type` AS `head_type`,(sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`) - sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `cur_bal`,\'0\' AS `bal`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank-bajbajia`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19212\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19214\') and ((`co-operativebank-bajbajia`.`headvoucher`.`main_head` = 10000) or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-bajbajia`.`headvoucher`.`date` <= \'2023-07-31\') and ((`co-operativebank-bajbajia`.`headvoucher`.`cr` <> 0) or (`co-operativebank-bajbajia`.`headvoucher`.`dr` <> 0))) group by `co-operativebank-bajbajia`.`headvoucher`.`htcode` union select \'2\' AS `sl_no`,`co-operativebank-bajbajia`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,sum(`co-operativebank-bajbajia`.`approciation`.`amt`) AS `cur_bal`,0 AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank-bajbajia`.`approciation` where ((`co-operativebank-bajbajia`.`approciation`.`date` <= \'2023-07-31\') and (`co-operativebank-bajbajia`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank-bajbajia`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank-bajbajia`.`approciation`.`main_head` union select `co-operativebank-bajbajia`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `code`,`co-operativebank-bajbajia`.`headvoucher`.`head_type` AS `head_type`,\'0\' AS `cur_bal`,(sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`) - sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `bal`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank-bajbajia`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19212\') and ((`co-operativebank-bajbajia`.`headvoucher`.`main_head` = 10000) or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-bajbajia`.`headvoucher`.`date` <= \'2023-07-01\') and ((`co-operativebank-bajbajia`.`headvoucher`.`cr` <> 0) or (`co-operativebank-bajbajia`.`headvoucher`.`dr` <> 0))) group by `co-operativebank-bajbajia`.`headvoucher`.`htcode` union all select \'2\' AS `sl_no`,`co-operativebank-bajbajia`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,\'0\' AS `cur_bal`,sum(`co-operativebank-bajbajia`.`approciation`.`amt`) AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank-bajbajia`.`approciation` where ((`co-operativebank-bajbajia`.`approciation`.`date` <= \'2023-07-01\') and (`co-operativebank-bajbajia`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank-bajbajia`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank-bajbajia`.`approciation`.`main_head`
md5=15e34ac6fe644fe8f38a3ad7da2eff48
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2023-08-10 04:05:26
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-07-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-07-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` <= \'2023-07-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` <= \'2023-07-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-bajbajia`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `code`,`co-operativebank-bajbajia`.`headvoucher`.`head_type` AS `head_type`,(sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`) - sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `cur_bal`,\'0\' AS `bal`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank-bajbajia`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19212\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19214\') and ((`co-operativebank-bajbajia`.`headvoucher`.`main_head` = 10000) or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-bajbajia`.`headvoucher`.`date` <= \'2023-07-31\') and ((`co-operativebank-bajbajia`.`headvoucher`.`cr` <> 0) or (`co-operativebank-bajbajia`.`headvoucher`.`dr` <> 0))) group by `co-operativebank-bajbajia`.`headvoucher`.`htcode` union select \'2\' AS `sl_no`,`co-operativebank-bajbajia`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,sum(`co-operativebank-bajbajia`.`approciation`.`amt`) AS `cur_bal`,0 AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank-bajbajia`.`approciation` where ((`co-operativebank-bajbajia`.`approciation`.`date` <= \'2023-07-31\') and (`co-operativebank-bajbajia`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank-bajbajia`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank-bajbajia`.`approciation`.`main_head` union select `co-operativebank-bajbajia`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `code`,`co-operativebank-bajbajia`.`headvoucher`.`head_type` AS `head_type`,\'0\' AS `cur_bal`,(sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`) - sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `bal`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank-bajbajia`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` <> \'19212\') and ((`co-operativebank-bajbajia`.`headvoucher`.`main_head` = 10000) or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-bajbajia`.`headvoucher`.`date` <= \'2023-07-01\') and ((`co-operativebank-bajbajia`.`headvoucher`.`cr` <> 0) or (`co-operativebank-bajbajia`.`headvoucher`.`dr` <> 0))) group by `co-operativebank-bajbajia`.`headvoucher`.`htcode` union all select \'2\' AS `sl_no`,`co-operativebank-bajbajia`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,\'0\' AS `cur_bal`,sum(`co-operativebank-bajbajia`.`approciation`.`amt`) AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank-bajbajia`.`approciation` where ((`co-operativebank-bajbajia`.`approciation`.`date` <= \'2023-07-01\') and (`co-operativebank-bajbajia`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank-bajbajia`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank-bajbajia`.`approciation`.`main_head`
