diff --git a/api/application/config/customconfig_one.php b/api/application/config/customconfig_one.php index cb4954fb..db05058f 100644 --- a/api/application/config/customconfig_one.php +++ b/api/application/config/customconfig_one.php @@ -54,7 +54,7 @@ $config['authorization_key'] = 'sparqvenba2018'; }else if(ENVIRONMENT == 'prod') { - + } diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index d7e71e86..c3652878 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -319,6 +319,12 @@ class PD_Controller extends REST_Controller { $pd_details = json_decode($this->post('pd_details'),true); + + // $pd_details['fk_lender_id'] = 16; + // $pd_details['fk_product_id'] = 7; + // $pd_details['fk_customer_segment'] = 5; + // $pd_details['pd_status'] = TRIGGERED; + $pd_addtional_requirements = array(); unset($pd_details['createdon']); $addresses = array(); @@ -366,6 +372,7 @@ class PD_Controller extends REST_Controller { } else // CHOOSE GENERIC TEMPLATE// { + if($pd_details['fk_customer_segment'] == 1 || $pd_details['fk_customer_segment'] == 2) { //SAL - (CASH/CHQ) @@ -388,7 +395,8 @@ class PD_Controller extends REST_Controller { } } } - die(); + + /***********************PD ALLOCATION TYPE PROCESS **********/ // $pd_details['pd_status'] = TRIGGERED; diff --git a/api/application/helpers/assetsform_helper.php b/api/application/helpers/assetsform_helper.php index c31e13ea..a56cdb4c 100644 --- a/api/application/helpers/assetsform_helper.php +++ b/api/application/helpers/assetsform_helper.php @@ -169,26 +169,26 @@ public static function getOthersAssetsDetails($values){ $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].''; - $sec_row .= ''.($fetchVal['business_details'][0]['equipment_manufacturing_description']).''; - $third_row .= ''. $ownership_type .''; + $sec_row .= ''.($fetchVal['business_details'][0]['equipment_manufacturing_description']).' purchased at '.$fetchVal['business_purchase_year'] .''; + $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; - $eighth_row .= ''.($fetchVal['business_emi'] != "" ? $fetchVal['business_emi'] : 'NA').''; + $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } // this is for vehicle else if($fetchVal['business_assets_mode']==3){ $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].''; - $sec_row .= ''.($fetchVal['business_details'][0]['manufacturer_model_vehicle']).''; - $third_row .= ''. $ownership_type .''; + $sec_row .= ''.($fetchVal['business_details'][0]['manufacturer_model_vehicle']).' purchased at '.$fetchVal['business_purchase_year'].''; + $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; - $eighth_row .= ''.($fetchVal['business_emi'] != "" ? $fetchVal['business_emi'] : 'NA').''; + $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } // this property @@ -198,24 +198,24 @@ public static function getOthersAssetsDetails($values){ $header_row .= 'Asset '.($bsk+1).''; $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 .''; + $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; - $eighth_row .= ''.($fetchVal['business_emi'] != "" ? $fetchVal['business_emi'] : 'NA').''; + $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } //this is for other else if($fetchVal['business_assets_mode']==1){ $header_row .= 'Asset '.($bsk+1).''; $first_row .= ''.$fetchVal['business_assets_mode_master'].''; $sec_row .= ''.$fetchVal['business_details'][0]['any_other_assets'].''; - $third_row .= ''. $ownership_type .''; + $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; - $eighth_row .= ''.($fetchVal['business_emi'] != "" ? strtoupper($fetchVal['business_emi']) : 'NA').''; + $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } } diff --git a/api/application/helpers/otherfamilyform_helper.php b/api/application/helpers/otherfamilyform_helper.php index 1ecd789d..5f056c02 100644 --- a/api/application/helpers/otherfamilyform_helper.php +++ b/api/application/helpers/otherfamilyform_helper.php @@ -5,9 +5,10 @@ class Otherfamilyform public static function getFamilyDetails($values){ $mergeResult=array(); + $male_gender_array = array('1','2','4','5','11','12','14','16','17','19','21','24'); + // $gender = 'DEFAULT'; $rupee_symbol = ""; foreach($values as $fetchVal){ - //print_r($fetchVal);die(); $storeValue=array(); $storeValue['selected_person_title']= isset($fetchVal['selected_person_title_master']) ? $fetchVal['selected_person_title_master'] : ''; @@ -19,20 +20,25 @@ public static function getFamilyDetails($values){ $storeValue['residence_ownership']=($fetchVal['residence_ownership'] == 1) ? $fetchVal['ownershipOther'] :(($fetchVal['residence_ownership'] == 3) ? $fetchVal['residence_ownership_master'] : $fetchVal['residence_ownership_master']); $storeValue['rent'] = $fetchVal['rent']; $storeValue['no_family_members']= count($fetchVal['family_members_details']) > 0 ? count($fetchVal['family_members_details']) : '0'; - $storeValue['family_members_details'] = array_map(function($tag) { + $storeValue['family_members_details'] = array_map(function($tag) use ($male_gender_array){ + + $gender = array_search($tag['family_member_relationship'],$male_gender_array); + $gender = $gender ? 'He' :'She'; $getFamilyEarning=''; if($tag['family_member_earning_status']==1){ $getFamilyEarning= 'Earning '; $getFamilyOccupation = $tag['earning_segment']==1 ? $tag['earning_if_others_segment'].' Income of '.$tag['earning_gross_income_per_month'].' per month. ':' Income of '.''.' '.MYUTIL::customIndianNumberFormat($tag['earning_gross_income_per_month']).' per month '; $getFamilyOccupation .= $tag['earning_name_of_the_employer_or_business'] ? ' received from '.$tag['earning_name_of_the_employer_or_business'].'. ' : ''; - $getFamilyOccupation .= 'He has been working for '.$tag['earning_number_of_years_in_employment_or_business'].' years.'; + $getFamilyOccupation .= $gender.' has been working for '.$tag['earning_number_of_years_in_employment_or_business'].' years.'; // ? .' years earning Rs.'. : $tag['earning_segment_master'].' with '.$tag['earning_name_of_the_employer_or_business'].' since '.$tag['earning_number_of_years_in_employment_or_business'].' years earning Rs.'.$tag['earning_gross_income_per_month'].' per month '; } else if($tag['family_member_earning_status']==2){ $getFamilyEarning = 'Non-Earning'; $getFamilyOccupation = $tag['non_earning_occupation'] != 1 ? $tag['non_earning_occupation_master'] : $tag['non_earning_if_others']; + $getFamilyOccupation .= $tag['non_earning_if_schoolorcollege'] != "" ? ' at '.$tag['non_earning_if_schoolorcollege'] : ($tag['non_earning_if_retired_from'] != "" ? ' from '.$tag['non_earning_if_retired_from']: ''); + } return array( 'name' => $tag['family_member_name'], diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 3b642174..fe849cc9 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -954,7 +954,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $loan_table_dispaly_rows[] = array('particulars' => 'Top Up Amount applied for','details' => ""." ".MYUTIL::customIndianNumberFormat($loan_form['topup_amount']).' ('.MYUTIL::numtowords($loan_form['topup_amount']).')'); - $loan_table_dispaly_rows[] = array('particulars' => 'End Use of Topup','details' => ($loan_form['end_use_topup_master'])); + $loan_table_dispaly_rows[] = array('particulars' => 'End Use of Topup','details' => ( strcasecmp('others',$loan_form['end_use_topup_master'])) ? $loan_form['end_use_topup_master'] : $loan_form['other_end_use_topup'] ); $loan_table_dispaly_rows[] = array('particulars' => 'Balance Transfer from','details' => $loan_form['lender_master']); @@ -1024,7 +1024,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { $bRow = $pd_processed_forms[13][$business_count]; $businessRow = json_decode($bRow['processed_json'],true); - //print_r($businessRow); + //print_r($businessRow);die(); + $business_form_common_remarks = $businessRow['business_remarks']; $companyList = MYUTIL::findCompanyName($all_company_details,$businessRow['company_id'],2); //$companyList .=' The director details are as under :'; $bindEachResult["company_details"]=$companyList; @@ -1105,7 +1106,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $bindEachResult['company_employees'] = ''; - // this is for no of employess details + // this is for no of employees details if(isset($businessRow['employees_permanent']) && $businessRow['employees_permanent'] <= 0) { $bindEachResult['company_empployees']='As per person met there are no permanent'; } @@ -1119,12 +1120,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } else{ - $bindEachResult['company_employees'].= ' and no temporary employess with company'; + $bindEachResult['company_employees'].= ' and no temporary employees 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.'; + $bindEachResult['company_employees'].= 'There are no permanant and temporary employees with company.'; } @@ -1580,9 +1581,18 @@ defined('BASEPATH') OR exit('No direct script access allowed'); + } + + if($business_form_common_remarks != "") + { + echo '

'.$business_form_common_remarks.'

'; + } + + ?> + + '; } } + + if($business_assets_form_remark != "" ){ echo '

'.$business_assets_form_remark.'

'; } } } // ENd of if business assesst available in this current index @@ -1667,9 +1680,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $baRow = $pd_processed_forms[14][$business_count]; $businessFinancialRow = json_decode($baRow['processed_json'],true); //print_r($businessFinancialRow);die(); + $financial_remarks = $businessFinancialRow['financial_remarks']; + //echo $financial_remarks;die(); // statementdate_per_financial if(strtoupper($businessFinancialRow['is_financial_statements'])=='YES' && count($businessFinancialRow['date_per_financial'])>0){ - $bindBusinessFinancial["company_name"] =MYUTIL::findCompanyName($all_company_details,$businessFinancialRow['company_id'],1); + $bindBusinessFinancial["company_name"] = MYUTIL::findCompanyName($all_company_details,$businessFinancialRow['company_id'],1); //$bindBusinessFinancial["company_name"] .= count($businessFinancialRow['date_per_financial'])>1 ? ' provided with last '.count($businessFinancialRow['date_per_financial']).' years of financial statements and the snapshot is as below :' : ' we were provided with last '.count($businessFinancialRow['date_per_financial']).' year of financial statements and the snapshot is as below :'; $bindBusinessFinancial["years_data_provided"] = count($businessFinancialRow['date_per_financial']); $bindBusinessFinancial['is_statement']= 1; @@ -1817,7 +1832,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); As per Loan Applicant(s) met, the financials statements were not provided.

";} + else{ echo "

Financials statements not providing by Loan Applicants to PD officer.

";} ?> @@ -1898,7 +1913,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); The Loan Applicants have not availed any Working Capital Facilities from any financial institution

";} ?> - '. $financial_remarks.'

'; } + } else {?>

Financial information is not available.

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; } } @@ -1966,6 +1985,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); '.$business_banking_common_remarks.'

