mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-06-19 12:58:51 -04:00
- fixed excel import: if there was missing a location-id in the import-csv, then there would not have been created an entry into item_quantities for the item and location.
- fixed also the inventory info-part: before in the inventory-table there was no quantity inserted and data[10] as the location_id
This commit is contained in:
@@ -26,6 +26,25 @@ class Stock_locations extends CI_Model
|
||||
return $this->db->get();
|
||||
}
|
||||
|
||||
/*
|
||||
* returns all location-ids in a simple array like array (location_id, location_id, ...)
|
||||
* used in items-controller::do_excel_import
|
||||
* @since 22.1.15
|
||||
*/
|
||||
function get_location_ids_as_array()
|
||||
{
|
||||
$this->db->select('location_id');
|
||||
$this->db->from('stock_locations');
|
||||
$this->db->where('deleted', 0);
|
||||
$query = $this->db->get();
|
||||
$ids_array = array();
|
||||
foreach($query->result() as $row)
|
||||
{
|
||||
$ids_array[] = $row->location_id;
|
||||
}
|
||||
return $ids_array;
|
||||
}
|
||||
|
||||
function concat_location_names()
|
||||
{
|
||||
$this->db->select('GROUP_CONCAT(location_name SEPARATOR\',\') AS location_names', FALSE);
|
||||
|
||||
Reference in New Issue
Block a user