This commit is contained in:
@@ -106,11 +106,17 @@ namespace AyaNova.Biz
|
||||
{
|
||||
var ret = await ct.PurchaseOrder.Include(z => z.Items).AsNoTracking().SingleOrDefaultAsync(z => z.Id == id);
|
||||
//populate names for client ui
|
||||
var pl = new PickListBiz(ct, UserId, UserTranslationId, CurrentUserRoles);
|
||||
var log = AyaNova.Util.ApplicationLogging.CreateLogger("PurchaseOrderBiz::GetAsync");
|
||||
|
||||
foreach (PurchaseOrderItem item in ret.Items)
|
||||
{
|
||||
item.PartName = await pl.GetTemplatedNameAsync(AyaType.Part, item.PartId, null, log);
|
||||
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.PartRequestedById != null)
|
||||
item.DisplayRequestUser = await ct.User.AsNoTracking().Where(x => x.Id == item.PartRequestedById).Select(x => x.Name).SingleAsync();
|
||||
if (item.WorkorderItemPartRequestId != null)
|
||||
item.DisplayRequestWorkorder = "todo:woidfromleafnode";//MIGRATE_OUTSTANDING routine to get wo id from the woitempartrequestid
|
||||
if (item.PurchaseTaxCodeId != null)
|
||||
item.DisplayTaxCode = await ct.TaxCode.AsNoTracking().Where(x => x.Id == item.PurchaseTaxCodeId).Select(x => x.Name).SingleAsync();
|
||||
}
|
||||
if (logTheGetEvent && ret != null)
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
||||
|
||||
Reference in New Issue
Block a user