mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge pull request #12617 from kenchan0130/patch-12249
Fixed #12249: fix csv importer for serial_number field
This commit is contained in:
commit
1ccedf6426
|
@ -90,7 +90,7 @@ class ItemImporter extends Importer
|
||||||
$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;
|
||||||
$this->item['serial'] = $this->findCsvMatch($row, 'serial number');
|
$this->item['serial'] = $this->findCsvMatch($row, 'serial');
|
||||||
// NO need to call this method if we're running the user import.
|
// NO need to call this method if we're running the user import.
|
||||||
// TODO: Merge these methods.
|
// TODO: Merge these methods.
|
||||||
$this->item['checkout_class'] = $this->findCsvMatch($row, 'checkout_class');
|
$this->item['checkout_class'] = $this->findCsvMatch($row, 'checkout_class');
|
||||||
|
@ -222,11 +222,11 @@ 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['notes'] = $this->findCsvMatch($row, 'model_notes');
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
$asset_model->update($item);
|
$asset_model->update($item);
|
||||||
$asset_model->save();
|
$asset_model->save();
|
||||||
$this->log('Asset Model Updated');
|
$this->log('Asset Model Updated');
|
||||||
|
|
Loading…
Reference in a new issue