This commit is contained in:
2021-01-19 00:53:49 +00:00
parent 247c600e15
commit 4e15728207
6 changed files with 66 additions and 5 deletions

View File

@@ -1522,7 +1522,7 @@ namespace AyaNova.Util
o.Retail = o.Cost * 1.2m;
o.UnitOfMeasure = "each";
//This seems wrong to do in a loop but is 4 times faster this way ?!?
using (AyContext ct = ServiceProviderProvider.DBContext)
@@ -1536,6 +1536,19 @@ namespace AyaNova.Util
log.LogError(err);
throw new System.Exception(err);
}
// 50% chance it has serial numbers
//MIGRATE_OUTSTANDING this is just temporary until inventory is coded fully
if (Fake.Random.Number() == 1)
{
var serialCount = Fake.Random.Number(1, 5);
for (int y = 0; y < serialCount; y++)
{
await ct.PartSerial.AddAsync(new PartSerial() { PartId = NewObject.Id, Serial = Fake.Finance.Account().ToString() + y.ToString() });
}
await ct.SaveChangesAsync();
}
}
}
}