From 887f8e666c145f01186958218bb3370d8a2fdce3 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 6 Jan 2023 13:40:51 +0530 Subject: [PATCH 1/6] CET app Credit PD fIXES: ps --- .../controllers/SMC_Credit_PD_Controller.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 47d17a54..4388a067 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -270,6 +270,7 @@ class SMC_Credit_PD_Controller extends REST_Controller { function uploadCreditPDDataToCETApp_get() { log_message('ERROR', '#### upload SMC Credit PDData To CETApp Called'); + $smc_credit_pd = $this->uri->segment(2); $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'); @@ -283,12 +284,13 @@ class SMC_Credit_PD_Controller extends REST_Controller { foreach ($pd_section_data as $key => $value) { if (isset($value['json']) && $value['json'] != '') { $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 { 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']); $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,7 +358,18 @@ class SMC_Credit_PD_Controller extends REST_Controller { } } 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 = "