This commit is contained in:
2021-02-19 19:30:44 +00:00
parent b34b2d10b5
commit cd1db15fa0
3 changed files with 14 additions and 7 deletions

View File

@@ -1713,14 +1713,16 @@ namespace AyaNova.Util
o.Status = PurchaseOrderStatus.ClosedFullReceived;
o.ReferenceNumber = Fake.Finance.Account(6);
o.VendorMemo = Fake.Lorem.Sentence();
if (Fake.Random.Number(1, 10) == 5)
o.ProjectId = Fake.Random.Long(1, TotalSeededProjects);
if (Fake.Random.Number(1, 10) == 5)
o.ProjectId = Fake.Random.Long(1, TotalSeededProjects);
o.Text1 = Fake.Lorem.Sentence(1, 3);
o.Text2 = Fake.Lorem.Sentence(1, 3);
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, 3) == 2);
for (int y = 0; y < partCount; y++)
{
long partId = 0;
@@ -1730,6 +1732,7 @@ namespace AyaNova.Util
} while (partsAdded.Contains(partId));
partsAdded.Add(partId);
var qty = Fake.Random.Int(1, 100);
o.Items.Add(new PurchaseOrderItem()
{
PartId = partId,
@@ -1739,7 +1742,7 @@ namespace AyaNova.Util
PurchaseOrderCost = 10,
ReceivedCost = 10,
ReceivedDate = o.ExpectedReceiveDate,
PurchaseTaxCodeId = 3//sales and goods
PurchaseTaxCodeId = addTaxCode ? 3 : null//sales and goods
});
}