mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
Add autoincrementing asset tags to the import if the CSV column is empty
This commit is contained in:
parent
b52c00d49b
commit
9f0ecba9b9
|
@ -55,6 +55,11 @@ class AssetImporter extends ItemImporter
|
||||||
{
|
{
|
||||||
$editingAsset = false;
|
$editingAsset = false;
|
||||||
$asset_tag = $this->findCsvMatch($row, 'asset_tag');
|
$asset_tag = $this->findCsvMatch($row, 'asset_tag');
|
||||||
|
|
||||||
|
if(empty($asset_tag)){
|
||||||
|
$asset_tag = Asset::autoincrement_asset();
|
||||||
|
}
|
||||||
|
|
||||||
$asset = Asset::where(['asset_tag'=> $asset_tag])->first();
|
$asset = Asset::where(['asset_tag'=> $asset_tag])->first();
|
||||||
if ($asset) {
|
if ($asset) {
|
||||||
if (! $this->updating) {
|
if (! $this->updating) {
|
||||||
|
|
Loading…
Reference in a new issue