A free open source IT asset/license management system
Added EOL date to importer
snipe3296716dfa37
diff --git a/app/Http/Livewire/Importer.php b/app/Http/Livewire/Importer.phpindex 7a37b00d18..00f3bd58b7 100644--- a/app/Http/Livewire/Importer.php+++ b/app/Http/Livewire/Importer.php@@ -96,6 +96,7 @@ class Importer extends Component'full_name' => 'Full Name','status' => 'Status','warranty_months' => 'Warranty Months',+ 'asset_eol_date' => 'EOL Date',];static $consumables = [diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.phpindex 0fcbf1166c..7ba40d0499 100644--- a/app/Importer/AssetImporter.php+++ b/app/Importer/AssetImporter.php@@ -114,6 +114,11 @@ class AssetImporter extends ItemImporter$item['next_audit_date'] = $this->item['next_audit_date'];}+ $item['asset_eol_date'] = null;+ if (isset($this->item['asset_eol_date'])) {+ $item['asset_eol_date'] = $this->item['asset_eol_date'];+ }+if ($editingAsset) {$asset->update($item);} else {@@ -127,7 +132,7 @@ class AssetImporter extends ItemImporter}}- //FIXME: this disables model validation. Need to find a way to avoid double-logs without breaking everything.+ // FIXME: this disables model validation. Need to find a way to avoid double-logs without breaking everything.// $asset->unsetEventDispatcher();if ($asset->save()) {$asset->logCreate('Imported using csv importer');diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.phpindex 8e5cfbb16a..21ae60f4da 100644--- a/app/Importer/ItemImporter.php+++ b/app/Importer/ItemImporter.php@@ -87,6 +87,11 @@ class ItemImporter extends Importer$this->item['next_audit_date'] = date('Y-m-d', strtotime($this->findCsvMatch($row, 'next_audit_date')));}+ $this->item['asset_eol_date'] = null;+ if ($this->findCsvMatch($row, 'asset_eol_date') != '') {+ $this->item['asset_eol_date'] = date('Y-m-d', strtotime($this->findCsvMatch($row, 'asset_eol_date')));+ }+$this->item['qty'] = $this->findCsvMatch($row, 'quantity');$this->item['requestable'] = $this->findCsvMatch($row, 'requestable');$this->item['user_id'] = $this->user_id;