A free open source IT asset/license management system
Put asset EOL date back in the Item Importer
snipe3a0f7eca54ee
diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.phpindex c472023fa0..6f6b43876d 100644--- a/app/Importer/ItemImporter.php+++ b/app/Importer/ItemImporter.php@@ -79,6 +79,18 @@ class ItemImporter extends Importer$this->item['purchase_date'] = date('Y-m-d', strtotime($this->findCsvMatch($row, 'purchase_date')));}+ $this->item['asset_eol_date'] = null;+ if ($this->findCsvMatch($row, 'asset_eol_date') != '') {+ $csvMatch = $this->findCsvMatch($row, 'asset_eol_date');+ \Log::warning('EOL Date for $csvMatch is '.$csvMatch);+ try {+ $this->item['asset_eol_date'] = CarbonImmutable::parse($csvMatch)->format('Y-m-d');+ } catch (\Exception $e) {+ Log::info($e->getMessage());+ $this->log('Unable to parse date: '.$csvMatch);+ }+ }+$this->item['qty'] = $this->findCsvMatch($row, 'quantity');$this->item['requestable'] = $this->findCsvMatch($row, 'requestable');@@ -369,7 +381,6 @@ class ItemImporter extends Importerif ($status->save()) {$this->log('Status '.$asset_statuslabel_name.' was created');-return $status->id;}