From ca4e0807932804d31584220850728ecedbbe3b5c Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Tue, 24 Nov 2020 20:40:27 +0530 Subject: [PATCH] SMC REPORT 2 --- .../controllers/SMC_Credit_PD_Controller.php | 26 +- .../helpers/satellite_image_helper.php | 17 +- .../helpers/smc_creditpd_helper.php | 38 ++- api/application/models/PD_Model.php | 5 +- .../views/smc_creditpd_reports/MWISE.php | 279 +++++++++++++++--- 5 files changed, 303 insertions(+), 62 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 7fe5717e..269283b5 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -463,18 +463,28 @@ class SMC_Credit_PD_Controller extends REST_Controller { public function saveSMCCreditPDImage_post() { + // echo 'called';die(); $records = $this->post('records'); $is_customer_app = isset($records['is_customer_app']) ? $records['is_customer_app'] : null; unset($records['is_customer_app']); + // print_r($records); + if($records['img_name'] == 'person_met') + { + // echo 'slefie'; + $location = $records['location']; + $update_fields = array('start_location' => $records['location']); + $this->SMC_Credit_PD_Model->updateRecords($update_fields,PDTRIGGER,array('pd_id' => $records['fk_smc_credit_pd_id'])); + // print_r($this->db->last_query());die(); + satellite_image::getSatelliteImage($records['fk_smc_credit_pd_id'],3); + } + // die(); if(!$records['is_multiple']) { - //$location = $records['location']; - //$update_fields = array('geo_location' => $records['location']); - //$this->SMC_Credit_PD_Model->updateRecords($update_fields,SMC_CREDIT_PD,array('smc_credit_pd' => $records['fk_smc_credit_pd'])); + - //satellite_image::getSatelliteImage($records['fk_smc_credit_pd'],2); + // // //disable previous selfie img // $update_fields2 = array('isactive' => 0); @@ -1449,10 +1459,10 @@ public function filterSalesPDList_post() { //die(); } } - // print_r($view_data['pd_section_data'][15]);die(); - - - + // print_r($view_data['pd_section_data'][1]);die(); + $view_data['smc_images'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name!=' => 'satellite'),SMC_CREDIT_PD_DOCS); + $view_data['satellite'] = $this->SMC_Credit_PD_Model->selectCustomRecords(array('doc_id', 'fk_smc_credit_pd_id','img','img_name','isactive'),array('fk_smc_credit_pd_id' => $records['pd_id'],'isactive' => 1,'img_name=' => 'satellite'),SMC_CREDIT_PD_DOCS); + //print_r(count($view_data['smc_images']));die(); $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); // echo $html_content;die(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; diff --git a/api/application/helpers/satellite_image_helper.php b/api/application/helpers/satellite_image_helper.php index 9273a2c8..00c5cc93 100644 --- a/api/application/helpers/satellite_image_helper.php +++ b/api/application/helpers/satellite_image_helper.php @@ -3,25 +3,27 @@ class satellite_image { - public static function getSatelliteImage($pd_id,$pd_type = 1,$api = null)//1 - credit PD,2 - sales pd + public static function getSatelliteImage($pd_id,$pd_type = 1,$api = null)//1 - credit PD,2 - sales pd, 3- smc credit pd { + // echo 'satellite'.$pd_type; $pdid = $pd_id; $api_return = null; $CI =&get_instance(); - $path_to_check = $pd_type == 1 ? $CI->external_path.'/pd_reports/'.$pdid : $CI->external_path.'/sales_pd/'.$pdid; + $path_to_check = ($pd_type == 1 || $pd_type == 3) ? $CI->external_path.'/pd_reports/'.$pdid : $CI->external_path.'/sales_pd/'.$pdid; + // echo $path_to_check;die(); $geo_location = null; $pdmas = array(); $logger = $pd_type == 1 ? MYLOG::logFunction(null,$pdid) : MYLOG::logSalesPD($pdid); - $model_to_load = $pd_type == 1 ? 'PD_Model' : 'Sales_PD_Model'; + $model_to_load = ($pd_type == 1 || $pd_type == 3) ? 'PD_Model' : 'Sales_PD_Model'; //print_r($logger);die(); if(!file_exists($path_to_check)) { mkdir($path_to_check,0777); } $google_map_static_api_key = GOOGLE_STATIC_MAP_API_KEY; - if($pd_type == 1) + if($pd_type == 1 || $pd_type == 3) { $pdmas = $CI->PD_Model->getPDMasterDetails($pdid); $geo_location = $pdmas[0]['start_location']; @@ -98,6 +100,13 @@ class satellite_image $CI->Sales_PD_Model->updateRecords(array('isactive' => 0),SALEPD_DOCS,array('img_name' => 'satellite','fk_sales_pd_id' => $pd_id)); $CI->Sales_PD_Model->saveRecords(array('img' => $satellite_base64,'img_name' => 'satellite','fk_sales_pd_id' => $pdid),SALEPD_DOCS); } + else if($pd_type == 3) + { + echo 'updae'; + $satellite_base64 = base64_encode(file_get_contents($satellite_image_png_path)); + $CI->PD_Model->updateRecords(array('isactive' => 0),SMC_CREDIT_PD_DOCS,array('img_name' => 'satellite','fk_smc_credit_pd_id' => $pd_id)); + $CI->PD_Model->saveRecords(array('img' => $satellite_base64,'img_name' => 'satellite','fk_smc_credit_pd_id' => $pd_id),SMC_CREDIT_PD_DOCS); + } //generate log $logger->info("Generate Satellite Called in (".ENVIRONMENT.")",array('script' => $satellite_script,'script_output' => $ou)); //return $base64_pdscore_chart_url; diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index 2d1100e6..6efd5ded 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -14,7 +14,7 @@ class smc_creditpd case 1://borrower $return_data = SELF::getBorrowerSectionData($section); break; - case 3://fund + case 4://General Business case 5://Key Stakeholders case 6://bbusiness brief @@ -26,6 +26,9 @@ class smc_creditpd case 19://final remarks $return_data = json_decode($section['json'],true); break; + case 3://fund + $return_data = SELF::getLoanSectionData($section); + break; case 2://address $return_data = SELF::getAddressSectionData($section); break; @@ -84,7 +87,8 @@ class smc_creditpd $rupee_symbol = ""; // $CI =&get_instance(); // $CI->load->model('PD_Model'); - + if(isset($json['business_assets_details']) && is_array($json['business_assets_details']) && count($json['business_assets_details'])) + { $applicant_details = applicantname_grabber::getLatestApplicantsName($section['fk_pd_id']); $asset_type = array('2' => 'Property','3' => 'Vehicle','4' => 'Equipments and machinery','5' => 'Jewellery','6' => 'Life Insurance Policy','7' => 'Investments','1' => 'Others'); $address_type = array('2' => 'Clinic','3' => 'Factory','4' => 'Warehouse / Godown','5' => 'Shop','6' => 'Residence','7' => 'Residence cum Office','1' => 'Others','8' => 'Industrial Shed','9'=> 'Workshop','10'=> 'Business Centre','11'=> 'Shared Office','12'=> 'Office'); @@ -145,6 +149,7 @@ class smc_creditpd $siz_row .= ''; $json['display_data'] = array('header_row' => $header_row,'first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'siz_row' => $siz_row,'seven_row' => $seven_row); + } return $json; } @@ -196,7 +201,8 @@ class smc_creditpd $json = json_decode($section['json'],true); $payment_term = array('1' => 'Supply against advance payment','2' => 'Payment on Receipt of goods / service','3' => 'Payment after Credit Period provided'); // print_r($json);die(); - + if(isset($json['client_details']) && is_array($json['client_details']) && count($json['client_details'])) + { $header_row = ''.' Particulars '; $first_row = ''.' Product/ Service '; $second_row = ''.' Contact Person '; @@ -205,8 +211,7 @@ class smc_creditpd $five_row = ''.' Payment Terms '; $siz_row = ''.' Payment Mode '; $seven_row = ''.' No of days credit '; - if(isset($json['client_details']) && is_array($json['client_details']) && count($json['client_details'])) - { + foreach ($json['client_details'] as $key => $value) { @@ -220,7 +225,7 @@ class smc_creditpd $siz_row .= ' '. (isset($value['payment_mode']) ? $value['payment_mode'] : 'NA') .' '; $seven_row .= ' '. (isset($value['credit_period_no']) ? $value['credit_period_no'] : 'NA') .' '; } - } + $header_row .= ''; $first_row .= ''; $second_row .= ''; @@ -231,6 +236,7 @@ class smc_creditpd $seven_row .= ''; $json['display_data'] = array('header_row' => $header_row,'first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'siz_row' => $siz_row,'seven_row' => $seven_row); + } return $json; } @@ -405,6 +411,26 @@ class smc_creditpd return $json; } + static function getLoanSectionData($section) + { + $json = json_decode($section['json'],true); + $applicant_details = applicantname_grabber::getLatestApplicantsName(SELF::$current_pd_id); + // print_r($json);die(); + + $json['owner_name'] = applicantname_grabber::getMultipleApplicantsNameById($json['owner_name'],$applicant_details); + if(isset($json['lender'])) + { + $json['lender'] = SELF::getDBvalue(BTLENDERLIST,BTLENDERLISTID,$json['lender']); + } + $json['state'] = SELF::getDBvalue(STATE,STATEID,$json['state']); + $json['city'] = SELF::getDBvalue(CITY,CITYID,$json['city']); + $pin = $json['pincode'] != 1 ? SELF::getDBvalue(PINCODE,PINCODEID,$json['pincode']) : $json['pincode_others']; + $json['pincode'] = is_array($pin) ? $pin['pincode'] : $pin; + // print_r($json);die(); + + return $json; + } + } ?> \ No newline at end of file diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 23d96d72..ad0dbd30 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -39,6 +39,8 @@ class PD_Model extends SPARQ_Model { $this->db->JOIN(ENTITYLENDERBRANCH.' as ENTITYLENDERBRANCH','PDTRIGGER.pd_branch_id = ENTITYLENDERBRANCH.entity_lender_branch_id','LEFT'); $this->db->JOIN(ENTITYFININSTITUTION.' as ENTITYFININSTITUTION','PDTRIGGER.imgc_fin_institute = ENTITYFININSTITUTION.entity_fin_institution_id','LEFT'); $this->db->JOIN(PDAPPLICANTSDETAILS.' as PDAPPLICANTSDETAILS','PDTRIGGER.pd_id = PDAPPLICANTSDETAILS.fk_pd_id AND PDAPPLICANTSDETAILS.applicant_type = 1','LEFT'); + + // $this->db->JOIN(COMMONMASTER.' as COMMONMASTER','PDTRIGGER.pd_id = COMMONMASTER.primary_key && COMMONMASTER.field_name = pd_status ','LEFT'); $this->db->WHERE('PDTRIGGER.pd_status !=',ARCHIVED); $this->db->WHERE('PDTRIGGER.pd_status !=',TRUNCATED); @@ -985,7 +987,7 @@ class PD_Model extends SPARQ_Model { */ public function getPDMasterDetails($pdid,$random_string = null) { - $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.sub_entity_id,SUBENTITY.short_name as sub_entity_short_name,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PRODUCTS.prod_catagory,PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.is_qc_enabled,AGENCY.full_name as agency_name,AGENCY.short_name as agency_short_name,PDTRIGGER.vendor_pdofficer,concat(VENDORPDOFFICER.first_name," ",VENDORPDOFFICER.last_name) as vendor_pdofficer_name,PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,AGENCY.is_vendor_visit_disabled,PDTRIGGER.is_notify_enabled,ENTITYFININSTITUTION.institute_name as fin_institute_name,PDTRIGGER.is_img_pdf_created,PDTRIGGER.is_video_merged,PDTRIGGER.vendor_status,PDTRIGGER.vendor_scheduled_on as vendor_scheduled_on_validation,DATE_FORMAT(PDTRIGGER.vendor_scheduled_on,"%d/%m/%Y %h:%i %p") as vendor_scheduled_on,PDTRIGGER.complete_override_data,PDTRIGGER.excel_file_id,SMC_EXCEL_FILELIST.file_name,SMC_EXCEL_FILELIST.modified_fname'); + $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.pd_sno,PDTRIGGER.fk_lender_id,PDTRIGGER.sub_entity_id,SUBENTITY.short_name as sub_entity_short_name,PDTRIGGER.imgc_fin_institute,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name,ENTITY.is_score_card_enabled,ENTITY.is_otp_enabled, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PRODUCTS.prod_catagory,PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby,DESIGNATION.designation as updatedby_designation,PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.is_qc_enabled,AGENCY.full_name as agency_name,AGENCY.short_name as agency_short_name,PDTRIGGER.vendor_pdofficer,concat(VENDORPDOFFICER.first_name," ",VENDORPDOFFICER.last_name) as vendor_pdofficer_name,PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.lender_sales_person,concat(LENDERSALESPERSON.first_name," ",LENDERSALESPERSON.last_name) as lender_sales_person_name,LENDERSALESPERSON.mobile_no as lender_sales_contact_mobileno,LENDERSALESPERSON.email as lender_sales_person_email,PDTRIGGER.lender_credit_person,concat(LENDERCREDITPERSON.first_name," ",LENDERCREDITPERSON.last_name) as lender_credit_person_name,LENDERCREDITPERSON.mobile_no as lender_credit_person_contact_mobileno,LENDERCREDITPERSON.email as lender_credit_person_email,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,OTPREJECTION.rejection_reason,PDTRIGGER.otp_reject_other_reason,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created,PDTRIGGER.pd_qc_note,ENTITY.is_sms_enabled,ENTITY.is_mail_enabled,ENTITY.is_app_notify_enabled,AGENCY.is_vendor_visit_disabled,PDTRIGGER.is_notify_enabled,ENTITYFININSTITUTION.institute_name as fin_institute_name,PDTRIGGER.is_img_pdf_created,PDTRIGGER.is_video_merged,PDTRIGGER.vendor_status,PDTRIGGER.vendor_scheduled_on as vendor_scheduled_on_validation,DATE_FORMAT(PDTRIGGER.vendor_scheduled_on,"%d/%m/%Y %h:%i %p") as vendor_scheduled_on,PDTRIGGER.complete_override_data,PDTRIGGER.excel_file_id,SMC_EXCEL_FILELIST.file_name,SMC_EXCEL_FILELIST.modified_fname'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT'); $this->db->JOIN(ENTITY.' as SUBENTITY','PDTRIGGER.sub_entity_id = SUBENTITY.entity_id ','LEFT'); @@ -1017,6 +1019,7 @@ class PD_Model extends SPARQ_Model { $this->db->JOIN(TITLES.' as TITLES','PDAPPLICANTSDETAILS.applicant_title_name = TITLES.title_id','LEFT'); $this->db->JOIN(OTPREJECTION.' as OTPREJECTION','PDTRIGGER.otp_reject_reason = OTPREJECTION.otp_rejection_id','LEFT'); $this->db->JOIN(SMC_EXCEL_FILELIST.' as SMC_EXCEL_FILELIST','SMC_EXCEL_FILELIST.id = PDTRIGGER.excel_file_id','LEFT'); + $this->db->JOIN(DESIGNATION.' as DESIGNATION','USERPROFILE1.designation = DESIGNATION.designation_id','LEFT'); $this->db->WHERE('PDTRIGGER.pd_id',$pdid); if($random_string != null) { diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index 5ed9f4ba..1a9554f3 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -197,6 +197,24 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> +
+ + + + + + + + $value1) + { + echo ''; + } + ?> + + + +
Applicant`s Details
Borrower
Type
NameEntity TypeDesignationRelationRealtion toAgeNo of Year(s)
Business runing
'.$value1['borrower_type'].' '.$value1['borrower_name'].' '.$value1['entity_type'].' '.$value1['designation'].' '.$value1['relationship'].' '.$value1['relationship_to'].' '.(isset($value1['borrower_age']) ? : 'NA').' '.(isset($value1['numbers_of_years_business_running']) ? $value1['numbers_of_years_business_running'] : 'NA').'

@@ -208,13 +226,56 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + +
Loan Amount Applied for (Rs) Total Fund Requirement (Rs)
Remarks of funds for balance Amount required
Is There any Balance Transfer
Balance Transfer AmountTop up amount
Lender from where BT done
Type of Property being Mortaged
Name of The Owner
Loan Tenure (Months)Loan Purpose (End-Use)Estimated Market Value as per CustomerMarket Value considered for LTV
Addess of propertyStage of construction
Property usageStructure type
@@ -253,9 +314,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> - - - +
+
@@ -375,10 +435,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
Other Family Members involved in the business
+ - + @@ -415,13 +476,14 @@ defined('BASEPATH') OR exit('No direct script access allowed'); +
General Business InformationGeneral Business Information
Business Entity Type
-
+
Business Assets
- + @@ -435,14 +497,24 @@ defined('BASEPATH') OR exit('No direct script access allowed'); +'; + } + + - + ?>
There is no Business asset
+
Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].'
'; + }?> - -
+ + @@ -599,24 +671,74 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } ?> -
Financial Information
+ + Debtor days + $fy_value) + { + if(is_numeric($fy_key)) + { + echo ''.number_format($fy_value['debtor_days_cet'],2,'.','') .''; + } + } + ?> + + + Debtor days + $fy_value) + { + if(is_numeric($fy_key)) + { + echo ''.number_format($fy_value['creditor_days_cet'],2,'.','') .''; + } + } + ?> + + + Inventory days + $fy_value) + { + if(is_numeric($fy_key)) + { + echo ''.number_format($fy_value['inventory_days_cet'],2,'.','') .''; + } + } + ?> + + - -
+
+ + +
Particulars of Financials for Latest Year as per person met during PD visit
+ + + '?> + '?> + '?> + + +
Sales / Revenue (Rs) '.$rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[10]['sales_amount']) .'
Net Profit or (Net Loss) to Sales % '. $pd_section_data[10]['net_profit_to_sales_percent'] .'
Net Profit / (Net Loss) (Rs) '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[10]['net_profit_rs']) .'

+ + + +
Working Capital Cycle (As per Person Met during PD)
+ + + '?> + '?> + '?> + + +
Debtor Days '.$pd_section_data[10]['debtor_days_cm'].'Creditor Days '.$pd_section_data[10]['creditor_days_cm'].' Stock Days '.$pd_section_data[10]['inventory_days_cm'].'
Does the business have any working capital facility from any lender other than Moneywise? (Yes / No) '.$pd_section_data[10]['is_any_other_working_captial_facility'].' If Yes, then details of the same to be captured '.$pd_section_data[10]['facility_details_specify'].'
('.(isset($pd_section_data[10]['facility_details_other']) ? $pd_section_data[10]['facility_details_other'] : $pd_section_data[10]['facility_details_other_lender']).')'.'
Remarks on Financials >> '.$pd_section_data[10]['common_remarks'].'
+ +
Supplier Details
@@ -649,6 +771,7 @@ if(isset($pd_section_data[11]['common_remarks'])){ +
@@ -724,8 +847,6 @@ if(isset($pd_section_data[12]['common_remarks'])){ ?>
Client Details
-

@@ -740,7 +861,9 @@ if(isset($pd_section_data[12]['common_remarks'])){
Brief of other group concerns/ Business run by the applicant
-
+ + +
@@ -783,6 +906,9 @@ Business run by the applicant

+ + +