TYPE=VIEW
query=select `co-operativebank-124`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank-124`.`headvoucher`.`htcode` AS `code`,`co-operativebank-124`.`headvoucher`.`head_type` AS `head_type`,(sum(`co-operativebank-124`.`headvoucher`.`cr`) - sum(`co-operativebank-124`.`headvoucher`.`dr`)) AS `cur_bal`,\'0\' AS `bal`,`co-operativebank-124`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank-124`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank-124`.`headvoucher` where ((`co-operativebank-124`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19212\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19214\') and ((`co-operativebank-124`.`headvoucher`.`main_head` = 10000) or (`co-operativebank-124`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-124`.`headvoucher`.`date` <= \'2022-12-29\') and ((`co-operativebank-124`.`headvoucher`.`cr` <> 0) or (`co-operativebank-124`.`headvoucher`.`dr` <> 0))) group by `co-operativebank-124`.`headvoucher`.`htcode` union select \'2\' AS `sl_no`,`co-operativebank-124`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,sum(`co-operativebank-124`.`approciation`.`amt`) AS `cur_bal`,0 AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank-124`.`approciation` where ((`co-operativebank-124`.`approciation`.`date` <= \'2022-12-29\') and (`co-operativebank-124`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank-124`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank-124`.`approciation`.`main_head` union select `co-operativebank-124`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank-124`.`headvoucher`.`htcode` AS `code`,`co-operativebank-124`.`headvoucher`.`head_type` AS `head_type`,\'0\' AS `cur_bal`,(sum(`co-operativebank-124`.`headvoucher`.`cr`) - sum(`co-operativebank-124`.`headvoucher`.`dr`)) AS `bal`,`co-operativebank-124`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank-124`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank-124`.`headvoucher` where ((`co-operativebank-124`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19212\') and ((`co-operativebank-124`.`headvoucher`.`main_head` = 10000) or (`co-operativebank-124`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-124`.`headvoucher`.`date` <= \'2021-12-29\') and ((`co-operativebank-124`.`headvoucher`.`cr` <> 0) or (`co-operativebank-124`.`headvoucher`.`dr` <> 0))) group by `co-operativebank-124`.`headvoucher`.`htcode` union all select \'2\' AS `sl_no`,`co-operativebank-124`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,\'0\' AS `cur_bal`,sum(`co-operativebank-124`.`approciation`.`amt`) AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank-124`.`approciation` where ((`co-operativebank-124`.`approciation`.`date` <= \'2021-12-29\') and (`co-operativebank-124`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank-124`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank-124`.`approciation`.`main_head`
md5=1f963f004df01661048604bb3712f725
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2022-12-29 11:39:53
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` <= \'2022-12-29\') 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` <= \'2022-12-29\' 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` <= \'2021-12-29\') 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` <= \'2021-12-29\' 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-124`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank-124`.`headvoucher`.`htcode` AS `code`,`co-operativebank-124`.`headvoucher`.`head_type` AS `head_type`,(sum(`co-operativebank-124`.`headvoucher`.`cr`) - sum(`co-operativebank-124`.`headvoucher`.`dr`)) AS `cur_bal`,\'0\' AS `bal`,`co-operativebank-124`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank-124`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank-124`.`headvoucher` where ((`co-operativebank-124`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19212\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19214\') and ((`co-operativebank-124`.`headvoucher`.`main_head` = 10000) or (`co-operativebank-124`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-124`.`headvoucher`.`date` <= \'2022-12-29\') and ((`co-operativebank-124`.`headvoucher`.`cr` <> 0) or (`co-operativebank-124`.`headvoucher`.`dr` <> 0))) group by `co-operativebank-124`.`headvoucher`.`htcode` union select \'2\' AS `sl_no`,`co-operativebank-124`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,sum(`co-operativebank-124`.`approciation`.`amt`) AS `cur_bal`,0 AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank-124`.`approciation` where ((`co-operativebank-124`.`approciation`.`date` <= \'2022-12-29\') and (`co-operativebank-124`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank-124`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank-124`.`approciation`.`main_head` union select `co-operativebank-124`.`headvoucher`.`hslno` AS `sl_no`,`co-operativebank-124`.`headvoucher`.`htcode` AS `code`,`co-operativebank-124`.`headvoucher`.`head_type` AS `head_type`,\'0\' AS `cur_bal`,(sum(`co-operativebank-124`.`headvoucher`.`cr`) - sum(`co-operativebank-124`.`headvoucher`.`dr`)) AS `bal`,`co-operativebank-124`.`headvoucher`.`shcode` AS `shcode`,`co-operativebank-124`.`headvoucher`.`main_head` AS `main_head` from `co-operativebank-124`.`headvoucher` where ((`co-operativebank-124`.`headvoucher`.`shcode` <> \'12301\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'12302\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19205\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19206\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19216\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19203\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19207\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19211\') and (`co-operativebank-124`.`headvoucher`.`shcode` <> \'19212\') and ((`co-operativebank-124`.`headvoucher`.`main_head` = 10000) or (`co-operativebank-124`.`headvoucher`.`htcode` = \'46000\')) and (`co-operativebank-124`.`headvoucher`.`date` <= \'2021-12-29\') and ((`co-operativebank-124`.`headvoucher`.`cr` <> 0) or (`co-operativebank-124`.`headvoucher`.`dr` <> 0))) group by `co-operativebank-124`.`headvoucher`.`htcode` union all select \'2\' AS `sl_no`,`co-operativebank-124`.`approciation`.`main_head` AS `code`,\'\' AS `head_type`,\'0\' AS `cur_bal`,sum(`co-operativebank-124`.`approciation`.`amt`) AS `bal`,\'\' AS `shcode`,\'10000\' AS `main_hyead` from `co-operativebank-124`.`approciation` where ((`co-operativebank-124`.`approciation`.`date` <= \'2021-12-29\') and (`co-operativebank-124`.`approciation`.`sub_head` <> \'12301\') and (`co-operativebank-124`.`approciation`.`main_head` <> \'38000\')) group by `co-operativebank-124`.`approciation`.`main_head`
