Skip to content

A free open source IT asset/license management system

Removed unneeded lines

snipe0d099263e3ef
diff --git a/app/Importer/ConsumableImporter.php b/app/Importer/ConsumableImporter.php
index 10ffaaedfb..40c597e896 100644
--- a/app/Importer/ConsumableImporter.php
+++ b/app/Importer/ConsumableImporter.php
@@ -28,9 +28,9 @@ class ConsumableImporter extends ItemImporter
{
$consumable = Consumable::where('name', trim($this->item['name']))->first();
if ($consumable) {
+
if (! $this->updating) {
$this->log('A matching Consumable '.$this->item['name'].' already exists. ');
-
return;
}
$this->log('Updating Consumable');
@@ -39,12 +39,10 @@ class ConsumableImporter extends ItemImporter
return;
}
+
$this->log('No matching consumable, creating one');
$consumable = new Consumable();
$consumable->created_by = auth()->id();
- $this->item['model_number'] = trim($this->findCsvMatch($row, 'model_number'));
- $this->item['item_no'] = trim($this->findCsvMatch($row, 'item_number'));
- $this->item['min_amt'] = trim($this->findCsvMatch($row, "min_amt"));
$consumable->fill($this->sanitizeItemForStoring($consumable));
// This sets an attribute on the Loggable trait for the action log