mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-03 06:44:27 -04:00
CSV Import fixes
- Corrected Capitalization in File Handling Logic - Populated $allowedStockLocations before sending it to the validation function Signed-off-by: objec <objecttothis@gmail.com>
This commit is contained in:
@@ -1008,7 +1008,7 @@ class Items extends Secure_Controller
|
||||
'pic_filename' => $row['Image']
|
||||
];
|
||||
|
||||
if (!empty($row['supplier ID'])) {
|
||||
if (!empty($row['Supplier ID'])) {
|
||||
$itemData['supplier_id'] = $this->supplier->exists($row['Supplier ID']) ? $row['Supplier ID'] : null;
|
||||
}
|
||||
|
||||
@@ -1026,7 +1026,12 @@ class Items extends Secure_Controller
|
||||
}
|
||||
|
||||
if (!$isFailedRow) {
|
||||
$allowedStockLocations = $this->stock_location->get_allowed_locations();
|
||||
$isFailedRow = $this->validateCSVData($row, $itemData, $allowedStockLocations, $attributeDefinitionNames, $attributeData);
|
||||
if (!empty($invalidLocations)) {
|
||||
$isFailedRow = true;
|
||||
log_message('error', 'CSV import: Invalid stock location(s) found: ' . implode(', ', $invalidLocations));
|
||||
}
|
||||
}
|
||||
|
||||
// Remove false, null, '' and empty strings but keep 0
|
||||
|
||||
Reference in New Issue
Block a user