Company name fixes : ps

This commit is contained in:
Sanjeev 2021-04-28 12:11:28 +05:30
parent 9afac90ea6
commit 09418f5783
4 changed files with 33 additions and 75 deletions

View File

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

View File

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

View File

@ -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 .= '<td style="text-align:center;"> '. (isset($value['payment_mode']) ? $value['payment_mode'] : 'NA') .' </td>';
$seven_row .= '<td style="text-align:center;"> '. (isset($value['credit_period_no']) ? $value['credit_period_no'] : 'NA') .' </td>';
$eigth_row .= '<td style="text-align:center;"> '. (isset($value['credit_total_purchase']) ? $value['credit_total_purchase'].'%' : 'NA') .' </td>';
$ninth_row .= '<td style="text-align:center;"> '. (isset($value['company_name']) ? $value['company_name']: 'NA') .' </td>';
$ninth_row .= '<td style="text-align:center;"> '. (isset($value['company_name']) ? $company[$value['company_name']] : 'NA') .' </td>';
}
$header_row .= '</tr>';
$first_row .= '</tr>';
@ -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 .= '<td style="text-align:center;"> '. (isset($value['payment_mode']) ? $value['payment_mode'] : 'NA') .' </td>';
$seven_row .= '<td style="text-align:center;"> '. (isset($value['credit_period_no']) ? $value['credit_period_no'] : 'NA') .' </td>';
$eight_row .= '<td style="text-align:center;"> '. (isset($value['credit_total_purchase']) ? $value['credit_total_purchase'].'%' : 'NA') .' </td>';
$ninth_row .= '<td style="text-align:center;"> '. (isset($value['company_name']) ? $value['company_name']: 'NA') .' </td>';
$ninth_row .= '<td style="text-align:center;"> '. (isset($value['company_name']) ? $company[$value['company_name']] : 'NA') .' </td>';
}

View File

@ -6,17 +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();
$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'];
}
}
}
// $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>
@ -824,7 +824,7 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re
<?php }else
{
echo '<tr> <td class = "tdcenteralign" colspan="10">There is no other business asset available</td> </tr>';
echo '<tr> <td class = "tdcenteralign" colspan="11">There is no other business asset available</td> </tr>';
}
@ -834,7 +834,7 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re
<?php if(isset($pd_section_data[8]['common_remarks']) && !empty($pd_section_data[8]['common_remarks']))
{
//echo '<br><br><table class="scorecard_table"><tr> <td class = "tdcenteralign" colspan="1">Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].' </td></tr></table>';
echo '<tr> <td class = "tdcenteralign" colspan="10">Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].' </td></tr>';
echo '<tr> <td class = "tdcenteralign" colspan="11">Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].' </td></tr>';
}?>
</tbody>
</table>
@ -849,7 +849,7 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re
<?php if(isset($pd_section_data[10]) && strtolower($pd_section_data[10]['financial_info_available']) == 'yes') { ?>
<tr>
<td colspan="6" >Name of the Company / Firm whose financials are noted </td>
<td class = "tdcenteralign" colspan="4" ><?php echo isset($applicant_details[0]['company_name']) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant']?></td>
<td class = "tdcenteralign" colspan="4" ><?php echo (isset($pd_section_data[10]['company_name'])) ? $compnay[$pd_section_data[10]['company_name']] : isset($applicant_details[0]['company_name']) ? $applicant_details[0]['company_name'] : $pd_master_details[0]['main_applicant']?></td>
</tr>
</tbody></table>
<table class="scorecard_table"><tbody>
@ -1205,7 +1205,7 @@ if(isset($pd_section_data[12]['common_remarks']) && !empty($pd_section_data[12][
'<td class="tdcenteralign" colspan="3">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.(isset($section13_value['estimated_stock_value']) ? $rupee_symbol.''.MYUTIL::customIndianNumberFormat($section13_value['estimated_stock_value']) : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="1">'.(isset($section13_value['estimated_quantity']) ? $section13_value['estimated_quantity'].' '.$section13_value['estimated_uom'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="2">'.(isset($section13_value['company_name']) ? $section13_value['company_name'] : 'NA').'</td>'.'</tr>';
'<td class="tdcenteralign" colspan="2">'.(isset($section13_value['company_name']) ? $company[$section13_value['company_name']] : 'NA').'</td>'.'</tr>';
// '<td class="tdcenteralign" colspan="1">'.(isset($section13_value['company_name']) ? MYUTIL::getCompanyNameById($section13_value['company_name']) : 'NA').'</td>'.'</tr>';