diff --git a/api/application/controllers/Common_Masters_Controller.php b/api/application/controllers/Common_Masters_Controller.php index 2bcc8d10..dc2ada51 100644 --- a/api/application/controllers/Common_Masters_Controller.php +++ b/api/application/controllers/Common_Masters_Controller.php @@ -1406,7 +1406,8 @@ class Common_Masters_Controller extends REST_Controller { { $pd_master_details = $this->PD_Model->getPDMasterDetails($pdid); // print_r($pd_master_details);die(); - $addresses = $this->Common_Masters_Model->getSMCTempAddresses($pd_master_details[0]['excel_file_id']); + $file_id = isset($pd_master_details[0]['excel_file_id']) && $pd_master_details[0]['excel_file_id'] != '' ? $pd_master_details[0]['excel_file_id'] : $pdid; + $addresses = $this->Common_Masters_Model->getSMCTempAddresses($file_id); $addresses[] = array('id' => null,'display' => 'Add New Address', 'is_others' => -1); if(count($addresses)) { @@ -1438,8 +1439,19 @@ class Common_Masters_Controller extends REST_Controller { { $records = $this->post('records'); // print_r($records); - if(isset($records['file_id'])) + if(isset($records['pd_id'])) { + $pd_master_details = $this->PD_Model->getPDMasterDetails($records['pd_id']); + if(isset($pd_master_details[0]['excel_file_id']) && $pd_master_details[0]['excel_file_id'] != '') + { + $records['file_id'] = $pd_master_details[0]['excel_file_id']; + } + else + { + $records['file_id'] = $records['pd_id']; + + } + unset($records['pd_id']); $id = $this->Common_Masters_Model->saveRecords($records,SMC_TEMP_ADDRESS); if($id) { diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 62b0f5f5..98eaeadb 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -601,6 +601,13 @@ class PD_Controller extends REST_Controller { if($pd_id != null || $pd_id != '') { + + // if it is SMC PD check excel file id , if not store address in smc address + // temprary table against pd id + if(!isset($pd_details[0]['excel_file_id']))// && $pd_details[0]['excel_file_id'] != '') + { + $this->saveSMCTempAddress($pd_id,$addresses); + } //If PD created sucessfully then create a externa folder named with pd_id if(!file_exists($this->external_path.'/pd_reports/'.$pd_id)) @@ -11150,6 +11157,13 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() // echo $pd_details['fk_pd_allocated_to'];die(); return $pd_details; } + + + function saveSMCTempAddress($pd_id,$addresses) + { + $records = array('file_id' => $pd_id,'addressline' => $addresses[0]['addressline1'],'city' => $addresses[0]['fk_city'],'state' => $addresses[0]['fk_state'],'pincode' => $addresses[0]['pincode']); + $this->PD_Model->saveRecords($records,SMC_TEMP_ADDRESS); + } diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 3dd47a30..13431bd9 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1513,13 +1513,13 @@ public function filterSalesPDList_post() { // die(); //score card part $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); - // echo $html_content;die(); + // echo $html_content;die(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/pd_reports/" . $records['pd_id'] . "/temp.pdf"; $bytes = file_put_contents($output_file, $pdf_doc); - // echo $bytes;die(); + // echo $bytes;die(); $bucket_name = LENDER_BUCKET_NAME_PREFIX.(ENVIRONMENT == 'production' ? 7 : 35); $key = 'pd'.$records['pd_id'].'/pd_reports/'.$pdf_name.'.pdf'; $bucket_data = array('bucket_name'=>$bucket_name,'key'=>$key,'sourcefile'=>$output_file); @@ -1567,16 +1567,16 @@ public function filterSalesPDList_post() { } - $score_card_questions['no_of_years_business_run'] = array('answer_id' => ( $view_data['pd_section_data'][8]['business_years'].'.'.(isset($view_data['pd_section_data'][8]['business_years']) ? $view_data['pd_section_data'][8]['business_months'] : '0') ) ,'answer' => ( $view_data['pd_section_data'][8]['business_years'].'.'.(isset($view_data['pd_section_data'][8]['business_years']) ? $view_data['pd_section_data'][8]['business_months'] : '0') )); + $score_card_questions['no_of_years_business_run'] = array('answer_id' => (isset($view_data['pd_section_data'][8]['business_years']) ? $view_data['pd_section_data'][8]['business_years'].'.'.(isset($view_data['pd_section_data'][8]['business_years']) ? $view_data['pd_section_data'][8]['business_months'] : '0') : 'NA' ) ,'answer' => ( isset($view_data['pd_section_data'][8]['business_years']) ? $view_data['pd_section_data'][8]['business_years'].'.'.(isset($view_data['pd_section_data'][8]['business_years']) ? $view_data['pd_section_data'][8]['business_months'] : '0') : 'NA')); - $score_card_questions['business_activity_has_seen'] = array('answer_id' => $view_data['pd_section_data'][8]['business_is_pd_visited'],'answer' => $view_data['pd_section_data'][8]['business_is_pd_visited']); + $score_card_questions['business_activity_has_seen'] = array('answer_id' => isset($view_data['pd_section_data'][8]['business_is_pd_visited']) ? $view_data['pd_section_data'][8]['business_is_pd_visited'] : 'NA','answer' => isset($view_data['pd_section_data'][8]['business_is_pd_visited']) ? $view_data['pd_section_data'][8]['business_is_pd_visited'] : 'NA'); $score_card_questions['employees_total'] = array('answer_id' => ($view_data['pd_section_data'][7]['permanant_employees_person_met'] + $view_data['pd_section_data'][7]['temporary_employees_person_met'] ),'answer' => ($view_data['pd_section_data'][7]['permanant_employees_person_met'] + $view_data['pd_section_data'][7]['temporary_employees_person_met'] )); - $score_card_questions['owned_property'] = array('answer_id' => ($view_data['pd_section_data'][8]['business_ownership_type'] == 'Rented' ? 'No' : 'Yes') ,'answer' => ($view_data['pd_section_data'][8]['business_ownership_type'] == 'Rented' ? 'No' : 'Yes')); + $score_card_questions['owned_property'] = array('answer_id' => (isset($view_data['pd_section_data'][8]['business_ownership_type']) ? ($view_data['pd_section_data'][8]['business_ownership_type'] == 'Rented' ? 'No' : 'Yes') : 'NA') ,'answer' => (isset($view_data['pd_section_data'][8]['business_ownership_type']) ? ($view_data['pd_section_data'][8]['business_ownership_type'] == 'Rented' ? 'No' : 'Yes') : 'NA')); - $score_card_questions['business_activity'] = array('answer_id' => $view_data['pd_section_data'][8]['business_is_pd_visited'],'answer' => $view_data['pd_section_data'][8]['business_is_pd_visited']); + //$score_card_questions['business_activity'] = array('answer_id' => $view_data['pd_section_data'][8]['business_is_pd_visited'],'answer' => $view_data['pd_section_data'][8]['business_is_pd_visited']); $score_card_questions['stock_visited'] = array('answer_id' => (isset($view_data['pd_section_data'][13]['estimated_uom']) ? $view_data['pd_section_data'][13]['estimated_uom'] : 'NA'),'answer' => (isset($view_data['pd_section_data'][13]['estimated_uom']) ? $view_data['pd_section_data'][13]['estimated_uom'] : 'NA')); @@ -1611,8 +1611,9 @@ public function filterSalesPDList_post() { $this->response($data,REST_Controller::HTTP_OK); } - print_r($this->db->last_query()); + // print_r($this->db->last_query()); } + } \ No newline at end of file diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index 422792f6..6ad7fb54 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -245,14 +245,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } $ownership_type = ''; - if( (strtolower($pd_section_data[8]['business_ownership_type'])) == 'owned') + if( isset($pd_section_data[8]['business_ownership_type']) && (strtolower($pd_section_data[8]['business_ownership_type'])) == 'owned') { $ownership_type = '( Owned )'; } - else + else if(isset($pd_section_data[8]['business_ownership_type']) && (strtolower($pd_section_data[8]['business_ownership_type'])) == 'rented') { $ownership_type = ' ( Rented ) - Rent paid '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[8]['business_monthly_rented_amt']); } + echo ' Address Type / Ownership '.$pd_section_data[2]['address_type']['address_type'].$ownership_type.''; if(isset($pd_section_data[8]['is_business_address']) && strtolower($pd_section_data[8]['is_business_address']) == 'yes') { @@ -399,9 +400,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Loan Amount Applied for () - + Total Fund Requirement () - + @@ -411,16 +412,16 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Loan tenure - + End use of Loan - + Is There any Balance Transfer - + @@ -437,29 +438,29 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Type of Property being Mortaged - + Name of The Owner - + Estimated Market Value as per Customer - + Market Value considered for LTV - + Addess of property - + Stage of construction - + Property usage - + Structure type - + @@ -630,10 +631,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Activity Observed during Visit (Yes / No) - +
@@ -1075,6 +1076,10 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re else if(isset($pd_section_data[11]['supplier_not_available_reason'])){ echo '';} + else + { + echo ''; + } if(isset($pd_section_data[11]['common_remarks']) && !empty($pd_section_data[11]['common_remarks'])){ echo '';} @@ -1108,6 +1113,10 @@ if(isset($pd_section_data[11]['common_remarks']) && !empty($pd_section_data[11][ else if(isset($pd_section_data[12]['client_not_available_reason'])){ echo '';} + else + { + echo ''; + } if(isset($pd_section_data[12]['common_remarks']) && !empty($pd_section_data[12]['common_remarks'])){ echo ''; } @@ -1155,6 +1164,10 @@ if(isset($pd_section_data[12]['common_remarks']) && !empty($pd_section_data[12][ { echo ''; } + else + { + echo ''; + } if(isset($pd_section_data[13]['common_remarks']) && !empty($pd_section_data[13]['common_remarks'])){ echo '';} @@ -1189,7 +1202,7 @@ Business run by the applicant - + @@ -1274,7 +1287,7 @@ Business run by the applicant - + @@ -1301,7 +1314,7 @@ Business run by the applicant'; } - if($pd_section_data[15]['common_remarks']) + if(isset($pd_section_data[15]['common_remarks']) && $pd_section_data[15]['common_remarks']) { echo ''; }
Supplier Information Not available. Reason - '.$pd_section_data[11]['supplier_not_available_reason'] .'
Supplier Information Not available
Remarks - '.$pd_section_data[11]['common_remarks'] .'
Client Information Not available. Reason - '.$pd_section_data[12]['client_not_available_reason'] .'
Client Information Not available
Remarks - '.$pd_section_data[12]['common_remarks'] .'
Stock Information Not available. Reason - '.$pd_section_data[13]['stock_not_available_reason'] .'
Stock Information Not available.
Remarks - '.$pd_section_data[13]['common_remarks'] .'
Business Banking & Personal Banking
Sr. No. Account Holder's Name Existing Loan Obligations
Sr. No. Loan
Type
Existing Loan Obligations Not Available
Remarks '. $pd_section_data[15]['common_remarks'] .'