TYPE=VIEW
query=select `co-operativebank-144`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-144`.`headvoucher`.`shcode` AS `code`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),concat(\'BY \',`co-operativebank-144`.`headvoucher`.`sub_head`,\' A/C\',\' -\',`co-operativebank-144`.`headvoucher`.`acc_no`),concat(\'BY \',`co-operativebank-144`.`headvoucher`.`sub_head`,\' A/C\')) AS `sub_head`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-144`.`headvoucher`.`cr`),sum(`co-operativebank-144`.`headvoucher`.`dr`)) AS `dr`,0 AS `cr`,0 AS `interest`,`co-operativebank-144`.`headvoucher`.`hcode` AS `head`,`co-operativebank-144`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-144`.`headvoucher` where ((`co-operativebank-144`.`headvoucher`.`date` = \'2023-11-02\') and (`co-operativebank-144`.`headvoucher`.`shcode` = \'22402\')) union all select `co-operativebank-144`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-144`.`headvoucher`.`shcode` AS `code`,concat(\'BY INTEREST\',\' A/C\') AS `sub_head`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-144`.`headvoucher`.`cr`),sum(`co-operativebank-144`.`headvoucher`.`dr`)) AS `dr`,0 AS `cr`,0 AS `interest`,`co-operativebank-144`.`headvoucher`.`hcode` AS `head`,`co-operativebank-144`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-144`.`headvoucher` where ((`co-operativebank-144`.`headvoucher`.`date` = \'2023-11-02\') and (`co-operativebank-144`.`headvoucher`.`shcode` = (\'22402\' + 48000))) union all select `co-operativebank-144`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-144`.`headvoucher`.`shcode` AS `code`,\'TO CASH A/C\' AS `sub_head`,0 AS `dr`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-144`.`headvoucher`.`cr`),sum(`co-operativebank-144`.`headvoucher`.`dr`)) AS `cr`,0 AS `interest`,`co-operativebank-144`.`headvoucher`.`hcode` AS `head`,`co-operativebank-144`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-144`.`headvoucher` where ((`co-operativebank-144`.`headvoucher`.`deposit_type` = \'CASH\') and (`co-operativebank-144`.`headvoucher`.`date` = \'2023-11-02\') and ((`co-operativebank-144`.`headvoucher`.`shcode` = \'22402\') or (`co-operativebank-144`.`headvoucher`.`shcode` = (\'22402\' + 48000)))) union all select `co-operativebank-144`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-144`.`headvoucher`.`shcode` AS `code`,\'TO TRANSFER A/C\' AS `sub_head`,0 AS `dr`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-144`.`headvoucher`.`cr`),sum(`co-operativebank-144`.`headvoucher`.`dr`)) AS `cr`,0 AS `interest`,`co-operativebank-144`.`headvoucher`.`hcode` AS `head`,`co-operativebank-144`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-144`.`headvoucher` where ((`co-operativebank-144`.`headvoucher`.`deposit_type` = \'TRANSFER\') and (`co-operativebank-144`.`headvoucher`.`date` = \'2023-11-02\') and ((`co-operativebank-144`.`headvoucher`.`shcode` = \'22402\') or (`co-operativebank-144`.`headvoucher`.`shcode` = (\'22402\' + 48000))))
md5=fb4cdea1c05f29620904c7136e560aae
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2023-11-03 09:59:19
create-version=1
source=select sub_head as headname,shcode as code,if(htcode=\'28000\' or htcode=\'22000\',CONCAT(\'BY \',sub_head,\' A/C\',\' -\',acc_no),CONCAT(\'BY \',sub_head,\' A/C\')) AS sub_head,if(htcode=\'28000\' or htcode=\'22000\',sum(cr),sum(dr)) as dr,0 cr,0 as interest, hcode as head,htcode htcode,0 as m_count from headvoucher where   date=\'2023-11-02\'  AND SHCODE=\'22402\' union all select sub_head as headname,shcode as code,CONCAT(\'BY INTEREST\',\' A/C\') AS sub_head,if(htcode=\'28000\' or htcode=\'22000\',sum(cr),sum(dr)) as  dr,0 cr,0 as interest, hcode as head,htcode htcode,0 as m_count from headvoucher where   date=\'2023-11-02\'  AND SHCODE=\'22402\'+48000 union all select sub_head as headname,shcode as code,\'TO CASH A/C\' AS sub_head,0 dr,if(htcode=\'28000\' or htcode=\'22000\',sum(cr),sum(dr)) cr,0 as interest, hcode as head,htcode htcode,0 as m_count from headvoucher where  deposit_type=\'CASH\' and date=\'2023-11-02\'  AND (SHCODE=\'22402\' OR SHCODE=\'22402\'+48000) union all select sub_head as headname,shcode as code,\'TO TRANSFER A/C\' AS sub_head,0 dr,if(htcode=\'28000\' or htcode=\'22000\',sum(cr),sum(dr)) cr,0 as interest, hcode as head,htcode htcode,0 as m_count from headvoucher where  deposit_type=\'TRANSFER\' and date=\'2023-11-02\'  AND (SHCODE=\'22402\' OR SHCODE=\'22402\'+48000)
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `co-operativebank-144`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-144`.`headvoucher`.`shcode` AS `code`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),concat(\'BY \',`co-operativebank-144`.`headvoucher`.`sub_head`,\' A/C\',\' -\',`co-operativebank-144`.`headvoucher`.`acc_no`),concat(\'BY \',`co-operativebank-144`.`headvoucher`.`sub_head`,\' A/C\')) AS `sub_head`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-144`.`headvoucher`.`cr`),sum(`co-operativebank-144`.`headvoucher`.`dr`)) AS `dr`,0 AS `cr`,0 AS `interest`,`co-operativebank-144`.`headvoucher`.`hcode` AS `head`,`co-operativebank-144`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-144`.`headvoucher` where ((`co-operativebank-144`.`headvoucher`.`date` = \'2023-11-02\') and (`co-operativebank-144`.`headvoucher`.`shcode` = \'22402\')) union all select `co-operativebank-144`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-144`.`headvoucher`.`shcode` AS `code`,concat(\'BY INTEREST\',\' A/C\') AS `sub_head`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-144`.`headvoucher`.`cr`),sum(`co-operativebank-144`.`headvoucher`.`dr`)) AS `dr`,0 AS `cr`,0 AS `interest`,`co-operativebank-144`.`headvoucher`.`hcode` AS `head`,`co-operativebank-144`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-144`.`headvoucher` where ((`co-operativebank-144`.`headvoucher`.`date` = \'2023-11-02\') and (`co-operativebank-144`.`headvoucher`.`shcode` = (\'22402\' + 48000))) union all select `co-operativebank-144`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-144`.`headvoucher`.`shcode` AS `code`,\'TO CASH A/C\' AS `sub_head`,0 AS `dr`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-144`.`headvoucher`.`cr`),sum(`co-operativebank-144`.`headvoucher`.`dr`)) AS `cr`,0 AS `interest`,`co-operativebank-144`.`headvoucher`.`hcode` AS `head`,`co-operativebank-144`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-144`.`headvoucher` where ((`co-operativebank-144`.`headvoucher`.`deposit_type` = \'CASH\') and (`co-operativebank-144`.`headvoucher`.`date` = \'2023-11-02\') and ((`co-operativebank-144`.`headvoucher`.`shcode` = \'22402\') or (`co-operativebank-144`.`headvoucher`.`shcode` = (\'22402\' + 48000)))) union all select `co-operativebank-144`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-144`.`headvoucher`.`shcode` AS `code`,\'TO TRANSFER A/C\' AS `sub_head`,0 AS `dr`,if(((`co-operativebank-144`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-144`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-144`.`headvoucher`.`cr`),sum(`co-operativebank-144`.`headvoucher`.`dr`)) AS `cr`,0 AS `interest`,`co-operativebank-144`.`headvoucher`.`hcode` AS `head`,`co-operativebank-144`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-144`.`headvoucher` where ((`co-operativebank-144`.`headvoucher`.`deposit_type` = \'TRANSFER\') and (`co-operativebank-144`.`headvoucher`.`date` = \'2023-11-02\') and ((`co-operativebank-144`.`headvoucher`.`shcode` = \'22402\') or (`co-operativebank-144`.`headvoucher`.`shcode` = (\'22402\' + 48000))))
