This commit is contained in:
2021-01-21 19:15:29 +00:00
parent e54a7f60d8
commit 651d3009c3
4 changed files with 23 additions and 9 deletions

View File

@@ -1537,8 +1537,8 @@ namespace AyaNova.Util
throw new System.Exception(err);
}
// 50% chance it has serial numbers
//MIGRATE_OUTSTANDING this is just temporary until inventory is coded fully
PartInventoryBiz PartInventoryBizNess = PartInventoryBiz.GetBiz(ct);
// 50% chance it has serial numbers
if (Fake.Random.Number() == 1)
{
var serialCount = Fake.Random.Number(1, 5);
@@ -1548,6 +1548,13 @@ namespace AyaNova.Util
}
await ct.SaveChangesAsync();
//add inventory to cover serials
await PartInventoryBizNess.CreateAsync(new dtPartInventory() { PartId = NewObject.Id, PartWarehouseId = 1, Quantity = serialCount });
}
else
{
//add random inventory level
await PartInventoryBizNess.CreateAsync(new dtPartInventory() { PartId = NewObject.Id, PartWarehouseId = 1, Quantity = Fake.Random.Number(1, 100) });
}
}
}