SMC REPORT 1

This commit is contained in:
Velz2020 2020-11-24 02:15:36 +05:30
parent b6545b1167
commit 64e4c651a5
5 changed files with 374 additions and 63 deletions

View File

@ -1443,12 +1443,15 @@ public function filterSalesPDList_post() {
{
foreach ($pd_section_data as $key => $value)
{
$value['json'] = smc_creditpd::getSMCCreditPDReportContent($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'];
//die();
}
}
// print_r($view_data['pd_section_data'][18]);die();
// print_r($view_data['pd_section_data'][15]);die();
$html_content = $this->load->view('smc_creditpd_reports/MWISE',$view_data,true);
// echo $html_content;die();

View File

@ -29,6 +29,23 @@ class applicantname_grabber
return $type == 1 ? $value['applicant_name'] : ($type == 2 ? $value['title'] : ($value['title'].' '.$value['applicant_name']));
}
}
}
public static function getMultipleApplicantsNameById($arr,$latest_applicants_names) //$type i for return name only, 2 for return title only, and 3 for return both
{
$mergered_applicants_name = '';
foreach ($arr as $key => $value) {
foreach ($latest_applicants_names as $k => $val)
{
if($value == $val['pd_co_applicant_id'])
{
$mergered_applicants_name .= $val['applicant_name'].', ';
}
}
}
if($mergered_applicants_name != ''){ $mergered_applicants_name = substr_replace($mergered_applicants_name, '',-2);}
return $mergered_applicants_name;
}
}
?>

View File

@ -2,11 +2,14 @@
class readexceldata
{
private static $current_section_id = null;
public static function getExcelSectionData($file_path_withname,$section_id = null,$pd_id = null)
{
$CI =&get_instance();
$CI->load->library('myspreadsheet');
SELF::$current_section_id = $section_id;
// echo is_numeric($section_id);
// var_dump($section_id);die();
//echo $file_path_withname;echo file_exists($file_path_withname); die();
@ -51,7 +54,7 @@ class readexceldata
$return_data = SELF::getIndividualSectionData($sheetData,$section_ref_data);
if($section_id == 2) //get pd initialted address as custom function
if($section_id == 2 || $section_id == 8) //get pd initialted address as custom function
{
$pd_address = $CI->PD_Model->getPDAddress($pd_id);
@ -107,10 +110,24 @@ class readexceldata
}
}
// print_r($keys);
// print_r($return_data);die();
//print_r($return_data);//die();
$return_data = SELF::transformRowColumsForMultipleData($return_data,$keys);
// print_r($return_data);
// die();
if(SELF::$current_section_id == 10)
{
$return_data['financial_info'] = array_reverse($return_data['financial_info']);
$return_data['broken_period_turnover_percent'] = SELF::getNumFormat($return_data['broken_period_turnover_percent'],'per');
$return_data['net_profit_to_sales_percent'] = SELF::getNumFormat($return_data['net_profit_to_sales_percent'],'per');
$return_data['net_profit_rs'] = SELF::getNumFormat($return_data['net_profit_rs']);
$return_data['sales_amount'] = SELF::getNumFormat($return_data['net_profit_rs']);
$return_data['broken_period_turnover_cy'] = SELF::getNumFormat($return_data['broken_period_turnover_cy']);
$return_data['broken_period_turnover_py'] = SELF::getNumFormat($return_data['broken_period_turnover_py']);
$return_data['broken_period_from_month'] = SELF::getExcel2DateFormat($return_data['broken_period_from_month']);
$return_data['broken_period_to_month'] = SELF::getExcel2DateFormat($return_data['broken_period_to_month']);
}
// print_r($return_data);
// die();
return ($return_data);
}
@ -200,12 +217,18 @@ class readexceldata
$return_data[] = $value;
}
}
// if(SELF::$current_section_id == 5)
// {
// print_r($return_data);
// }
return $return_data;
}
static function transformRowColumsForMultipleData($return_data,$keys)
{
$final_data = array();
$keys_to_be_decimal = array('sales_revenue','net_profit');
$keys_to_be_per = array('share_holding');
// print_r($return_data);
// print_r($keys);die();
foreach ($keys as $current_key => $arr)
@ -223,7 +246,21 @@ class readexceldata
{
for($j=0;$j<$total_no_of_data;$j++)
{
$temp[$j][ $arr[$i] ] = isset($data_to_be_transform[ $arr[$i] ][$j]) ? $data_to_be_transform[ $arr[$i] ][$j] : '';
if(in_array($arr[$i],$keys_to_be_decimal))
{
$temp[$j][ $arr[$i] ] = isset($data_to_be_transform[ $arr[$i] ][$j]) ? (SELF::getNumFormat($data_to_be_transform[ $arr[$i] ][$j])) : '';
}
else if(in_array($arr[$i],$keys_to_be_per))
{
$temp[$j][ $arr[$i] ] = isset($data_to_be_transform[ $arr[$i] ][$j]) ? (SELF::getNumFormat($data_to_be_transform[ $arr[$i] ][$j],'per')) : '';
}
else
{
$temp[$j][ $arr[$i] ] = isset($data_to_be_transform[ $arr[$i] ][$j]) ? $data_to_be_transform[ $arr[$i] ][$j] : '';
}
}
}
@ -232,6 +269,28 @@ class readexceldata
}
}
return $return_data;
}
}
static function getNumFormat($field,$field_type = '')
{
if(isset($field) && $field != '')
{
if($field_type == 'per')
{
$field = $field * 100;
}
$field = number_format($field,2,'.','');
}
return $field;
}
static function getExcel2DateFormat($excel_date)
{
// $excel_date = 39994;
return gmdate('d-m-Y',$UNIX_DATE = (($excel_date) - 25569) * 86400);
// return date('m/d/Y',mktime(0,0,0,1,($excel_date-1),1900));
//gmdate("d-m-Y H:i:s", $UNIX_DATE);
}
}
?>

View File

@ -2,9 +2,10 @@
class smc_creditpd
{
public static function getSMCCreditPDReportContent($section)//1 = Di, 2 = SAL
private static $current_pd_id = null;
public static function getSMCCreditPDReportContent($section,$pd_id)//1 = Di, 2 = SAL
{
SELF::$current_pd_id = $pd_id;
// $CI =&get_instance();
// $CI->load->model('PD_Model');
$return_data =array();
@ -13,8 +14,6 @@ class smc_creditpd
case 1://borrower
$return_data = SELF::getBorrowerSectionData($section);
break;
case 2://address
case 3://fund
case 4://General Business
case 5://Key Stakeholders
@ -23,12 +22,13 @@ class smc_creditpd
case 9://banking
case 10://finance
case 14://future
case 16://other family
case 18://credit
case 19://final remarks
$return_data = json_decode($section['json'],true);
break;
case 2://address
$return_data = SELF::getAddressSectionData($section);
break;
case 8://assest
$return_data = SELF::getAssestSectionData($section);
break;
@ -47,7 +47,10 @@ class smc_creditpd
case 15://existing loan
$return_data = SELF::getExistingLoanSectionData($section);
break;
case 16://other family
$return_data = SELF::getFamilySectionData($section);
// print_r($return_data);die();
break;
case 17://neighborhood
$return_data = SELF::getNeibourSectionData($section);
break;
@ -62,27 +65,31 @@ class smc_creditpd
$json = json_decode($section['json'],true);
foreach ($json['borrower_details'] as $key => $value)
{
if(!strcasecmp($value['borrower_met'],'yes'))
if(isset($value['borrower_met']) && !strcasecmp($value['borrower_met'],'yes'))
{
$json['person_met'] = $value['borrower_name'];
break;
}
}
if(!isset($json['person_met']))
{
$json['person_met'] = 'No One Met';
}
// if(!isset($json['person_met']))
// {
// $json['person_met'] = '';
// }
return $json;
}
static function getAssestSectionData($section)
{
$json = json_decode($section['json'],true);
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
// $CI =&get_instance();
// $CI->load->model('PD_Model');
$applicant_details = applicantname_grabber::getLatestApplicantsName($section['fk_pd_id']);
$asset_type = array('2' => 'Property','3' => 'Vehicle','4' => 'Equipments and machinery','5' => 'Jewellery','6' => 'Life Insurance Policy','7' => 'Investments','1' => 'Others');
$address_type = array('2' => 'Clinic','3' => 'Factory','4' => 'Warehouse / Godown','5' => 'Shop','6' => 'Residence','7' => 'Residence cum Office','1' => 'Others','8' => 'Industrial Shed','9'=> 'Workshop','10'=> 'Business Centre','11'=> 'Shared Office','12'=> 'Office');
$vehicle_type = array('2' => 'Car/Jeep','3' => 'Truck/ Bus','4' => 'Rickshaw/Tempo','5' => 'Tractor','6' => 'Two Wheeler','1' => 'Others');
// print_r($applicant_details);die();
$header_row = '<tr>'.'<th> Particulars </th>';
@ -95,13 +102,37 @@ class smc_creditpd
$seven_row = '<tr>'.'<td> Is there a Loan Against the Asset? (Yes / No) </td>';
foreach ($json['business_assets_details'] as $key => $value)
{
$description = $value['other_asset_description'];
if(isset($value['property_type']))
{
if($value['property_type'] == 1){ $description .= '('. $value['property_type_others'] .')'; }
else{ $description .= '('. $address_type[ $value['property_type'] ] .')'; }
}
if(isset($value['vehicle_type']))
{
if($value['vehicle_type'] == 1){ $description .= '('. $value['vehicle_type_others'] .')'; }
else{$description .= '('. $vehicle_type[ $value['vehicle_type'] ] .')';}
}
if(isset($value['business_purchase_year']))
{
$description .= ' purchased at '.$value['business_purchase_year'];
}
if(isset($value['property_address']))
{
$description .= ' is in '. $value['property_address'];
}
$business_ownership_type = $value['business_ownership_type'] . (isset($value['business_monthly_rented_amt']) ? ' ( '. $rupee_symbol .' '. MYUTIL::customIndianNumberFormat($value['business_monthly_rented_amt']) .' ) ' : '');
$header_row .= '<th> Assest '. ( $key + 1 ).'</th>';
$first_row .= '<td style="text-align:center;">'. $asset_type [ $value['business_assets_mode'] ].'</td>';
$second_row .= '<td style="text-align:center;">'. $value['other_asset_description'] .'</td>';
$third_row .= '<td style="text-align:center;"> '. $value['business_ownership_type'] .' </td>';
$business_name_of_the_owner = (isset($value['business_name_of_the_owner']) ? (applicantname_grabber::getApplicantsNameById($value['business_name_of_the_owner'],$applicant_details)): 'NA');
$first_row .= '<td style="text-align:center;">'. ( $value['business_assets_mode'] == 1 ? $value['other_asset_description'] : $asset_type [ $value['business_assets_mode'] ]).'</td>';
$second_row .= '<td style="text-align:center;">'. $description .'</td>';
$third_row .= '<td style="text-align:center;"> '.$business_ownership_type.' </td>';
$business_name_of_the_owner = (isset($value['business_name_of_the_owner']) ? (applicantname_grabber::getMultipleApplicantsNameById($value['business_name_of_the_owner'],$applicant_details)): 'NA');
$fourth_row .= '<td style="text-align:center;"> '. $business_name_of_the_owner .' </td>';
$five_row .= '<td style="text-align:center;"> '. (isset($value['business_approximate_market_value']) ? $value['business_approximate_market_value'] : 'NA') .' </td>';
$five_row .= '<td style="text-align:center;"> '. (isset($value['business_approximate_market_value']) ? ( $rupee_symbol .' '. MYUTIL::customIndianNumberFormat($value['business_approximate_market_value'])) : 'NA') .' </td>';
$siz_row .= '<td style="text-align:center;"> '. (isset($value['business_purchase_year']) ? $value['business_purchase_year'] : 'NA') .' </td>';
$seven_row .= '<td style="text-align:center;"> '. (isset($value['business_emi']) ? $value['business_emi'] : 'NA') .' </td>';
}
@ -130,6 +161,8 @@ class smc_creditpd
$five_row = '<tr>'.'<td> Payment Terms </td>';
$siz_row = '<tr>'.'<td> Payment Mode </td>';
$seven_row = '<tr>'.'<td> No of days credit </td>';
if(isset($json['supplier_details']) && is_array($json['supplier_details']) && count($json['supplier_details']))
{
foreach ($json['supplier_details'] as $key => $value)
{
@ -153,6 +186,7 @@ class smc_creditpd
$seven_row .= '</tr>';
$json['display_data'] = array('header_row' => $header_row,'first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'siz_row' => $siz_row,'seven_row' => $seven_row);
}
return $json;
}
@ -162,6 +196,7 @@ class smc_creditpd
$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');
// print_r($json);die();
$header_row = '<tr>'.'<th> Particulars </th>';
$first_row = '<tr>'.'<td> Product/ Service </td>';
$second_row = '<tr>'.'<td> Contact Person </td>';
@ -170,6 +205,8 @@ class smc_creditpd
$five_row = '<tr>'.'<td> Payment Terms </td>';
$siz_row = '<tr>'.'<td> Payment Mode </td>';
$seven_row = '<tr>'.'<td> No of days credit </td>';
if(isset($json['client_details']) && is_array($json['client_details']) && count($json['client_details']))
{
foreach ($json['client_details'] as $key => $value)
{
@ -183,6 +220,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>';
}
}
$header_row .= '</tr>';
$first_row .= '</tr>';
$second_row .= '</tr>';
@ -205,7 +243,8 @@ class smc_creditpd
$CI->load->model('PD_Model');
$uom_master = $CI->PD_Model->selectCustomRecords(array('*'),array('isactive' => 1),UOM);
// print_r($json);die();
if(isset($json['stock_details']) && is_array($json['stock_details']) && count($json['stock_details']))
{
foreach ($json['stock_details'] as $key => $value)
{
if(isset($value['estimated_uom']))
@ -218,6 +257,7 @@ class smc_creditpd
}
}
}
}
//echo 'asfter';
// print_r($json);die();
return $json;
@ -234,6 +274,7 @@ class smc_creditpd
$third_row = '<tr>'.'<td> Availed From </td>';
$fourth_row = '<tr>'.'<td> Borrower`s Name </td>';
$five_row = '<tr>'.'<td> Instalment Amount (Rs) </td>';
$install_fre_row = '<tr>'.'<td> Instalment Frequency (Rs) </td>';
$siz_row = '<tr>'.'<td> Original Tenure (Mnts) </td>';
$seven_row = '<tr>'.'<td> Elapsed Tenure (Mnts) </td>';
$eight_row = '<tr>'.'<td> Balance Tenure (Mnts) </td>';
@ -247,6 +288,7 @@ class smc_creditpd
// $business_name_of_the_owner = (isset($value['business_name_of_the_owner']) ? (applicantname_grabber::getApplicantsNameById($value['business_name_of_the_owner'],$applicant_details)): 'NA');
$fourth_row .= '<td style="text-align:center;"> '. $value['lender_name'] .' </td>';
$five_row .= '<td style="text-align:center;"> '. (isset($value['instalment_amount']) ? $value['instalment_amount'] : 'NA') .' </td>';
$install_fre_row .= '<td style="text-align:center;"> '. (isset($value['instalment_frequency']) ? $value['instalment_frequency'] : 'NA') .' </td>';
$siz_row .= '<td style="text-align:center;"> '. (isset($value['original_tenure_months']) ? $value['original_tenure_months'] : 'NA') .' </td>';
$seven_row .= '<td style="text-align:center;"> '. (isset($value['elapsed_tenure_months']) ? $value['elapsed_tenure_months'] : 'NA') .' </td>';
$eight_row .= '<td style="text-align:center;"> '. (isset($value['current_tenure_months']) ? $value['current_tenure_months'] : 'NA') .' </td>';
@ -257,11 +299,12 @@ class smc_creditpd
$third_row .= '</tr>';
$fourth_row .= '</tr>';
$five_row .= '</tr>';
$install_fre_row .= '</tr>';
$siz_row .= '</tr>';
$seven_row .= '</tr>';
$eight_row .= '</tr>';
$json['display_data'] = array('header_row' => $header_row,'first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'siz_row' => $siz_row,'seven_row' => $seven_row,'eight_row' => $eight_row);
$json['display_data'] = array('header_row' => $header_row,'first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'siz_row' => $siz_row,'seven_row' => $seven_row,'eight_row' => $eight_row,'install_fre_row' => $install_fre_row);
return $json;
}
@ -300,8 +343,8 @@ class smc_creditpd
$first_row .= '</tr>';
$second_row .= '</tr>';
$third_row .= '</tr>';
$fourth_row .= '<td style="text-align:center;" colspan='.$colspan.'>'.$json['neighbourhood_status'].'</td>'.'</tr>';
$five_row .= '<td style="text-align:center;" colspan='.$colspan.'>'.$json['neighbourhood_remarks'].'</td>'.'</tr>';
$fourth_row .= '<td style="text-align:center;" colspan='.$colspan.'>'.$json['neighbourhood_remarks'].'</td>'.'</tr>';
$five_row .= '<td style="text-align:center;" colspan='.$colspan.'>'.$json['neighbourhood_status'].'</td>'.'</tr>';
// $siz_row .= '</tr>';
// $seven_row .= '</tr>';
@ -311,5 +354,57 @@ class smc_creditpd
}
static function getAddressSectionData($section)
{
$json = json_decode($section['json'],true);
// print_r($json);//die();
$json['address_type'] = SELF::getDBvalue(ADDRESSTYPE,ADDRESSTYPEID,$json['address_type']);
$json['pd_locality'] = SELF::getDBvalue(LOCALITY,LOCALITYID,$json['pd_locality']);
$json['pd_location'] = SELF::getDBvalue(PDLOCATIONAPPROACH,PDLOCATIONAPPROACHID,$json['pd_location']);
$json['comment_locality'] = SELF::getDBvalue(COMMENTSONLOCALITY,COMMENTSONLOCALITYID,$json['comment_locality']);
$json['alternative_address'] = isset($json['alternative_address']) ? $json['alternative_address'] : '';
// die();
return $json;
}
static function getDBvalue($table_name,$field_name,$pk)
{
$CI =&get_instance();
$CI->load->model('PD_Model');
$res_data = $CI->PD_Model->selectCustomRecords(array('*'),array('isactive' => 1,$field_name => $pk),$table_name);
//print_r($CI->db->last_query());
if(is_array($res_data) && count($res_data))
{
return $res_data[0];
}
return null;
}
static function getFamilySectionData($section)
{
$json = json_decode($section['json'],true);
$applicant_details = applicantname_grabber::getLatestApplicantsName(SELF::$current_pd_id);
// print_r($json);die();
if(isset($json['family_details']) && count($json['family_details']))
{
foreach ($json['family_details'] as $key => $value)
{
$json['family_details'][$key]['relationship'] = SELF::getDBvalue(RELATIONSHIPS,RELATIONSHIPSID,$value['relationship']);
$json['family_details'][$key]['stakeholder_relation'] = applicantname_grabber::getApplicantsNameById($value['stakeholder_relation'],$applicant_details);
$json['family_details'][$key]['company_relation'] = SELF::getDBvalue(COMPANYRELATIONSHIPS,COMPANYRELATIONSHIPSID,$value['company_relation']);
// $json[$key]['comment_locality'] = SELF::getDBvalue(COMMENTSONLOCALITY,COMMENTSONLOCALITYID,$value['comment_locality']);
// $json['alternative_address'] = isset($json['alternative_address']) ? $json['alternative_address'] : '';
}
}
// print_r($json);die();
// die();
return $json;
}
}
?>

