diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 0199bf9c..3e9f2971 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -194,6 +194,7 @@ $route['getAssetsWithLoanFromBusiness'] = 'PD_Controller/getAssetsWithLoanFromBu $route['getListOfCities'] = 'PD_Controller/getListOfCities'; $route['savePDPhotos'] = 'PD_Controller/savePDPhotos'; $route['getPDAddress'] = 'PD_Controller/getPDAddress'; +$route['updatePDAddress'] = 'PD_Controller/updatePDAddress'; // $route['savePDFormDetailsJSON'] = 'PD_Controller/savePDFormDetailsJSON'; // $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index e38cc384..d83be491 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -802,17 +802,17 @@ class PD_Controller extends REST_Controller { if($value['pd_address_id'] != "" || $value['pd_address_id'] != null) { $where_condition_array = array('pd_address_id' => $value['pd_address_id']); - $id = $this->db->updateRecords($value,PDADDRESS,$where_condition_array); + $id = $this->PD_Model->updateRecords($value,PDADDRESS,$where_condition_array); if($id != "" || $id != null){ $count++; } } else { - $id = $this->db->saveRecords($value,PDADDRESS); + $id = $this->PD_Model->saveRecords($value,PDADDRESS); if($id != "" || $id != null){ $count++; } } } - if($count != count($records)) + if($count == count($records)) { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; @@ -4201,7 +4201,7 @@ class PD_Controller extends REST_Controller { $records = $this->post('records'); $pdid = $records['pd_id']; $fk_createdby = $records['fk_createdby']; - // $this->calculateScore($pdid); + // die(); $is_regenerate = 0; if(isset($records['regenerate'])) @@ -4212,7 +4212,8 @@ class PD_Controller extends REST_Controller { $data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid); $data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid); $data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid); - + $data['pd_score'] = $this->calculateScore($pdid); + //print_r($data['pd_score']);; //GET ALL PROCESSED JSON for($i = 1;$i<=25;$i++) { @@ -4230,7 +4231,7 @@ class PD_Controller extends REST_Controller { // die(); $t = $this->load->view('report_templates/JSONTOREPORT',$data,true); - + //echo $t;die(); //PDF Gen using DOM PDF $pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF @@ -4363,7 +4364,7 @@ class PD_Controller extends REST_Controller { array('form_id' => 22,'form_name' => 'Business Assets'), array('form_id' => 21,'form_name' => 'Business Banking'), array('form_id' => 14,'form_name' => 'Financial Information'), - array('form_id' => 16,'form_name' => 'Assessed Income'), + //array('form_id' => 16,'form_name' => 'Assessed Income'), array('form_id' => 1,'form_name' => 'Supplier Details'), array('form_id' => 2,'form_name' => 'Client Details'), array('form_id' => 11,'form_name' => 'Stock Details'), @@ -5190,7 +5191,7 @@ class PD_Controller extends REST_Controller { switch($combination) { - case 1111: + case 111111: PDSCORE::calculatePDScore111($score_questions,$pd_master_details,$personal_asset_grid); break; @@ -5198,12 +5199,12 @@ class PD_Controller extends REST_Controller { switch($pd_master_details[0]['fk_customer_segment']) { case 1: - PDSCORE::genericDI($score_questions,$pd_master_details,$personal_asset_grid); + $score_questions = PDSCORE::genericDI($score_questions,$pd_master_details,$personal_asset_grid); break; } } - + return $score_questions; } diff --git a/api/application/docs/sample.pdf b/api/application/docs/sample.pdf index a2286ab3..380f67b0 100644 Binary files a/api/application/docs/sample.pdf and b/api/application/docs/sample.pdf differ diff --git a/api/application/helpers/pdscore_helper.php b/api/application/helpers/pdscore_helper.php index 10716b0c..812e5423 100644 --- a/api/application/helpers/pdscore_helper.php +++ b/api/application/helpers/pdscore_helper.php @@ -10,7 +10,7 @@ class PDSCORE public static function genericDI($score_questions,$pd_master_details,$personal_asset_grid) { - print_r($score_questions); + //print_r($score_questions); ############ GENERIC SE-DI CASES ####################### ############ SCROE VARIABLES DECLERATIONS ############## @@ -66,7 +66,7 @@ class PDSCORE /*-------- BUSNIESS --------------*/ $no_of_years_business_run = array('100> to >=10' => 10,'5<= to <10' => 8,'3<= to <5' => 6,'1<= to <3' => 4,' 1> to >0' => 2); - $business_seasonality = array('yes' => 5, 'no major chnages in sales' => 10); + $business_seasonality = array('yes' => 5, 'no major changes in sales' => 10); $employees_total = array('1000> to >50' => 10,'21<= to <50' => 8, '11<= to <20' => 6, '6<= to <10' =>4,'5>= to >0' => 2) ; $cerificates = array('yes' => 10,'no' => 0, 'not applicable' => 0); $owned_property = array('yes' => 10, 'no' => 0); @@ -85,7 +85,7 @@ class PDSCORE /*-----------CALCULATION PART -----------*/ /*-----------GENERAL SECTION -----------*/ - echo "##################################################"; + //echo "##################################################"; $general_distribute_level_weightage = 0; //#######1.1 person_met_is_applicant @@ -427,14 +427,24 @@ class PDSCORE $overall_actual_score = 0; foreach($score_questions as $key => $value) { + + $current_max_score = 0; + $current_actual_score = 0; foreach($value as $v_key => $f_value) { $overall_max_score += $f_value['max_score']; $overall_actual_score += $f_value['actual_score']; + + $current_max_score += $f_value['max_score']; + $current_actual_score += $f_value['actual_score']; + } + $score_questions['score_summary'][$key] = array('actual_score' => $current_actual_score,'max_score' => $current_max_score); + } - $score_questions['overall_score'] = array('overall_actual_score' => $overall_actual_score, 'overall_max_score' => $overall_max_score,'final_score' => ($overall_actual_score/$overall_max_score) * 100); - print_r($score_questions); + $score_questions['score_summary']['overall_score'] = array('overall_actual_score' => $overall_actual_score, 'overall_max_score' => $overall_max_score,'final_score' => ($overall_actual_score/$overall_max_score) * 100); + + return ($score_questions); diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 2ca2e064..5959bb7f 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -119,6 +119,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');

"; + echo "

"; + echo "

Score Summary

"; + echo "General Section Score :".$pd_score['score_summary']['general']['actual_score']."
"; + echo "Business Section Score :".$pd_score['score_summary']['business']['actual_score']."
"; + echo "Final Remarks Score :".$pd_score['score_summary']['final_remarks']['actual_score']."
"; + echo "Final PD Score :".$pd_score['score_summary']['overall_score']['final_score']."
"; echo "
"; @@ -133,6 +139,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } // echo MYUITIL::findCompanyName($all_company_details,2); //print_r($all_company_details); + //print_r($pd_score['overall_score']['final_score']); ?>

General Section Information