LFMP company name in report : ps

This commit is contained in:
Sanjeev 2021-04-27 20:11:26 +05:30
parent 2c11fd6803
commit 9c7b003e66
4 changed files with 88 additions and 7 deletions

View File

@ -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;
}
}

View File

@ -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;
}
}
?>

View File

@ -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 = '<tr>'.'<th> Particulars </th>';

View File

@ -6,7 +6,17 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$dash = '<span style="color:black;"> </span>';
// $product_name = $master[0]['abbr'];
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
//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<count($arr);$i++){
$entity_type = $arr[$i]['entity_type'];
if($entity_type != "Individual"){
$company[$i+1] =$arr[$i]['borrower_name'];
}
}
}
?><!DOCTYPE html>
<html lang="en">
<head>
@ -502,7 +512,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
'<td class="tdcenteralign" colspan="4">'.( isset ($section5_value['previous_experience_details']) && $section5_value['previous_experience_details'] ? $section5_value['previous_experience_details'] : 'NA' ).'</td>'.
'<td class="tdcenteralign" colspan="2" style="text-align: center">'.$section5_value['started_biz'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.( isset ($section5_value['company_name']) ? $section5_value['company_name'] : 'NA' ).'</td>'.
'<td class="tdcenteralign" colspan="2">'.( isset ($section5_value['company_name']) ? $company[$section5_value['company_name']] : 'NA' ).'</td>'.
'</tr>';
}
@ -567,7 +577,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
foreach ($pd_section_data[4]['business_entity'] as $key => $value) {
echo "<tr>".
"<th colspan='4' >Name of the Company</th>".
"<th colspan='4' >".$value['company_name']."</th>".
"<th colspan='4' >".$company[$value['company_name']]."</th>".
"</tr>";
echo "<tr>".
"<td colspan='4' >Business Entity Type</td>".
@ -607,7 +617,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
// print_r($section6_value);
echo '<tr><td class="tdcenteralign" colspan="3">'.$section6_value['product_name'] .'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section6_value['contribution_business_product'].'%</td>'.
'<td class="tdcenteralign" colspan="2">'.$section6_value['company_name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.$company[$section6_value['company_name']].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section6_value['remarks'].'</td>'.'</tr>';
// '<td class="tdcenteralign" colspan="2">'.$section5_value['total_work_exp'].'</td>'.
@ -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 "<tr>".
"<th colspan='4' >Name of the Company</th>".
"<th colspan='4' >".$value['company_name']."</th>".
"<th colspan='4' >".$company[$value['company_name']]."</th>".
"</tr>";
echo "<tr>".
"<td colspan='4' >Business Seasonal (Yes / No)</td>".
@ -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 '<tr> <td colspan="2">'.( $b_asset['business_assets_mode'] == 1 ? $b_asset['other_asset_description'] : $asset_type [ $b_asset['business_assets_mode'] ]).'</td> <td colspan="3"> '. $description .'</td> <td colspan="1">'. $business_ownership_type .'</td> <td colspan="1">'. $business_name_of_the_owner .'</td> <td colspan="1">'.(isset($b_asset['business_approximate_market_value']) ? ( $rupee_symbol .' '. MYUTIL::customIndianNumberFormat($b_asset['business_approximate_market_value'])) : 'NA').'</td> <td>'.(isset($b_asset['business_purchase_year']) ? $b_asset['business_purchase_year'] : 'NA').'</td><td colspan="1">'.(isset($b_asset['business_emi']) ? $b_asset['business_emi'] : 'NA').'</td><td colspan="1">'.(isset($b_asset['company_name']) ? $b_asset['company_name'] : 'NA').'</td></tr>';
echo '<tr> <td colspan="2">'.( $b_asset['business_assets_mode'] == 1 ? $b_asset['other_asset_description'] : $asset_type [ $b_asset['business_assets_mode'] ]).'</td> <td colspan="3"> '. $description .'</td> <td colspan="1">'. $business_ownership_type .'</td> <td colspan="1">'. $business_name_of_the_owner .'</td> <td colspan="1">'.(isset($b_asset['business_approximate_market_value']) ? ( $rupee_symbol .' '. MYUTIL::customIndianNumberFormat($b_asset['business_approximate_market_value'])) : 'NA').'</td> <td>'.(isset($b_asset['business_purchase_year']) ? $b_asset['business_purchase_year'] : 'NA').'</td><td colspan="1">'.(isset($b_asset['business_emi']) ? $b_asset['business_emi'] : 'NA').'</td><td colspan="1">'.(isset($b_asset['company_name']) ? $company[$b_asset['company_name']] : 'NA').'</td></tr>';
}
?>