Separate notes on assets and asset models

This commit is contained in:
Ivan Nieto Vivanco 2022-02-24 16:05:03 -06:00
parent 4b7f45a15e
commit 64fa7e23fc
3 changed files with 9 additions and 2 deletions

View file

@ -71,7 +71,7 @@ class AssetImporter extends ItemImporter
$this->log("No Matching Asset, Creating a new one"); $this->log("No Matching Asset, Creating a new one");
$asset = new Asset; $asset = new Asset;
} }
$this->item['notes'] = $this->findCsvMatch($row, 'asset_notes');
$this->item['image'] = $this->findCsvMatch($row, "image"); $this->item['image'] = $this->findCsvMatch($row, "image");
$this->item['requestable'] = $this->fetchHumanBoolean($this->findCsvMatch($row, "requestable"));; $this->item['requestable'] = $this->fetchHumanBoolean($this->findCsvMatch($row, "requestable"));;
$asset->requestable = $this->fetchHumanBoolean($this->findCsvMatch($row, "requestable")); $asset->requestable = $this->fetchHumanBoolean($this->findCsvMatch($row, "requestable"));

View file

@ -208,6 +208,7 @@ class ItemImporter extends Importer
$this->log("Matching Model found, updating it."); $this->log("Matching Model found, updating it.");
$item = $this->sanitizeItemForStoring($asset_model, $editingModel); $item = $this->sanitizeItemForStoring($asset_model, $editingModel);
$item['name'] = $asset_model_name; $item['name'] = $asset_model_name;
$item['notes'] = $this->findCsvMatch($row, 'model_notes');
if(!empty($asset_modelNumber)){ if(!empty($asset_modelNumber)){
$item['model_number'] = $asset_modelNumber; $item['model_number'] = $asset_modelNumber;
@ -224,6 +225,7 @@ class ItemImporter extends Importer
$item = $this->sanitizeItemForStoring($asset_model, $editingModel); $item = $this->sanitizeItemForStoring($asset_model, $editingModel);
$item['name'] = $asset_model_name; $item['name'] = $asset_model_name;
$item['model_number'] = $asset_modelNumber; $item['model_number'] = $asset_modelNumber;
$item['notes'] = $this->findCsvMatch($row, 'model_notes');
$asset_model->fill($item); $asset_model->fill($item);
$item = null; $item = null;

View file

@ -130,7 +130,6 @@
{id: 'location', text: 'Location' }, {id: 'location', text: 'Location' },
{id: 'maintained', text: 'Maintained' }, {id: 'maintained', text: 'Maintained' },
{id: 'manufacturer', text: 'Manufacturer' }, {id: 'manufacturer', text: 'Manufacturer' },
{id: 'notes', text: 'Notes' },
{id: 'order_number', text: 'Order Number' }, {id: 'order_number', text: 'Order Number' },
{id: 'purchase_cost', text: 'Purchase Cost' }, {id: 'purchase_cost', text: 'Purchase Cost' },
{id: 'purchase_date', text: 'Purchase Date' }, {id: 'purchase_date', text: 'Purchase Date' },
@ -143,10 +142,13 @@
], ],
accessories:[ accessories:[
{id: 'model_number', text: 'Model Number'}, {id: 'model_number', text: 'Model Number'},
{id: 'notes', text: 'Notes' },
], ],
assets: [ assets: [
{id: 'asset_tag', text: 'Asset Tag' }, {id: 'asset_tag', text: 'Asset Tag' },
{id: 'asset_model', text: 'Model Name' }, {id: 'asset_model', text: 'Model Name' },
{id: 'asset_notes', text: 'Asset Notes' },
{id: 'model_notes', text: 'Model Notes' },
{id: 'checkout_class', text: 'Checkout Type' }, {id: 'checkout_class', text: 'Checkout Type' },
{id: 'checkout_location', text: 'Checkout Location' }, {id: 'checkout_location', text: 'Checkout Location' },
{id: 'image', text: 'Image Filename' }, {id: 'image', text: 'Image Filename' },
@ -159,6 +161,7 @@
{id: 'item_no', text: "Item Number"}, {id: 'item_no', text: "Item Number"},
{id: 'model_number', text: "Model Number"}, {id: 'model_number', text: "Model Number"},
{id: 'min_amt', text: "Minimum Quantity"}, {id: 'min_amt', text: "Minimum Quantity"},
{id: 'notes', text: 'Notes' },
], ],
licenses: [ licenses: [
{id: 'asset_tag', text: 'Assigned To Asset'}, {id: 'asset_tag', text: 'Assigned To Asset'},
@ -166,6 +169,7 @@
{id: 'full_name', text: 'Full Name' }, {id: 'full_name', text: 'Full Name' },
{id: 'license_email', text: 'Licensed To Email' }, {id: 'license_email', text: 'Licensed To Email' },
{id: 'license_name', text: 'Licensed To Name' }, {id: 'license_name', text: 'Licensed To Name' },
{id: 'notes', text: 'Notes' },
{id: 'purchase_order', text: 'Purchase Order' }, {id: 'purchase_order', text: 'Purchase Order' },
{id: 'reassignable', text: 'Reassignable' }, {id: 'reassignable', text: 'Reassignable' },
{id: 'seats', text: 'Seats' }, {id: 'seats', text: 'Seats' },
@ -178,6 +182,7 @@
{id: 'phone_number', text: 'Phone Number' }, {id: 'phone_number', text: 'Phone Number' },
{id: 'manager_first_name', text: 'Manager First Name' }, {id: 'manager_first_name', text: 'Manager First Name' },
{id: 'manager_last_name', text: 'Manager Last Name' }, {id: 'manager_last_name', text: 'Manager Last Name' },
{id: 'notes', text: 'Notes' },
{id: 'activated', text: 'Activated' }, {id: 'activated', text: 'Activated' },
{id: 'address', text: 'Address' }, {id: 'address', text: 'Address' },
{id: 'city', text: 'City' }, {id: 'city', text: 'City' },