diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 3dc43b3b..9111aef1 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -1642,7 +1642,10 @@ public function assignPDTempalate($data) if($smc_lender_id == $lender_id[0]['fk_lender_id'] && isset($records['pd_agency_id']) && $records['pd_agency_id'] != null){ $records['vendor_status'] = isset($records['pd_status']) ? $records['pd_status'] : ALLOCATED ; //Here vendor_status is dynamic (ALLOCATED,SCHEDULED,COMPLETED like that) //Mail - SMC Vendor. - if($records['vendor_status'] == ALLOCATED){PDALERTS::sendMWcreditPDMail($this,$records['pd_id']);} + if($records['vendor_status'] == ALLOCATED){ + PDALERTS::sendMWcreditPDMail($this,$records['pd_id']); + $records['pd_status'] = ALLOCATED_TO_FIA; + } } } else{ diff --git a/api/application/helpers/applicantname_grabber_helper.php b/api/application/helpers/applicantname_grabber_helper.php index a388b344..e1b1d1f8 100644 --- a/api/application/helpers/applicantname_grabber_helper.php +++ b/api/application/helpers/applicantname_grabber_helper.php @@ -9,15 +9,16 @@ class applicantname_grabber $CI->load->model('PD_Model'); //return ( $CI->PD_Model->selectCustomRecords(array('pd_co_applicant_id','applicant_name'),array('fk_pd_id' => $pd_id),PDAPPLICANTSDETAILS)); - $columns = array('pd_co_applicant_id','applicant_name','TITLES.name as title'); + $columns = array('PDAPPLICANTSDETAILS.pd_co_applicant_id','PDAPPLICANTSDETAILS.applicant_name','TITLES.name as title'); $table = array(PDAPPLICANTSDETAILS.' as PDAPPLICANTSDETAILS'); $joins = array( array('table' => TITLES. ' as TITLES', 'condition' =>"PDAPPLICANTSDETAILS.applicant_title_name = TITLES.title_id AND PDAPPLICANTSDETAILS.fk_pd_id = $pd_id", 'jointype' => 'LEFT') ); + $where_condition_array = array('PDAPPLICANTSDETAILS.fk_pd_id'=>$pd_id); + return ( $CI->PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array)); - return ( $CI->PD_Model->getJoinRecords($columns,$table,$joins)); } public static function getApplicantsNameById($id,$latest_applicants_names,$type = 1) //$type i for return name only, 2 for return title only, and 3 for return both diff --git a/api/application/helpers/bankingform_helper.php b/api/application/helpers/bankingform_helper.php index 94d8cf83..bcc05218 100644 --- a/api/application/helpers/bankingform_helper.php +++ b/api/application/helpers/bankingform_helper.php @@ -62,10 +62,10 @@ public static function getNewBuinessBankingDetails($values,$pdid){ $count_vintage .=$tag['vintage_month_business'] >0 ? $tag['vintage_month_business'] : ""; $count_vintage .=($tag['vintage_month_business'] == 1) ? " Month" : (($tag['vintage_month_business'] > 1) ? " Months" : ""); return array( - 'account_name' => $tag['applicant_name_business']['id']==0 ? $tag['other_applicant_business'] : APPLICANTNAME_GRABBER::getApplicantsNameById($tag['applicant_name_business']['id'],$latest_applicants_names), + 'account_name' => $tag['applicant_name_business']['id']==0 ? $tag['other_applicant_business'] : ($tag['applicant_name']['group_id'] == 2 ? APPLICANTNAME_GRABBER::getApplicantsNameById($tag['applicant_name']['id'],$latest_applicants_names) : $tag['applicant_name_business']['name']), 'bank_name' => $tag['bank_name_business'] ==1 ? $tag['other_bank_business'] : $tag['bank_name_business_master'], 'account_type' => $tag['account_type_business_master'], - 'main_business' => $tag['salary_business'], + 'main_business' => $tag['is_main'], 'od_cc_limit' => ($tag['account_type_business']==3) ? $tag['limit_business'] : (($tag['account_type_business']==4) ? $tag['limit_business'] : ''), 'vintage' => $count_vintage, 'same_ac_used_for' => "Business", diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php index 4fe7555a..fd00025a 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -2669,15 +2669,22 @@ if($total_no_of_business > 0) { } foreach($newBankingResult as $bd){ if($bd['account_type']== 4 || $bd['account_type']== 3){ $is_od_cc = true; } } if(count($newBankingResult)>0){ - $newBankingResult = array_filter($newBankingResult, function ($var) { - // return ($var['same_ac_used_for'] == "Business"); - return (($var['account_name'] == $fetchRow['company_details']['company_name']) && ($var['same_ac_used_for'] == "Business")); - }); + // $newBankingResult = array_filter($newBankingResult, function ($var) { + // // return ($var['same_ac_used_for'] == "Business"); + // return (($var['account_name'] == $fetchRow['company_details']['company_name']) && ($var['same_ac_used_for'] == "Business")); + // }); + $filteredBankingResult = array();$b=0; + for($a = 0; $a <= count($newBankingResult); $a++){ + if($newBankingResult[$a]['account_name'] == $fetchRow['company_details']['company_name'] && $newBankingResult[$a]['same_ac_used_for'] == "Business"){ + $filteredBankingResult[$b] = $newBankingResult[$a]; + $b++; + } + } }//forloop ends here. ?> Business Banking:'; - if(count($newBankingResult)>0){ ?> + if(count($filteredBankingResult)>0){ ?>