diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 7bcadecc..4769e3c2 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -350,6 +350,7 @@ class PD_Controller extends REST_Controller { /***********************CHOOSE PD TEMPALATE*********************/ if($pd_details['pd_status'] == TRIGGERED) { + $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); @@ -357,7 +358,7 @@ class PD_Controller extends REST_Controller { $table = LENDERTEMPLATE; $choosed_template_id = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,$table); - + if(count($choosed_template_id))// CHOOSE FILTERED TEMPLATE// { @@ -797,20 +798,20 @@ class PD_Controller extends REST_Controller { /***********************CHOOSE PD TEMPALATE*********************/ $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) { - $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']); - MYHTTPCLIENT::sendPOST($dataToBot); + //$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); } } - + die(); $primary_address_id = null; 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 "*******************************************"; $t = $this->load->view('report_templates/JSONTOREPORT',$data,true); //$t = $this->load->view('temp_html.html',null,true); - + echo $t;die(); $total_replaces = substr_count($t,''); //echo $total_replaces; @@ -5256,10 +5257,12 @@ class PD_Controller extends REST_Controller { { $records = $this->post('records'); $pd_id = $records['pd_id']; + $ai_flag = 0; //GET TEMPALE ID FROM MASTER $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); //echo $str; 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) { @@ -5353,7 +5360,8 @@ class PD_Controller extends REST_Controller { // print_r($template_forms_count);echo $form['form_id']; 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); @@ -5379,7 +5387,7 @@ class PD_Controller extends REST_Controller { $client_form_status = 1; } - if($form['form_id'] == 11) + if($form['form_id'] == 11 || $form['form_id'] == 22) { //echo "COUNT YES STOCK" 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)) { $data['dataStatus'] = true; @@ -6101,7 +6110,7 @@ class PD_Controller extends REST_Controller { public function getPDImages_post() { $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)) { $data['dataStatus'] = true; diff --git a/api/application/helpers/assetsform_helper.php b/api/application/helpers/assetsform_helper.php index 16eab9a6..c31e13ea 100644 --- a/api/application/helpers/assetsform_helper.php +++ b/api/application/helpers/assetsform_helper.php @@ -7,6 +7,8 @@ public static function getOthersAssetsDetails($values){ $mergeResult=array(); foreach($values as $key => $fetchVal){ $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['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']; @@ -108,6 +110,7 @@ public static function getOthersAssetsDetails($values){ } array_push($mergeResult,$storeValue); + } } return $mergeResult; } @@ -115,7 +118,7 @@ public static function getOthersAssetsDetails($values){ // business asset details public static function getBusinessAssetsDetails($business_assets){ - + //print_r($business_assets); $header_row = 'Particulars'; $first_row = 'Asset Type'; $sec_row = 'Asset Description'; @@ -128,11 +131,16 @@ public static function getOthersAssetsDetails($values){ $rupee_symbol = ""; $rental_flag = 0; $owned_flag = 0; + $show_table = 1; + $overall_empty_flag = 0; foreach($business_assets as $bsk => $fetchVal){ $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'])) { @@ -188,7 +196,7 @@ public static function getOthersAssetsDetails($values){ // switch(strtoupper($fetchVal['business_ownership_type'])) { $header_row .= 'Asset '.($bsk+1).''; - $first_row .= ''.$fetchVal['business_assets_mode_master'].''; + $first_row .= ''.$fetchVal['business_assets_mode_master'].' at '. $fetchVal['business_details'][0]['address_of_the_property'].''; $sec_row .= ''.($fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master']).''; $third_row .= ''. $ownership_type .''; $fourth_row .= ''.$owners_list.''; @@ -225,7 +233,7 @@ public static function getOthersAssetsDetails($values){ $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); } } ?> \ No newline at end of file diff --git a/api/application/helpers/bankingform_helper.php b/api/application/helpers/bankingform_helper.php index 43c6297d..cfd462c9 100644 --- a/api/application/helpers/bankingform_helper.php +++ b/api/application/helpers/bankingform_helper.php @@ -5,7 +5,7 @@ class Bankingform //get business Banking public static function getBusinessBankingDetails($values){ // print_r($values);die(); - if(count($values)>0){ + if(count($values)>0){ $values = array_map(function($tag) { $count_vintage = $tag['vintage_year'] >0 ? $tag['vintage_year'] :""; $count_vintage .= ($tag['vintage_year'] == 1) ? " Year" : (($tag['vintage_year'] > 1) ? " Years" : ""); diff --git a/api/application/helpers/businessform_helper.php b/api/application/helpers/businessform_helper.php index 8bfff812..b1f91b2c 100644 --- a/api/application/helpers/businessform_helper.php +++ b/api/application/helpers/businessform_helper.php @@ -15,7 +15,7 @@ public static function getPartnerDetails($values){ return array( 'name' => array_key_exists('partner_other_name',$tag) ? $tag['partner_other_name'] : $tag['partner_name_master'], '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, 'total_experience' => $tag['total_business_experiance'], '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 public static function getFamilyMemberDetails($values){ - //print_r($values);die(); + //print_r($values);die(); $getFamilyMembers=array(); - foreach($values as $parRow){ - 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']); - - array_push($getFamilyMembers,$temp_family); - } - + foreach($values as $parRow){ + 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']); + + array_push($getFamilyMembers,$temp_family); + } + // $getFamilyMembers = array_map(function($tag) { // if($tag['family_member_name'] != "" || $tag['family_member_name'] != null) - // { - // return array( - // 'name' => $tag['family_member_salutation_master'].' '.$tag['family_member_name'], - // 'individual_relation' => $tag['other_family_relationship_id_master'] .' of ', - // 'relation_to' => $tag['relation_to_id_master'], - // 'relation_to_company' => substr($tag['relationship_with_company_id_master'],0,-2), - // 'started_business' => $tag['started_business'], + // { + // return array( + // 'name' => $tag['family_member_salutation_master'].' '.$tag['family_member_name'], + // 'individual_relation' => $tag['other_family_relationship_id_master'] .' of ', + // 'relation_to' => $tag['relation_to_id_master'], + // 'relation_to_company' => substr($tag['relationship_with_company_id_master'],0,-2), + // 'started_business' => $tag['started_business'], - // ); - // } + // ); + // } // }, $values); } 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 .=' '.$childRow['approx_sale']; - $mergeStatesCities .='% sales done in '; + $mergeStatesCities .='% of export sales done in '; $mergeStatesCities .=$childRow['country_name']; //$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 ? "." : ""); } $getEachProducts['sales_done']=$mergeStatesCities; + $getEachProducts['area_of_sale']='Domestics & Exports'; // max sales done $mergeMaxStatesCities=''; foreach($busManuRow['max_sale_state_name'] as $chilMKey=>$childMRow){ @@ -192,6 +193,7 @@ public static function getActivityDetails($values,$type){ } $mergeMaxStatesCities.='.'; $getEachProducts['max_sales_done']=$mergeMaxStatesCities; + $getEachProducts['area_of_sale']='Domestics & Exports'; } else{ $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 ' : ","); $mergeBothStates .=' '.$childRow['approx_sale']; - $mergeBothStates .='% sales done in '; + $mergeBothStates .='% of export sales done in '; $mergeBothStates .=$childRow['country_name']; } $mergeBothStates.='.'; @@ -221,7 +223,7 @@ public static function getActivityDetails($values,$type){ foreach($values as $busManuRowkey=>$busManuRow){ $getEachProducts=array(); $getEachProducts['products']=$busManuRow['main_products']; - $getEachProducts['description']=$busManuRow['description']; + $getEachProducts['description']=$busManuRow['description']; $getEachProducts['area_of_sale']=$busManuRow['area_of_sale']; // check area of sales @@ -315,6 +317,7 @@ public static function getActivityDetails($values,$type){ $mergeStatesCities .= ($chilKey==count($busManuRow['india_where_sale_done'])-1 ? "." : ""); } $getEachProducts['sales_done']=$mergeStatesCities; + $getEachProducts['area_of_sale']= 'Domestics & Exports'; // max sales done $mergeMaxStatesCities=''; foreach($busManuRow['max_sale_state_name'] as $chilMKey=>$childMRow){ @@ -381,7 +384,7 @@ public static function getActivityDetails($values,$type){ foreach($values as $busManuRowkey=>$busManuRow){ $getEachProducts=array(); $getEachProducts['products']=$busManuRow['others_details']; - $getEachProducts['description']=$busManuRow['description']; + $getEachProducts['description']=$busManuRow['description']; array_push($getRow,$getEachProducts); } diff --git a/api/application/helpers/financialform_helper.php b/api/application/helpers/financialform_helper.php index ff11e117..dc6507a1 100644 --- a/api/application/helpers/financialform_helper.php +++ b/api/application/helpers/financialform_helper.php @@ -16,9 +16,12 @@ public static function getOtherLoanDetails($values){ $eigth_row = 'Original Tenure (Months)'; $ninth_row = 'Elapsed Tenure (Months)'; $tenth_row = 'Balance Tenure (Months)'; - + $total_header = 0; foreach($values as $key => $tag) { + if(isset($tag['loan_type_master']) && $tag['loan_type_master'] != '') + { + $total_header++; $setFrequencyType=''; switch($tag['frequency']) { case 1: @@ -47,32 +50,32 @@ public static function getOtherLoanDetails($values){ } $loanTaken=$tag['loan_taken_by'][0]; - - - - $first_row .= $tag['loan_type']==1 ? ''.$tag['others_loan_type'].'' : ''.$tag['loan_type_master'] .''; - - $second_row .= ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['loan_amount']).''; - - //$third_row = ''.MYUTIL::customIndianNumberFormat($tag['loan_amount']).''; - - $fourth_row .= $tag['lender']==1 ? ''.$tag['others_lender'].'' : ''.$tag['lender_master'].''; - - $fifth_row .= $loanTaken['id']==0 ? ''.$tag['others_loan_taken'].'' : ''.$loanTaken['name'].''; - - $sixth_row .= ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['emi']).''; - - $seventh_row .= $tag['frequency']==1 ? ''.$tag['other_frequency'].'' : ''.$tag['frequency_master'].''; - - $eigth_row .= ''.$tag['original_tenure'].''; - - $ninth_row .= ''.$tag['elapsed_tenure'].''; - - $tenth_row .= ''.($tag['original_tenure'] - $tag['elapsed_tenure']).''; - + + + + $first_row .= $tag['loan_type']==1 ? ''.$tag['others_loan_type'].'' : ''.$tag['loan_type_master'] .''; + + $second_row .= ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['loan_amount']).''; + + //$third_row = ''.MYUTIL::customIndianNumberFormat($tag['loan_amount']).''; + + $fourth_row .= $tag['lender']==1 ? ''.$tag['others_lender'].'' : ''.$tag['lender_master'].''; + + $fifth_row .= $loanTaken['id']==0 ? ''.$tag['others_loan_taken'].'' : ''.$loanTaken['name'].''; + + $sixth_row .= ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['emi']).''; + + $seventh_row .= $tag['frequency']==1 ? ''.$tag['other_frequency'].'' : ''.$tag['frequency_master'].''; + + $eigth_row .= ''.$tag['original_tenure'].''; + + $ninth_row .= ''.$tag['elapsed_tenure'].''; + + $tenth_row .= ''.($tag['original_tenure'] - $tag['elapsed_tenure']).''; + } } return array( - 'first_row' => $first_row.'','second_row' => $second_row.'','fourth_row' => $fourth_row.'','fifth_row' => $fifth_row.'','sixth_row' => $sixth_row.'','seventh_row' => $seventh_row.'','eigth_row' => $eigth_row.'', 'ninth_row' => $ninth_row.'', 'tenth_row' => $tenth_row.'' + 'first_row' => $first_row.'','second_row' => $second_row.'','fourth_row' => $fourth_row.'','fifth_row' => $fifth_row.'','sixth_row' => $sixth_row.'','seventh_row' => $seventh_row.'','eigth_row' => $eigth_row.'', 'ninth_row' => $ninth_row.'', 'tenth_row' => $tenth_row.'','total_header' => $total_header ); //return $values; @@ -82,12 +85,12 @@ public static function getOtherLoanDetails($values){ public static function getBusinessFinancialDetails($values){ $values = array_map(function($tag) { - return array( + return array( 'financial_year' => $tag['financial_year'], 'financial_sales_revenue' => $tag['financial_annual_sale'], '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_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_loss' => $tag['finanical_profit_or_loss']!=1 ? $tag['financial_margin_of_loss'] : '', 'profit_variation' => $tag['financial_variation'], @@ -106,28 +109,29 @@ public static function getBusinessCustomerFinancialDetails($values) { 'estimate_sales_from' => $tag['estimate_sales_from'], 'estimate_sales_to' => $tag['estimate_sales_to'], 'estimate_net_margin_availablity' => $tag['estimate_net_margin_availablity'], - + //'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_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_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_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_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_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_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_to']:'', - + + + //'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_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_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '( '.$tag['estimate_profit_range_from'].', '.$tag['estimate_profit_range_to'].')', + //'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'].')', ); } 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_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_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_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'], + '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_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'], + + //'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_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'].')', @@ -157,7 +161,7 @@ public static function getBusinessCustomerFinancialDetails($values) { return $values; } -// get customer header +// not in use public static function getBusinessCustomerHeader($values){ if(count($values)>0 && $values[0]['estimate_profit_or_loss']==1){ return array("Sales","Net Profit","Net Margin %"); @@ -169,19 +173,19 @@ public static function getBusinessCustomerHeader($values){ return array(); } } - +//not in use public static function getAvailableFacilities($arr) { - echo "@@@@@@@@@@@@@@"; - print_r($arr); - die(); - $word_array = array('1' => 'Others', '2' => 'Bank Guarantee', '3' => 'Cash Credit Limit','4' => 'Factoring', '5' => 'Forfaiting', '6' => 'Letter of Credit'); - if(is_array($array)) - { - //$array = array_map(function($arr){ },$array); - } - return $array; + echo "@@@@@@@@@@@@@@"; + print_r($arr); + die(); + $word_array = array('1' => 'Others', '2' => 'Bank Guarantee', '3' => 'Cash Credit Limit','4' => 'Factoring', '5' => 'Forfaiting', '6' => 'Letter of Credit'); + if(is_array($array)) + { + //$array = array_map(function($arr){ },$array); + } + return $array; } - + } ?> \ No newline at end of file diff --git a/api/application/helpers/getprocessedjson_helper.php b/api/application/helpers/getprocessedjson_helper.php index d3414810..79cb7ed3 100644 --- a/api/application/helpers/getprocessedjson_helper.php +++ b/api/application/helpers/getprocessedjson_helper.php @@ -812,7 +812,26 @@ class GETPROCESSEDJSON //print_r($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)) { diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 01689436..ac3f11dc 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -217,7 +217,7 @@ class PD_Model extends SPARQ_Model { /* *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(); $document_lists = array(); @@ -232,14 +232,18 @@ class PD_Model extends SPARQ_Model { //Get PD Documenttitle and name from DB $where_condition_array = array('fk_pd_id' => $pdid); - if($company_id != null){ + if($form_id != null){ $where_condition_array['fk_form_id'] = $form_id; } if($company_id != null){ $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(); $document_lists = $this->selectRecords(PDDOCUMENTS,$where_condition_array); //print_r($this->db->last_query());die(); @@ -745,7 +749,7 @@ class PD_Model extends SPARQ_Model { */ 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->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'); @@ -1603,7 +1607,7 @@ class PD_Model extends SPARQ_Model { //print_r($purchase_billwise_parent);die(); //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'; $where_condition_array = array('fk_pd_id'=>$pdid,'PDBUSINESSEXPENSES.isactive'=>1); $where_condition_array['company_id'] = $company_id ? $company_id : null; diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 9722a727..3b642174 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -508,7 +508,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } } //$temp_person_met['name'] = - //print_r($general_form['persons_with_relationships']);die(); + //print_r($general_form['persons_with_relationships']); $personal_relationship_data = null; foreach($general_form['persons_with_relationships'] as $persons_with_relationship) { @@ -562,16 +562,16 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { echo '

'.$person['name'].'

'; - echo '

'.$person['relations'].'

'; + echo '

'.substr_replace($person['relations'],'.',strrpos($person['relations'],','),1).'

'; echo '

'; if($person['photo']) { - echo ''; + echo ''; } echo '          '; if($person['id_proof']) { - echo ''; + echo ''; } echo '

'; echo count($person_met_data) != ($pk+1)? '
':''; @@ -582,6 +582,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> Person(s) Met: '; // 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" ; //echo $applicant_name.'**************************'; - echo ''.$individual['applicant_title_name_master'].' '.$applicant_name.''.$individual['age'].''.$education_qualification.''; + + $title = isset($individual['applicant_title_name_master']) && $individual['applicant_title_name_master'] != "" ? $individual['applicant_title_name_master'] : ''; + + echo ''.$title.' '.$applicant_name.''.$individual['age'].''.$education_qualification.''; $company_relationship_data = null; //print_r($general_form['company_with_relationships']); @@ -691,7 +695,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
'; - //die(); + // ?> + + $rental_property) + { + //echo $rental_property_key; + $current_property = json_decode($rental_property['processed_json'],true); + $rental_data[] = RENTALFORM::getRentalText($current_property); + + } + // + //******************************************************************** //******************************************************************** //******************************************************************** + + ?> + + '; - echo 'The PD visit was done at '. $address_type. 'Address Form - Type of Address of the loan applicants.'; + echo 'The PD visit was done at '. $address_type. 'Address Form - Type of Address of the loan applicants. '; echo 'The '.$address_type.'Address Form - Type of Address is '.$property_owner_type.'Business Assest Form - Owner of the Property and the business has been in operation from here for the last '.$yrs_being_run.'Business Assest Form - Business running Yrs in this premise .'; echo '

The '.$address_type.'Address Form - Type of Address is located in '.$locality.'Address Form - Locality of Address and the estimated area of the '.$address_type.'Address Form - Type of Address is '.$estimated_area.'Address Form - Estimated Area .'; echo '

The PD location was '. $pd_address['pd_location_master'].'Address Form - Approach to PD location . ' . 'As Per PD Offcier, the '.$address_type .'Address Form - Type of Address is situated in '.$comment_locality_master .'Address Form - Comment on locality Locality.'; @@ -896,7 +918,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo ''.$address_form['address_form_remark'].'Address Form - Address Form Remarks ';} echo "

"; echo "
"; - //die(); + // ?> @@ -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']).')'); - //print_r($loan_table_dispaly_rows);die(); + //print_r($loan_table_dispaly_rows); ?>

@@ -979,7 +1001,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');

".$loan_form['loandetails_remarks']; ?> @@ -998,10 +1020,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
.
'; } @@ -1128,7 +1159,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } if(strtoupper($businessRow['other_documents'])=='YES' && array_key_exists('documents',$businessRow)){ 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; @@ -1139,6 +1170,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?>

BUSINESS INFORMATION:

$fetchRow){ ?> @@ -1182,7 +1214,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 0){ ?>

Other Family Members involved in business :

@@ -1220,7 +1252,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 0){ ?>

Type of Business Activity : Manufacturing

@@ -1391,7 +1423,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - @@ -1399,7 +1433,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
- + '.$fetchRow['total_per_of_export'].' % of total sales is export.
'; + } + ?> @@ -1451,6 +1490,33 @@ defined('BASEPATH') OR exit('No direct script access allowed'); + + As per person`s met,applicant using Mobile Wallets/UPI for business transactions.

'; + }//else + //{ + // echo '

As per person`s met,applicant using Mobile Wallets/UPI for business transactions.

' + //} + if(!strcasecmp($fetchRow['applicant_use_pos_machines'],'yes')) + { + echo '

The applicant using the following POS machines:

'; + echo ''; + echo ''; + foreach($fetchRow['pos_machines_details'] as $pos) + { + echo ''; + } + echo '
Name of the Financial Insitution TID Number of POS machine
'.$pos['pos_machines_financial_institution_name'].' '.$pos['tid_no_of_pos_machine'].'
'; + } + + + + ?> + + + @@ -1459,7 +1525,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');

@@ -1473,7 +1539,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');

The below documents were sighted during the visit :

@@ -1481,10 +1547,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - +
@@ -1527,12 +1596,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 0){ ?> + //print_r($businessAssetResult);die(); + if( $businessAssetResult[0]['details']['show_table'] ){ ?>

Assets used in Business

@@ -1574,10 +1646,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo '
'; } } - }?> + } + + } // ENd of if business assesst available in this current index + ?> + //?> @@ -1586,6 +1661,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ↑ /'; + + if(isset($pd_processed_forms[14][$business_count])) + { $baRow = $pd_processed_forms[14][$business_count]; $businessFinancialRow = json_decode($baRow['processed_json'],true); //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; - //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); @@ -1750,7 +1828,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); if($iterateFinance['is_customer_statement']) { 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');

Financial information is not available.

- + @@ -1831,11 +1912,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 0){ $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; } } @@ -1847,7 +1929,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> 0){ ?>

Business Banking:

@@ -1883,6 +1965,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); @@ -1896,6 +1980,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $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); $client_first_row .= ''.$main_raw_material['manufacturing_product_name'].''; @@ -1975,11 +2067,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 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) { + if($trading_product['trade_product_name'] != "" || $trading_product['trade_product_name'] != null) + { + $to_no_of_clients++; + } $client_first_row .= ''.$trading_product['trade_product_name'].''; $client_second_row .= isset($trading_product['person_title_name_master']) ? '' . $trading_product['person_title_name_master'].' ': ''; @@ -1995,7 +2091,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $client_fourth_row .= $trading_product['person_stdcode'] && $trading_product['person_landline'] ? ''. $trading_product['person_stdcode'].' '.$trading_product['person_landline'].'' : ''.'Not Provided'.''; - $client_fifth_row .= $trading_product['trade_product_payment_type_master'] ? ''. $trading_product['trade_product_payment_type_master'] .'' : 'NA'; + $client_fifth_row .= isset($trading_product['trade_product_payment_type_master']) ? ''. $trading_product['trade_product_payment_type_master'] .'' : 'NA'; $client_sixth_row .= $trading_product['trade_product_payment_mode'] ? ''. $trading_product['trade_product_payment_mode'] .'' : 'NA';; @@ -2017,10 +2113,14 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 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) { + if($service_product['service_provider_product_name'] != "" || $service_product['service_provider_product_name'] != null) + { + $to_no_of_clients++; + } $client_first_row .= ''.$service_product['service_provider_product_name'].''; $client_second_row .= isset($service_product['person_title_name_master']) ? '' . $service_product['person_title_name_master'].' ': ''; @@ -2057,7 +2157,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $client_fifth_row .= ''; $client_sixth_row .= ''; $client_seventh_row .= ''; - //echo $client_third_row;die(); + //echo $client_third_row; ?> Out of total sales done by ".$name_of_the_company .", ".$done_on_credit."% is done on credit.

"; } + echo '

'.$client_form_remarks.'

'; //CLient Photo Section $client_photo_count = $pd_images[2]; $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 ?> - + @@ -2146,14 +2248,18 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $raw){ - + + if($raw['manufacturing_raw_material_name'] != "" || $raw['manufacturing_raw_material_name'] != null) + { + $total_no_of_suppliers++; + } $temp['supplier_first_row'] = '1Item Purchased '.''.$raw['manufacturing_raw_material_name'].''; $supplier_second_row = '2Contact Person '; @@ -2210,14 +2320,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { 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']; - //if(isset($tradeRow['trading_products'])){ - - - //foreach($tradeRow['trading_products'] as $trade){ - $temp['supplier_first_row'] = '1Item Purchased '.''.$tradeRow['trade_product_name'].''; $supplier_second_row = '2Contact Person '; @@ -2240,7 +2351,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $temp['supplier_fifth_row'] = '5Payment Terms'; - $temp['supplier_fifth_row'] .= $tradeRow['trade_product_payment_type_master'] ? ''. $tradeRow['trade_product_payment_type_master'] .'' : 'NA'; + $temp['supplier_fifth_row'] .= isset($tradeRow['trade_product_payment_type_master']) ? ''. $tradeRow['trade_product_payment_type_master'] .'' : 'NA'; $temp['supplier_sixth_row'] = '6Payment Mode'; @@ -2257,10 +2368,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } } // echo "dsfnsdkfnj**********"; - // print_r($supplierResult); -//die(); -//echo $supplierResult[0]['supplier_third_row'];die(); - if(count($supplierResult)) + //print_r($supplierResult);die(); + + if($total_no_of_suppliers > 0) { ?> @@ -2349,25 +2459,30 @@ defined('BASEPATH') OR exit('No direct script access allowed'); }//End of supplier foreach ?> 0) { echo "

Have to make payment of about ". $total_payments_percent_on_credit_for_supplier ." % in advance rest on delivery.

"; } - }?> + } + echo '

'.$supplier_form_remarks.'

'; + }// End of supplier info avilable in this current index?> '; echo ''; } - //die(); + // ?> + echo '

'.$stock_form_remarks.'

'; + //else {?> - @@ -2564,7 +2680,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // echo "######################################"; // print_r($ai_core_details_processed); - // die(); + // $ai_summary_details = ($assessed_income_details[ ($business_count+1) ]['summary_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 '


'; } - //die(); + // if(isset($ai_core_details) && count($ai_core_details['sales_calculated_by_itemwise'])) { echo '

Sales Itemwise :

'; @@ -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'])) { echo '

Business Expenses Details :

'; @@ -2813,7 +2929,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo ''; } echo "
"; - //die(); + // ?> @@ -2830,19 +2946,19 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $otherAssetResult=array(); foreach($pd_processed_forms[4] as $rowKey=> $oaRow) { $otherAssetRow = json_decode($oaRow['processed_json'],true); - //print_r($otherAssetRow);die(); + //print_r($otherAssetRow); //echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@"; if(count($otherAssetRow['assets_details'])>0){ $otherAssetResult=ASSETSFORM::getOthersAssetsDetails($otherAssetRow['assets_details']); - //print_r($otherAssetResult);die(); + //print_r($otherAssetResult); } } ?>

Personal Assets

0){ ?> @@ -2934,7 +3050,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $iRow) { @@ -2986,7 +3102,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $familyResult=array(); foreach($pd_processed_forms[6] as $rowKey=> $fRow) { $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){ $familyResult=OTHERFAMILYFORM::getFamilyDetails($familyRow['family_details']); } @@ -2994,7 +3110,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> 0){ - //print_r($familyResult);die(); + //print_r($familyResult); ?>

Family Information:

@@ -3048,11 +3164,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $elRow) { $otherLoanRow = json_decode($elRow['processed_json'],true); - //print_r($otherLoanRow);die(); + //print_r($otherLoanRow); $total_no_of_data = 0; if(strtoupper($otherLoanRow['existing_loan'])=='YES' && count($otherLoanRow['loan_details'])>0){ $total_no_of_data = count($otherLoanRow['loan_details']); @@ -3061,7 +3177,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } ?> 0){ - //print_r($existLoanResult);die(); + //print_r($existLoanResult); ?> @@ -3072,7 +3188,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - Loan $header";}?> + Loan $header";}?> @@ -3093,7 +3209,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
Particulars

As per loan applicant he doesn’t have any existing obligations

@@ -3112,9 +3228,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $pd_offiecer_status_about_neighbor = ""; foreach($pd_processed_forms[19] as $rowKey=> $nrcRow) { $neighbourRefRow = json_decode($nrcRow['processed_json'],true); - //print_r($applicants_details);die(); + //print_r($applicants_details); //print_r($neighbourRefRow); - //die(); + // if(strcasecmp($neighbourRefRow['neighbourhood_status'],'could not verify')){ $pd_offiecer_status_about_neighbor = $neighbourRefRow['neighbourhood_status']; if(count($neighbourRefRow['neighbourhood_list'])>0){ @@ -3131,7 +3247,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');

Neighbourhood / Reference Check

0){ - //print_r($existNeighRefCheck);die(); + //print_r($existNeighRefCheck); ?> $nfValue) { @@ -3164,7 +3280,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');

PD OFFICERS REMARKS ON CUSTOMER BEHAVIOUR, BUSINESS LOCATION & OVERALL PD STATUS

@@ -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';} echo ''.$fo_diplay.'.

';?>

The following key points were considered while arriving at the aforementioned status.

"; foreach($final_remark_data['recommendation_positive'] as $pos){ echo "
  • ".$pos['reason_for_positive']."
  • ";} }else if($negative){ echo "