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

@@ -131,6 +131,7 @@ namespace AyaNova.Biz
//Show PartRequest fields? //Show PartRequest fields?
po.DisplayPartRequest = false; po.DisplayPartRequest = false;
po.DisplayTaxes = false;
foreach (PurchaseOrderItem item in po.Items) 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(); tax = await ct.TaxCode.AsNoTracking().Where(x => x.Id == item.PurchaseTaxCodeId).SingleAsync();
item.DisplayTaxCode = tax.Name; item.DisplayTaxCode = tax.Name;
po.DisplayTaxes = true;
} }
//Calculate line totals //Calculate line totals

View File

@@ -42,10 +42,12 @@ namespace AyaNova.Models
[NotMapped, JsonIgnore] [NotMapped, JsonIgnore]
public AyaType AyaType { get => AyaType.PurchaseOrder; } public AyaType AyaType { get => AyaType.PurchaseOrder; }
[NotMapped] [NotMapped]
public bool DisplayWarehouses { get; set; } public bool DisplayWarehouses { get; set; }
[NotMapped] [NotMapped]
public bool DisplayPartRequest { get; set; } public bool DisplayPartRequest { get; set; }
[NotMapped]
public bool DisplayTaxes { get; set; }
}//eoc }//eoc

View File

@@ -1721,6 +1721,8 @@ namespace AyaNova.Util
List<long> partsAdded = new List<long>(); List<long> partsAdded = new List<long>();
int partCount = Fake.Random.Int(1, 5); 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++) for (int y = 0; y < partCount; y++)
{ {
long partId = 0; long partId = 0;
@@ -1730,6 +1732,7 @@ namespace AyaNova.Util
} while (partsAdded.Contains(partId)); } while (partsAdded.Contains(partId));
partsAdded.Add(partId); partsAdded.Add(partId);
var qty = Fake.Random.Int(1, 100); var qty = Fake.Random.Int(1, 100);
o.Items.Add(new PurchaseOrderItem() o.Items.Add(new PurchaseOrderItem()
{ {
PartId = partId, PartId = partId,
@@ -1739,7 +1742,7 @@ namespace AyaNova.Util
PurchaseOrderCost = 10, PurchaseOrderCost = 10,
ReceivedCost = 10, ReceivedCost = 10,
ReceivedDate = o.ExpectedReceiveDate, ReceivedDate = o.ExpectedReceiveDate,
PurchaseTaxCodeId = 3//sales and goods PurchaseTaxCodeId = addTaxCode ? 3 : null//sales and goods
}); });
} }