mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Put asset EOL date back in the Item Importer
I have no idea why this is necessary Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
f4d530b4b1
commit
3a0f7eca54
|
@ -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 Importer
|
|||
|
||||
if ($status->save()) {
|
||||
$this->log('Status '.$asset_statuslabel_name.' was created');
|
||||
|
||||
return $status->id;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue