mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-29 03:15:58 -04:00
Fix stock location crud (#2965)
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user