diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 5fb05843..69a6ba0a 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -885,6 +885,7 @@ class PD_Controller extends REST_Controller { public function updatePDMaster_post() { $pd_details = $this->post('records'); + //print_r($pd_details);die(); log_message('ERROR',"UpdatePD Called"); // log_message('ERROR',print_r($pd_details)); if((isset($pd_details['pd_id']) && $pd_details['pd_id'] != "" ) && (isset($pd_details['random_string']) && $pd_details['random_string'] != " ")) @@ -947,6 +948,11 @@ class PD_Controller extends REST_Controller { if(isset($pd_details['pd_status']) && (($pd_details['pd_status'] == COMPLETED) || ($pd_details['pd_status'] == ADD_ON_PENDING)) ) { + if($pd_details['pd_status'] == COMPLETED) + { + $pd_details['complete_override_data'] = json_encode($pd_details['complete_override_data']); + } + if(array_key_exists('link',$pd_details)) { $pd_details['complete_location'] = isset($pd_details['link']) ? $pd_details['link'] : null; @@ -9703,7 +9709,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id']; - $query = "SELECT * FROM ".VIDEO_ROOM_INFO." where fk_pd_id = $pd_id";// and is_call_ended = 1 and composition_id is not null"; + $query = "SELECT * FROM ".VIDEO_ROOM_INFO." where fk_pd_id = $pd_id and isactive = 1";// and is_call_ended = 1 and composition_id is not null"; $video_info = $this->db->query($query); if($video_info->num_rows()) { @@ -9757,7 +9763,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $result_data = 0; // $query = "SELECT * FROM ".VIDEO_ROOM_INFO." where fk_pd_id = $pd_id and twilo_status = 'enqueued' and composition_id is not null;"; $pd_master_details = $this->PD_Model->getPDMasterDetails($pd_id,$random_string); - $query = "SELECT * FROM ".VIDEO_ROOM_INFO." where fk_pd_id = $pd_id";// and twilo_status = 'enqueued' and composition_id is not null;"; + $query = "SELECT * FROM ".VIDEO_ROOM_INFO." where fk_pd_id = $pd_id and isactive = 1";// and twilo_status = 'enqueued' and composition_id is not null;"; if($room_id) { $query .=" and room_id = '$room_id'"; diff --git a/api/application/helpers/pdscore_helper.php b/api/application/helpers/pdscore_helper.php index 60afcaba..4d030576 100644 --- a/api/application/helpers/pdscore_helper.php +++ b/api/application/helpers/pdscore_helper.php @@ -831,7 +831,7 @@ class PDSCORE - $actual_value_of_assets_percentage = ($actual_value_of_assets / $loan_amount) * 100; + $actual_value_of_assets_percentage = $actual_value_of_assets ? ($actual_value_of_assets / $loan_amount) * 100 : 0; $asset_calculation_details['actual_value_of_assets_percentage'] = round($actual_value_of_assets_percentage,2); //echo 'actual_value_of_assets_percentage--'.$actual_value_of_assets_percentage; @@ -1001,27 +1001,30 @@ class PDSCORE //print_r($score_questions['business']['cerificates']);die(); //######2.1 no_of_years_business_run - + //echo $score_questions['business']['no_of_years_business_run'];die(); $no_of_years_business_run_actual_score = 0; $score_band = 0; - foreach($no_of_years_business_run as $key => $value) + if($score_questions['business']['no_of_years_business_run']) { - $exp = explode('to',$key); - //print_r($exp); - $left = $exp[0].$score_questions['business']['no_of_years_business_run']; - $right = $score_questions['business']['no_of_years_business_run'].$exp[1]; - //echo $left.'````'.$right;echo "\n"; - eval( '$left_exp = ' . $left . ';'); - eval( '$right_exp = ' . $right . ';'); - if($left_exp && $right_exp) + foreach($no_of_years_business_run as $key => $value) { + $exp = explode('to',$key); + //print_r($exp); + $left = $exp[0].$score_questions['business']['no_of_years_business_run']; + $right = $score_questions['business']['no_of_years_business_run'].$exp[1]; + //echo $left.'````'.$right;echo "\n";die(); + eval( '$left_exp = ' . $left . ';'); + eval( '$right_exp = ' . $right . ';'); + if($left_exp && $right_exp) + { + + $no_of_years_business_run_L2 = $business_distribute_level_weightage ? ($no_of_years_business_run_L2 + ($no_of_years_business_run_L2 / (100 - $business_distribute_level_weightage )) * $business_distribute_level_weightage) : $no_of_years_business_run_L2 ; + + $no_of_years_business_run_actual_score = ($l1_business/100) * ($no_of_years_business_run_L2/100) * $value; + $score_band = $value; + } - $no_of_years_business_run_L2 = $business_distribute_level_weightage ? ($no_of_years_business_run_L2 + ($no_of_years_business_run_L2 / (100 - $business_distribute_level_weightage )) * $business_distribute_level_weightage) : $no_of_years_business_run_L2 ; - - $no_of_years_business_run_actual_score = ($l1_business/100) * ($no_of_years_business_run_L2/100) * $value; - $score_band = $value; } - } @@ -1047,21 +1050,24 @@ class PDSCORE $employees_total_L2 = $business_distribute_level_weightage ? ($employees_total_L2 + ($employees_total_L2 / (100 - $business_distribute_level_weightage )) * $business_distribute_level_weightage) : $employees_total_L2 ; $score_band = 0; - foreach($employees_total as $key => $value) + if($score_questions['business']['employees_total']) { - $exp = explode('to',$key); - //print_r($exp); - $left = $exp[0].$score_questions['business']['employees_total']; - $right = $score_questions['business']['employees_total'].$exp[1]; - //echo $left.'````'.$right;echo "\n"; - eval( '$left_exp = ' . $left . ';'); - eval( '$right_exp = ' . $right . ';'); - if($left_exp && $right_exp) + foreach($employees_total as $key => $value) { - $employees_total_actual_score = ($l1_business/100) * ($employees_total_L2/100) * $value; - $score_band = $value; + $exp = explode('to',$key); + //print_r($exp); + $left = $exp[0].$score_questions['business']['employees_total']; + $right = $score_questions['business']['employees_total'].$exp[1]; + //echo $left.'````'.$right;echo "\n"; + eval( '$left_exp = ' . $left . ';'); + eval( '$right_exp = ' . $right . ';'); + if($left_exp && $right_exp) + { + $employees_total_actual_score = ($l1_business/100) * ($employees_total_L2/100) * $value; + $score_band = $value; + } + } - } // echo $score_band; // die(); diff --git a/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php b/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php index 1e2b291b..a5544c17 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL_SMARTPD.php @@ -1151,7 +1151,7 @@ font-weight: bolder;; { $employeement_data = json_decode($pd_processed_forms[12][0]['processed_json'],true); } - //print_r($employeement_data);die(); + //print_r($employeement_data); echo "
Salary paid to the applicant between ".MYUTIL::addOrdinalNumberSuffix($employeement_data['from_date_the_salary_is_rcv']) ." and ".MYUTIL::addOrdinalNumberSuffix($employeement_data['to_date_the_salary_is_rcv']). " of every month via ".$salary_mode_text [ $employeement_data['mode_of_getting_salary'] ]."
"; + echo "Salary paid to the applicant between ".MYUTIL::addOrdinalNumberSuffix($employeement_data['from_date_the_salary_is_rcv']) ." and ".MYUTIL::addOrdinalNumberSuffix($employeement_data['to_date_the_salary_is_rcv']). " of every month via ".$salary_mode_text [ $employeement_data['mode_of_getting_salary'] ].".
"; + if((isset($employeement_data['amount_paid_in_cash']) && $employeement_data['amount_paid_in_cash']) && (isset($employeement_data['amount_paid_through_bank']) && $employeement_data['amount_paid_through_bank'])) + { + echo "Applicant is getting ".$rupee_symbol.' '.$employeement_data['amount_paid_in_cash']." paid as cash and ".$rupee_symbol.' '.$employeement_data['amount_paid_through_bank']." as bank transfer."; + } if(isset($employeement_data['sal_paid_regularly']) && $employeement_data['sal_paid_regularly'] == 'yes') { @@ -1195,12 +1199,9 @@ font-weight: bolder;; } else { - echo 'Salary has been not paid regularly for last three months becasue '.$employer_details['reason_not_sal_pay'].'.
' ; - } - if((isset($employeement_data['amount_paid_in_cash']) && $employeement_data['amount_paid_in_cash']) && (isset($employeement_data['amount_paid_through_bank']) && $employeement_data['amount_paid_through_bank'])) - { - echo $rupee_symbol.' '.$employeement_data['amount_paid_in_cash']." paid as cash and ".$rupee_symbol.' '.$employeement_data['amount_paid_through_bank']." as bank transfer"; + echo 'Salary has been not paid regularly for last three months becasue '.$employeement_data['reason_not_sal_pay'].'.
' ; } + // else if(isset($employeement_data['amount_paid_in_cash']) && $employeement_data['amount_paid_in_cash']) // { // echo "entire salary is paid as cash."; @@ -1232,7 +1233,7 @@ font-weight: bolder;; $document_name .= ($employeement_data['cash_voucher'] == 'yes'? 'Cash Voucher,' : ''); $document_name .= ($employeement_data['sal_certificate'] == 'yes' ? 'Salary Certificate, ' : ''); $document_name .= ($employeement_data['sal_slip'] == 'yes' ? 'Salary Slip, ': ''); - $document_name .= ($employeement_data['other_doc'] == 'yes' ? $employeement_data['docs_sighted']['other_doc_name'].', ' : ''); + $document_name .= ($employeement_data['other_doc'] == 'yes' ? $employeement_data['other_doc_name'].', ' : ''); if($document_name != '') {