TYPE=VIEW
query=select `la`.`acc_no` AS `acc_no`,`la`.`date_open` AS `date_open`,if((`la`.`name_p` <> \'\'),concat(`j_a`.`name`,\' [ \',`la`.`name_p`,\' ]\'),`j_a`.`name`) AS `name`,`j_a`.`father_name` AS `father_name`,`la`.`amt` AS `amt`,sum(`ld`.`Total_amt`) AS `received_amt`,sum(`ld`.`intrst_Amt`) AS `int_received`,(`la`.`amt` - sum(`ld`.`Total_amt`)) AS `final_amt`,round(if(((`la`.`sub_head` = \'23109\') or (`la`.`sub_head` = \'23115\')),(((`la`.`amt` - sum(`ld`.`Total_amt`)) * pow((1 + (`la`.`interest` / 400)),(4 * ((to_days(\'2016-05-03\') - to_days(max(`ld`.`Date`))) / 365)))) - (`la`.`amt` - sum(`ld`.`Total_amt`))),(((`la`.`amt` - sum(`ld`.`Total_amt`)) * (`la`.`interest` / 100)) * ((to_days(\'2016-05-03\') - to_days(max(`ld`.`Date`))) / 365))),2) AS `interest_receivable`,timestampdiff(DAY,max(`ld`.`Date`),\'2016-05-03\') AS `days`,if((max(`la`.`fianl_date`) > \'2016-05-03\'),\'CC\',\'OD\') AS `Status` from `co-operativebank`.`loan_acc` `la` join `co-operativebank`.`loan_deposit` `ld` join `co-operativebank`.`j_a` join `co-operativebank`.`cc_od_int` `coi` where ((`la`.`acc_no` = `ld`.`Acc_No`) and (`j_a`.`Acc_No` = `la`.`loan_against_sv_acc`) and (`la`.`id` = `ld`.`loan_id`) and (`coi`.`id` = `la`.`id`) and (`coi`.`date_open` <= `ld`.`Date`) and (`la`.`sub_head` = \'23101B\')) group by `la`.`acc_no`
md5=95686f94f15644e4e7967b7b6e4f2031
updatable=0
algorithm=0
definer_user=root
definer_host=localhost
suid=2
with_check_option=0
timestamp=2016-05-03 15:03:23
create-version=1
source=select la.acc_no,la.date_open,if(la.name_p<>\'\',concat(j_a.name,\' [ \',la.name_p,\' ]\'),j_a.name)as name,j_a.father_name, la.amt,sum(total_amt) received_amt,sum(intrst_amt) int_received,la.amt-sum(total_amt) final_amt,round(if(la.sub_head=\'23109\' or la.sub_head=\'23115\',(la.amt-sum(total_amt)) * power((1 + (la.interest / 400)) , (4 * (datediff(\'2016-05-03\',max(ld.date)) / 365)))-(la.amt-sum(total_amt)),((la.amt-sum(total_amt))*(la.interest/100)*(datediff(\'2016-05-03\',max(ld.date)) / 365))),2) interest_receivable,timestampdiff(day,max(ld.date),\'2016-05-03\') days,if(max(la.fianl_date)>\'2016-05-03\',\'CC\',\'OD\') as Status from loan_acc la,loan_deposit ld,j_a,cc_od_int coi where la.acc_no=ld.acc_no and j_a.acc_no=la.loan_against_sv_acc and la.id=ld.loan_id and coi.id=la.id  and coi.date_open<=date and la.sub_head=\'23101B\' group by la.acc_no
client_cs_name=latin1
connection_cl_name=latin1_swedish_ci
view_body_utf8=select `la`.`acc_no` AS `acc_no`,`la`.`date_open` AS `date_open`,if((`la`.`name_p` <> \'\'),concat(`j_a`.`name`,\' [ \',`la`.`name_p`,\' ]\'),`j_a`.`name`) AS `name`,`j_a`.`father_name` AS `father_name`,`la`.`amt` AS `amt`,sum(`ld`.`Total_amt`) AS `received_amt`,sum(`ld`.`intrst_Amt`) AS `int_received`,(`la`.`amt` - sum(`ld`.`Total_amt`)) AS `final_amt`,round(if(((`la`.`sub_head` = \'23109\') or (`la`.`sub_head` = \'23115\')),(((`la`.`amt` - sum(`ld`.`Total_amt`)) * pow((1 + (`la`.`interest` / 400)),(4 * ((to_days(\'2016-05-03\') - to_days(max(`ld`.`Date`))) / 365)))) - (`la`.`amt` - sum(`ld`.`Total_amt`))),(((`la`.`amt` - sum(`ld`.`Total_amt`)) * (`la`.`interest` / 100)) * ((to_days(\'2016-05-03\') - to_days(max(`ld`.`Date`))) / 365))),2) AS `interest_receivable`,timestampdiff(DAY,max(`ld`.`Date`),\'2016-05-03\') AS `days`,if((max(`la`.`fianl_date`) > \'2016-05-03\'),\'CC\',\'OD\') AS `Status` from `co-operativebank`.`loan_acc` `la` join `co-operativebank`.`loan_deposit` `ld` join `co-operativebank`.`j_a` join `co-operativebank`.`cc_od_int` `coi` where ((`la`.`acc_no` = `ld`.`Acc_No`) and (`j_a`.`Acc_No` = `la`.`loan_against_sv_acc`) and (`la`.`id` = `ld`.`loan_id`) and (`coi`.`id` = `la`.`id`) and (`coi`.`date_open` <= `ld`.`Date`) and (`la`.`sub_head` = \'23101B\')) group by `la`.`acc_no`
