TYPE=VIEW
query=select `co-operativebank-bajbajia`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `code`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),concat(\'BY \',`co-operativebank-bajbajia`.`headvoucher`.`sub_head`,\' A/C\',\' -\',`co-operativebank-bajbajia`.`headvoucher`.`acc_no`),concat(\'BY \',`co-operativebank-bajbajia`.`headvoucher`.`sub_head`,\' A/C\')) AS `sub_head`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`),sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `dr`,0 AS `cr`,0 AS `interest`,`co-operativebank-bajbajia`.`headvoucher`.`hcode` AS `head`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`date` = \'2025-04-20\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` = \'14101\')) union all select `co-operativebank-bajbajia`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `code`,concat(\'BY INTEREST\',\' A/C\') AS `sub_head`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`),sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `dr`,0 AS `cr`,0 AS `interest`,`co-operativebank-bajbajia`.`headvoucher`.`hcode` AS `head`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`date` = \'2025-04-20\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` = (\'14101\' + 48000))) union all select `co-operativebank-bajbajia`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `code`,\'TO CASH A/C\' AS `sub_head`,0 AS `dr`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`),sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `cr`,0 AS `interest`,`co-operativebank-bajbajia`.`headvoucher`.`hcode` AS `head`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`deposit_type` = \'CASH\') and (`co-operativebank-bajbajia`.`headvoucher`.`date` = \'2025-04-20\') and ((`co-operativebank-bajbajia`.`headvoucher`.`shcode` = \'14101\') or (`co-operativebank-bajbajia`.`headvoucher`.`shcode` = (\'14101\' + 48000)))) union all select `co-operativebank-bajbajia`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `code`,\'TO TRANSFER A/C\' AS `sub_head`,0 AS `dr`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`),sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `cr`,0 AS `interest`,`co-operativebank-bajbajia`.`headvoucher`.`hcode` AS `head`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`deposit_type` = \'TRANSFER\') and (`co-operativebank-bajbajia`.`headvoucher`.`date` = \'2025-04-20\') and ((`co-operativebank-bajbajia`.`headvoucher`.`shcode` = \'14101\') or (`co-operativebank-bajbajia`.`headvoucher`.`shcode` = (\'14101\' + 48000))))
md5=5758c6c5cff22914b79b7b06b1201c96
updatable=0
algorithm=0
definer_user=admin
definer_host=localhost
suid=2
with_check_option=0
timestamp=2025-11-13 03:32:36
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=\'2025-04-20\'  AND SHCODE=\'14101\' 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=\'2025-04-20\'  AND SHCODE=\'14101\'+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=\'2025-04-20\'  AND (SHCODE=\'14101\' OR SHCODE=\'14101\'+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=\'2025-04-20\'  AND (SHCODE=\'14101\' OR SHCODE=\'14101\'+48000)
client_cs_name=utf8
connection_cl_name=utf8_general_ci
view_body_utf8=select `co-operativebank-bajbajia`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `code`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),concat(\'BY \',`co-operativebank-bajbajia`.`headvoucher`.`sub_head`,\' A/C\',\' -\',`co-operativebank-bajbajia`.`headvoucher`.`acc_no`),concat(\'BY \',`co-operativebank-bajbajia`.`headvoucher`.`sub_head`,\' A/C\')) AS `sub_head`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`),sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `dr`,0 AS `cr`,0 AS `interest`,`co-operativebank-bajbajia`.`headvoucher`.`hcode` AS `head`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`date` = \'2025-04-20\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` = \'14101\')) union all select `co-operativebank-bajbajia`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `code`,concat(\'BY INTEREST\',\' A/C\') AS `sub_head`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`),sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `dr`,0 AS `cr`,0 AS `interest`,`co-operativebank-bajbajia`.`headvoucher`.`hcode` AS `head`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`date` = \'2025-04-20\') and (`co-operativebank-bajbajia`.`headvoucher`.`shcode` = (\'14101\' + 48000))) union all select `co-operativebank-bajbajia`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `code`,\'TO CASH A/C\' AS `sub_head`,0 AS `dr`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`),sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `cr`,0 AS `interest`,`co-operativebank-bajbajia`.`headvoucher`.`hcode` AS `head`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`deposit_type` = \'CASH\') and (`co-operativebank-bajbajia`.`headvoucher`.`date` = \'2025-04-20\') and ((`co-operativebank-bajbajia`.`headvoucher`.`shcode` = \'14101\') or (`co-operativebank-bajbajia`.`headvoucher`.`shcode` = (\'14101\' + 48000)))) union all select `co-operativebank-bajbajia`.`headvoucher`.`sub_head` AS `headname`,`co-operativebank-bajbajia`.`headvoucher`.`shcode` AS `code`,\'TO TRANSFER A/C\' AS `sub_head`,0 AS `dr`,if(((`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'28000\') or (`co-operativebank-bajbajia`.`headvoucher`.`htcode` = \'22000\')),sum(`co-operativebank-bajbajia`.`headvoucher`.`cr`),sum(`co-operativebank-bajbajia`.`headvoucher`.`dr`)) AS `cr`,0 AS `interest`,`co-operativebank-bajbajia`.`headvoucher`.`hcode` AS `head`,`co-operativebank-bajbajia`.`headvoucher`.`htcode` AS `htcode`,0 AS `m_count` from `co-operativebank-bajbajia`.`headvoucher` where ((`co-operativebank-bajbajia`.`headvoucher`.`deposit_type` = \'TRANSFER\') and (`co-operativebank-bajbajia`.`headvoucher`.`date` = \'2025-04-20\') and ((`co-operativebank-bajbajia`.`headvoucher`.`shcode` = \'14101\') or (`co-operativebank-bajbajia`.`headvoucher`.`shcode` = (\'14101\' + 48000))))
