diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 01084da3..716c87e5 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1509,16 +1509,20 @@ public function filterSalesPDList_post() { //$pd_section_data = $this->SMC_Credit_PD_Model->selectCustomRecords(array('*'),array('isactive' => 1,'fk_pd_id' => $records['pd_id']),SMC_CREDIT_PD_SECTION_DATA,array(),'','fk_form_id','ASC'); $pd_section_data = $this->SMC_Credit_PD_Model->getSMCTemplateForPD($records['pd_id'],$view_data['pd_master_details'][0]['fk_product_id'],null,null,'REPORT'); // print_r ($view_data['pd_master_details']);die(); - // print_r($pd_section_data);die(); + // print_r($pd_section_data);die(); $forms_data_to_be_get_direct_from_excel_sheet = array(3,9,10,15); + + // Using borrower_details in $pd_section_data To Get the company name for SMC Credit PD => MWISE; + $companylist = $this->getCompanyName($pd_section_data[0]); + $view_data['company'] = $companylist ; + if(count($pd_section_data)) { foreach ($pd_section_data as $key => $value) { if(isset($value['json']) && $value['json'] != '') { - // $companylist = $this->getCompanyName($value); - $value['json'] = smc_creditpd::getSMCCreditPDReportContent($value,$records['pd_id']); + $value['json'] = smc_creditpd::getSMCCreditPDReportContent($value,$records['pd_id'],$companylist); // if($value['fk_form_id'] == 2){print_r($value['json']);die();} $view_data['pd_section_data'][$value['fk_form_id']] = $value['json']; @@ -1577,13 +1581,14 @@ public function filterSalesPDList_post() { //score card part // print_r($view_data); // 25 "product_abbr": "NBFC/MFI", + if($view_data['pd_master_details'][0]['product_abbr'] == "NBFC/MFI"){ $html_content = $this->load->view('smc_creditpd_reports/NBFC',$view_data,true); }else{ $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 diff --git a/api/application/helpers/applicantname_grabber_helper.php b/api/application/helpers/applicantname_grabber_helper.php index 50cc4f09..a388b344 100644 --- a/api/application/helpers/applicantname_grabber_helper.php +++ b/api/application/helpers/applicantname_grabber_helper.php @@ -47,22 +47,5 @@ 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 fe4ad8c4..fb301d44 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -3,31 +3,12 @@ class smc_creditpd { private static $current_pd_id = null; - public static function getSMCCreditPDReportContent($section,$pd_id)//1 = Di, 2 = SAL + public static function getSMCCreditPDReportContent($section,$pd_id,$company)//1 = Di, 2 = SAL { SELF::$current_pd_id = $pd_id; // $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 @@ -56,10 +37,10 @@ class smc_creditpd break; case 11://supplier - $return_data = SELF::getSupplierSectionData($section); + $return_data = SELF::getSupplierSectionData($section,$company); break; case 12://client - $return_data = SELF::getClientSectionData($section); + $return_data = SELF::getClientSectionData($section,$company); break; case 13://stock @@ -247,23 +228,12 @@ class smc_creditpd return $json; } - static function getSupplierSectionData($section) + static function getSupplierSectionData($section,$company) { + // echo "i am in supp Fns";print_r($company);exit(); $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(); @@ -292,7 +262,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') .' '; $eigth_row .= ' '. (isset($value['credit_total_purchase']) ? $value['credit_total_purchase'].'%' : 'NA') .' '; - $ninth_row .= ' '. (isset($value['company_name']) ? $value['company_name']: 'NA') .' '; + $ninth_row .= ' '. (isset($value['company_name']) ? $company[$value['company_name']] : 'NA') .' '; } $header_row .= ''; $first_row .= ''; @@ -311,7 +281,7 @@ class smc_creditpd } - static function getClientSectionData($section) + static function getClientSectionData($section,$company) { $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'); @@ -342,7 +312,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') .' '; $eight_row .= ' '. (isset($value['credit_total_purchase']) ? $value['credit_total_purchase'].'%' : 'NA') .' '; - $ninth_row .= ' '. (isset($value['company_name']) ? $value['company_name']: 'NA') .' '; + $ninth_row .= ' '. (isset($value['company_name']) ? $company[$value['company_name']] : 'NA') .' '; } diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index 5e37c74d..fb375ee7 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -6,17 +6,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $dash = ' '; // $product_name = $master[0]['abbr']; $rupee_symbol = ""; - //print_r($master[0]['abbr']);die(); - $company = array(); - $arr = $pd_section_data[1]['borrower_details']; - if(!empty($arr)){ - for($i=0;$i @@ -824,7 +824,7 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re There is no other business asset available '; + echo ' There is no other business asset available '; } @@ -834,7 +834,7 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re
Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].'
'; - echo ' Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].' '; + echo ' Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].' '; }?> @@ -849,7 +849,7 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re Name of the Company / Firm whose financials are noted - + @@ -1205,7 +1205,7 @@ if(isset($pd_section_data[12]['common_remarks']) && !empty($pd_section_data[12][ ''. ''. ''. - ''.''; + ''.''; // ''.'';
'.$section13_value['provider_name'].''.(isset($section13_value['estimated_stock_value']) ? $rupee_symbol.''.MYUTIL::customIndianNumberFormat($section13_value['estimated_stock_value']) : 'NA').''.(isset($section13_value['estimated_quantity']) ? $section13_value['estimated_quantity'].' '.$section13_value['estimated_uom'] : 'NA').''.(isset($section13_value['company_name']) ? $section13_value['company_name'] : 'NA').'
'.(isset($section13_value['company_name']) ? $company[$section13_value['company_name']] : 'NA').'
'.(isset($section13_value['company_name']) ? MYUTIL::getCompanyNameById($section13_value['company_name']) : 'NA').'