This commit is contained in:
@@ -1576,9 +1576,10 @@ namespace AyaNova.Util
|
||||
//
|
||||
public async Task SeedPartAsync(ILogger log, int count, int maxQuantity)
|
||||
{
|
||||
todo: need to have a few partstocklevel entries for testing, maybe here, maybe in known seed data or I guess part must exist first so...
|
||||
//maybe just do the first X number with restock values higher than in stock values??
|
||||
//or seed known parts??
|
||||
|
||||
//for testing purposes make a quarter (approx) of parts that are lower than restock level
|
||||
int PartStockLevelParts = count / 4;
|
||||
Console.WriteLine($"SEEDER PartStockLevelParts is {PartStockLevelParts}");
|
||||
|
||||
for (int x = 0; x < count; x++)
|
||||
{
|
||||
@@ -1665,6 +1666,13 @@ namespace AyaNova.Util
|
||||
}
|
||||
}
|
||||
|
||||
if (PartStockLevelParts > 0)
|
||||
{
|
||||
PartStockLevelParts--;
|
||||
List<PartStockLevel> partStockLevels = new List<PartStockLevel>();
|
||||
partStockLevels.Add(new PartStockLevel() { PartWarehouseId = 1, PartId = NewObject.Id, MinimumQuantity = OpeningInventoryLevel * 2 });
|
||||
await biz.PutStockLevelsAsync(NewObject.Id, partStockLevels);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user