From 68a132aaf69d5209a56fd0b58e830e6391ea88bf Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Tue, 24 May 2022 18:46:30 +0530 Subject: [PATCH] for cet data : ps --- .../controllers/SMC_Credit_PD_Controller.php | 2 +- .../helpers/smc_creditpd_helper.php | 38 ++++++++++++++++++- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index dfb9169c..fa1bc610 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1669,7 +1669,7 @@ public function filterSalesPDList_post() { }else{ $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); } - + // print_r($html_content);exit(); $pdf_name = $view_data['pd_master_details'][0]['main_applicant']; $new_pdf_name = "PD_Report_".$view_data['pd_master_details'][0]['main_applicant']; diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index 841bfb9a..66fff635 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -16,8 +16,32 @@ class smc_creditpd break; case 4://General Business + $json = json_decode($section['json'],true); + for($i=0;$i $value) { + $json['supplier_details'][$key]['name_of_the_company'] = (isset($value['company_name']) ? $company[$value['company_name']] : 'NA'); + $json['supplier_details'][$key]['type_of_payment'] = (isset($value['payment_type']) ? $payment_term [ $value['payment_type'] ]: 'NA'); $header_row .= 'Supplier '.$value['supplier_name'].''; $first_row .= ''. $value['provider_name'] .''; @@ -309,7 +335,9 @@ class smc_creditpd foreach ($json['client_details'] as $key => $value) { - + $json['client_details'][$key]['name_of_the_company'] = (isset($value['company_name']) ? $company[$value['company_name']] : 'NA'); + $json['client_details'][$key]['type_of_payment'] = (isset($value['payment_type']) ? $payment_term [ $value['payment_type'] ]: 'NA'); + $header_row .= 'Client '.$value['client_name'].''; $first_row .= ''. $value['provider_name'] .''; $second_row .= ''. $value['contact_person_name'] .''; @@ -351,12 +379,17 @@ class smc_creditpd if(isset($json['stock_details']) && is_array($json['stock_details']) && count($json['stock_details'])) { foreach ($json['stock_details'] as $key => $value) - { + { + if(isset($value['company_name'])) + { + $json['stock_details'][$key]['name_of_the_company'] = (isset($value['company_name']) ? $company[$value['company_name']] : 'NA'); + } if(isset($value['estimated_uom'])) { //echo $value['estimated_uom'];die(); foreach ($uom_master as $m_key => $mvalue) { + if($value['estimated_uom'] == $mvalue['uom_id']) { $json['stock_details'][$key]['estimated_uom'] = $mvalue['name'];break; } } @@ -385,6 +418,7 @@ class smc_creditpd $eight_row = ''.' Balance Tenure (Mnts) '; foreach ($json['existing_loan_details'] as $key => $value) { + $json['existing_loan_details'][$key]['lender_name'] = ((isset($value['lender_name']) && $value['lender_name'] != 0) ? $value['lender_name'] : 'NA'); $json['existing_loan_details'][$key]['business_owner_name'] = (isset($value['business_name_of_the_owner']) ? (applicantname_grabber::getApplicantsNameById($value['business_name_of_the_owner'],$applicant_details)): 'NA'); $header_row .= 'Loan '.($key + 1).'';