mirror of
https://github.com/snipe/snipe-it.git
synced 2026-03-29 20:04:21 +00:00
Small fixes for asset tag regeneration script
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
@ -60,7 +60,7 @@ class RegenerateAssetTags extends Command
|
||||
}
|
||||
|
||||
foreach ($total_assets as $asset) {
|
||||
$start_tag++;
|
||||
|
||||
$output['info'][] = 'Asset tag:'.$asset->asset_tag;
|
||||
$asset->asset_tag = $settings->auto_increment_prefix.$settings->auto_increment_prefix.$start_tag;
|
||||
|
||||
@ -72,8 +72,15 @@ class RegenerateAssetTags extends Command
|
||||
|
||||
// Use forceSave here to override model level validation
|
||||
$asset->forceSave();
|
||||
$start_tag++;
|
||||
if ($bar) {
|
||||
$bar->advance();
|
||||
}
|
||||
}
|
||||
|
||||
$settings->next_auto_tag_base = Asset::zerofill($start_tag, $settings->zerofill_count);
|
||||
$settings->save();
|
||||
|
||||
$bar->finish();
|
||||
$this->info("\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user