for cet data : ps

This commit is contained in:
VE10-Sanjeev 2022-05-24 18:46:30 +05:30
parent 3979ab9031
commit 68a132aaf6
2 changed files with 37 additions and 3 deletions

View File

@ -1669,7 +1669,7 @@ public function filterSalesPDList_post() {
}else{ }else{
$html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true); $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']; $pdf_name = $view_data['pd_master_details'][0]['main_applicant'];
$new_pdf_name = "PD_Report_".$view_data['pd_master_details'][0]['main_applicant']; $new_pdf_name = "PD_Report_".$view_data['pd_master_details'][0]['main_applicant'];

View File

@ -16,8 +16,32 @@ class smc_creditpd
break; break;
case 4://General Business case 4://General Business
$json = json_decode($section['json'],true);
for($i=0;$i<count($json['business_entity']);$i++)
{
$value = $json['business_entity'][$i]['company_name'];
$json['business_entity'][$i]['name_of_the_company'] = (isset($value) ? $company[$value] : 'NA');
}
$return_data = $json;
break;
case 5://Key Stakeholders case 5://Key Stakeholders
$json = json_decode($section['json'],true);
for($i=0;$i<count($json['key_stakeholders']);$i++)
{
$value = $json['key_stakeholders'][$i]['company_name'];
$json['key_stakeholders'][$i]['name_of_the_company'] = (isset($value) ? $company[$value] : 'NA');
}
$return_data = $json;
break;
case 6://bbusiness brief case 6://bbusiness brief
$json = json_decode($section['json'],true);
for($i=0;$i<count($json['key_products_contribution']);$i++)
{
$value = $json['key_products_contribution'][$i]['company_name'];
$json['key_products_contribution'][$i]['name_of_the_company'] = (isset($value) ? $company[$value] : 'NA');
}
$return_data = $json;
break;
case 7://emp strength case 7://emp strength
case 9://banking case 9://banking
case 10://finance case 10://finance
@ -259,6 +283,8 @@ class smc_creditpd
{ {
foreach ($json['supplier_details'] as $key => $value) foreach ($json['supplier_details'] as $key => $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 .= '<th>Supplier '.$value['supplier_name'].'</th>'; $header_row .= '<th>Supplier '.$value['supplier_name'].'</th>';
$first_row .= '<td style="text-align:center;">'. $value['provider_name'] .'</td>'; $first_row .= '<td style="text-align:center;">'. $value['provider_name'] .'</td>';
@ -309,6 +335,8 @@ class smc_creditpd
foreach ($json['client_details'] as $key => $value) 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 .= '<th>Client '.$value['client_name'].'</th>'; $header_row .= '<th>Client '.$value['client_name'].'</th>';
$first_row .= '<td style="text-align:center;">'. $value['provider_name'] .'</td>'; $first_row .= '<td style="text-align:center;">'. $value['provider_name'] .'</td>';
@ -352,11 +380,16 @@ class smc_creditpd
{ {
foreach ($json['stock_details'] as $key => $value) 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'])) if(isset($value['estimated_uom']))
{ {
//echo $value['estimated_uom'];die(); //echo $value['estimated_uom'];die();
foreach ($uom_master as $m_key => $mvalue) foreach ($uom_master as $m_key => $mvalue)
{ {
if($value['estimated_uom'] == $mvalue['uom_id']) if($value['estimated_uom'] == $mvalue['uom_id'])
{ $json['stock_details'][$key]['estimated_uom'] = $mvalue['name'];break; } { $json['stock_details'][$key]['estimated_uom'] = $mvalue['name'];break; }
} }
@ -385,6 +418,7 @@ class smc_creditpd
$eight_row = '<tr>'.'<td> Balance Tenure (Mnts) </td>'; $eight_row = '<tr>'.'<td> Balance Tenure (Mnts) </td>';
foreach ($json['existing_loan_details'] as $key => $value) 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'); $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 .= '<th>Loan '.($key + 1).'</th>'; $header_row .= '<th>Loan '.($key + 1).'</th>';