diff --git a/api/application/config/constants.php b/api/application/config/constants.php index 42ea37e7..8ff59e74 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -454,6 +454,12 @@ defined('PDFORMDETAILSJSONID') OR define('PDFORMDETAILSJSONID','pd_form_detail_j defined('BUSINESSENTITYTYPE') OR define('BUSINESSENTITYTYPE','m_business_entity_type'); defined('BUSINESSENTITYTYPEID') OR define('BUSINESSENTITYTYPEID','business_entity_type_id'); +defined('BUSINESSINCOME') OR define('BUSINESSINCOME','m_business_income'); +defined('BUSINESSINCOMEID') OR define('BUSINESSINCOMEID','business_income_id'); + +defined('PDBUSINESSINCOME') OR define('PDBUSINESSINCOME','t_pd_business_income'); +defined('PDBUSINESSINCOMEID') OR define('PDBUSINESSINCOMEID','pd_business_income_id'); + diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index e56bbfb5..b454990f 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -2085,8 +2085,8 @@ class PD_Controller extends REST_Controller { else { $data['dataStatus'] = false; - $data['status'] = REST_Controller::HTTP_NOT_MODIFIED; - $data['msg'] = 'Something Went Wrong! Try Later..!'; + $data['status'] = REST_Controller::HTTP_NO_CONTENT; + $data['msg'] = 'No Data Available'; $this->response($data,REST_Controller::HTTP_OK); } @@ -2210,6 +2210,41 @@ class PD_Controller extends REST_Controller { } } + + public function saveOtherBusinessIncome_post() + { + $records = $this->post('records'); + $count = 0; + foreach($records as $rec_key => $record) + { + if($record['pd_business_income_id'] != null || $record['pd_business_income_id'] != "") + { + $where_condition_array = array('pd_business_income_id'=>$record['pd_business_income_id']); + $id = $this->PD_Model->updateRecords($record,PDBUSINESSINCOME,$where_condition_array); + if($id != "" || $id != null){$count++;} + } + else + { + $id = $this->PD_Model->saveRecords($record,PDBUSINESSINCOME); + if($id != "" || $id != null){$count++;} + } + } + if($count == count($records)) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = true; + $this->response($data,REST_Controller::HTTP_OK); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_MODIFIED; + $data['msg'] = 'Something went wrong! Try Later'; + $this->response($data,REST_Controller::HTTP_OK); + } + + } public function saveAssessedIncomeSalesCalculatedByItemwise_post() { @@ -3706,7 +3741,13 @@ class PD_Controller extends REST_Controller { $pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF $output_file2 = APPPATH."/docs/sample.pdf"; - echo file_put_contents($output_file2, $pdf_doc); + $ti = file_put_contents($output_file2, $pdf_doc); + //echo $ti; + // $data['dataStatus'] = true; + // $data['status'] = REST_Controller::HTTP_OK; + // $data['records'] = $ti; + // $this->response($data,REST_Controller::HTTP_OK); + } @@ -3783,4 +3824,6 @@ class PD_Controller extends REST_Controller { } } + + } \ No newline at end of file diff --git a/api/application/controllers/Template_Management_Controller.php b/api/application/controllers/Template_Management_Controller.php index 6627eb84..5f940307 100644 --- a/api/application/controllers/Template_Management_Controller.php +++ b/api/application/controllers/Template_Management_Controller.php @@ -812,7 +812,7 @@ class Template_Management_Controller extends REST_Controller { $temp = array(); foreach($result_array as $r) { - $formid = (int)$r['form_id']; + $formid = $r['form_id']; $temp = array_merge($temp,array($formid)); } @@ -875,7 +875,7 @@ class Template_Management_Controller extends REST_Controller { if($pk_id != "" || $pk_id != null) { $count++; } } - if($count != 0 && ($count == count($insert_array))) + if($count == count($insert_array)) { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK;