diff --git a/api/application/config/constants.php b/api/application/config/constants.php index f09b95ce..22791701 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -99,7 +99,7 @@ defined('DETAILED_SCORE_CARD_IMAGE_LOCATION') OR define('DETAILED_SCORE_CARD_IMA defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','lender'); defined('PHANTOMJSSCRIPT_LOCATION') OR define('PHANTOMJSSCRIPT_LOCATION','phantomjs_dev'); defined('LOGTOBOT') OR define('LOGTOBOT',0); -defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0'); +defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg'); } else if(ENVIRONMENT == 'testing') { @@ -108,7 +108,7 @@ else if(ENVIRONMENT == 'testing') defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','len'); defined('PHANTOMJSSCRIPT_LOCATION') OR define('PHANTOMJSSCRIPT_LOCATION','phantomjs_test'); defined('LOGTOBOT') OR define('LOGTOBOT',0); - defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0'); + defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg'); } else if(ENVIRONMENT == 'prod') { @@ -117,7 +117,7 @@ else if(ENVIRONMENT == 'prod') defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','lender'); defined('PHANTOMJSSCRIPT_LOCATION') OR define('PHANTOMJSSCRIPT_LOCATION','phantomjs_test'); defined('LOGTOBOT') OR define('LOGTOBOT',0); - defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0'); + defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg'); } /*********************END of AWS resources Constants*************************************************/ diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 46d9a66c..a27f955c 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -2339,6 +2339,9 @@ class PD_Controller extends REST_Controller { case 22: $processed_json = GETPROCESSEDJSON::convertBusinessAssetsForm($records,$formid); break; + case 23: + $processed_json = $records; + break; //default: //echo "Something Wrong! Form ID did not match, Contact System Administrator"; @@ -5031,7 +5034,7 @@ class PD_Controller extends REST_Controller { $records = $this->post('records'); $pdid = $records['pd_id']; - + ini_set('max_execution_time', 300); //PDALERTS::pdnotification($pdid);die(); $is_regenerate = 0; if(isset($records['regenerate'])) @@ -5040,7 +5043,6 @@ class PD_Controller extends REST_Controller { } //print_r($records); $data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid); - $data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid); //print_r($data['applicants_details']);die(); $data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid); @@ -5102,17 +5104,17 @@ class PD_Controller extends REST_Controller { $data['pd_images'][$i] = $this->PD_Model->getSignedPDDocsURL($pdid,$i); - // $this->getPDImages_post($fields2,array('fk_pd_id'=>$pdid,'fk_form_id' => $i),PDDOCUMENTS,array(),'','company_id','ASC'); + // $this->getPDImages_post``($fields2,array('fk_pd_id'=>$pdid,'fk_form_id' => $i),PDDOCUMENTS,array(),'','company_id','ASC'); // print_r($this->db->last_query()); } - // print_r($data['pd_processed_forms']); + //print_r($data['pd_processed_forms']);die(); //print_r($data['pd_images']);die(); //print_r(json_decode($data['pd_processed_forms'][14][0]['processed_json'],true)); //die(); //echo "*******************************************"; $t = $this->load->view('report_templates/JSONTOREPORT',$data,true); //$t = $this->load->view('temp_html.html',null,true); - //echo $t;die(); + echo $t;die(); $total_replaces = substr_count($t,''); //echo $total_replaces; @@ -6320,22 +6322,22 @@ class PD_Controller extends REST_Controller { $address_form = (json_decode($form_data[5][0]['processed_json'],true)); //print_r($address_form);die(); - if($address_form['is_pd_done_on_initiated_address'] == 1) + if(isset($address_form['is_pd_done_on_initiated_address']) && $address_form['is_pd_done_on_initiated_address'] != 1) { - // 4 - QNO(1.2) - Comment on locality - $score_questions['general']['comment_locality'] = $address_form['addresses'][0]['comment_locality_master']; - // 5 - QNO(1.3) - pd location approach - $score_questions['general']['pd_location_approach'] = $address_form['addresses'][0]['pd_location_master']; + $score_questions['general']['comment_locality'] = $address_form['alternative_addresses'][0]['comment_locality_master']; + // 5 - QNO(1.3) - pd location approach + $score_questions['general']['pd_location_approach'] = $address_form['alternative_addresses'][0]['pd_location_master']; + } else //get it from alternative address { // 4 - QNO(1.2) - Comment on locality - $score_questions['general']['comment_locality'] = $address_form['alternative_addresses'][0]['comment_locality_master']; - // 5 - QNO(1.3) - pd location approach - $score_questions['general']['pd_location_approach'] = $address_form['alternative_addresses'][0]['pd_location_master']; + $score_questions['general']['comment_locality'] = $address_form['addresses'][0]['comment_locality_master']; + // 5 - QNO(1.3) - pd location approach + $score_questions['general']['pd_location_approach'] = $address_form['addresses'][0]['pd_location_master']; } @@ -6817,6 +6819,7 @@ class PD_Controller extends REST_Controller { public function pdFormsCompletenessCheck_post() { $pdid = $this->post('pd_id'); + $client = $this->post('client') ? $this->post('client') : 'WEB'; $business_captions = array("no_of_years_business_run" => "Business Vintage >>", "location_suited_for_busienss" => "Business Location suitability >>", "business_seasonality" => "Seasonality >>", "employees_total" => "Employee Strength >>", "cerificates" => "Business Certifications Sighted >>","owned_property" => "Business Premise Ownership >>", "owned_vechile" => "Vehicle Ownership >>", "business_activity_has_seen" => "Business Activity Observed >>", "minimum_supplier_info" => "Supplier Information Provided >>", "minimum_client_info" => "Client Information Provided >>","stock_raw_material_enough" => "Raw Materials Stock Sufficiency >>", "stock_finished_goods_enough" => "Finished/Traded Stock Sufficiency >>", "vintage_of_business_account" => "Main Business Banking Account Vintage >>"); @@ -6912,7 +6915,14 @@ class PD_Controller extends REST_Controller { array_push($selected_type_of_activity,$value['type_of_activity_id']); } - // 13 - QNO(2.4) - all business certificate + if($business_form['employees_temporary'] == "" || $business_form['employees_permanent'] == "" || $business_form['employees_appx_salary'] == "") + { + $incomplete_details[] = 'Business Section - Company Employees Details Not Filled'; + } + + + if( $client != 'WEB')// if API came from web then ignore this check + { $certificate_count = 0; $name_board_image_count = 0; if(count($pd_images[13])) @@ -6962,8 +6972,8 @@ class PD_Controller extends REST_Controller { - //If Business Type of activity is manufacturing or whole sale trading then check these two certifications, - if(in_array('2',$selected_type_of_activity) || in_array('4',$selected_type_of_activity)) + //If Business Type of activity is manufacturing then check these two certifications, + if(in_array('2',$selected_type_of_activity))// || in_array('4',$selected_type_of_activity)) { if(isset($business_form['factory_cert'])) { @@ -6974,8 +6984,8 @@ class PD_Controller extends REST_Controller { } //else { $certificate_count++; } } - //If Business Type of activity is manufacturing then check - if(in_array('2',$selected_type_of_activity)) + //If Business Type of activity is manufacturing,wholesale,retail then check + if(in_array('2',$selected_type_of_activity) || in_array('4',$selected_type_of_activity) || in_array('3',$selected_type_of_activity)) { if(isset($business_form['export_import_cert'])) { @@ -7002,42 +7012,52 @@ class PD_Controller extends REST_Controller { if($certificate_count){ $incomplete_details[] = 'Business Section - Images for Document Sighted Not Sufficient'; } - + + } #####End of Business Form Questions######## ########## Finance Form Questions################ - $finance_form = isset($form_data[14][0]['processed_json'])?(json_decode($form_data[14][0]['processed_json'],true)):array(); - $finance_form_photo_count = isset($pd_images[14]) ? count($pd_images[14]) : 0; - //print_r($finance_form);die(); - //print_r($pd_images[14]);die(); - if(!strcasecmp($finance_form['is_financial_statements'],'yes') && !($finance_form_photo_count) ) + if( $client != 'WEB')// if API came from web then ignore this check { - $incomplete_details[] = 'Financial Section - Financial Images Not captured'; + $finance_form = isset($form_data[14][0]['processed_json'])?(json_decode($form_data[14][0]['processed_json'],true)):array(); + $finance_form_photo_count = isset($pd_images[14]) ? count($pd_images[14]) : 0; + //print_r($finance_form);die(); + //print_r($pd_images[14]);die(); + if(!strcasecmp($finance_form['is_financial_statements'],'yes') && !($finance_form_photo_count) ) + { + $incomplete_details[] = 'Financial Section - Financial Images Not captured'; + } } #####End of Finance Form Questions######## #####Business Assets Form Questions######## - $business_assest_form = (json_decode($form_data[22][0]['processed_json'],true)); - $businees_assest_images_count = isset($pd_images[22]) ? count($pd_images[22]) : 0; - //print_r($business_assest_form);die(); - if(array_key_exists('business_assets_details',$business_assest_form)) + if( $client != 'WEB')// if API came from web then ignore this check { - - foreach($business_assest_form['business_assets_details'] as $value) + $business_assest_form = (json_decode($form_data[22][0]['processed_json'],true)); + $businees_assest_images_count = isset($pd_images[22]) ? count($pd_images[22]) : 0; + //print_r($business_assest_form);die(); + if(array_key_exists('business_assets_details',$business_assest_form)) { - if(isset($value['business_assets_mode']) && $value['business_assets_mode'] == 4 && !($businees_assest_images_count)) - { - $incomplete_details[] = 'Business Assets Section - Machinery Image'; - } + foreach($business_assest_form['business_assets_details'] as $value) + { + if(isset($value['business_assets_mode']) && $value['business_assets_mode'] == 4 && !($businees_assest_images_count)) + { + $incomplete_details[] = 'Business Assets Section - Machinery Image'; + } + + } } } #####End of Business Assets Form Questions######## + + if($client != 'WEB') + { #####supplier Form Questions######## $supplier_form = isset($form_data[1][0]['processed_json'])?(json_decode($form_data[1][0]['processed_json'],true)):array(); @@ -7080,11 +7100,11 @@ class PD_Controller extends REST_Controller { } - if($cureent_supplier_images_count < 2){ $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Image Not Sufficient';} + if($cureent_supplier_images_count < 2){ $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Image Not Sufficient.';} } else { - $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Image Not Sufficient'; + $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Images Not Found'; } } else @@ -7130,7 +7150,7 @@ class PD_Controller extends REST_Controller { } else { - $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Image Not Sufficient'; + $incomplete_details[] = 'Supplier Section - '.$supplier_name.' - Images Not Found'; } } else @@ -7193,7 +7213,7 @@ class PD_Controller extends REST_Controller { } else { - $incomplete_details[] = 'Client Section - '.$client_name .'- Image Not Sufficient'; + $incomplete_details[] = 'Client Section - '.$client_name .'- Images Not Found'; } } @@ -7235,7 +7255,7 @@ class PD_Controller extends REST_Controller { } else { - $incomplete_details[] = 'Client Section - '.$client_name .'- Image Not Sufficient'; + $incomplete_details[] = 'Client Section - '.$client_name .'- Images Not Found'; } } else @@ -7275,7 +7295,7 @@ class PD_Controller extends REST_Controller { } else { - $incomplete_details[] ='Client Section - ' .$client_name .'- Image Not Sufficient'; + $incomplete_details[] ='Client Section - ' .$client_name .'- Images Not Found'; } } @@ -7357,12 +7377,13 @@ class PD_Controller extends REST_Controller { if( $total_stock_observed != 0 && !(count($pd_images[11])))//&& !count($pd_images[11][0])) ) { - $incomplete_details[] = 'Stock Section - Images not sufficient'; + $incomplete_details[] = 'Stock Section - Images not sufficient. Available Images - '.(count($pd_images[11]) ? count($pd_images[11]) : 0); } //} } } + } $data['dataStatus'] = true; diff --git a/api/application/docs/sample.pdf b/api/application/docs/sample.pdf index c025545b..86c7a89e 100644 Binary files a/api/application/docs/sample.pdf and b/api/application/docs/sample.pdf differ diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 14ea4efd..751b5419 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -100,7 +100,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); /* #########End of Mini Score Card Div Styles######### */ #rcorners_green { - background: #ff9900; + background: #33cc33; padding: 3px; width: 75px; height: 5px; @@ -121,7 +121,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } #rcorners_amber{ - background: #33cc33; + background: #ff9900; padding: 3px; width: 75px; height: 5px; @@ -797,9 +797,16 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $answer = null; $per = $business_score['attributed_score'] > 0 && $business_score['max_score'] > 0 ? ( ($business_score['attributed_score'] / $business_score['max_score']) * 100) : 0; - $class = ( $per >= 80 ? 'rcorners_green' : $per >= 70 && $per < 80 ? 'rcorners_light_green' : $per >= 60 && $per < 70 ? 'rcorners_amber' : 'rcorners_red'); + $class = ( $per >= 80 ? 'rcorners_green' : ($per >= 70 && $per < 80 ? 'rcorners_light_green' : ($per >= 60 && $per < 70 ? 'rcorners_amber' : 'rcorners_red'))); - + // if($bsk == 'business_seasonality') + // { + // echo "BUSINESS"; + // echo $per; + // echo $class; + // echo $per >= 80 ? 'rcorners_green' : 'SOME'; + // die(); + // } if($bsk == 'location_suited_for_busienss') { $answer = $address_type_remarks_caption[ $business_score['answer'] ]; @@ -980,8 +987,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); else{ echo '
  • No business activity was seen during the PD visit.Business Assest Form - Busienss activity seen during PD visit
  • '; } - if(isset($business_assets_details['business_assets_form_remark']) && $business_assets_details['business_assets_form_remark'] != ""){ - echo '
  • '.$business_assets_details['business_assets_form_remark'] .'Business Assest Form - Busienss Assest Form Remarks
  • ';} + if(isset($business_assets_details['business_pd_visited_remark']) && $business_assets_details['business_pd_visited_remark'] != ""){ + echo '
  • '.$business_assets_details['business_pd_visited_remark'] .'Business Assest Form - Busienss Assest Form Remarks
  • ';} echo ""; if($address_form['address_form_remark']) @@ -1004,10 +1011,16 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $loan_amount = MYUTIL::customIndianNumberFormat($loan_form['loan_amount']); echo 'During the PD visit, '.$main_applicant_name.', provided the following information about loan applied for:'; + + $is_current_product_bl = $pd_master_details[0]['product_abbr'] == "BL" ? true: false; $loan_table_dispaly_rows = array(); $loan_table_dispaly_rows[] = array('particulars' => 'Total Loan Amount applied for','details' => ""." ".$loan_amount.' ('.MYUTIL::numtowords($loan_form['loan_amount']).')'); - + if($is_current_product_bl) + { + $to_dispaly = !strcasecmp($loan_form['is_there_total_fund'], 'yes disclose') ? ('Disclosed '.""." ".MYUTIL::customIndianNumberFormat($loan_form['fund_amt']).' ('.MYUTIL::numtowords($loan_form['fund_amt']).')'):'Not Disclosed'; + $loan_table_dispaly_rows[] = array('particulars' => 'Total Fund Requirement','details' => $to_dispaly); + } $loan_table_dispaly_rows[] = array('particulars' => 'Loan Tenure expected','details' => $loan_form['loan_tenure'].' Months'); $end_use = ''; @@ -1033,21 +1046,26 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } else{ - - $loan_table_dispaly_rows[] = array('particulars' => 'Amount of Own Contribution','details' =>""." ".MYUTIL::customIndianNumberFormat($loan_form['own_contribution']).' ('.MYUTIL::numtowords($loan_form['own_contribution']).')' ); - $source_of_own_contribution = null; - - foreach($loan_form['source_of_own_contribution_master'] as $own_source) - { - if(strpos(strval($own_source), 'Others') === false) { $source_of_own_contribution.= $own_source.' and ';}else{ $source_of_own_contribution.=$loan_form['other_source'].' and '; } - } - $source_of_own_contribution = substr_replace($source_of_own_contribution, '', strrpos($source_of_own_contribution, ' and '),strlen($source_of_own_contribution)); - - $loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution); + + if(!$is_current_product_bl) + { + $loan_table_dispaly_rows[] = array('particulars' => 'Amount of Own Contribution','details' =>""." ".MYUTIL::customIndianNumberFormat($loan_form['own_contribution']).' ('.MYUTIL::numtowords($loan_form['own_contribution']).')' ); + $source_of_own_contribution = null; + + foreach($loan_form['source_of_own_contribution_master'] as $own_source) + { + if(strpos(strval($own_source), 'Others') === false) { $source_of_own_contribution.= $own_source.' and ';}else{ $source_of_own_contribution.=$loan_form['other_source'].' and '; } + } + $source_of_own_contribution = substr_replace($source_of_own_contribution, '', strrpos($source_of_own_contribution, ' and '),strlen($source_of_own_contribution)); + + $loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution); + } } $loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')' ); + if(!$is_current_product_bl) + { $loan_table_dispaly_rows[] = array('particulars' => 'Type of Property Being Mortgaged','details' => $loan_form['property_type_master']); $owners_list = null;foreach($loan_form['owners_list_master'] as $owner){ $owners_list.=$owner.' and '; } @@ -1057,7 +1075,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $loan_table_dispaly_rows[] = array('particulars' => 'Status of Construction','details' => $loan_form['construction_status_master']); $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); ?>

    @@ -1279,7 +1297,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - + @@ -1312,7 +1330,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - + @@ -1909,7 +1927,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Financials statements not providing by Loan Applicants to PD officer.

    ";} + else{ echo "

    Financials statements not provided by Loan Applicants to PD officer.

    ";} ?> @@ -2763,8 +2781,47 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } //end of stock details available in current index ?> + + + + +

    Future Plan and Business Environment

    + + + + + + '; + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + + ?> + +
    Details Particulars
    USP of the business (How applicant’s business is different from others in the business)'.$future_plan_business_environment['usp_of_the_business'].'
    Future plan for business expansion'.$future_plan_business_environment['future_plans_for_business_expansion'].'
    Impact of GST on business'.$future_plan_business_environment['impact_of_gst_on_the_business'].'
    Key competitors in the business'.$future_plan_business_environment['key_competitors'].'
    Succession Plan for business'.$future_plan_business_environment['succession_plan'].'
    Brief of other group concerns/ Business run by the applicant'.$future_plan_business_environment['brief_of_other_group_concerns_or_businesses_run_by_the_applicants'].'
    + '; + echo '

    '. $future_plan_business_environment['remarks'] .'

    '; + } + } + + ?> + + + +