From 0d099263e3ef7528e2542d0fc7b9fd644b0f3411 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 2 Apr 2025 21:09:28 +0100 Subject: [PATCH] Removed unneeded lines Signed-off-by: snipe --- app/Importer/ConsumableImporter.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Importer/ConsumableImporter.php b/app/Importer/ConsumableImporter.php index 10ffaaedf..40c597e89 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