This commit is contained in:
@@ -123,19 +123,23 @@ namespace AyaNova.Biz
|
|||||||
//
|
//
|
||||||
private async Task SetDisplayFields(PurchaseOrder po)
|
private async Task SetDisplayFields(PurchaseOrder po)
|
||||||
{
|
{
|
||||||
|
//NOTE: This expects to run AFTER bizActions have been performed
|
||||||
if (po == null) return;
|
if (po == null) return;
|
||||||
|
|
||||||
//populate server fields for client ui
|
//populate server fields for client ui
|
||||||
//Show Warehouses
|
//Show Warehouses
|
||||||
po.DisplayWarehouses = await ct.PartWarehouse.CountAsync() > 1;
|
po.DisplayWarehouses = await ct.PartWarehouse.CountAsync() > 1;
|
||||||
|
|
||||||
//Show PartRequest fields?
|
//default hidden and show when traverse items if applicable
|
||||||
po.DisplayPartRequest = false;
|
po.DisplayPartRequest = false;
|
||||||
po.DisplayTaxes = false;
|
po.DisplayTaxes = false;
|
||||||
|
po.DisplayReceived = false;
|
||||||
|
po.DisplayVendorNumber = false;
|
||||||
|
|
||||||
foreach (PurchaseOrderItem item in po.Items)
|
foreach (PurchaseOrderItem item in po.Items)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
item.DisplayPartNumber = await ct.Part.AsNoTracking().Where(x => x.Id == item.PartId).Select(x => x.PartNumber).SingleAsync();
|
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();
|
item.DisplayWarehouse = await ct.PartWarehouse.AsNoTracking().Where(x => x.Id == item.PartWarehouseId).Select(x => x.Name).SingleAsync();
|
||||||
if (item.WorkorderItemPartRequestId != null)
|
if (item.WorkorderItemPartRequestId != null)
|
||||||
@@ -153,6 +157,12 @@ namespace AyaNova.Biz
|
|||||||
po.DisplayTaxes = true;
|
po.DisplayTaxes = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(item.VendorPartNumber))
|
||||||
|
po.DisplayVendorNumber = true;
|
||||||
|
|
||||||
|
if (item.QuantityReceived > 0)
|
||||||
|
po.DisplayReceived = true;
|
||||||
|
|
||||||
//Calculate line totals
|
//Calculate line totals
|
||||||
if (item.QuantityOrdered != 0 && item.PurchaseOrderCost != 0)
|
if (item.QuantityOrdered != 0 && item.PurchaseOrderCost != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ namespace AyaNova.Models
|
|||||||
public bool DisplayPartRequest { get; set; }
|
public bool DisplayPartRequest { get; set; }
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public bool DisplayTaxes { get; set; }
|
public bool DisplayTaxes { get; set; }
|
||||||
|
[NotMapped]
|
||||||
|
public bool DisplayReceived { get; set; }
|
||||||
|
[NotMapped]
|
||||||
|
public bool DisplayVendorNumber { get; set; }
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user