ASSESSED INCOME MULTIPLE2

This commit is contained in:
velz 2018-11-20 17:22:55 +05:30
parent ac272d4135
commit bf8bf3d5ad
2 changed files with 42 additions and 35 deletions

View File

@ -87,7 +87,7 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto
// define login route name for token verification // define login route name for token verification
//defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listLessPDDetails/:any)'); // no errors //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listLessPDDetails/:any)'); // no errors
//defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listAllTemplates/:any)'); // no errors //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listAllTemplates/:any)'); // no errors
defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'saveAssessedIncomeSalesCalculatedByItemwise'); // no errors defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'saveAssessedIncomeMonthwiseItems'); // no errors
/*********************AWS resources Constants*************************************************/ /*********************AWS resources Constants*************************************************/
defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic'); defined('PROFILE_PICTURE_BUCKET_NAME') OR define('PROFILE_PICTURE_BUCKET_NAME','sineedgedevprofilepic');

View File

@ -1963,19 +1963,24 @@ class PD_Controller extends REST_Controller {
public function saveAssessedIncomeMonthwiseItems_post()//SALESITEMMONTHWISECHILD public function saveAssessedIncomeMonthwiseItems_post()//SALESITEMMONTHWISECHILD
{ {
$records = $this->post('records'); $records = $this->post('records');
$child_data = array(); $count = 0;
if(array_key_exists('child',$records)) foreach($records as $key => $record)
{ {
$child_data = $records['child'];
unset($records['child']); $child_data = array();
if(array_key_exists('child',$record))
{
$child_data = $record['child'];
unset($record['child']);
} }
$id = ""; $id = "";
if($records['sim_id'] != null || $records['sim_id'] != "") if($record['sim_id'] != null || $record['sim_id'] != "")
{ {
$where_condition_array = array('sim_id'=>$records['sim_id']); $where_condition_array = array('sim_id'=>$record['sim_id']);
$id = $this->PD_Model->updateRecords($records,SALESITEMMONTHWISE,$where_condition_array); $id = $this->PD_Model->updateRecords($record,SALESITEMMONTHWISE,$where_condition_array);
if($id != "" || $id != null) if($id != "" || $id != null)
{ {
$count++;
foreach($child_data as $ckey => $child) foreach($child_data as $ckey => $child)
{ {
if($child['simc_id'] != "" || $child['simc_id'] != null) if($child['simc_id'] != "" || $child['simc_id'] != null)
@ -1994,9 +1999,10 @@ class PD_Controller extends REST_Controller {
} }
else else
{ {
$id = $this->PD_Model->saveRecords($records,SALESITEMMONTHWISE); $id = $this->PD_Model->saveRecords($record,SALESITEMMONTHWISE);
if($id != "" || $id != null) if($id != "" || $id != null)
{ {
$count++;
foreach($child_data as $ckey => $child) foreach($child_data as $ckey => $child)
{ {
$child['fk_sim_id'] = $id; $child['fk_sim_id'] = $id;
@ -2004,8 +2010,9 @@ class PD_Controller extends REST_Controller {
} }
} }
} }
}
if($id != "" || $id != null) if($count == count($records))
{ {
$data['dataStatus'] = true; $data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK; $data['status'] = REST_Controller::HTTP_OK;