View File

@ -157,11 +157,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="3"> Name of the Company/Firm</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $applicant_details[0]['company_name']?></td>
</tr>
<?php if(isset($pd_section_data[1]['person_met'])){?>
<tr>
<td colspan="3"> Name of Person Met During Visit</td>
<td class = "tdcenteralign" colspan="7"> <?php echo $pd_section_data[1]['person_met']?> </td>
</tr>
<?php }?>
<!-- <tr>
<td colspan="3"><?php if($master[0]['sales_pd_type'] == 1){echo 'Name of Person Met during visit'; }else{ echo 'Name of the Person Contacted'; } ?></td>
@ -173,12 +176,25 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tr>
<tr>
<td>City</td>
<td class = "tdcenteralign"><?php echo$pd_master_details[0]['state_name']?></td>
<td class = "tdcenteralign"><?php echo$pd_master_details[0]['city_name']?></td>
<td>State</td>
<td class = "tdcenteralign"><?php echo $pd_master_details[0]['city_name']?></td>
<td class = "tdcenteralign"><?php echo $pd_master_details[0]['state_name']?></td>
<td>PIN</td>
<td class = "tdcenteralign" colspan="2"><?php if(isset($pd_master_details[0]['pincode_others'])){ echo $pd_master_details[0]['pincode_others']; } else { echo $pd_master_details[0]['pincode']; }?></td>
</tr>
<?php
if(isset($pd_section_data[2]))
{
if(isset($pd_section_data[2]['alternative_address']) && $pd_section_data[2]['alternative_address'] != '')
{
echo '<tr> <td colspan="3">Actual PD Address</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['alternative_address'].'</td></tr>';
}
echo '<tr> <td colspan="3">Address Type</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['address_type']['address_type'].'</td></tr>';
echo '<tr> <td colspan="3">PD locality</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_locality']['locality_name'].'</td></tr>';
echo '<tr> <td colspan="3">Location Approach</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['pd_location']['description'].'</td></tr>';
echo '<tr> <td colspan="3">Comment On Locality</td> <td colspan="7" class = "tdcenteralign">'.$pd_section_data[2]['comment_locality']['rating'].'</td></tr>';
}
?>
</tbody>
</table>
@ -244,6 +260,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<tr>
<th class="thlargefont" colspan="15">Other Family Members involved in the business</th>
</tr>
<?php if(isset($pd_section_data[16]['family_details'])) {?>
<tr>
<th colspan="5">Name</th>
<th colspan="3" >Relationship</th>
@ -252,28 +269,33 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<th colspan="2" >Started Biz (Yes / No)</th>
<!-- <th colspan="2" >Started Business</th> -->
</tr>
<?php } ?>
<?php
if(isset($pd_section_data[16]))
if(isset($pd_section_data[16]['family_details']) && count($pd_section_data[16]['family_details']))
{
foreach ($pd_section_data[16]['family_details'] as $sectio16_key => $section16_value)
{
echo '<tr><td class="tdcenteralign" colspan="5">'.$section16_value['member_name'] .'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section16_value['relationship'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section16_value['relationship']['name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section16_value['stakeholder_relation'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section16_value['company_relation'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section16_value['company_relation']['name'].'</td>'.
// '<td class="tdcenteralign" colspan="2">'.( 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" style="text-align: center">'.$section16_value['started_biz'].'</td>'.
'</tr>';
}
}
if(isset($pd_section_data[16]['common_remarks']))
{
echo '<tr><th class="tdcenteralign" colspan="5">Remarks</th><td class="tdcenteralign" colspan="10">'.$pd_section_data[16]['common_remarks'] .'</td>';
}
?>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
@ -282,29 +304,49 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<tr>
<th colspan="3">Product/Service Name</th>
<th colspan="2">Contribution Business Product</th>
<th colspan="5">Business Process Brief</th>
<th colspan="5">remarks</th>
</tr>
<?php
// print_r($pd_section_data[6]);
if(isset($pd_section_data[6]))
{
foreach ($pd_section_data[6]['key_products_contribution'] as $section6_key => $section6_value)
{
// 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="5">'.$section6_value['business_process'].'</td>'.'</tr>';
'<td class="tdcenteralign" colspan="5">'.$section6_value['remarks'].'</td>'.'</tr>';
// '<td class="tdcenteralign" colspan="2">'.$section5_value['total_work_exp'].'</td>'.
// '<td class="tdcenteralign" colspan="2">'.( 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>'.
}
// if(isset($pd_section_data[6]['business_process']))
// {
// echo '<tr><th class="tdcenteralign" colspan="3">Remarks</th><td class="tdcenteralign" colspan="8">'.$pd_section_data[6]['business_process'] .'</td>';
// }
if(isset($pd_section_data[6]['common_remarks']))
{
echo '<tr><th class="tdcenteralign" colspan="3">Remarks</th><td class="tdcenteralign" colspan="7">'.$pd_section_data[6]['common_remarks'] .'</td>';
}
}
?>
</tbody></table>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<?php
echo '<tr><th>Business Brief</th></tr><tr><td class="tdcenteralign">'.$pd_section_data[6]['business_process'] .'</td></tr>';?>
</tbody>
</table>
<table class="scorecard_table">
<tbody>
<tr>
@ -333,6 +375,25 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tr>
</tbody>
</table>
<table class="scorecard_table">
<tbody>
<tr>
<th class="thlargefont" colspan="16">General Business Information</th>
</tr>
<tr>
<td colspan="4" >Business Entity Type</td>
<td colspan="4" ><?php echo $pd_section_data[4]['business_entity_type'] ?></td>
</tr>
<tr>
<td colspan="4" >Business Activity</td>
<td colspan="4" ><?php echo $pd_section_data[4]['select_business_activity_type'] ?></td>
</tr>
<tr>
<td colspan="4" >Area of Sale</td>
<td colspan="4" ><?php echo $pd_section_data[4]['area_of_sale'] ?></td>
</tr>
</tbody></table>
<table class="scorecard_table">
<tbody>
<tr>
@ -342,15 +403,20 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td colspan="4" >Business Seasonal (Yes / No)</td>
<td colspan="4" ><?php echo $pd_section_data[4]['seasonality'] ?></td>
<td colspan="4" >If Seasonal Please mention the Lean Months</td>
<td colspan="4" ><?php echo $pd_section_data[4]['low_sale_month'] ?></td>
<?php $low_month = '';if(isset($pd_section_data[4]['low_sale_month']) && is_array($pd_section_data[4]['low_sale_month']) && count($pd_section_data[4]['low_sale_month'])){foreach($pd_section_data[4]['low_sale_month'] as $low){ $low_month .= $low.' ,';}}
if($low_month != ''){$low_month = substr_replace($low_month, '', -1);}else{$low_month = '-';}
?>
<td colspan="4" ><?php echo $low_month ?></td>
</tr>
<?php if(isset($pd_section_data[4]['low_sale_month_reason'])){?>
<tr>
<td colspan="4" >Reason</td>
<td colspan="12" ><?php echo $pd_section_data[4]['low_sale_month_reason'] ?></td>
</tr>
</tbody></table>
<?php }?>
<br>
<table class="scorecard_table">
<tr><th class="thlargefont">Business Assets</th></tr>
</table>
@ -396,6 +462,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//print_r($section5);die();
// $totol = 0;
$pd_section_data[10]['financial_info'] = array_reverse($pd_section_data[10]['financial_info']);
foreach ($pd_section_data[10]['financial_info'] as $fy_key => $fy_value)
{
// if(is_numeric($fy_key))
@ -462,7 +529,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
// echo '<td colspan="1" class="tdcenteralign">'.($fy_value['sales_py']).'</td>';
if($fy_key == 0)
if($fy_key == (count($pd_section_data[10]['financial_info']) - 1))
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
@ -489,7 +556,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
{
if(is_numeric($fy_key))
{
if($fy_key == 0)
if($fy_key == (count($pd_section_data[10]['financial_info']) - 1))
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
@ -514,7 +581,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
{
if(is_numeric($fy_key))
{
if($fy_key == 0)
if($fy_key == (count($pd_section_data[10]['financial_info']) - 1))
{
echo '<td colspan="1" class="tdcenteralign">NA</td>';
}
@ -533,8 +600,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?>
</tr>
</tbody></table>
<br>
</tbody></table>
<!-- <table class="scorecard_table">
<tr>
<td colspan="3">Income to be Considered (Rs Per Annum) </td>
@ -549,12 +616,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td class="tdcenteralign" colspan="2"><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat( $section5['fixed_obligations'] )?></td>
</tr>
</tbody></table> -->
<br>
<table class="scorecard_table">
<tr><th class="thlargefont">Supplier Details</th></tr>
</table>
<table class="scorecard_table">
<?php if(isset($pd_section_data[11]['supplier_details']) && is_array($pd_section_data[11]['supplier_details']) && count($pd_section_data[11]['supplier_details'])) { ?>
<thead>
<?php echo $pd_section_data[11]['display_data']['header_row']?>
@ -569,14 +637,24 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php echo $pd_section_data[11]['display_data']['seven_row']?>
</tbody>
<?php }
else if(isset($pd_section_data[11]['supplier_not_available_reason'])){
echo '<tr><td class="tdcenteralign">Supplier Information Not available. Reason - '.$pd_section_data[11]['supplier_not_available_reason'] .'</td></tr>';}
if(isset($pd_section_data[11]['common_remarks'])){
echo '<tr><td class="tdcenteralign">Remarks - '.$pd_section_data[11]['common_remarks'] .'</td></tr>';}
?>
</table>
<br>
<table class="scorecard_table">
<tr><th class="thlargefont">Client Details</th></tr>
</table>
<table class="scorecard_table">
<?php if(isset($pd_section_data[12]['client_details']) && is_array($pd_section_data[12]['client_details']) && count($pd_section_data[12]['client_details'])) { ?>
<thead>
<?php echo $pd_section_data[12]['display_data']['header_row']?>
@ -590,32 +668,41 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php echo $pd_section_data[12]['display_data']['siz_row']?>
<?php echo $pd_section_data[12]['display_data']['seven_row']?>
</tbody>
<?php }
else if(isset($pd_section_data[12]['client_not_available_reason'])){
echo '<tr><td class="tdcenteralign">Client Information Not available. Reason - '.$pd_section_data[12]['client_not_available_reason'] .'</td></tr>';}
if(isset($pd_section_data[12]['common_remarks'])){
echo '<tr><td class="tdcenteralign">Remarks - '.$pd_section_data[12]['common_remarks'] .'</td></tr>';}
?>
</table><br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="8">Details of Stock Sighted during the PD visit</th>
</tr>
<?php if(isset($pd_section_data[13]['stock_details']) && is_array($pd_section_data[13]['stock_details']) && count($pd_section_data[13]['stock_details']) ){?>
<tr>
<th colspan="1">Sr. No.</th>
<!-- <th colspan="2">Type of Stock (RM / FG)</th> -->
<th colspan="1">Type of Stock (RM / FG)</th>
<th colspan="3">Stock Item</th>
<th colspan="3">Approx Stock Value (Rs)</th>
<th colspan="2">Approx Stock Value (Rs)</th>
<th colspan="1">Approx Stock Quantity</th>
</tr>
<?php
if(isset($pd_section_data[13]))
{
foreach ($pd_section_data[13]['stock_details'] as $section13_key => $section13_value)
{
echo '<tr><td class="tdcenteralign" colspan="1">'.($section13_key + 1) .'</td>'.
// '<td class="tdcenteralign" colspan="2">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="1">'.$section13_value['stock_type'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.(isset($section13_value['estimated_stock_value']) ? $section13_value['estimated_stock_value'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="2">'.(isset($section13_value['estimated_stock_value']) ? $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>'.'</tr>';
@ -627,9 +714,19 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<td class="tdcenteralign" colspan="4">'.( ucfirst($pd_section_data[13]['estimated_uom']) ) .'</td></tr>';
}
}
else if(isset($pd_section_data[13]['stock_not_available_reason']))
{
echo '<tr><td class="tdcenteralign" colspan="8">Stock Information Not available. Reason - '.$pd_section_data[13]['stock_not_available_reason'] .'</td></tr>';
}
if(isset($pd_section_data[13]['common_remarks'])){
echo '<tr><td class="tdcenteralign" colspan="8">Remarks - '.$pd_section_data[13]['common_remarks'] .'</td></tr>';}
?>
</tbody></table>
<?php //print_r($pd_section_data[2]);
// die();?>
<br>
<br>
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
@ -647,15 +744,15 @@ Business run by the applicant</td><td colspan="4"><?php echo $pd_section_data[1
<table class="scorecard_table" style="table-layout: fixed">
<tbody>
<tr>
<th class="thlargefont" colspan="10">Business Banking & Personal Banking</th>
<th class="thlargefont" colspan="8">Business Banking & Personal Banking</th>
</tr>
<tr>
<th colspan="1">Sr. No.</th>
<th colspan="2">Account Holder's Name</th>
<th colspan="3">Bank Name</th>
<th colspan="3">Account Type</th>
<!-- <th colspan="2">OD / CC Limit</th> -->
<th colspan="1">Vintage</th>
<th colspan="1">Account Type</th>
<th colspan="1">OD / CC Limit</th>
<!-- <th colspan="1">Vintage</th> -->
</tr>
<?php
if(isset($pd_section_data[9]))
@ -663,15 +760,15 @@ Business run by the applicant</td><td colspan="4"><?php echo $pd_section_data[1
foreach ($pd_section_data[9]['banking_details'] as $section9_key => $section9_value)
{
$vintage = $section9_value['vintage_year'].'Yr(s)';
$vintage .= (isset($section9_value['vintage_month']) && $section9_value['vintage_month'] != 0 ? (' & '.$section9_value['vintage_month'].'Mt(s)') : '');
// $vintage = $section9_value['vintage_year'].'Yr(s)';
// $vintage .= (isset($section9_value['vintage_month']) && $section9_value['vintage_month'] != 0 ? (' & '.$section9_value['vintage_month'].'Mt(s)') : '');
echo '<tr><td class="tdcenteralign" colspan="1">'.($section9_key + 1) .'</td>'.
// '<td class="tdcenteralign" colspan="2">'.$section13_value['provider_name'].'</td>'.
'<td class="tdcenteralign" colspan="2">'.$section9_value['applicant_name'].'</td>'.
'<td class="tdcenteralign" colspan="3">'.(isset($section9_value['bank_name']) ? $section9_value['bank_name'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="3">'.(isset($section9_value['account_type']) ? $section9_value['account_type'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="1">'.(isset($section9_value['account_type']) ? $section9_value['account_type'] : 'NA').'</td>'.
// '<td class="tdcenteralign" colspan="1">'.(isset($section14_value['estimated_quantity']) ? $section14_value['estimated_quantity'].' '.$section14_value['estimated_uom'] : 'NA').'</td>'.
'<td class="tdcenteralign" colspan="1">'.$vintage.'</td>'.'</tr>';
'<td class="tdcenteralign" colspan="1">'.(isset($section9_value['cc_limit']) ? $section9_value['cc_limit'] : '-').'</td>'.'</tr>';
}
@ -686,7 +783,7 @@ Business run by the applicant</td><td colspan="4"><?php echo $pd_section_data[1
?>
</tbody></table>
<br>
<table class="scorecard_table">
<!-- <table class="scorecard_table">
<tr><th class="thlargefont" colspan="<?php echo (count($pd_section_data[15]['existing_loan_details']) + 1 )?>">Existing Loan Obligations</th></tr>
</table>
<br>
@ -702,12 +799,52 @@ Business run by the applicant</td><td colspan="4"><?php echo $pd_section_data[1
<?php echo $pd_section_data[15]['display_data']['third_row']?>
<?php echo $pd_section_data[15]['display_data']['fourth_row']?>
<?php echo $pd_section_data[15]['display_data']['five_row']?>
<?php echo $pd_section_data[15]['display_data']['install_fre_row']?>
<?php echo $pd_section_data[15]['display_data']['siz_row']?>
<?php echo $pd_section_data[15]['display_data']['seven_row']?>
<?php echo $pd_section_data[15]['display_data']['eight_row']?>
</tbody>
</table> -->
<table class="scorecard_table">
<tr>
<th>Existing Loan Obligations</th>
</tr>
</table>
<br>
<table class="scorecard_table">
<thead>
<tr>
<th colspan="">Sr. No.</th>
<th colspan="">Loan Type</th>
<th colspan="">Loan Amount </th>
<th colspan="">Availed From </th>
<th colspan="">Borrower`s Name </th>
<th colspan="">Instalment Amount (Rs) </th>
<th colspan="">Instalment Frequency (Rs) </th>
<th colspan="">Original Tenure (Mnts) </th>
<th colspan="">Elapsed Tenure (Mnts) </th>
<th colspan="">Balance Tenure (Mnts)</th>
<!-- <th colspan="1">Vintage</th> -->
</tr>
</thead>
<tbody>
<?php
foreach ($pd_section_data[15]['existing_loan_details'] as $key15 => $value15)
{
echo '<tr><td class="tdcenteralign">'. ($key15 + 1) .'</td><td>'. $value15['loan_type'] .'</td><td>'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($value15['loan_amount']).'</td><td>'.$value15['lender_name'].'</td><td>'.$value15['loan_taken_by'].'</td><td class="tdcenteralign">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($value15['instalment_amount']).'</td><td class="tdcenteralign">'.$value15['instalment_frequency'].'</td><td class="tdcenteralign">'.$value15['original_tenure_months'].'</td><td class="tdcenteralign">'.$value15['current_tenure_months'].'</td><td class="tdcenteralign">'.$value15['elapsed_tenure_months'].'</td></tr>';
}
?>
</tbody>
</table>
<br>
<table class="scorecard_table">