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