'; } + }// end of busienss bankDetails available in this currrent index ?> @@ -1997,20 +2018,20 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { $cRow = $pd_processed_forms[2][$business_count]; $clientRow = json_decode($cRow['processed_json'],true); - $client_form_remarks = $clientRow['supplier_info_form_remark']; + $client_form_remarks = isset($clientRow['supplier_info_form_remark']) ? $clientRow['supplier_info_form_remark'] : ''; $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); // $getmanufacturing = array(); // $getTrading=array(); // $getService=array(); //$getTotalPaymentsPercentonCredit=array(); - $client_first_row = '1Product / Service '; - $client_second_row = '2Contact Person '; - $client_third_row = '3Mobile Number '; - $client_fourth_row = '4Landline No'; - $client_fifth_row = '5Payment Terms'; - $client_sixth_row = '6Payment Mode'; - $client_seventh_row = '7No of Days Credit'; + $client_first_row = '1Product / Service '; + $client_second_row = '2Contact Person '; + $client_third_row = '3Mobile Number '; + $client_fourth_row = '4Landline No'; + $client_fifth_row = '5Payment Terms'; + $client_sixth_row = '6Payment Mode'; + $client_seventh_row = '7No of Days Credit'; // this is for manufacturing @@ -2490,7 +2511,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $is_raw_materials_sufficient_enough_remarks = null; $bindStockResult["company_name"]=MYUTIL::findCompanyName($all_company_details,$stockRow['company_id'],1); // this is for stock manufacturing details - if(count($stockRow['manufacturing_details'] && (count($stockRow['manufacturing_details'][0]['manufacturing_raw_materials']) > 0 || count($stockRow['manufacturing_details'][0]['manufacturing_finished_goods']) > 0))){ + if(isset($stockRow['manufacturing_details']) && is_array($stockRow['manufacturing_details']) && count($stockRow['manufacturing_details'] && (count($stockRow['manufacturing_details'][0]['manufacturing_raw_materials']) > 0 || count($stockRow['manufacturing_details'][0]['manufacturing_finished_goods']) > 0))){ $is_raw_materials_sufficient_enough = $stockRow['manufacturing_details'][0]['is_sufficiant_raw']; $is_raw_materials_sufficient_enough_remarks = $stockRow['manufacturing_details'][0]['rawmaterial_remarks']; @@ -2671,7 +2692,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 0){ $otherAssetResult=ASSETSFORM::getOthersAssetsDetails($otherAssetRow['assets_details']); @@ -2990,7 +3012,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');

