diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 90592d14..9c559bc3 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1517,7 +1517,9 @@ public function filterSalesPDList_post() { { if(isset($value['json']) && $value['json'] != '') { + // $companylist = $this->getCompanyName($value); $value['json'] = smc_creditpd::getSMCCreditPDReportContent($value,$records['pd_id']); + // if($value['fk_form_id'] == 2){print_r($value['json']);die();} $view_data['pd_section_data'][$value['fk_form_id']] = $value['json']; } @@ -1581,7 +1583,7 @@ public function filterSalesPDList_post() { $html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); } - // echo $html_content;exit(); + echo $html_content;exit(); $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 @@ -1717,6 +1719,24 @@ public function filterSalesPDList_post() { } + public static function getCompanyName($section){ + $json = json_decode($section['json'],true); + $cpny = array(); + if(!empty($json['borrower_details'])){ + $inx = 1; + foreach ($json['borrower_details'] as $key => $value) + { + $entity_type = $value['entity_type']; + if($entity_type != "Individual"){ + $cpny[$inx] =$value['borrower_name']; + $inx++; + } + + } + } + return $cpny; + } + } \ No newline at end of file diff --git a/api/application/helpers/applicantname_grabber_helper.php b/api/application/helpers/applicantname_grabber_helper.php index a388b344..50cc4f09 100644 --- a/api/application/helpers/applicantname_grabber_helper.php +++ b/api/application/helpers/applicantname_grabber_helper.php @@ -47,5 +47,22 @@ class applicantname_grabber if($mergered_applicants_name != ''){ $mergered_applicants_name = substr_replace($mergered_applicants_name, '',-2);} return $mergered_applicants_name; } + public static function getCompanyName($section){ + $json = json_decode($section['json'],true); + $cpny = array(); + if(!empty($json['borrower_details'])){ + $inx = 1; + foreach ($json['borrower_details'] as $key => $value) + { + $entity_type = $value['entity_type']; + if($entity_type != "Individual"){ + $cpny[$inx] =$value['borrower_name']; + $inx++; + } + + } + } + return $cpny; + } } ?> \ No newline at end of file diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index bbd53a8f..fe4ad8c4 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -9,6 +9,25 @@ class smc_creditpd // $CI =&get_instance(); // $CI->load->model('PD_Model'); $return_data =array(); + // $json = json_decode($section['json'],true); + // $cpny = array(); + // if(!empty($json['borrower_details'])){ + // $inx = 1; + // foreach ($json['borrower_details'] as $key => $value) + // { + // $entity_type = $value['entity_type']; + // if($entity_type != "Individual"){ + // $cpny[$inx] =$value['borrower_name']; + // $inx++; + // } + + // } + // } + // SELF::$company = $cpny; + // print_r($company);die(); + if($section['fk_form_id'] == 1){ + $company = applicantname_grabber::getCompanyName($section); + } switch($section['fk_form_id']) { case 1://borrower @@ -231,6 +250,21 @@ class smc_creditpd static function getSupplierSectionData($section) { $json = json_decode($section['json'],true); + // print_r(json_decode($section['clist'],true)); + // $cpny = array(); + // if(!empty($json['borrower_details'])){ + // $inx = 1; + // foreach ($json['borrower_details'] as $key => $value) + // { + // $entity_type = $value['entity_type']; + // if($entity_type != "Individual"){ + // $cpny[$inx] =$value['borrower_name']; + // $inx++; + // } + + // } + // } + $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(); $header_row = '