PD FEEDBACK 2 FIXED AFTER SYS FAIL

This commit is contained in:
Lalitha.K 2019-06-15 14:17:59 +05:30
parent 6f9916ce07
commit 5b9b348ea4
8 changed files with 368 additions and 205 deletions

View File

@ -350,6 +350,7 @@ class PD_Controller extends REST_Controller {
/***********************CHOOSE PD TEMPALATE*********************/ /***********************CHOOSE PD TEMPALATE*********************/
if($pd_details['pd_status'] == TRIGGERED) if($pd_details['pd_status'] == TRIGGERED)
{ {
$fields = array('fk_template_id'); $fields = array('fk_template_id');
$where_condition_array = array('fk_lender_id'=>$pd_details['fk_lender_id'] ,'fk_product_id'=> $pd_details['fk_product_id'],'fk_customer_segment'=> $pd_details['fk_customer_segment'],'isactive' => 1); $where_condition_array = array('fk_lender_id'=>$pd_details['fk_lender_id'] ,'fk_product_id'=> $pd_details['fk_product_id'],'fk_customer_segment'=> $pd_details['fk_customer_segment'],'isactive' => 1);
@ -797,20 +798,20 @@ class PD_Controller extends REST_Controller {
/***********************CHOOSE PD TEMPALATE*********************/ /***********************CHOOSE PD TEMPALATE*********************/
$pd_details['fk_pd_template_id'] = $this->assignPDTempalate($pd_details['pd_id']); $pd_details['fk_pd_template_id'] = $this->assignPDTempalate($pd_details['pd_id']);
echo $pd_details['fk_pd_template_id'];
if($pd_details['fk_pd_template_id'] != "" || $pd_details['fk_pd_template_id'] != null) if($pd_details['fk_pd_template_id'] != "" || $pd_details['fk_pd_template_id'] != null)
{ {
$logger->info("TEMPLATE ASSIGN FUNCTIONALTIY".$pd_details['fk_pd_template_id']." CHOOSED",array('ENV'=>ENVIRONMENT,'PDID' => $pd_details['pd_id'],'Pre-Status' => $exist_pd_details[0]['pd_status'],'Current_status' => $pd_details['pd_status'])); //$logger->info("TEMPLATE ASSIGN FUNCTIONALTIY".$pd_details['fk_pd_template_id']." CHOOSED",array('ENV'=>ENVIRONMENT,'PDID' => $pd_details['pd_id'],'Pre-Status' => $exist_pd_details[0]['pd_status'],'Current_status' => $pd_details['pd_status']));
$dataToBot = array('ENV'=>ENVIRONMENT,'Task Name'=>'PD Template Assign','Template ID'=>$pd_details['fk_pd_template_id'] ,'PDID'=> $pd_details['pd_id'],'Method' => 'UpdatePDMaster','Pre-Status' => $exist_pd_details[0]['pd_status'],'Current_status' => $pd_details['pd_status']); //$dataToBot = array('ENV'=>ENVIRONMENT,'Task Name'=>'PD Template Assign','Template ID'=>$pd_details['fk_pd_template_id'] ,'PDID'=> $pd_details['pd_id'],'Method' => 'UpdatePDMaster','Pre-Status' => $exist_pd_details[0]['pd_status'],'Current_status' => $pd_details['pd_status']);
MYHTTPCLIENT::sendPOST($dataToBot); //MYHTTPCLIENT::sendPOST($dataToBot);
} }
} }
die();
$primary_address_id = null; $primary_address_id = null;
if( $exist_pd_details[0]['fk_primary_address_id'] == null && $exist_pd_details[0]['is_child'] == 0)//Master PD only if( $exist_pd_details[0]['fk_primary_address_id'] == null && $exist_pd_details[0]['is_child'] == 0)//Master PD only
@ -5120,7 +5121,7 @@ class PD_Controller extends REST_Controller {
//echo "*******************************************"; //echo "*******************************************";
$t = $this->load->view('report_templates/JSONTOREPORT',$data,true); $t = $this->load->view('report_templates/JSONTOREPORT',$data,true);
//$t = $this->load->view('temp_html.html',null,true); //$t = $this->load->view('temp_html.html',null,true);
echo $t;die();
$total_replaces = substr_count($t,'<span class="tooltip">'); $total_replaces = substr_count($t,'<span class="tooltip">');
//echo $total_replaces; //echo $total_replaces;
@ -5256,10 +5257,12 @@ class PD_Controller extends REST_Controller {
{ {
$records = $this->post('records'); $records = $this->post('records');
$pd_id = $records['pd_id']; $pd_id = $records['pd_id'];
$ai_flag = 0; $ai_flag = 0;
//GET TEMPALE ID FROM MASTER //GET TEMPALE ID FROM MASTER
$pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id); $pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id);
//print_r($pd_master_details[0]['customer_segment_abbr']); $lender_short_name = $pd_master_details[0]['lender_short_name'];
//print_r($lender_short_name);
$str = substr($pd_master_details[0]['customer_segment_abbr'],-2); $str = substr($pd_master_details[0]['customer_segment_abbr'],-2);
//echo $str; //echo $str;
if(!strcmp($str,'AI')) { $ai_flag = 1; } if(!strcmp($str,'AI')) { $ai_flag = 1; }
@ -5321,6 +5324,10 @@ class PD_Controller extends REST_Controller {
} }
if(!strcasecmp($lender_short_name, 'CLIX')){$form_array[] = array('form_id' => 22,'form_name' => 'Future Plans & Business Environments');}
//print_r($form_array);//die();
foreach($company_list as $list_key => $company) foreach($company_list as $list_key => $company)
{ {
@ -5353,7 +5360,8 @@ class PD_Controller extends REST_Controller {
// print_r($template_forms_count);echo $form['form_id']; // print_r($template_forms_count);echo $form['form_id'];
if($template_forms_count[0]['count'] != 0) { if($template_forms_count[0]['count'] != 0) {
if($form['form_id'] == 13 || $form['form_id'] == 22)
if($form['form_id'] == 13 )
{ {
$temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => true,'isAnswerable'=>true); $temp[] = array('form_id' => $form['form_id'],'form_name'=> $form['form_name'],'isAnswered' => true,'isAnswerable'=>true);
@ -5379,7 +5387,7 @@ class PD_Controller extends REST_Controller {
$client_form_status = 1; $client_form_status = 1;
} }
if($form['form_id'] == 11) if($form['form_id'] == 11 || $form['form_id'] == 22)
{ {
//echo "COUNT YES STOCK" //echo "COUNT YES STOCK"
if($client_form_status == 1 && $supplier_form_status == 1) if($client_form_status == 1 && $supplier_form_status == 1)
@ -5447,6 +5455,7 @@ class PD_Controller extends REST_Controller {
} }
} }
// print_r($company_list);die();
if(count($company_list)) if(count($company_list))
{ {
$data['dataStatus'] = true; $data['dataStatus'] = true;
@ -6101,7 +6110,7 @@ class PD_Controller extends REST_Controller {
public function getPDImages_post() public function getPDImages_post()
{ {
$records = $this->post('records'); $records = $this->post('records');
$result_data = $this->PD_Model->getSignedPDDocsURL($records['pd_id'],$records['form_id'],isset($records['company_id']) ? $records['company_id'] : null); $result_data = $this->PD_Model->getSignedPDDocsURL($records['pd_id'],isset($records['form_id']) ? $records['form_id']: null ,isset($records['company_id']) ? $records['company_id'] : null,isset($records['is_common']) ? $records['is_common'] : null);
if(count($result_data)) if(count($result_data))
{ {
$data['dataStatus'] = true; $data['dataStatus'] = true;

View File

@ -7,6 +7,8 @@ public static function getOthersAssetsDetails($values){
$mergeResult=array(); $mergeResult=array();
foreach($values as $key => $fetchVal){ foreach($values as $key => $fetchVal){
$storeValue=array(); $storeValue=array();
if(isset($fetchVal['assets_mode_master']) && ($fetchVal['assets_mode_master'] != '' || $fetchVal['assets_mode_master'] != null))
{
$storeValue['assets_mode'] = $fetchVal['assets_mode_master']; $storeValue['assets_mode'] = $fetchVal['assets_mode_master'];
$storeValue['name_of_the_owner'] = $fetchVal['name_of_the_owner'][0]['id']==0 ? $fetchVal['other_owner'] : $fetchVal['name_of_the_owner'][0]['name']; $storeValue['name_of_the_owner'] = $fetchVal['name_of_the_owner'][0]['id']==0 ? $fetchVal['other_owner'] : $fetchVal['name_of_the_owner'][0]['name'];
$storeValue['purchase_year'] = $fetchVal['vintage_personal']; $storeValue['purchase_year'] = $fetchVal['vintage_personal'];
@ -108,6 +110,7 @@ public static function getOthersAssetsDetails($values){
} }
array_push($mergeResult,$storeValue); array_push($mergeResult,$storeValue);
}
} }
return $mergeResult; return $mergeResult;
} }
@ -115,7 +118,7 @@ public static function getOthersAssetsDetails($values){
// business asset details // business asset details
public static function getBusinessAssetsDetails($business_assets){ public static function getBusinessAssetsDetails($business_assets){
//print_r($business_assets);
$header_row = '<tr><th>Particulars</th>'; $header_row = '<tr><th>Particulars</th>';
$first_row = '<tr><td>Asset Type</td>'; $first_row = '<tr><td>Asset Type</td>';
$sec_row = '<tr><td>Asset Description</td>'; $sec_row = '<tr><td>Asset Description</td>';
@ -128,11 +131,16 @@ public static function getOthersAssetsDetails($values){
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"; $rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
$rental_flag = 0; $rental_flag = 0;
$owned_flag = 0; $owned_flag = 0;
$show_table = 1;
$overall_empty_flag = 0;
foreach($business_assets as $bsk => $fetchVal){ foreach($business_assets as $bsk => $fetchVal){
$owners_list = null; $owners_list = null;
if($fetchVal['business_assets_mode'] == "" || $fetchVal['business_assets_mode'] == null)
{
if(count($business_assets) == 1){ $show_table = 0;}
}
if(isset($fetchVal['business_name_of_the_owner']) && (is_array($fetchVal['business_name_of_the_owner'])) && count($fetchVal['business_name_of_the_owner'])) if(isset($fetchVal['business_name_of_the_owner']) && (is_array($fetchVal['business_name_of_the_owner'])) && count($fetchVal['business_name_of_the_owner']))
{ {
@ -188,7 +196,7 @@ public static function getOthersAssetsDetails($values){
// switch(strtoupper($fetchVal['business_ownership_type'])) { // switch(strtoupper($fetchVal['business_ownership_type'])) {
$header_row .= '<th>Asset '.($bsk+1).'</th>'; $header_row .= '<th>Asset '.($bsk+1).'</th>';
$first_row .= '<td class="customtd">'.$fetchVal['business_assets_mode_master'].'</td>'; $first_row .= '<td class="customtd">'.$fetchVal['business_assets_mode_master'].' at '. $fetchVal['business_details'][0]['address_of_the_property'].'</td>';
$sec_row .= '<td class="customtd">'.($fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master']).'</td>'; $sec_row .= '<td class="customtd">'.($fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master']).'</td>';
$third_row .= '<td class="customtd">'. $ownership_type .'</td>'; $third_row .= '<td class="customtd">'. $ownership_type .'</td>';
$fourth_row .= '<td class="customtd">'.$owners_list.'</td>'; $fourth_row .= '<td class="customtd">'.$owners_list.'</td>';
@ -225,7 +233,7 @@ public static function getOthersAssetsDetails($values){
$eighth_row .= '</tr>'; $eighth_row .= '</tr>';
$eighth_row = $owned_flag != 0 ? $eighth_row : ''; $eighth_row = $owned_flag != 0 ? $eighth_row : '';
return array('header_row' => $header_row, 'first_row' => $first_row,'sec_row'=> $sec_row,'third_row' =>$third_row,'fourth_row'=>$fourth_row,'fifth_row'=>$fifth_row,'sixth_row'=>$sixth_row,'seventh_row'=>$seventh_row,'eighth_row'=>$eighth_row); return array('header_row' => $header_row, 'first_row' => $first_row,'sec_row'=> $sec_row,'third_row' =>$third_row,'fourth_row'=>$fourth_row,'fifth_row'=>$fifth_row,'sixth_row'=>$sixth_row,'seventh_row'=>$seventh_row,'eighth_row'=>$eighth_row,'show_table'=> $show_table);
} }
} }
?> ?>

View File

@ -5,7 +5,7 @@ class Bankingform
//get business Banking //get business Banking
public static function getBusinessBankingDetails($values){ public static function getBusinessBankingDetails($values){
// print_r($values);die(); // print_r($values);die();
if(count($values)>0){ if(count($values)>0){
$values = array_map(function($tag) { $values = array_map(function($tag) {
$count_vintage = $tag['vintage_year'] >0 ? $tag['vintage_year'] :""; $count_vintage = $tag['vintage_year'] >0 ? $tag['vintage_year'] :"";
$count_vintage .= ($tag['vintage_year'] == 1) ? " Year" : (($tag['vintage_year'] > 1) ? " Years" : ""); $count_vintage .= ($tag['vintage_year'] == 1) ? " Year" : (($tag['vintage_year'] > 1) ? " Years" : "");

View File

@ -15,7 +15,7 @@ public static function getPartnerDetails($values){
return array( return array(
'name' => array_key_exists('partner_other_name',$tag) ? $tag['partner_other_name'] : $tag['partner_name_master'], 'name' => array_key_exists('partner_other_name',$tag) ? $tag['partner_other_name'] : $tag['partner_name_master'],
'share_holding' => $tag['shareholding'].'%', 'share_holding' => $tag['shareholding'].'%',
'started_business' => $tag['started_business'] ? $tag['started_business'] : 'No', 'started_business' => $tag['started_business'] ? $tag['started_business'] : 'No',
'no_years_business' => $con_business_run, 'no_years_business' => $con_business_run,
'total_experience' => $tag['total_business_experiance'], 'total_experience' => $tag['total_business_experiance'],
'previous_experience' => array_key_exists('total_business_previous_experience',$tag) ? $tag['total_business_previous_experience'] : 'NIL', 'previous_experience' => array_key_exists('total_business_previous_experience',$tag) ? $tag['total_business_previous_experience'] : 'NIL',
@ -28,28 +28,28 @@ public static function getPartnerDetails($values){
} }
//get family members details //get family members details
public static function getFamilyMemberDetails($values){ public static function getFamilyMemberDetails($values){
//print_r($values);die(); //print_r($values);die();
$getFamilyMembers=array(); $getFamilyMembers=array();
foreach($values as $parRow){ foreach($values as $parRow){
if($parRow['family_member_name'] != "" || $parRow['family_member_name'] != null) if($parRow['family_member_name'] != "" || $parRow['family_member_name'] != null)
{ {
$temp_family = array('name' => $parRow['family_member_salutation_master'].' '.$parRow['family_member_name'],'individual_relation' => $parRow['other_family_relationship_id_master'] .' of ','relation_to' => $parRow['relation_to_id_master'],'relation_to_company' => substr($parRow['relationship_with_company_id_master'],0,-2),'started_business' => $parRow['started_business']); $temp_family = array('name' => $parRow['family_member_salutation_master'].' '.$parRow['family_member_name'],'individual_relation' => $parRow['other_family_relationship_id_master'] .' of ','relation_to' => $parRow['relation_to_id_master'],'relation_to_company' => substr($parRow['relationship_with_company_id_master'],0,-2),'started_business' => $parRow['started_business']);
array_push($getFamilyMembers,$temp_family); array_push($getFamilyMembers,$temp_family);
} }
// $getFamilyMembers = array_map(function($tag) { // $getFamilyMembers = array_map(function($tag) {
// if($tag['family_member_name'] != "" || $tag['family_member_name'] != null) // if($tag['family_member_name'] != "" || $tag['family_member_name'] != null)
// { // {
// return array( // return array(
// 'name' => $tag['family_member_salutation_master'].' '.$tag['family_member_name'], // 'name' => $tag['family_member_salutation_master'].' '.$tag['family_member_name'],
// 'individual_relation' => $tag['other_family_relationship_id_master'] .' of ', // 'individual_relation' => $tag['other_family_relationship_id_master'] .' of ',
// 'relation_to' => $tag['relation_to_id_master'], // 'relation_to' => $tag['relation_to_id_master'],
// 'relation_to_company' => substr($tag['relationship_with_company_id_master'],0,-2), // 'relation_to_company' => substr($tag['relationship_with_company_id_master'],0,-2),
// 'started_business' => $tag['started_business'], // 'started_business' => $tag['started_business'],
// ); // );
// } // }
// }, $values); // }, $values);
} }
return $getFamilyMembers; return $getFamilyMembers;
@ -129,7 +129,7 @@ public static function getActivityDetails($values,$type){
$mergeStatesCities .= ($chilKey==0) ? "":($chilKey==count($busManuRow['countries_where_export_done'])-1 ? ' and ' : ","); $mergeStatesCities .= ($chilKey==0) ? "":($chilKey==count($busManuRow['countries_where_export_done'])-1 ? ' and ' : ",");
$mergeStatesCities .=' '.$childRow['approx_sale']; $mergeStatesCities .=' '.$childRow['approx_sale'];
$mergeStatesCities .='% sales done in '; $mergeStatesCities .='% of export sales done in ';
$mergeStatesCities .=$childRow['country_name']; $mergeStatesCities .=$childRow['country_name'];
//$mergeStatesCities .= ($chilKey==count($busManuRow['countries_where_export_done'])-1 ? "." : ""); //$mergeStatesCities .= ($chilKey==count($busManuRow['countries_where_export_done'])-1 ? "." : "");
} }
@ -155,6 +155,7 @@ public static function getActivityDetails($values,$type){
$mergeStatesCities .= ($chilKey==count($busManuRow['india_where_sale_done'])-1 ? "." : ""); $mergeStatesCities .= ($chilKey==count($busManuRow['india_where_sale_done'])-1 ? "." : "");
} }
$getEachProducts['sales_done']=$mergeStatesCities; $getEachProducts['sales_done']=$mergeStatesCities;
$getEachProducts['area_of_sale']='Domestics & Exports';
// max sales done // max sales done
$mergeMaxStatesCities=''; $mergeMaxStatesCities='';
foreach($busManuRow['max_sale_state_name'] as $chilMKey=>$childMRow){ foreach($busManuRow['max_sale_state_name'] as $chilMKey=>$childMRow){
@ -192,6 +193,7 @@ public static function getActivityDetails($values,$type){
} }
$mergeMaxStatesCities.='.'; $mergeMaxStatesCities.='.';
$getEachProducts['max_sales_done']=$mergeMaxStatesCities; $getEachProducts['max_sales_done']=$mergeMaxStatesCities;
$getEachProducts['area_of_sale']='Domestics & Exports';
} }
else{ else{
$getEachProducts['sales_done']=""; $getEachProducts['sales_done']="";
@ -205,7 +207,7 @@ public static function getActivityDetails($values,$type){
$mergeStatesCities .= ($chilKey==0) ? "":($chilKey==count($busManuRow['countries_where_export_done'])-1 ? ' and ' : ","); $mergeStatesCities .= ($chilKey==0) ? "":($chilKey==count($busManuRow['countries_where_export_done'])-1 ? ' and ' : ",");
$mergeBothStates .=' '.$childRow['approx_sale']; $mergeBothStates .=' '.$childRow['approx_sale'];
$mergeBothStates .='% sales done in '; $mergeBothStates .='% of export sales done in ';
$mergeBothStates .=$childRow['country_name']; $mergeBothStates .=$childRow['country_name'];
} }
$mergeBothStates.='.'; $mergeBothStates.='.';
@ -221,7 +223,7 @@ public static function getActivityDetails($values,$type){
foreach($values as $busManuRowkey=>$busManuRow){ foreach($values as $busManuRowkey=>$busManuRow){
$getEachProducts=array(); $getEachProducts=array();
$getEachProducts['products']=$busManuRow['main_products']; $getEachProducts['products']=$busManuRow['main_products'];
$getEachProducts['description']=$busManuRow['description']; $getEachProducts['description']=$busManuRow['description'];
$getEachProducts['area_of_sale']=$busManuRow['area_of_sale']; $getEachProducts['area_of_sale']=$busManuRow['area_of_sale'];
// check area of sales // check area of sales
@ -315,6 +317,7 @@ public static function getActivityDetails($values,$type){
$mergeStatesCities .= ($chilKey==count($busManuRow['india_where_sale_done'])-1 ? "." : ""); $mergeStatesCities .= ($chilKey==count($busManuRow['india_where_sale_done'])-1 ? "." : "");
} }
$getEachProducts['sales_done']=$mergeStatesCities; $getEachProducts['sales_done']=$mergeStatesCities;
$getEachProducts['area_of_sale']= 'Domestics & Exports';
// max sales done // max sales done
$mergeMaxStatesCities=''; $mergeMaxStatesCities='';
foreach($busManuRow['max_sale_state_name'] as $chilMKey=>$childMRow){ foreach($busManuRow['max_sale_state_name'] as $chilMKey=>$childMRow){
@ -381,7 +384,7 @@ public static function getActivityDetails($values,$type){
foreach($values as $busManuRowkey=>$busManuRow){ foreach($values as $busManuRowkey=>$busManuRow){
$getEachProducts=array(); $getEachProducts=array();
$getEachProducts['products']=$busManuRow['others_details']; $getEachProducts['products']=$busManuRow['others_details'];
$getEachProducts['description']=$busManuRow['description']; $getEachProducts['description']=$busManuRow['description'];
array_push($getRow,$getEachProducts); array_push($getRow,$getEachProducts);
} }

View File

@ -16,9 +16,12 @@ public static function getOtherLoanDetails($values){
$eigth_row = '<tr><td class="customtd">Original Tenure (Months)</td>'; $eigth_row = '<tr><td class="customtd">Original Tenure (Months)</td>';
$ninth_row = '<tr><td class="customtd">Elapsed Tenure (Months)</td>'; $ninth_row = '<tr><td class="customtd">Elapsed Tenure (Months)</td>';
$tenth_row = '<tr><td class="customtd">Balance Tenure (Months)</td>'; $tenth_row = '<tr><td class="customtd">Balance Tenure (Months)</td>';
$total_header = 0;
foreach($values as $key => $tag) foreach($values as $key => $tag)
{ {
if(isset($tag['loan_type_master']) && $tag['loan_type_master'] != '')
{
$total_header++;
$setFrequencyType=''; $setFrequencyType='';
switch($tag['frequency']) { switch($tag['frequency']) {
case 1: case 1:
@ -50,29 +53,29 @@ public static function getOtherLoanDetails($values){
$first_row .= $tag['loan_type']==1 ? '<td class="customtd">'.$tag['others_loan_type'].'</td>' : '<td class="customtd">'.$tag['loan_type_master'] .'</td>'; $first_row .= $tag['loan_type']==1 ? '<td class="customtd">'.$tag['others_loan_type'].'</td>' : '<td class="customtd">'.$tag['loan_type_master'] .'</td>';
$second_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['loan_amount']).'</td>'; $second_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['loan_amount']).'</td>';
//$third_row = '<td class="customtd">'.MYUTIL::customIndianNumberFormat($tag['loan_amount']).'</td>'; //$third_row = '<td class="customtd">'.MYUTIL::customIndianNumberFormat($tag['loan_amount']).'</td>';
$fourth_row .= $tag['lender']==1 ? '<td class="customtd">'.$tag['others_lender'].'</td>' : '<td class="customtd">'.$tag['lender_master'].'</td>'; $fourth_row .= $tag['lender']==1 ? '<td class="customtd">'.$tag['others_lender'].'</td>' : '<td class="customtd">'.$tag['lender_master'].'</td>';
$fifth_row .= $loanTaken['id']==0 ? '<td class="customtd">'.$tag['others_loan_taken'].'</td>' : '<td class="customtd">'.$loanTaken['name'].'</td>'; $fifth_row .= $loanTaken['id']==0 ? '<td class="customtd">'.$tag['others_loan_taken'].'</td>' : '<td class="customtd">'.$loanTaken['name'].'</td>';
$sixth_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['emi']).'</td>'; $sixth_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['emi']).'</td>';
$seventh_row .= $tag['frequency']==1 ? '<td class="customtd">'.$tag['other_frequency'].'</td>' : '<td class="customtd">'.$tag['frequency_master'].'</td>'; $seventh_row .= $tag['frequency']==1 ? '<td class="customtd">'.$tag['other_frequency'].'</td>' : '<td class="customtd">'.$tag['frequency_master'].'</td>';
$eigth_row .= '<td class="customtd">'.$tag['original_tenure'].'</td>'; $eigth_row .= '<td class="customtd">'.$tag['original_tenure'].'</td>';
$ninth_row .= '<td class="customtd">'.$tag['elapsed_tenure'].'</td>'; $ninth_row .= '<td class="customtd">'.$tag['elapsed_tenure'].'</td>';
$tenth_row .= '<td class="customtd">'.($tag['original_tenure'] - $tag['elapsed_tenure']).'</td>';
$tenth_row .= '<td class="customtd">'.($tag['original_tenure'] - $tag['elapsed_tenure']).'</td>';
}
} }
return array( return array(
'first_row' => $first_row.'</tr>','second_row' => $second_row.'</tr>','fourth_row' => $fourth_row.'</tr>','fifth_row' => $fifth_row.'</tr>','sixth_row' => $sixth_row.'</tr>','seventh_row' => $seventh_row.'</tr>','eigth_row' => $eigth_row.'</tr>', 'ninth_row' => $ninth_row.'</tr>', 'tenth_row' => $tenth_row.'</tr>' 'first_row' => $first_row.'</tr>','second_row' => $second_row.'</tr>','fourth_row' => $fourth_row.'</tr>','fifth_row' => $fifth_row.'</tr>','sixth_row' => $sixth_row.'</tr>','seventh_row' => $seventh_row.'</tr>','eigth_row' => $eigth_row.'</tr>', 'ninth_row' => $ninth_row.'</tr>', 'tenth_row' => $tenth_row.'</tr>','total_header' => $total_header
); );
//return $values; //return $values;
@ -82,12 +85,12 @@ public static function getOtherLoanDetails($values){
public static function getBusinessFinancialDetails($values){ public static function getBusinessFinancialDetails($values){
$values = array_map(function($tag) { $values = array_map(function($tag) {
return array( return array(
'financial_year' => $tag['financial_year'], 'financial_year' => $tag['financial_year'],
'financial_sales_revenue' => $tag['financial_annual_sale'], 'financial_sales_revenue' => $tag['financial_annual_sale'],
'financial_net_profit_mode' => $tag['finanical_profit_or_loss']==1 ? 1 : 0, 'financial_net_profit_mode' => $tag['finanical_profit_or_loss']==1 ? 1 : 0,
'financial_net_profit' => $tag['finanical_profit_or_loss']==1 ? $tag['financial_net_profit'] : '', 'financial_net_profit' => $tag['finanical_profit_or_loss']==1 ? $tag['financial_net_profit'] : '',
'financial_net_loss' => $tag['finanical_profit_or_loss']!=1 ? $tag['financial_net_loss'] : '', 'financial_net_loss' => $tag['finanical_profit_or_loss']!=1 ? $tag['financial_net_loss'] : '',
'financial_margin_of_profit' => $tag['finanical_profit_or_loss']==1 ? $tag['financial_margin_of_profit'] : '', 'financial_margin_of_profit' => $tag['finanical_profit_or_loss']==1 ? $tag['financial_margin_of_profit'] : '',
'financial_margin_of_loss' => $tag['finanical_profit_or_loss']!=1 ? $tag['financial_margin_of_loss'] : '', 'financial_margin_of_loss' => $tag['finanical_profit_or_loss']!=1 ? $tag['financial_margin_of_loss'] : '',
'profit_variation' => $tag['financial_variation'], 'profit_variation' => $tag['financial_variation'],
@ -109,25 +112,26 @@ public static function getBusinessCustomerFinancialDetails($values) {
//'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ?$tag['estimate_profit_margin'] : $tag['estimate_net_profit'], //'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ?$tag['estimate_profit_margin'] : $tag['estimate_net_profit'],
'net_profit_loss_sales_per_from' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_range_from']: $tag['estimate_net_profit_from'], 'net_profit_loss_sales_per_from' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_range_from']: $tag['estimate_net_profit_from'],
'net_profit_loss_sales_per_to' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_range_to']: $tag['estimate_net_profit_to'], 'net_profit_loss_sales_per_to' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_range_to']: $tag['estimate_net_profit_to'],
'net_profit_loss_sales_final_per' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_margin_percent']:$tag['estimate_profit_margin'], //$tag['estimate_net_profit_percent'], 'net_profit_loss_sales_final_per' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_margin_percent']:$tag['estimate_net_profit'],
//Pre - estimate_profit_margin
'net_profit_loss_sales_final_rs' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_margin']: $tag['estimate_profit_margin_percent'],//$tag['estimate_net_profit'], 'net_profit_loss_sales_final_rs' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_margin']: $tag['estimate_net_profit_percent'],//pre_ estimate_profit_margin_percent
//'estimate_net_margin_from' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_from']: '', //'estimate_net_margin_from' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_from']: '',
//'estimate_net_margin_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_to']:'', //'estimate_net_margin_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_to']:'',
//'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_percent'] : $tag['estimate_profit_margin_percent'], //'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_percent'] : $tag['estimate_profit_margin_percent'],
//'estimate_net_margin_range_from' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : $tag['estimate_profit_range_from'], //'estimate_net_margin_range_from' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : $tag['estimate_profit_range_from'],
// 'estimate_net_margin_range_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '( '.$tag['estimate_profit_range_from'].', '.$tag['estimate_profit_range_to'].')', // 'estimate_net_margin_range_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '( '.$tag['estimate_profit_range_from'].', '.$tag['estimate_profit_range_to'].')',
); );
} }
else if($tag['estimate_profit_or_loss']==2){ else if($tag['estimate_profit_or_loss']==2){
@ -138,15 +142,15 @@ public static function getBusinessCustomerFinancialDetails($values) {
'estimate_sales_to' => $tag['estimate_sales_to'], 'estimate_sales_to' => $tag['estimate_sales_to'],
'estimate_net_margin_availablity' => $tag['estimate_net_margin_availablity'], 'estimate_net_margin_availablity' => $tag['estimate_net_margin_availablity'],
'net_profit_loss_sales_per_from' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_range_from']: $tag['estimate_net_profit_from'], 'net_profit_loss_sales_per_from' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_range_from']: $tag['estimate_net_profit_from'],
'net_profit_loss_sales_per_to' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_range_to']: $tag['estimate_net_loss_to'], 'net_profit_loss_sales_per_to' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_range_to']: $tag['estimate_net_loss_to'],
'net_profit_loss_sales_final_per' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_margin_percent']: $tag['estimate_loss_margin'],//$tag['estimate_net_loss_percent'], 'net_profit_loss_sales_final_per' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_margin_percent']: $tag['estimate_loss_margin'],//$tag['estimate_net_loss_percent'],
'net_profit_loss_sales_final_rs' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_margin']: $tag['estimate_loss_margin_percent']//$tag['estimate_net_loss'], 'net_profit_loss_sales_final_rs' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_margin']: $tag['estimate_loss_margin_percent']//$tag['estimate_net_loss'],
//'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? 'Rs.'.$tag['estimate_net_loss'] : 'Rs.'.$tag['estimate_loss_margin'], //'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? 'Rs.'.$tag['estimate_net_loss'] : 'Rs.'.$tag['estimate_loss_margin'],
//'estimate_net_margin_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '(Rs.'.$tag['estimate_net_loss_from'].', Rs.'.$tag['estimate_net_loss_to'].')' : '', //'estimate_net_margin_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '(Rs.'.$tag['estimate_net_loss_from'].', Rs.'.$tag['estimate_net_loss_to'].')' : '',
//'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_loss_percent'] : $tag['estimate_loss_margin_percent'], //'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_loss_percent'] : $tag['estimate_loss_margin_percent'],
//'estimate_net_margin_range_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '('.$tag['estimate_loss_range_from'].', '.$tag['estimate_loss_range_to'].')', //'estimate_net_margin_range_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '('.$tag['estimate_loss_range_from'].', '.$tag['estimate_loss_range_to'].')',
@ -157,7 +161,7 @@ public static function getBusinessCustomerFinancialDetails($values) {
return $values; return $values;
} }
// get customer header // not in use
public static function getBusinessCustomerHeader($values){ public static function getBusinessCustomerHeader($values){
if(count($values)>0 && $values[0]['estimate_profit_or_loss']==1){ if(count($values)>0 && $values[0]['estimate_profit_or_loss']==1){
return array("Sales","Net Profit","Net Margin %"); return array("Sales","Net Profit","Net Margin %");
@ -169,18 +173,18 @@ public static function getBusinessCustomerHeader($values){
return array(); return array();
} }
} }
//not in use
public static function getAvailableFacilities($arr) public static function getAvailableFacilities($arr)
{ {
echo "@@@@@@@@@@@@@@"; echo "@@@@@@@@@@@@@@";
print_r($arr); print_r($arr);
die(); die();
$word_array = array('1' => 'Others', '2' => 'Bank Guarantee', '3' => 'Cash Credit Limit','4' => 'Factoring', '5' => 'Forfaiting', '6' => 'Letter of Credit'); $word_array = array('1' => 'Others', '2' => 'Bank Guarantee', '3' => 'Cash Credit Limit','4' => 'Factoring', '5' => 'Forfaiting', '6' => 'Letter of Credit');
if(is_array($array)) if(is_array($array))
{ {
//$array = array_map(function($arr){ },$array); //$array = array_map(function($arr){ },$array);
} }
return $array; return $array;
} }
} }

View File

@ -812,7 +812,26 @@ class GETPROCESSEDJSON
//print_r($master_keys); //print_r($master_keys);
if(!empty($raw_json) && !empty($master_keys)) if(!empty($raw_json) && !empty($master_keys))
{ {
if(isset($raw_json['pos_machines_details']) && count($raw_json['pos_machines_details']))
{
$CI->db->SELECT( 'bt_lender_list_id,lender_name');
$CI->db->FROM(BTLENDERLIST. ' as BTLENDERLIST');
$CI->db->WHERE('BTLENDERLIST.isactive',1);
$bt_lender_list = $CI->db->GET()->result_array();
//print_r($bt_lender_list);die();
foreach($raw_json['pos_machines_details'] as $pos_key => $pos)
{
foreach($bt_lender_list as $bt_lender)
{
if($bt_lender['bt_lender_list_id'] == $pos['pos_machines_financial_institution_name'])
{
$raw_json['pos_machines_details'][$pos_key]['pos_machines_financial_institution_name'] = $bt_lender['lender_name'];
}
}
}
}
if(array_key_exists('partners',$raw_json)) if(array_key_exists('partners',$raw_json))
{ {

View File

@ -217,7 +217,7 @@ class PD_Model extends SPARQ_Model {
/* /*
*Get All PD Related Documents as signed and expired URL's from S3 Buckets *Get All PD Related Documents as signed and expired URL's from S3 Buckets
*/ */
public function getSignedPDDocsURL($pdid,$form_id = null,$company_id = null) public function getSignedPDDocsURL($pdid,$form_id = null,$company_id = null,$is_common_api = null)
{ {
//echo $pdid,$form_id,$company_id;die(); //echo $pdid,$form_id,$company_id;die();
$document_lists = array(); $document_lists = array();
@ -232,14 +232,18 @@ class PD_Model extends SPARQ_Model {
//Get PD Documenttitle and name from DB //Get PD Documenttitle and name from DB
$where_condition_array = array('fk_pd_id' => $pdid); $where_condition_array = array('fk_pd_id' => $pdid);
if($company_id != null){ if($form_id != null){
$where_condition_array['fk_form_id'] = $form_id; $where_condition_array['fk_form_id'] = $form_id;
} }
if($company_id != null){ if($company_id != null){
$where_condition_array['company_id'] = $company_id ; $where_condition_array['company_id'] = $company_id ;
} }
if($is_common_api != null)
{
$where_condition_array['company_id'] = null ;
$where_condition_array['fk_form_id'] = null ;
}
//print_r($where_condition_array);die(); //print_r($where_condition_array);die();
$document_lists = $this->selectRecords(PDDOCUMENTS,$where_condition_array); $document_lists = $this->selectRecords(PDDOCUMENTS,$where_condition_array);
//print_r($this->db->last_query());die(); //print_r($this->db->last_query());die();
@ -745,7 +749,7 @@ class PD_Model extends SPARQ_Model {
*/ */
public function getPDMasterDetails($pdid) public function getPDMasterDetails($pdid)
{ {
$this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %H:%i %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created'); $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %h:%i:%s %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created');
$this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER');
$this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT'); $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT');
$this->db->JOIN(ENTITYBILLING.' as ENTITYBILLING','PDTRIGGER.fk_entity_billing_id = ENTITYBILLING.entity_billing_id','LEFT'); $this->db->JOIN(ENTITYBILLING.' as ENTITYBILLING','PDTRIGGER.fk_entity_billing_id = ENTITYBILLING.entity_billing_id','LEFT');
@ -1603,7 +1607,7 @@ class PD_Model extends SPARQ_Model {
//print_r($purchase_billwise_parent);die(); //print_r($purchase_billwise_parent);die();
//Get business_expenses //Get business_expenses
$fields = array('pd_expense_id','PDBUSINESSEXPENSES.expense_item_id','BUSINESSEXPENSES.expense_item','FREQUENCY.name as frequency_name','fk_frequency_id','expense_value','annual_expenses_value','comments'); $fields = array('pd_expense_id','PDBUSINESSEXPENSES.expense_item_id','BUSINESSEXPENSES.expense_item','FREQUENCY.name as frequency_name','fk_frequency_id','expense_value','annual_expenses_value','comments','other_expense_item');
$table = PDBUSINESSEXPENSES.' as PDBUSINESSEXPENSES'; $table = PDBUSINESSEXPENSES.' as PDBUSINESSEXPENSES';
$where_condition_array = array('fk_pd_id'=>$pdid,'PDBUSINESSEXPENSES.isactive'=>1); $where_condition_array = array('fk_pd_id'=>$pdid,'PDBUSINESSEXPENSES.isactive'=>1);
$where_condition_array['company_id'] = $company_id ? $company_id : null; $where_condition_array['company_id'] = $company_id ? $company_id : null;

View File

@ -508,7 +508,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
} }
} }
//$temp_person_met['name'] = //$temp_person_met['name'] =
//print_r($general_form['persons_with_relationships']);die(); //print_r($general_form['persons_with_relationships']);
$personal_relationship_data = null; $personal_relationship_data = null;
foreach($general_form['persons_with_relationships'] as $persons_with_relationship) foreach($general_form['persons_with_relationships'] as $persons_with_relationship)
{ {
@ -562,16 +562,16 @@ defined('BASEPATH') OR exit('No direct script access allowed');
{ {
echo '<p>'.$person['name'].'</p>'; echo '<p>'.$person['name'].'</p>';
echo '<p>'.$person['relations'].'</p>'; echo '<p>'.substr_replace($person['relations'],'.',strrpos($person['relations'],','),1).'</p>';
echo '<br><br><p>'; echo '<br><br><p>';
if($person['photo']) if($person['photo'])
{ {
echo '<img src='.$person['photo'].' width="200px" height="200px" alt=""/>'; echo '<img src='.$person['photo'].' width="400px" height="300px" alt=""/>';
} }
echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'; echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
if($person['id_proof']) if($person['id_proof'])
{ {
echo '<img src='.$person['id_proof'].' width="200px" height="200px" alt=""/>'; echo '<img src='.$person['id_proof'].' width="400px" height="300px" alt=""/>';
} }
echo '</p>'; echo '</p>';
echo count($person_met_data) != ($pk+1)? '<hr>':''; echo count($person_met_data) != ($pk+1)? '<hr>':'';
@ -582,6 +582,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?> ?>
<?php <?php
// echo '<h3>Person(s) Met: </h3>'; // echo '<h3>Person(s) Met: </h3>';
// foreach($person_met_data as $person) // foreach($person_met_data as $person)
// {?> // {?>
@ -635,7 +636,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$applicant_name = array_key_exists('pd_co_applicant_id_master',$individual) ? $individual['pd_co_applicant_id_master'] : " Could Not Find" ; $applicant_name = array_key_exists('pd_co_applicant_id_master',$individual) ? $individual['pd_co_applicant_id_master'] : " Could Not Find" ;
//echo $applicant_name.'**************************'; //echo $applicant_name.'**************************';
echo '<tr><td class="customtd">'.$individual['applicant_title_name_master'].' '.$applicant_name.'</td><td class="customtd">'.$individual['age'].'</td><td class="customtd">'.$education_qualification.'</td><td class="customtd">';
$title = isset($individual['applicant_title_name_master']) && $individual['applicant_title_name_master'] != "" ? $individual['applicant_title_name_master'] : '';
echo '<tr><td class="customtd">'.$title.' '.$applicant_name.'</td><td class="customtd">'.$individual['age'].'</td><td class="customtd">'.$education_qualification.'</td><td class="customtd">';
$company_relationship_data = null; $company_relationship_data = null;
//print_r($general_form['company_with_relationships']); //print_r($general_form['company_with_relationships']);
@ -691,7 +695,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<div id="page_break"> </div> <div id="page_break"> </div>
<?php <?php
//die(); //
// if($general_form['general_remark'] != "") { ?> // if($general_form['general_remark'] != "") { ?>
<!-- <p>PD Officers Note (About General Section) :</p> --><?php //echo $general_form['general_remark']; <!-- <p>PD Officers Note (About General Section) :</p> --><?php //echo $general_form['general_remark'];
// } // }
@ -823,16 +827,34 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '</table>'; echo '</table>';
//die(); //
?> ?>
<?php
//******************************************************************** //******************************************************************** //********************************************************************
//echo "RI";echo count($pd_processed_forms[17]);
foreach($pd_processed_forms[17] as $rental_property_key => $rental_property)
{
//echo $rental_property_key;
$current_property = json_decode($rental_property['processed_json'],true);
$rental_data[] = RENTALFORM::getRentalText($current_property);
}
//
//******************************************************************** //******************************************************************** //********************************************************************
?>
<!-- ####################### Address Details Section Statred ############################--> <!-- ####################### Address Details Section Statred ############################-->
<?php <?php
$address_form = json_decode($pd_processed_forms[5][0]['processed_json'],true); $address_form = json_decode($pd_processed_forms[5][0]['processed_json'],true);
//print_r($address_form);die(); //print_r($address_form);
$final_remark_data = json_decode($pd_processed_forms[20][0]['processed_json'],true) ; $final_remark_data = json_decode($pd_processed_forms[20][0]['processed_json'],true) ;
$business_assets_details = json_decode($pd_processed_forms[22][0]['processed_json'],true); $business_assets_details = json_decode($pd_processed_forms[22][0]['processed_json'],true);
@ -872,7 +894,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if($business_assets_details['business_assets_for_address'][0]['business_month'] != ""){ $yrs_being_run.= ' and '.$business_assets_details['business_assets_for_address'][0]['business_month'].' Months';} if($business_assets_details['business_assets_for_address'][0]['business_month'] != ""){ $yrs_being_run.= ' and '.$business_assets_details['business_assets_for_address'][0]['business_month'].' Months';}
echo '<p style="text-align:justify;">'; echo '<p style="text-align:justify;">';
echo '<span contenteditable="true">The PD visit was done at </span><span class="tooltip">'. $address_type. '<span class="tooltiptext">Address Form - Type of Address </span></span><span contenteditable="true"> of the loan applicants.</span>'; echo '<span contenteditable="true">The PD visit was done at </span><span class="tooltip">'. $address_type. '<span class="tooltiptext">Address Form - Type of Address </span></span><span contenteditable="true"> of the loan applicants. </span>';
echo '<span contenteditable="true">The </span><span class="tooltip">'.$address_type.'<span class="tooltiptext">Address Form - Type of Address </span></span><span contenteditable="true"> is </span><span class="tooltip">'.$property_owner_type.'<span class="tooltiptext">Business Assest Form - Owner of the Property </span></span><span contenteditable="true"> and the business has been in operation from here for the last</span> <span class="tooltip">'.$yrs_being_run.'<span class="tooltiptext">Business Assest Form - Business running Yrs in this premise </span></span><span contenteditable="true">.</span>'; echo '<span contenteditable="true">The </span><span class="tooltip">'.$address_type.'<span class="tooltiptext">Address Form - Type of Address </span></span><span contenteditable="true"> is </span><span class="tooltip">'.$property_owner_type.'<span class="tooltiptext">Business Assest Form - Owner of the Property </span></span><span contenteditable="true"> and the business has been in operation from here for the last</span> <span class="tooltip">'.$yrs_being_run.'<span class="tooltiptext">Business Assest Form - Business running Yrs in this premise </span></span><span contenteditable="true">.</span>';
echo '<br><br><span contenteditable="true">The</span> <span class="tooltip">'.$address_type.'<span class="tooltiptext">Address Form - Type of Address </span></span> <span contenteditable="true">is located in </span><span class="tooltip">'.$locality.'<span class="tooltiptext">Address Form - Locality of Address </span></span> <span contenteditable="true">and the estimated area of the</span> <span class="tooltip">'.$address_type.'<span class="tooltiptext">Address Form - Type of Address </span></span> <span contenteditable="true">is</span> <span class="tooltip">'.$estimated_area.'<span class="tooltiptext">Address Form - Estimated Area </span></span> <span contenteditable="true">.</span>'; echo '<br><br><span contenteditable="true">The</span> <span class="tooltip">'.$address_type.'<span class="tooltiptext">Address Form - Type of Address </span></span> <span contenteditable="true">is located in </span><span class="tooltip">'.$locality.'<span class="tooltiptext">Address Form - Locality of Address </span></span> <span contenteditable="true">and the estimated area of the</span> <span class="tooltip">'.$address_type.'<span class="tooltiptext">Address Form - Type of Address </span></span> <span contenteditable="true">is</span> <span class="tooltip">'.$estimated_area.'<span class="tooltiptext">Address Form - Estimated Area </span></span> <span contenteditable="true">.</span>';
echo '<br><br><span contenteditable="true">The PD location was </span><span class="tooltip">'. $pd_address['pd_location_master'].'<span class="tooltiptext">Address Form - Approach to PD location </span></span>. ' . '<span contenteditable="true">As Per PD Offcier, the</span> <span class="tooltip">'.$address_type .'<span class="tooltiptext">Address Form - Type of Address </span></span> <span contenteditable="true">is situated in</span><span class="tooltip"> '.$comment_locality_master .'<span class="tooltiptext">Address Form - Comment on locality </span></span> <span contenteditable="true">Locality.</span>'; echo '<br><br><span contenteditable="true">The PD location was </span><span class="tooltip">'. $pd_address['pd_location_master'].'<span class="tooltiptext">Address Form - Approach to PD location </span></span>. ' . '<span contenteditable="true">As Per PD Offcier, the</span> <span class="tooltip">'.$address_type .'<span class="tooltiptext">Address Form - Type of Address </span></span> <span contenteditable="true">is situated in</span><span class="tooltip"> '.$comment_locality_master .'<span class="tooltiptext">Address Form - Comment on locality </span></span> <span contenteditable="true">Locality.</span>';
@ -896,7 +918,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<span class="tooltip">'.$address_form['address_form_remark'].'<span class="tooltiptext">Address Form - Address Form Remarks </span></span>';} echo '<span class="tooltip">'.$address_form['address_form_remark'].'<span class="tooltiptext">Address Form - Address Form Remarks </span></span>';}
echo "</p>"; echo "</p>";
echo "<div id='page_break'></div>"; echo "<div id='page_break'></div>";
//die(); //
?> ?>
<!-- ####################### End of Address Details Section ############################--> <!-- ####################### End of Address Details Section ############################-->
@ -964,7 +986,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$loan_table_dispaly_rows[] = array('particulars' => 'Estimated Market Value of the property being mortgaged','details' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emv_per_customer']).' ('.MYUTIL::numtowords($loan_form['emv_per_customer']).')'); $loan_table_dispaly_rows[] = array('particulars' => 'Estimated Market Value of the property being mortgaged','details' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emv_per_customer']).' ('.MYUTIL::numtowords($loan_form['emv_per_customer']).')');
//print_r($loan_table_dispaly_rows);die(); //print_r($loan_table_dispaly_rows);
?> ?>
<br><br> <br><br>
<table class="scorecard_table"> <table class="scorecard_table">
@ -979,7 +1001,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tbody> </tbody>
</table> </table>
<?php <?php
//die(); //
echo "<br><br>".$loan_form['loandetails_remarks']; echo "<br><br>".$loan_form['loandetails_remarks'];
?> ?>
<!-- ####################### End of Loan Details Details Section ############################--> <!-- ####################### End of Loan Details Details Section ############################-->
@ -998,10 +1020,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<div id='page_break'></div> <div id='page_break'></div>
<?php <?php
$businessResult=array(); $businessResult=array();
if(isset($pd_processed_forms[13][$business_count]))
{
$bRow = $pd_processed_forms[13][$business_count]; $bRow = $pd_processed_forms[13][$business_count];
$businessRow = json_decode($bRow['processed_json'],true); $businessRow = json_decode($bRow['processed_json'],true);
//print_r($businessRow);die(); //print_r($businessRow);
$companyList = MYUTIL::findCompanyName($all_company_details,$businessRow['company_id'],2); $companyList = MYUTIL::findCompanyName($all_company_details,$businessRow['company_id'],2);
//$companyList .=' The director details are as under :'; //$companyList .=' The director details are as under :';
$bindEachResult["company_details"]=$companyList; $bindEachResult["company_details"]=$companyList;
@ -1022,6 +1045,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$getFamilyMembers=array(); $getFamilyMembers=array();
$bindEachResult["family_members_involved"]=$getFamilyMembers; $bindEachResult["family_members_involved"]=$getFamilyMembers;
} }
$bindEachResult['total_per_of_export'] = $businessRow['export_sale_of_total_sales'];
$bindEachResult['applicant_use_mobile_wallets'] = $businessRow['applicant_use_mobile_wallets'];
$bindEachResult['applicant_use_pos_machines'] = $businessRow['applicant_use_pos_machines'];
$bindEachResult['applicant_use_pos_machines'] = $businessRow['applicant_use_pos_machines'];
$bindEachResult['pos_machines_details'] = isset($businessRow['pos_machines_details']) ? $businessRow['pos_machines_details']: null;
$bindEachResult['no_of_pos_machines'] = isset($businessRow['no_of_pos_machines']) ? $businessRow['no_of_pos_machines'] : null;
// this is for manufacturing activities // this is for manufacturing activities
if(array_key_exists('manufacturing_activity_details',$businessRow)){ if(array_key_exists('manufacturing_activity_details',$businessRow)){
@ -1091,7 +1122,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$bindEachResult['company_employees'].= ' and no temporary employess with company'; $bindEachResult['company_employees'].= ' and no temporary employess with company';
} }
if(($businessRow['employees_permanent'] != "" || $businessRow['employees_permanent'] != 0) && ($businessRow['employees_temporary'] != "" || $businessRow['employees_temporary'] != 0)) if(($businessRow['employees_permanent'] != "" || $businessRow['employees_permanent'] == 0) && ($businessRow['employees_temporary'] != "" || $businessRow['employees_temporary'] == 0))
{ {
$bindEachResult['company_employees'].= ' There are no permanant and temporary employess with company<span contenteditable="true">.</span>'; $bindEachResult['company_employees'].= ' There are no permanant and temporary employess with company<span contenteditable="true">.</span>';
} }
@ -1128,7 +1159,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
} }
if(strtoupper($businessRow['other_documents'])=='YES' && array_key_exists('documents',$businessRow)){ if(strtoupper($businessRow['other_documents'])=='YES' && array_key_exists('documents',$businessRow)){
foreach($businessRow['documents'] as $docValue){ foreach($businessRow['documents'] as $docValue){
array_push($getDocuments,array('name' => $docValue['document'].'.', 'img' => $docValue['document_pic'])); array_push($getDocuments,array('name' => $docValue['document'].'.', 'img' => isset( $docValue['document_pic']) ? $docValue['document_pic'] : ''));
} }
} }
$bindEachResult['visit_documents']=$getDocuments; $bindEachResult['visit_documents']=$getDocuments;
@ -1139,6 +1170,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?> ?>
<h3 contenteditable="true">BUSINESS INFORMATION:</h3> <h3 contenteditable="true">BUSINESS INFORMATION:</h3>
<?php <?php
//print_r($businessResult);
foreach($businessResult as $bKey=>$fetchRow){ foreach($businessResult as $bKey=>$fetchRow){
?> ?>
@ -1182,7 +1214,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!--this is for family members involved in business --> <!--this is for family members involved in business -->
<?php <?php
//print_r($fetchRow['family_members_involved']);die(); //print_r($fetchRow['family_members_involved']);
if(count($fetchRow['family_members_involved']) >0){ ?> if(count($fetchRow['family_members_involved']) >0){ ?>
<div> <div>
<p>Other Family Members involved in business :</p> <p>Other Family Members involved in business :</p>
@ -1220,7 +1252,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- start manufacturing --> <!-- start manufacturing -->
<?php <?php
//die(); //
if(count($fetchRow['manufacturing']) >0){ ?> if(count($fetchRow['manufacturing']) >0){ ?>
<div> <div>
<p> Type of Business Activity : Manufacturing</p> <p> Type of Business Activity : Manufacturing</p>
@ -1391,7 +1423,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach($fetchRow['wholesale'] as $wholesaleRow){ <?php
//print_r($fetchRow['wholesale']);
foreach($fetchRow['wholesale'] as $wholesaleRow){
?> ?>
<tr> <tr>
<td class="customtd"><?php echo $wholesaleRow['products'] ?></td> <td class="customtd"><?php echo $wholesaleRow['products'] ?></td>
@ -1399,7 +1433,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<td class="customtd"><div><?php echo $wholesaleRow['sales_done'] ?></div> <td class="customtd"><div><?php echo $wholesaleRow['sales_done'] ?></div>
<?php if(array_key_exists('both_sales_done',$wholesaleRow)) { ?> <?php if(array_key_exists('both_sales_done',$wholesaleRow)) { ?>
<div><?php echo $wholesaleRow['both_sales_done'] ?></div> <div><?php echo $wholesaleRow['both_sales_done'] ?></div>
<?php } ?> <?php }
if(!strcasecmp($wholesaleRow['area_of_sale'],'Domestics & Exports'))
{
echo '<div>'.$fetchRow['total_per_of_export'].' % of total sales is export.</div>';
}
?>
</td> </td>
<td class="customtd"><?php echo $wholesaleRow['max_sales_done']?></td> <td class="customtd"><?php echo $wholesaleRow['max_sales_done']?></td>
@ -1451,6 +1490,33 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- end other avtivity --> <!-- end other avtivity -->
<!-- business POS,UPI Details details -->
<?php
if(!strcasecmp($fetchRow['applicant_use_mobile_wallets'],'yes'))
{
echo '<p>As per person`s met,applicant using Mobile Wallets/UPI for business transactions.</p>';
}//else
//{
// echo '<p>As per person`s met,applicant using Mobile Wallets/UPI for business transactions.</p>'
//}
if(!strcasecmp($fetchRow['applicant_use_pos_machines'],'yes'))
{
echo '<p>The applicant using the following POS machines:</p>';
echo '<table class="scorecard_table">';
echo '<tr> <th>Name of the Financial Insitution</th> <th>TID Number of POS machine</th> </tr>';
foreach($fetchRow['pos_machines_details'] as $pos)
{
echo '<tr> <td class="customtd">'.$pos['pos_machines_financial_institution_name'].'</td> <td class="customtd">'.$pos['tid_no_of_pos_machine'].'</td> </tr>';
}
echo '</table>';
}
?>
<!-- End of business POS,UPI Details details -->
@ -1459,7 +1525,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- start this is business peak details --> <!-- start this is business peak details -->
<?php <?php
//die(); //
if(array_key_exists('business_peak_details',$fetchRow)){ ?> if(array_key_exists('business_peak_details',$fetchRow)){ ?>
<div><p><?php echo $fetchRow['business_peak_details'];?></p></div> <div><p><?php echo $fetchRow['business_peak_details'];?></p></div>
<?php } ?> <?php } ?>
@ -1473,7 +1539,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- start documents details --> <!-- start documents details -->
<?php if(count($fetchRow['visit_documents'])){ <?php if(count($fetchRow['visit_documents'])){
//print_r($fetchRow['visit_documents']);die(); //print_r($fetchRow['visit_documents']);
?> ?>
<p>The below documents were sighted during the visit :</p> <p>The below documents were sighted during the visit :</p>
<table> <table>
@ -1481,10 +1547,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php <?php
$visit_documents = ($fetchRow['visit_documents']); $visit_documents = ($fetchRow['visit_documents']);
//print_r($visit_documents);die(); //print_r($visit_documents);
$visit_documents_row_count = ceil(count($fetchRow['visit_documents'])/2); $visit_documents_row_count = ceil(count($fetchRow['visit_documents'])/2);
//echo count($visit_documents); //echo count($visit_documents);
//echo $visit_documents_row_count;die(); //echo $visit_documents_row_count;
$from_index_increment = 0; $from_index_increment = 0;
for($vrc = 1;$vrc <= $visit_documents_row_count;$vrc++) for($vrc = 1;$vrc <= $visit_documents_row_count;$vrc++)
{ {
@ -1513,12 +1579,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!--Gallary Ended --> <!--Gallary Ended -->
<?php <?php
// die(); //
} ?> } ?>
<!-- end documents details --> <!-- end documents details -->
<?php } //die();?> <?php }
}// ENd of If current business available in current index
//?>
<div class="page_break"> </div> <div class="page_break"> </div>
<!-- #################End OF Business section############################### --> <!-- #################End OF Business section############################### -->
@ -1527,12 +1596,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- #################start business asset #################--> <!-- #################start business asset #################-->
<?php <?php
//die(); //
$businessAssetResult=array(); $businessAssetResult=array();
if(isset($pd_processed_forms[22][$business_count]))
{
$baRow = $pd_processed_forms[22][$business_count]; $baRow = $pd_processed_forms[22][$business_count];
$businessAssetRow = json_decode($baRow['processed_json'],true); $businessAssetRow = json_decode($baRow['processed_json'],true);
//print_r($businessAssetRow);die();
$bindBusinessAsset["company_name"] ='Assets used for '; $bindBusinessAsset["company_name"] ='Assets used for ';
$bindBusinessAsset["company_name"] .=MYUTIL::findCompanyName($all_company_details,$businessAssetRow['company_id'],1); $bindBusinessAsset["company_name"] .=MYUTIL::findCompanyName($all_company_details,$businessAssetRow['company_id'],1);
$bindBusinessAsset["company_name"] .=' Business :'; $bindBusinessAsset["company_name"] .=' Business :';
@ -1542,12 +1614,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
array_push($businessAssetResult,$bindBusinessAsset); array_push($businessAssetResult,$bindBusinessAsset);
// print_r($businessAssetResult);die(); // print_r($businessAssetResult);
?> ?>
<?php <?php
//print_r($businessAssetResult); //print_r($businessAssetResult);die();
if(count($businessAssetResult)>0){ ?> if( $businessAssetResult[0]['details']['show_table'] ){ ?>
<div class="page_break"> <div> <div class="page_break"> <div>
<br> <br>
<h3 contenteditable="true">Assets used in Business</h3> <h3 contenteditable="true">Assets used in Business</h3>
@ -1574,10 +1646,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '</table>'; echo '</table>';
} }
} }
}?> }
} // ENd of if business assesst available in this current index
?>
<?php <?php
//die();?> //?>
<!-- #################end business asset #################--> <!-- #################end business asset #################-->
@ -1586,6 +1661,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php <?php
$businessFinancialResult=array(); $businessFinancialResult=array();
$profit_loss_symbal = '<span style="font-family:DejaVu Sans; sans-serif;color:green;">↑</span> /<span style="font-family:DejaVu Sans; sans-serif;color:red;">↓</span>'; $profit_loss_symbal = '<span style="font-family:DejaVu Sans; sans-serif;color:green;">↑</span> /<span style="font-family:DejaVu Sans; sans-serif;color:red;">↓</span>';
if(isset($pd_processed_forms[14][$business_count]))
{
$baRow = $pd_processed_forms[14][$business_count]; $baRow = $pd_processed_forms[14][$business_count];
$businessFinancialRow = json_decode($baRow['processed_json'],true); $businessFinancialRow = json_decode($baRow['processed_json'],true);
//print_r($businessFinancialRow);die(); //print_r($businessFinancialRow);die();
@ -1669,7 +1747,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$bindBusinessFinancial['working_capital_facilites'] = isset($businessFinancialRow['select_working_capital_facilities_availed']) ? $businessFinancialRow['select_working_capital_facilities_availed'] : null; $bindBusinessFinancial['working_capital_facilites'] = isset($businessFinancialRow['select_working_capital_facilities_availed']) ? $businessFinancialRow['select_working_capital_facilities_availed'] : null;
//print_r($bindBusinessFinancial['select_working_capital_facilities_availed']);die(); //FINANCIALFORM::getAvailableFacilities($businessFinancialRow[-'"working_capital_facilities_availed']); //print_r($bindBusinessFinancial['select_working_capital_facilities_availed']); //FINANCIALFORM::getAvailableFacilities($businessFinancialRow[-'"working_capital_facilities_availed']);
array_push($businessFinancialResult,$bindBusinessFinancial); array_push($businessFinancialResult,$bindBusinessFinancial);
@ -1750,7 +1828,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if($iterateFinance['is_customer_statement']) if($iterateFinance['is_customer_statement'])
{ {
if(count($iterateFinance['customer_statements'])>0){ if(count($iterateFinance['customer_statements'])>0){
//print_r($iterateFinance['customer_statements']);die(); //print_r($iterateFinance['customer_statements']);
?> ?>
@ -1823,7 +1901,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php } <?php }
else {?> else {?>
<p>Financial information is not available.</p> <p>Financial information is not available.</p>
<?php } //die();?> <?php }
} //ENd of finance available in this current index
//?>
<!--################# end business financial #################--> <!--################# end business financial #################-->
<!-- start business banking section --> <!-- start business banking section -->
@ -1831,11 +1912,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php <?php
$bankingResult=array(); $bankingResult=array();
if(isset($pd_processed_forms[21][$business_count]))
{
// business banking // business banking
$bbRow = $pd_processed_forms[21][$business_count] ; $bbRow = $pd_processed_forms[21][$business_count] ;
$businessBankRow = json_decode($bbRow['processed_json'],true); $businessBankRow = json_decode($bbRow['processed_json'],true);
//print_r($businessBankRow);die(); //print_r($businessBankRow);
if(count($businessBankRow['banking_details'])>0){ if(count($businessBankRow['banking_details'])>0){
$getEachValues['is_od_cc'] = null; $getEachValues['is_od_cc'] = null;
foreach($businessBankRow['banking_details'] as $bd){ if($bd['account_type']== 4 || $bd['account_type']== 3){ $getEachValues['is_od_cc'] = true; } } foreach($businessBankRow['banking_details'] as $bd){ if($bd['account_type']== 4 || $bd['account_type']== 3){ $getEachValues['is_od_cc'] = true; } }
@ -1847,7 +1929,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?> ?>
<?php <?php
//print_r($bankingResult);die(); //print_r($bankingResult);
if(count($bankingResult)>0){ ?> if(count($bankingResult)>0){ ?>
<h3 contenteditable="true">Business Banking:</h3> <h3 contenteditable="true">Business Banking:</h3>
@ -1883,6 +1965,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tbody> </tbody>
</table> </table>
<?php } <?php }
}// end of busienss bankDetails available in this currrent index
?> ?>
@ -1896,6 +1980,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php <?php
$clientResult=array(); $clientResult=array();
$client_form_remarks = '';
// this is for manufacturing // this is for manufacturing
//global $client_first_row; //global $client_first_row;
$client_first_row = ''; $client_first_row = '';
@ -1908,9 +1993,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$to_no_of_clients = 0; $to_no_of_clients = 0;
$done_on_credit = 0; $done_on_credit = 0;
$name_of_the_company = ''; $name_of_the_company = '';
if(isset($pd_processed_forms[2][$business_count]))
{
$cRow = $pd_processed_forms[2][$business_count]; $cRow = $pd_processed_forms[2][$business_count];
$clientRow = json_decode($cRow['processed_json'],true); $clientRow = json_decode($cRow['processed_json'],true);
$client_form_remarks = $clientRow['supplier_info_form_remark'];
$name_of_the_company = MYUTIL::findCompanyName($all_company_details,$clientRow['company_id'],1); $name_of_the_company = MYUTIL::findCompanyName($all_company_details,$clientRow['company_id'],1);
// $bindEachResult["company_name"]=MYUTIL::findCompanyName($all_company_details,$clientRow['company_id'],1); // $bindEachResult["company_name"]=MYUTIL::findCompanyName($all_company_details,$clientRow['company_id'],1);
// $getmanufacturing = array(); // $getmanufacturing = array();
@ -1935,10 +2022,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(isset($manuRow['main_raw_materials'])){ if(isset($manuRow['main_raw_materials'])){
$to_no_of_clients += count($manuRow['main_raw_materials']); //$to_no_of_clients += count($manuRow['main_raw_materials']);
foreach($manuRow['main_raw_materials'] as $main_raw_material_key => $main_raw_material) foreach($manuRow['main_raw_materials'] as $main_raw_material_key => $main_raw_material)
{ {
if($main_raw_material['manufacturing_product_name'] != "" || $main_raw_material['manufacturing_product_name'] != null)
{
$to_no_of_clients ++;
}
//print_r($main_raw_material); //print_r($main_raw_material);
$client_first_row .= '<td class="customtd">'.$main_raw_material['manufacturing_product_name'].'</td>'; $client_first_row .= '<td class="customtd">'.$main_raw_material['manufacturing_product_name'].'</td>';
@ -1975,11 +2067,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(isset($tradeRow['trading_products'])){ if(isset($tradeRow['trading_products'])){
$to_no_of_clients += count($tradeRow['trading_products']); //$to_no_of_clients += count($tradeRow['trading_products']);
foreach($tradeRow['trading_products'] as $trading_product_key => $trading_product) foreach($tradeRow['trading_products'] as $trading_product_key => $trading_product)
{ {
if($trading_product['trade_product_name'] != "" || $trading_product['trade_product_name'] != null)
{
$to_no_of_clients++;
}
$client_first_row .= '<td class="customtd">'.$trading_product['trade_product_name'].'</td>'; $client_first_row .= '<td class="customtd">'.$trading_product['trade_product_name'].'</td>';
$client_second_row .= isset($trading_product['person_title_name_master']) ? '<td class="customtd">' . $trading_product['person_title_name_master'].' ': '<td class="customtd">'; $client_second_row .= isset($trading_product['person_title_name_master']) ? '<td class="customtd">' . $trading_product['person_title_name_master'].' ': '<td class="customtd">';
@ -1995,7 +2091,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$client_fourth_row .= $trading_product['person_stdcode'] && $trading_product['person_landline'] ? '<td class="customtd">'. $trading_product['person_stdcode'].' '.$trading_product['person_landline'].'</td>' : '<td class="customtd">'.'Not Provided'.'</td>'; $client_fourth_row .= $trading_product['person_stdcode'] && $trading_product['person_landline'] ? '<td class="customtd">'. $trading_product['person_stdcode'].' '.$trading_product['person_landline'].'</td>' : '<td class="customtd">'.'Not Provided'.'</td>';
$client_fifth_row .= $trading_product['trade_product_payment_type_master'] ? '<td class="customtd">'. $trading_product['trade_product_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>'; $client_fifth_row .= isset($trading_product['trade_product_payment_type_master']) ? '<td class="customtd">'. $trading_product['trade_product_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>';
$client_sixth_row .= $trading_product['trade_product_payment_mode'] ? '<td class="customtd">'. $trading_product['trade_product_payment_mode'] .'</td>' : '<td class="customtd">NA</td>';; $client_sixth_row .= $trading_product['trade_product_payment_mode'] ? '<td class="customtd">'. $trading_product['trade_product_payment_mode'] .'</td>' : '<td class="customtd">NA</td>';;
@ -2017,10 +2113,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if(isset($serviceRow['service_products'])){ if(isset($serviceRow['service_products'])){
$to_no_of_clients += count($serviceRow['service_products']); //$to_no_of_clients += count($serviceRow['service_products']);
foreach($serviceRow['service_products'] as $service_product_key => $service_product) foreach($serviceRow['service_products'] as $service_product_key => $service_product)
{ {
if($service_product['service_provider_product_name'] != "" || $service_product['service_provider_product_name'] != null)
{
$to_no_of_clients++;
}
$client_first_row .= '<td class="customtd">'.$service_product['service_provider_product_name'].'</td>'; $client_first_row .= '<td class="customtd">'.$service_product['service_provider_product_name'].'</td>';
$client_second_row .= isset($service_product['person_title_name_master']) ? '<td class="customtd">' . $service_product['person_title_name_master'].' ': '<td class="customtd">'; $client_second_row .= isset($service_product['person_title_name_master']) ? '<td class="customtd">' . $service_product['person_title_name_master'].' ': '<td class="customtd">';
@ -2057,7 +2157,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$client_fifth_row .= '</tr>'; $client_fifth_row .= '</tr>';
$client_sixth_row .= '</tr>'; $client_sixth_row .= '</tr>';
$client_seventh_row .= '</tr>'; $client_seventh_row .= '</tr>';
//echo $client_third_row;die(); //echo $client_third_row;
?> ?>
<?php <?php
@ -2097,6 +2197,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</table> </table>
<?php if($done_on_credit != 0) { echo "<p> Out of total sales done by ".$name_of_the_company .", ".$done_on_credit."% is done on credit.</p>"; } <?php if($done_on_credit != 0) { echo "<p> Out of total sales done by ".$name_of_the_company .", ".$done_on_credit."% is done on credit.</p>"; }
echo '<p>'.$client_form_remarks.'</p>';
//CLient Photo Section //CLient Photo Section
$client_photo_count = $pd_images[2]; $client_photo_count = $pd_images[2];
$client_img_row_count = ceil(count($client_photo_count) / 3); $client_img_row_count = ceil(count($client_photo_count) / 3);
@ -2138,7 +2239,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
} }
//End of CLient Photo Section //End of CLient Photo Section
?> ?>
<?php } ?> <?php }
} // ENd of client info available in this current index ?>
<!-- #################client section end #################--> <!-- #################client section end #################-->
@ -2146,14 +2248,18 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- #################supplier section start #################--> <!-- #################supplier section start #################-->
<?php <?php
//die(); //
$supplierResult=array(); $supplierResult=array();
// this is for manufacturing $supplier_form_remarks = '';
if(isset($pd_processed_forms[1][$business_count]))
{
$supplier_details = $pd_processed_forms[1][$business_count]; $supplier_details = $pd_processed_forms[1][$business_count];
$supplierRow = json_decode($supplier_details['processed_json'],true); $supplierRow = json_decode($supplier_details['processed_json'],true);
//print_r($supplierRow);die(); $supplier_form_remarks = (isset($supplierRow['supplier_info_form_remark']) ? $supplierRow['supplier_info_form_remark'] : '');
$company_name = MYUTIL::findCompanyName($all_company_details,$supplierRow['company_id'],1); $company_name = MYUTIL::findCompanyName($all_company_details,$supplierRow['company_id'],1);
$total_no_of_suppliers = count($supplierRow['manufacturing_details']); $total_no_of_suppliers = 0;
$total_payments_percent_on_credit_for_supplier = 0; $total_payments_percent_on_credit_for_supplier = 0;
@ -2165,6 +2271,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
foreach($manuRow['main_raw_materials'] as $rawkey => $raw){ foreach($manuRow['main_raw_materials'] as $rawkey => $raw){
if($raw['manufacturing_raw_material_name'] != "" || $raw['manufacturing_raw_material_name'] != null)
{
$total_no_of_suppliers++;
}
$temp['supplier_first_row'] = '<tr><td class="customtd">1</td><td class="customtd_leftalign">Item Purchased </td>'.'<td class="customtd">'.$raw['manufacturing_raw_material_name'].'</td></tr>'; $temp['supplier_first_row'] = '<tr><td class="customtd">1</td><td class="customtd_leftalign">Item Purchased </td>'.'<td class="customtd">'.$raw['manufacturing_raw_material_name'].'</td></tr>';
$supplier_second_row = '<tr><td class="customtd">2</td><td class="customtd_leftalign">Contact Person </td>'; $supplier_second_row = '<tr><td class="customtd">2</td><td class="customtd_leftalign">Contact Person </td>';
@ -2210,14 +2320,15 @@ defined('BASEPATH') OR exit('No direct script access allowed');
{ {
foreach($supplierRow['trade_details'][0]['trading_products'] as $tradeRow){ foreach($supplierRow['trade_details'][0]['trading_products'] as $tradeRow){
if($tradeRow['trade_product_name'] != "" || $tradeRow['trade_product_name'] != null)
{
$total_no_of_suppliers++;
}
$total_payments_percent_on_credit_for_supplier = $supplierRow['trade_details'][0]['trading_products_total_payments_percent_on_credit']; $total_payments_percent_on_credit_for_supplier = $supplierRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'];
//if(isset($tradeRow['trading_products'])){
//foreach($tradeRow['trading_products'] as $trade){
$temp['supplier_first_row'] = '<tr><td class="customtd">1</td><td class="customtd_leftalign">Item Purchased </td>'.'<td class="customtd">'.$tradeRow['trade_product_name'].'</td></tr>'; $temp['supplier_first_row'] = '<tr><td class="customtd">1</td><td class="customtd_leftalign">Item Purchased </td>'.'<td class="customtd">'.$tradeRow['trade_product_name'].'</td></tr>';
$supplier_second_row = '<tr><td class="customtd">2</td><td class="customtd_leftalign">Contact Person </td>'; $supplier_second_row = '<tr><td class="customtd">2</td><td class="customtd_leftalign">Contact Person </td>';
@ -2240,7 +2351,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$temp['supplier_fifth_row'] = '<tr><td class="customtd">5</td><td class="customtd_leftalign">Payment Terms</td>'; $temp['supplier_fifth_row'] = '<tr><td class="customtd">5</td><td class="customtd_leftalign">Payment Terms</td>';
$temp['supplier_fifth_row'] .= $tradeRow['trade_product_payment_type_master'] ? '<td class="customtd">'. $tradeRow['trade_product_payment_type_master'] .'</td></tr>' : '<td class="customtd">NA</td></tr>'; $temp['supplier_fifth_row'] .= isset($tradeRow['trade_product_payment_type_master']) ? '<td class="customtd">'. $tradeRow['trade_product_payment_type_master'] .'</td></tr>' : '<td class="customtd">NA</td></tr>';
$temp['supplier_sixth_row'] = '<tr><td class="customtd">6</td><td class="customtd_leftalign">Payment Mode</td>'; $temp['supplier_sixth_row'] = '<tr><td class="customtd">6</td><td class="customtd_leftalign">Payment Mode</td>';
@ -2257,10 +2368,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
} }
} }
// echo "dsfnsdkfnj**********"; // echo "dsfnsdkfnj**********";
// print_r($supplierResult); //print_r($supplierResult);die();
//die();
//echo $supplierResult[0]['supplier_third_row'];die(); if($total_no_of_suppliers > 0)
if(count($supplierResult))
{ {
?> ?>
@ -2349,25 +2459,30 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}//End of supplier foreach ?> }//End of supplier foreach ?>
<?php <?php
die();
if($total_payments_percent_on_credit_for_supplier > 0) if($total_payments_percent_on_credit_for_supplier > 0)
{ {
echo "<p>Have to make payment of about ". $total_payments_percent_on_credit_for_supplier ." % in advance rest on delivery.</p>"; echo "<p>Have to make payment of about ". $total_payments_percent_on_credit_for_supplier ." % in advance rest on delivery.</p>";
} }
}?> }
echo '<p>'.$supplier_form_remarks.'<p>';
}// End of supplier info avilable in this current index?>
<!-- #################supplier section end ##################################--> <!-- #################supplier section end ##################################-->
<!-- #################start stock section #################--> <!-- #################start stock section #################-->
<?php <?php
//die();
$stockResult=array();
$stockResult=array();
$stock_form_remarks = '';
if(isset($pd_processed_forms[11][$business_count]))
{
$stRow = $pd_processed_forms[11][$business_count]; $stRow = $pd_processed_forms[11][$business_count];
$stockRow = json_decode($stRow['processed_json'],true); $stockRow = json_decode($stRow['processed_json'],true);
//print_r($stockRow);die(); //print_r($stockRow);
$stock_form_remarks = $stockRow['stock_remarks'];
$stock_remarks = $stockRow['stock_remarks']; $stock_remarks = $stockRow['stock_remarks'];
$is_stock_sufficient_enough = $stockRow['is_sufficiant_finished_and_traded_goods']; $is_stock_sufficient_enough = $stockRow['is_sufficiant_finished_and_traded_goods'];
$is_stock_sufficient_enough_remarks = $stockRow['finished_and_traded_goods_remarks']; $is_stock_sufficient_enough_remarks = $stockRow['finished_and_traded_goods_remarks'];
@ -2402,7 +2517,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
count($bindStockResult['wholesale']) || count($bindStockResult['retail']) || count($bindStockResult['manufacturing'])? array_push($stockResult,$bindStockResult) : $stockResult; count($bindStockResult['wholesale']) || count($bindStockResult['retail']) || count($bindStockResult['manufacturing'])? array_push($stockResult,$bindStockResult) : $stockResult;
//echo "**********************"; //echo "**********************";
//print_r($stockResult);die(); //print_r($stockResult);
?> ?>
<?php <?php
@ -2446,7 +2561,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php } ?> <?php } ?>
<!-- Retail --> <!-- Retail -->
<?php if(count($getstRow['retail'])) { <?php if(count($getstRow['retail'])) {
//print_r(($getstRow['retail']));die(); //print_r(($getstRow['retail']));
?> ?>
<?php foreach($getstRow['retail'] as $reRow){ <?php foreach($getstRow['retail'] as $reRow){
if($reRow['name']){ if($reRow['name']){
@ -2467,7 +2582,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php <?php
//print_r($getstRow['wholesale']);die(); //print_r($getstRow['wholesale']);
if(count($getstRow['wholesale'])) { ?> if(count($getstRow['wholesale'])) { ?>
<?php foreach($getstRow['wholesale'] as $wsRow){ <?php foreach($getstRow['wholesale'] as $wsRow){
if($wsRow['name']){ if($wsRow['name']){
@ -2536,17 +2651,18 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//echo '</tbody>'; //echo '</tbody>';
echo '</table>'; echo '</table>';
} }
//die(); //
?> ?>
<?php <?php
//die(); //
} }
else {?> echo '<p>'.$stock_form_remarks.'</p>';
//else {?>
<!-- <p> Stock details is not available.</p> --> <!-- <p> Stock details is not available.</p> -->
<?php } <?php //}
//} for stop cell map error, un commet when lot of form data not available but have to test PDF } //end of stock details available in current index
?> ?>
<!-- #################end stock section #################--> <!-- #################end stock section #################-->
@ -2564,7 +2680,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
// echo "######################################"; // echo "######################################";
// print_r($ai_core_details_processed); // print_r($ai_core_details_processed);
// die(); //
$ai_summary_details = ($assessed_income_details[ ($business_count+1) ]['summary_details']); $ai_summary_details = ($assessed_income_details[ ($business_count+1) ]['summary_details']);
$ai_summary_details_processed = ASSESSEDINCOME::getSummaryTable($ai_summary_details,$ai_core_details); $ai_summary_details_processed = ASSESSEDINCOME::getSummaryTable($ai_summary_details,$ai_core_details);
@ -2646,7 +2762,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo $str; echo $str;
echo '</p><br>'; echo '</p><br>';
} }
//die(); //
if(isset($ai_core_details) && count($ai_core_details['sales_calculated_by_itemwise'])) if(isset($ai_core_details) && count($ai_core_details['sales_calculated_by_itemwise']))
{ {
echo '<p contenteditable="true">Sales Itemwise : </p>'; echo '<p contenteditable="true">Sales Itemwise : </p>';
@ -2746,7 +2862,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
} }
} }
//die(); //
if(isset($ai_core_details) && count($ai_core_details['business_expenses'])) if(isset($ai_core_details) && count($ai_core_details['business_expenses']))
{ {
echo '<p contenteditable="true">Business Expenses Details :</p>'; echo '<p contenteditable="true">Business Expenses Details :</p>';
@ -2813,7 +2929,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '</table>'; echo '</table>';
} }
echo "<div class='page_break'></div>"; echo "<div class='page_break'></div>";
//die(); //
?> ?>
<!-- #################End of AI #################--> <!-- #################End of AI #################-->
@ -2830,19 +2946,19 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$otherAssetResult=array(); $otherAssetResult=array();
foreach($pd_processed_forms[4] as $rowKey=> $oaRow) { foreach($pd_processed_forms[4] as $rowKey=> $oaRow) {
$otherAssetRow = json_decode($oaRow['processed_json'],true); $otherAssetRow = json_decode($oaRow['processed_json'],true);
//print_r($otherAssetRow);die(); //print_r($otherAssetRow);
//echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@"; //echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
if(count($otherAssetRow['assets_details'])>0){ if(count($otherAssetRow['assets_details'])>0){
$otherAssetResult=ASSETSFORM::getOthersAssetsDetails($otherAssetRow['assets_details']); $otherAssetResult=ASSETSFORM::getOthersAssetsDetails($otherAssetRow['assets_details']);
//print_r($otherAssetResult);die(); //print_r($otherAssetResult);
} }
} }
?> ?>
<h3 contenteditable="">Personal Assets</h3> <h3 contenteditable="">Personal Assets</h3>
<?php <?php
//print_r($otherAssetResult);die(); //print_r($otherAssetResult);
if(count($otherAssetResult)>0){ ?> if(count($otherAssetResult)>0){ ?>
<table class="scorecard_table"> <table class="scorecard_table">
<thead> <thead>
@ -2934,7 +3050,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- start other income section --> <!-- start other income section -->
<?php <?php
//die(); //
$otherIncomeResult=array(); $otherIncomeResult=array();
foreach($pd_processed_forms[9] as $rowKey=> $iRow) { foreach($pd_processed_forms[9] as $rowKey=> $iRow) {
@ -2986,7 +3102,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$familyResult=array(); $familyResult=array();
foreach($pd_processed_forms[6] as $rowKey=> $fRow) { foreach($pd_processed_forms[6] as $rowKey=> $fRow) {
$familyRow = json_decode($fRow['processed_json'],true); $familyRow = json_decode($fRow['processed_json'],true);
// print_r($familyRow);die(); // print_r($familyRow);
if(array_key_exists('family_details',$familyRow) && count($familyRow['family_details'])>0){ if(array_key_exists('family_details',$familyRow) && count($familyRow['family_details'])>0){
$familyResult=OTHERFAMILYFORM::getFamilyDetails($familyRow['family_details']); $familyResult=OTHERFAMILYFORM::getFamilyDetails($familyRow['family_details']);
} }
@ -2994,7 +3110,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
?> ?>
<?php if(count($familyResult)>0){ <?php if(count($familyResult)>0){
//print_r($familyResult);die(); //print_r($familyResult);
?> ?>
<div id='page_break'></div> <div id='page_break'></div>
<h3 contenteditable="true">Family Information:</h3> <h3 contenteditable="true">Family Information:</h3>
@ -3048,11 +3164,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<!-- #################start Existing Loan obligations section################# --> <!-- #################start Existing Loan obligations section################# -->
<?php <?php
//die(); //
$existLoanResult=array(); $existLoanResult=array();
foreach($pd_processed_forms[8] as $rowKey=> $elRow) { foreach($pd_processed_forms[8] as $rowKey=> $elRow) {
$otherLoanRow = json_decode($elRow['processed_json'],true); $otherLoanRow = json_decode($elRow['processed_json'],true);
//print_r($otherLoanRow);die(); //print_r($otherLoanRow);
$total_no_of_data = 0; $total_no_of_data = 0;
if(strtoupper($otherLoanRow['existing_loan'])=='YES' && count($otherLoanRow['loan_details'])>0){ if(strtoupper($otherLoanRow['existing_loan'])=='YES' && count($otherLoanRow['loan_details'])>0){
$total_no_of_data = count($otherLoanRow['loan_details']); $total_no_of_data = count($otherLoanRow['loan_details']);
@ -3061,7 +3177,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
} }
?> ?>
<?php if(count($existLoanResult)>0){ <?php if(count($existLoanResult)>0){
//print_r($existLoanResult);die(); //print_r($existLoanResult);
?> ?>
@ -3072,7 +3188,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<thead> <thead>
<tr> <tr>
<th>Particulars</th> <th>Particulars</th>
<?php for($header = 1;$header <= $total_no_of_data; $header++ ) {echo "<th>Loan $header</th>";}?> <?php for($header = 1;$header <= $existLoanResult['total_header']; $header++ ) {echo "<th>Loan $header</th>";}?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -3093,7 +3209,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</tbody> </tbody>
</table> </table>
<?php <?php
//die(); //
} }
else {?> else {?>
<p>As per loan applicant he doesnt have any existing obligations</p> <p>As per loan applicant he doesnt have any existing obligations</p>
@ -3112,9 +3228,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$pd_offiecer_status_about_neighbor = ""; $pd_offiecer_status_about_neighbor = "";
foreach($pd_processed_forms[19] as $rowKey=> $nrcRow) { foreach($pd_processed_forms[19] as $rowKey=> $nrcRow) {
$neighbourRefRow = json_decode($nrcRow['processed_json'],true); $neighbourRefRow = json_decode($nrcRow['processed_json'],true);
//print_r($applicants_details);die(); //print_r($applicants_details);
//print_r($neighbourRefRow); //print_r($neighbourRefRow);
//die(); //
if(strcasecmp($neighbourRefRow['neighbourhood_status'],'could not verify')){ if(strcasecmp($neighbourRefRow['neighbourhood_status'],'could not verify')){
$pd_offiecer_status_about_neighbor = $neighbourRefRow['neighbourhood_status']; $pd_offiecer_status_about_neighbor = $neighbourRefRow['neighbourhood_status'];
if(count($neighbourRefRow['neighbourhood_list'])>0){ if(count($neighbourRefRow['neighbourhood_list'])>0){
@ -3131,7 +3247,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<h3>Neighbourhood / Reference Check</h3> <h3>Neighbourhood / Reference Check</h3>
<?php if(count($existNeighRefCheck)>0){ <?php if(count($existNeighRefCheck)>0){
//print_r($existNeighRefCheck);die(); //print_r($existNeighRefCheck);
?> ?>
<?php foreach($existNeighRefCheck as $nkey => $nfValue) { <?php foreach($existNeighRefCheck as $nkey => $nfValue) {
@ -3164,7 +3280,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<div class="page_break"></div> <div class="page_break"></div>
<h3 contenteditable="true">PD OFFICERS REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS</h3> <h3 contenteditable="true">PD OFFICERS REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS</h3>
<?php <?php
//print_r($final_remark_data);die(); //print_r($final_remark_data);
$polite = null;$rude = null; $other_behaviour = null;$other_behaviour_remarks = null; $polite = null;$rude = null; $other_behaviour = null;$other_behaviour_remarks = null;
$fair = null;$well = null;$not = null; $fair = null;$well = null;$not = null;
@ -3193,7 +3309,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
} }
$pd_officer_final_remark = $final_remark_data['final_form_remarks']; $pd_officer_final_remark = $final_remark_data['final_form_remarks'];
//if(is_null($other_behaviour)){ echo 'null'; } die(); //if(is_null($other_behaviour)){ echo 'null'; }
?> ?>
<div> <div>
@ -3311,7 +3427,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if($positive){ $color_for_pd_offcier_recom = 'green';} else if($negative) { $color_for_pd_offcier_recom = 'red';}else{ $color_for_pd_offcier_recom = 'black';} if($positive){ $color_for_pd_offcier_recom = 'green';} else if($negative) { $color_for_pd_offcier_recom = 'red';}else{ $color_for_pd_offcier_recom = 'black';}
echo '<strong><span style="font-size:20px;color:'.$color_for_pd_offcier_recom.';">'.$fo_diplay.'</span>.</strong></p>';?> <p style="text-align:justify;">The following key points were considered while arriving at the aforementioned status.</p> echo '<strong><span style="font-size:20px;color:'.$color_for_pd_offcier_recom.';">'.$fo_diplay.'</span>.</strong></p>';?> <p style="text-align:justify;">The following key points were considered while arriving at the aforementioned status.</p>
<?php <?php
//die(); //
if($positive){ echo "<ul>"; foreach($final_remark_data['recommendation_positive'] as $pos){ echo "<li>".$pos['reason_for_positive']."</li>";} if($positive){ echo "<ul>"; foreach($final_remark_data['recommendation_positive'] as $pos){ echo "<li>".$pos['reason_for_positive']."</li>";}
}else if($negative){ echo "<ul>"; foreach($final_remark_data['recommendation_negative'] as $neg){ echo "<li>".$neg['reason_for_negative']."</li>";} }else if($negative){ echo "<ul>"; foreach($final_remark_data['recommendation_negative'] as $neg){ echo "<li>".$neg['reason_for_negative']."</li>";}