This commit is contained in:
@@ -131,10 +131,11 @@ namespace AyaNova.Biz
|
||||
|
||||
//Show PartRequest fields?
|
||||
po.DisplayPartRequest = false;
|
||||
po.DisplayTaxes = false;
|
||||
|
||||
foreach (PurchaseOrderItem item in po.Items)
|
||||
{
|
||||
|
||||
|
||||
item.DisplayPartNumber = await ct.Part.AsNoTracking().Where(x => x.Id == item.PartId).Select(x => x.PartNumber).SingleAsync();
|
||||
item.DisplayWarehouse = await ct.PartWarehouse.AsNoTracking().Where(x => x.Id == item.PartWarehouseId).Select(x => x.Name).SingleAsync();
|
||||
if (item.WorkorderItemPartRequestId != null)
|
||||
@@ -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
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace AyaNova.Models
|
||||
public long Id { get; set; }
|
||||
public uint Concurrency { get; set; }
|
||||
|
||||
|
||||
|
||||
public long Serial { get; set; }//WAS PO NUMBER
|
||||
public string Notes { get; set; }
|
||||
public string Wiki { get; set; }
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user