diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 2988aae8..d902183b 100755 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -390,6 +390,8 @@ $route['saveFlyhiPDImage'] = 'Flyhi_Controller/saveFlyhiPDImage'; $route['getFlyhiPDImgDataCusLink']='Flyhi_Controller/getFlyhiPDImgDataCusLink'; $route['saveFlyhiPDsection'] = 'Flyhi_Controller/saveFlyhiPDsection'; $route['filterFlyPDList']='Flyhi_Controller/filterFlyPDList'; +$route['regenerateFlyhiReport'] = 'Flyhi_Controller/regenerateFlyhiReport'; + $route['getDigiLockerDocs']='Flyhi_Controller/getDigiLockerDocs'; // $route['getDigiLockerDocs2']='Flyhi_Controller/getDigiLockerDos'; $route['downloadDigiLockerDocs']='Flyhi_Controller/downloadDigiLockerDocs'; diff --git a/api/application/controllers/Flyhi_Controller.php b/api/application/controllers/Flyhi_Controller.php index 3efc140e..5ec7016e 100644 --- a/api/application/controllers/Flyhi_Controller.php +++ b/api/application/controllers/Flyhi_Controller.php @@ -700,7 +700,7 @@ class Flyhi_Controller extends REST_Controller { $pdf_name .= '-'.$pd_type.$flyhipd_data[0]['abbr']; $pdf_name .= '-'.(date('dmY',strtotime($flyhipd_data[0]['completed_date']))); $key = 'sales_pd/'.$pd_id.'/'.$pdf_name.'.pdf'; - //$this->Flyhi_Model->updateRecords(array('pd_report_filename' => 'PD_Report-'.$pdf_name),SALES_PD_DATA,array('sales_pd_id' => $pd_id)); + $this->Flyhi_Model->updateRecords(array('pd_report_filename' => $pdf_name),SALES_PD_DATA,array('sales_pd_id' => $pd_id)); if(!file_exists($this->external_path.'/sales_pd/'.$pd_id)) { @@ -2187,6 +2187,21 @@ class Flyhi_Controller extends REST_Controller { } } + //api for Manually Report Generation. + public function regenerateFlyhiReport_get(){ + $sales_pd_id = $this->get('sales_pd_id'); + if(!empty($sales_pd_id)){ + $this->Sales_PD_Model->updateRecords(array('is_pdf' => 0),SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id)); + log_message('ERROR','####Manually Called - Report Generated Flyhi pd = '.$sales_pd_id); + $this->prepareFlyhiPDReport($sales_pd_id);} + else{ + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_FOUND; + $data['msg'] = 'Sales PDID Not Found !'; + $this->response($data,REST_Controller::HTTP_OK); + } + } + public function getDigiLockerDocs_get(){ $this->load->helper('digital_locker'); // $code = "66e28b748d5f73186206a03f27f6aee73191a087";