Fix stock location crud (#2965)

This commit is contained in:
jekkos-t520
2020-10-17 01:05:03 +02:00
parent c0ff849c0f
commit 760d7490a2
4 changed files with 13 additions and 14 deletions

View File

@@ -578,15 +578,16 @@ class Config extends Secure_Controller
{
if(strstr($key, 'stock_location'))
{
$location_id = preg_replace("/.*?_(\d+)$/", "$1", $key);
// save or update
$location_data = array('location_name' => $value);
if($this->Stock_location->save($location_data, $location_id))
foreach ($value as $location_id => $location_name)
{
$location_id = $this->Stock_location->get_location_id($value);
$not_to_delete[] = $location_id;
$this->_clear_session_state();
$location_data = array('location_name' => $location_name);
if($this->Stock_location->save($location_data, $location_id))
{
$location_id = $this->Stock_location->get_location_id($location_name);
$not_to_delete[] = $location_id;
$this->_clear_session_state();
}
}
}
}
@@ -957,4 +958,4 @@ class Config extends Secure_Controller
}
}
}
?>
?>