This commit is contained in:
@@ -131,6 +131,7 @@ namespace AyaNova.Biz
|
||||
|
||||
//Show PartRequest fields?
|
||||
po.DisplayPartRequest = false;
|
||||
po.DisplayTaxes = false;
|
||||
|
||||
foreach (PurchaseOrderItem item in po.Items)
|
||||
{
|
||||
@@ -149,6 +150,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
tax = await ct.TaxCode.AsNoTracking().Where(x => x.Id == item.PurchaseTaxCodeId).SingleAsync();
|
||||
item.DisplayTaxCode = tax.Name;
|
||||
po.DisplayTaxes = true;
|
||||
}
|
||||
|
||||
//Calculate line totals
|
||||
|
||||
@@ -42,10 +42,12 @@ namespace AyaNova.Models
|
||||
[NotMapped, JsonIgnore]
|
||||
public AyaType AyaType { get => AyaType.PurchaseOrder; }
|
||||
|
||||
[NotMapped]
|
||||
[NotMapped]
|
||||
public bool DisplayWarehouses { get; set; }
|
||||
[NotMapped]
|
||||
[NotMapped]
|
||||
public bool DisplayPartRequest { get; set; }
|
||||
[NotMapped]
|
||||
public bool DisplayTaxes { get; set; }
|
||||
|
||||
}//eoc
|
||||
|
||||
|
||||
@@ -1721,6 +1721,8 @@ 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, 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
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user