A free open source IT asset/license management system
viola
spencerrlongg0368b9df437d
diff --git a/app/Importer/ItemImporter.php b/app/Importer/ItemImporter.phpindex 0d17ecaedb..c966c9f3c9 100644--- a/app/Importer/ItemImporter.php+++ b/app/Importer/ItemImporter.php@@ -98,17 +98,6 @@ class ItemImporter extends ImporterLog::info($e->getMessage());$this->log('Unable to parse date: '.$csvMatch);}- } elseif ($this->createOrFetchAssetModel($row) != null) {- if(AssetModel::find($this->createOrFetchAssetModel($row))->eol && $this->findCsvMatch($row, 'purchase_date') != '') {- $eol = AssetModel::find($this->createOrFetchAssetModel($row))->eol;- $months = CarbonImmutable::parse($this->findCsvMatch($row, 'asset_eol_date'))->diffInMonths($this->findCsvMatch($row, 'purchase_date'));- if($months != $eol) {- $this->item['eol_explicit'] = true;- } else {- $this->item['eol_explicit'] = false;- }- $this->item['asset_eol_date'] = CarbonImmutable::parse($this->findCsvMatch($row, 'purchase_date'))->addMonths($eol)->format('Y-m-d');- }}$this->item['qty'] = $this->findCsvMatch($row, 'quantity');diff --git a/app/Observers/AssetObserver.php b/app/Observers/AssetObserver.phpindex 17e94a85bd..3cbaedded2 100644--- a/app/Observers/AssetObserver.php+++ b/app/Observers/AssetObserver.php@@ -140,7 +140,9 @@ class AssetObserver} elseif (!is_null($asset->asset_eol_date) && is_null($asset->purchase_date)) {$asset->eol_explicit = true;}-+ if ((!is_null($asset->asset_eol_date)) && (!is_null($asset->purchase_date)) && (is_null($asset->model->eol))) {+ $asset->eol_explicit = true;+ }}}