mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge pull request #10511 from inietov/features/audit_date_in_importer
Adds audit dates in the asset importer
This commit is contained in:
commit
a65fb63b6b
|
@ -96,6 +96,14 @@ class AssetImporter extends ItemImporter
|
|||
$item['rtd_location_id'] = $this->item['location_id'];
|
||||
}
|
||||
|
||||
if (isset($this->item['last_audit_date'])) {
|
||||
$item['last_audit_date'] = $this->item['last_audit_date'];
|
||||
}
|
||||
|
||||
if (isset($this->item['next_audit_date'])) {
|
||||
$item['next_audit_date'] = $this->item['next_audit_date'];
|
||||
}
|
||||
|
||||
if ($editingAsset) {
|
||||
$asset->update($item);
|
||||
} else {
|
||||
|
|
|
@ -76,6 +76,17 @@ class ItemImporter extends Importer
|
|||
if ($this->findCsvMatch($row, 'purchase_date') != '') {
|
||||
$this->item['purchase_date'] = date('Y-m-d 00:00:01', strtotime($this->findCsvMatch($row, 'purchase_date')));
|
||||
}
|
||||
|
||||
$this->item['last_audit_date'] = null;
|
||||
if ($this->findCsvMatch($row, 'last_audit_date') != '') {
|
||||
$this->item['last_audit_date'] = date('Y-m-d', strtotime($this->findCsvMatch($row, 'last_audit_date')));
|
||||
}
|
||||
|
||||
$this->item['next_audit_date'] = null;
|
||||
if ($this->findCsvMatch($row, 'next_audit_date') != '') {
|
||||
$this->item['next_audit_date'] = date('Y-m-d', strtotime($this->findCsvMatch($row, 'next_audit_date')));
|
||||
}
|
||||
|
||||
$this->item['qty'] = $this->findCsvMatch($row, 'quantity');
|
||||
$this->item['requestable'] = $this->findCsvMatch($row, 'requestable');
|
||||
$this->item['user_id'] = $this->user_id;
|
||||
|
|
|
@ -154,6 +154,8 @@
|
|||
{id: 'full_name', text: 'Full Name' },
|
||||
{id: 'status', text: 'Status' },
|
||||
{id: 'warranty_months', text: 'Warranty Months' },
|
||||
{id: 'last_audit_date', text: 'Last Audit Date' },
|
||||
{id: 'next_audit_date', text: 'Audit Date' },
|
||||
],
|
||||
consumables: [
|
||||
{id: 'item_no', text: "Item Number"},
|
||||
|
|
Loading…
Reference in a new issue