Add autoincrementing asset tags to the import if the CSV column is empty

This commit is contained in:
Ivan Nieto Vivanco 2022-08-03 12:48:48 -05:00
parent b52c00d49b
commit 9f0ecba9b9

View file

@ -55,6 +55,11 @@ class AssetImporter extends ItemImporter
{
$editingAsset = false;
$asset_tag = $this->findCsvMatch($row, 'asset_tag');
if(empty($asset_tag)){
$asset_tag = Asset::autoincrement_asset();
}
$asset = Asset::where(['asset_tag'=> $asset_tag])->first();
if ($asset) {
if (! $this->updating) {