Merge pull request #10511 from inietov/features/audit_date_in_importer

Adds audit dates in the asset importer
This commit is contained in:
snipe 2022-01-27 10:58:53 -08:00 committed by GitHub
commit a65fb63b6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View file

@ -96,6 +96,14 @@ class AssetImporter extends ItemImporter
$item['rtd_location_id'] = $this->item['location_id']; $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) { if ($editingAsset) {
$asset->update($item); $asset->update($item);
} else { } else {

View file

@ -76,6 +76,17 @@ class ItemImporter extends Importer
if ($this->findCsvMatch($row, 'purchase_date') != '') { 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['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['qty'] = $this->findCsvMatch($row, 'quantity');
$this->item['requestable'] = $this->findCsvMatch($row, 'requestable'); $this->item['requestable'] = $this->findCsvMatch($row, 'requestable');
$this->item['user_id'] = $this->user_id; $this->item['user_id'] = $this->user_id;

View file

@ -154,6 +154,8 @@
{id: 'full_name', text: 'Full Name' }, {id: 'full_name', text: 'Full Name' },
{id: 'status', text: 'Status' }, {id: 'status', text: 'Status' },
{id: 'warranty_months', text: 'Warranty Months' }, {id: 'warranty_months', text: 'Warranty Months' },
{id: 'last_audit_date', text: 'Last Audit Date' },
{id: 'next_audit_date', text: 'Audit Date' },
], ],
consumables: [ consumables: [
{id: 'item_no', text: "Item Number"}, {id: 'item_no', text: "Item Number"},