Personal asset is not available.

- + '.$other_assest_common_remrks.'

'; } + + ?> $ibRow) { $individualBankRow = json_decode($ibRow['processed_json'],true); //print_r($individualBankRow); + $ind_banking_common_remarks = $individualBankRow['banking_form_remark']; if(count($individualBankRow['banking_details'])>0){ $getIndividualEachValues=BANKINGFORM::getIndividualBankingDetails($individualBankRow['banking_details']); $bankingResult = array_merge($bankingResult,$getIndividualEachValues); @@ -3041,7 +3068,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - + '.$ind_banking_common_remarks.'

'; } + } ?> @@ -3056,7 +3086,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); foreach($pd_processed_forms[9] as $rowKey=> $iRow) { $otherIcomeRow = json_decode($iRow['processed_json'],true); // print_r($otherIcomeRow); - // echo "@@@@@@@@@@@@@@@@@@@@@"; + $other_source_income_common_remarks = $otherIcomeRow['otherincome_remarks']; if(strtoupper($otherIcomeRow['other_income'])=='YES' && count($otherIcomeRow['income_details'])>0){ $otherIncomeResult=OTHERINCOMEFORM::getIncomeDetails($otherIcomeRow['income_details']); } @@ -3093,7 +3123,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');

As per the loan applicants met by PD officer, they do not have any other source of Income.

- + '. $other_source_income_common_remarks.'

'; } + + ?> @@ -3102,7 +3135,8 @@ 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); + //print_r($familyRow);die(); + $other_family_form_common_remarks = $familyRow['family_details_form_remark']; if(array_key_exists('family_details',$familyRow) && count($familyRow['family_details'])>0){ $familyResult=OTHERFAMILYFORM::getFamilyDetails($familyRow['family_details']); } @@ -3120,7 +3154,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $intro_text = ''.$fmValue['selected_person_title'].$fmValue['selected_person'].'Family Information - Select person for capturing family details, who is an applicant in the case, resides at '.$fmValue['residency_address'].'Family Information - Residence Address of Select person .'; $residence_text ='This is a '. $fmValue['residence_ownership'].' Family Information - Ownership of Residence residence, where the applicant has been staying for '. $fmValue['residence_No_of_years'].'Family Information - No of Yrs in current residence .'; - $residence_text .= (!strcasecmp($fmValue['residence_ownership'],'rented')) ? 'The rent paid Rs.'.$fmValue['rent'].'per month.' : ''; + $residence_text .= (!strcasecmp($fmValue['residence_ownership'],'rented')) ? ' The rent paid Rs.'.$fmValue['rent'].' per month.' : ''; echo $intro_text;echo "

";echo $residence_text; @@ -3157,7 +3191,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');

Other Family Members is not available.

- + '.$other_family_form_common_remarks.'

'; } + + ?> @@ -3169,6 +3206,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); foreach($pd_processed_forms[8] as $rowKey=> $elRow) { $otherLoanRow = json_decode($elRow['processed_json'],true); //print_r($otherLoanRow); + $existing_loan_form_common_remarks = $otherLoanRow['currentloan_remarks']; $total_no_of_data = 0; if(strtoupper($otherLoanRow['existing_loan'])=='YES' && count($otherLoanRow['loan_details'])>0){ $total_no_of_data = count($otherLoanRow['loan_details']); @@ -3212,8 +3250,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // } else {?> -

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

+

As per loan applicant he does not have any existing loan obligations

+ '.$existing_loan_form_common_remarks.'

';} + ?> @@ -3230,7 +3271,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $neighbourRefRow = json_decode($nrcRow['processed_json'],true); //print_r($applicants_details); //print_r($neighbourRefRow); - // + $neighbourhood_form_common_remarks = $neighbourRefRow['neighbour_reference_remark']; if(strcasecmp($neighbourRefRow['neighbourhood_status'],'could not verify')){ $pd_offiecer_status_about_neighbor = $neighbourRefRow['neighbourhood_status']; if(count($neighbourRefRow['neighbourhood_list'])>0){ @@ -3261,10 +3302,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
  • -
  • Neighbourhood Check Status is
  • +
  • Neighbourhood Check Status is .
  • '. $neighbourhood_form_common_remarks.'

    ';} ?> @@ -3307,7 +3350,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $other_pd_officer_command = 1; $other_command_remark = $final_remark_data['others_pd_officers_recommendation']; } - $pd_officer_final_remark = $final_remark_data['final_form_remarks']; + $pd_officer_final_remark = isset($final_remark_data['final_form_remarks']) ? $final_remark_data['final_form_remarks'] : ''; //if(is_null($other_behaviour)){ echo 'null'; }