CET app Credit PD fIXES: ps

This commit is contained in:
VE10-Sanjeev 2023-01-06 13:40:51 +05:30
parent 3174ff076c
commit 887f8e666c

View File

@ -270,6 +270,7 @@ class SMC_Credit_PD_Controller extends REST_Controller {
function uploadCreditPDDataToCETApp_get() function uploadCreditPDDataToCETApp_get()
{ {
log_message('ERROR', '#### upload SMC Credit PDData To CETApp Called'); log_message('ERROR', '#### upload SMC Credit PDData To CETApp Called');
$smc_credit_pd = $this->uri->segment(2); $smc_credit_pd = $this->uri->segment(2);
$mater_details = $this->PD_Model->getPDMasterDetails($smc_credit_pd); $mater_details = $this->PD_Model->getPDMasterDetails($smc_credit_pd);
$pd_section_data = $this->SMC_Credit_PD_Model->getSMCTemplateForPD($smc_credit_pd,$mater_details[0]['fk_product_id'],null,null,'REPORT'); $pd_section_data = $this->SMC_Credit_PD_Model->getSMCTemplateForPD($smc_credit_pd,$mater_details[0]['fk_product_id'],null,null,'REPORT');
@ -283,12 +284,13 @@ class SMC_Credit_PD_Controller extends REST_Controller {
foreach ($pd_section_data as $key => $value) { foreach ($pd_section_data as $key => $value) {
if (isset($value['json']) && $value['json'] != '') { if (isset($value['json']) && $value['json'] != '') {
$filter_form_id[$key] = $value['fk_form_id']; $filter_form_id[$key] = $value['fk_form_id'];
$CETAPP_creditPD_data[$value['form_name']] = $value['json'];
$CETAPP_creditPD_data[$value['form_name']] = json_decode($value['json'],true);
} else { } else {
if (in_array($value['fk_form_id'], $forms_data_to_be_get_direct_from_excel_sheet)) { if (in_array($value['fk_form_id'], $forms_data_to_be_get_direct_from_excel_sheet)) {
$data_from_excel = $this->loadDataFromExcelBusiProcess($mater_details, $value['fk_form_id']); $data_from_excel = $this->loadDataFromExcelBusiProcess($mater_details, $value['fk_form_id']);
$filter_form_id[$key] = $value['fk_form_id']; $filter_form_id[$key] = $value['fk_form_id'];
$CETAPP_creditPD_data[$value['form_name']] = $data_from_excel; $CETAPP_creditPD_data[$value['form_name']] = json_decode($data_from_excel,true);
} }
} }
} }
@ -356,6 +358,17 @@ class SMC_Credit_PD_Controller extends REST_Controller {
} }
} }
cet_creditpd::pushwithcetcreditpdapi($common_fields, $CETAPP_creditPD_data); cet_creditpd::pushwithcetcreditpdapi($common_fields, $CETAPP_creditPD_data);
// print_r($CETAPP_creditPD_data);
// $path = $this->external_path ."/pd_reports/" . $mater_details[0]['pd_id'] . "/new-file-5-".$mater_details[0]['pd_id'].".json";
// $json = json_decode($view_data['pd_section_data'],true);
// $fp = fopen($path, 'w');
// fwrite($fp, $jsonString);
// fclose($fp);
// if(file_put_contents($path, $output_data))
// {
// $message = "<label class='text-success'>File createed and data added Success fully</p>";
// echo $message;
// }die();
$data['dataStatus'] = true; $data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK; $data['status'] = REST_Controller::HTTP_OK;