This commit is contained in:
2021-02-25 16:03:16 +00:00
parent 6358a94fd3
commit d70b1f3066
4 changed files with 38 additions and 3 deletions

View File

@@ -1742,6 +1742,9 @@ namespace AyaNova.Util
List<long> partsAdded = new List<long>();
int partCount = Fake.Random.Int(1, 5);
//simulate some items without tax codes
bool addTaxCode = (Fake.Random.Number(1, 4) != 3);
@@ -1761,6 +1764,19 @@ namespace AyaNova.Util
var qty = Fake.Random.Int(1, 100);
var cost = Fake.Random.Decimal(1, 25);
// 50% chance it has received serial numbers
string serials = string.Empty;
if (isReceived && Fake.Random.Number() == 1)
{
var serialStart = Fake.Finance.Account().ToString();
for (int si = 0; si < qty; si++)
{
serials += serialStart + si.ToString() + ", ";
}
serials = serials.TrimEnd().TrimEnd(',');
}
o.Items.Add(new PurchaseOrderItem()
{
PartId = partId,
@@ -1770,7 +1786,8 @@ namespace AyaNova.Util
PurchaseOrderCost = cost,
ReceivedCost = isReceived ? cost : 0,
ReceivedDate = isReceived ? o.ExpectedReceiveDate : null,
PurchaseTaxCodeId = addTaxCode ? 3 : null//sales and goods
PurchaseTaxCodeId = addTaxCode ? 3 : null,//sales and goods
Serials = serials
});
}