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 = ''.' Particulars '; diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index 36447612..5e37c74d 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -6,7 +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(); + //print_r($master[0]['abbr']);die(); + $company = array(); + $arr = $pd_section_data[1]['borrower_details']; + if(!empty($arr)){ + for($i=0;$i @@ -502,7 +512,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ''.( isset ($section5_value['previous_experience_details']) && $section5_value['previous_experience_details'] ? $section5_value['previous_experience_details'] : 'NA' ).''. ''.$section5_value['started_biz'].''. - ''.( isset ($section5_value['company_name']) ? $section5_value['company_name'] : 'NA' ).''. + ''.( isset ($section5_value['company_name']) ? $company[$section5_value['company_name']] : 'NA' ).''. ''; } @@ -567,7 +577,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); foreach ($pd_section_data[4]['business_entity'] as $key => $value) { echo "". "Name of the Company". - "".$value['company_name']."". + "".$company[$value['company_name']]."". ""; echo "". "Business Entity Type". @@ -607,7 +617,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // print_r($section6_value); echo ''.$section6_value['product_name'] .''. ''.$section6_value['contribution_business_product'].'%'. - ''.$section6_value['company_name'].''. + ''.$company[$section6_value['company_name']].''. ''.$section6_value['remarks'].''.''; // ''.$section5_value['total_work_exp'].''. @@ -699,7 +709,7 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re if($low_month != ''){$low_month = substr_replace($low_month, '', -1);}else{$low_month = '-';} echo "". "Name of the Company". - "".$value['company_name']."". + "".$company[$value['company_name']]."". ""; echo "". "Business Seasonal (Yes / No)". @@ -807,7 +817,7 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re $business_ownership_type = $b_asset['business_ownership_type'] . (isset($b_asset['business_monthly_rented_amt']) ? ' ( '. $rupee_symbol .' '. MYUTIL::customIndianNumberFormat($b_asset['business_monthly_rented_amt']) .' ) ' : ''); $business_name_of_the_owner = (isset($b_asset['business_name_of_the_owner']) ? (applicantname_grabber::getMultipleApplicantsNameById($b_asset['business_name_of_the_owner'],$applicant_details)): 'NA'); - echo ' '.( $b_asset['business_assets_mode'] == 1 ? $b_asset['other_asset_description'] : $asset_type [ $b_asset['business_assets_mode'] ]).' '. $description .' '. $business_ownership_type .' '. $business_name_of_the_owner .' '.(isset($b_asset['business_approximate_market_value']) ? ( $rupee_symbol .' '. MYUTIL::customIndianNumberFormat($b_asset['business_approximate_market_value'])) : 'NA').' '.(isset($b_asset['business_purchase_year']) ? $b_asset['business_purchase_year'] : 'NA').''.(isset($b_asset['business_emi']) ? $b_asset['business_emi'] : 'NA').''.(isset($b_asset['company_name']) ? $b_asset['company_name'] : 'NA').''; + echo ' '.( $b_asset['business_assets_mode'] == 1 ? $b_asset['other_asset_description'] : $asset_type [ $b_asset['business_assets_mode'] ]).' '. $description .' '. $business_ownership_type .' '. $business_name_of_the_owner .' '.(isset($b_asset['business_approximate_market_value']) ? ( $rupee_symbol .' '. MYUTIL::customIndianNumberFormat($b_asset['business_approximate_market_value'])) : 'NA').' '.(isset($b_asset['business_purchase_year']) ? $b_asset['business_purchase_year'] : 'NA').''.(isset($b_asset['business_emi']) ? $b_asset['business_emi'] : 'NA').''.(isset($b_asset['company_name']) ? $company[$b_asset['company_name']] : 'NA').''; } ?>