This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user