protected virtual decimal GetQty <TField>(InventoryMapValue inventoryValue) where TField : IBqlField { INLocationStatus ls = inventoryValue?.LocationStatus; if (ls != null) { return((decimal?)Base.Caches <INLocationStatus>().GetValue <TField>(ls) ?? 0m); } else { INSiteStatus ws = inventoryValue?.SiteStatus; return((decimal?)Base.Caches <INSiteStatus>().GetValue <TField>(ws) ?? 0m); } }
protected override void FillInventoryMatrixItem(EntryMatrix newRow, int colAttributeIndex, InventoryMapValue inventoryValue) { if (inventoryValue?.InventoryID == null) { return; } var item = InventoryItem.PK.Find(Base, inventoryValue.InventoryID); if (!IsItemStatusDisabled(item)) { newRow.InventoryIDs[colAttributeIndex] = inventoryValue.InventoryID; try { newRow.Quantities[colAttributeIndex] = GetQty(Header.Current.SiteID, inventoryValue.InventoryID); } catch (PXSetPropertyException exception) { newRow.InventoryIDs[colAttributeIndex] = null; newRow.Errors[colAttributeIndex] = exception.Message; } } else { string label = PXStringListAttribute.GetLocalizedLabel <InventoryItem.itemStatus>(Base.Caches <InventoryItem>(), item); newRow.Errors[colAttributeIndex] = PXLocalizer.LocalizeFormat(Messages.InventoryItemIsInStatus, label); } }
protected override void FillInventoryMatrixItem(EntryMatrix newRow, int colAttributeIndex, InventoryMapValue inventoryValue) { newRow.InventoryIDs[colAttributeIndex] = inventoryValue?.InventoryID; newRow.Selected[colAttributeIndex] = (inventoryValue?.InventoryID != null); }
protected override void FillInventoryMatrixItem(EntryMatrix newRow, int colAttributeIndex, InventoryMapValue inventoryValue) { newRow.InventoryIDs[colAttributeIndex] = inventoryValue?.InventoryID; switch (Header.Current.DisplayPlanType) { case PlanType.Available: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyAvail>(inventoryValue); break; case PlanType.AvailableforShipment: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyHardAvail>(inventoryValue); break; case PlanType.NotAvailable: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyNotAvail>(inventoryValue); break; case PlanType.SOBooked: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtySOBooked>(inventoryValue); break; case PlanType.SOShipped: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtySOShipped>(inventoryValue); break; case PlanType.SOShipping: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtySOShipping>(inventoryValue); break; case PlanType.SOBackOrdered: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtySOBackOrdered>(inventoryValue); break; case PlanType.InAssemblyDemand: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyINAssemblyDemand>(inventoryValue); break; case PlanType.INIssues: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyINIssues>(inventoryValue); break; case PlanType.INReceipts: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyINReceipts>(inventoryValue); break; case PlanType.InTransit: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyInTransit>(inventoryValue); break; case PlanType.PurchasePrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOPrepared>(inventoryValue); break; case PlanType.PurchaseOrders: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOOrders>(inventoryValue); break; case PlanType.POReceipts: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOReceipts>(inventoryValue); break; case PlanType.SOtoPurchase: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtySOFixed>(inventoryValue); break; case PlanType.PurchaseforSO: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOFixedOrders>(inventoryValue); break; case PlanType.PurchaseforSOPrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOFixedPrepared>(inventoryValue); break; case PlanType.PurchaseReceiptsForSO: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOFixedReceipts>(inventoryValue); break; case PlanType.SOtoDropShip: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtySODropShip>(inventoryValue); break; case PlanType.DropShipforSO: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPODropShipOrders>(inventoryValue); break; case PlanType.DropShipforSOPrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPODropShipPrepared>(inventoryValue); break; case PlanType.DropShipforSOReceipts: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPODropShipReceipts>(inventoryValue); break; case PlanType.InAssemblySupply: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyINAssemblySupply>(inventoryValue); break; case PlanType.OnHand: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyOnHand>(inventoryValue); break; case PlanType.Expired: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyExpired>(inventoryValue); break; case PlanType.FSSrvOrdPrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyFSSrvOrdPrepared>(inventoryValue); break; case PlanType.FSSrvOrdBooked: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyFSSrvOrdBooked>(inventoryValue); break; case PlanType.FSSrvOrdAllocated: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyFSSrvOrdAllocated>(inventoryValue); break; case PlanType.FixedFSSrvOrd: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyFixedFSSrvOrd>(inventoryValue); break; case PlanType.POFixedFSSrvOrd: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOFixedFSSrvOrd>(inventoryValue); break; case PlanType.POFixedFSSrvOrdPrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOFixedFSSrvOrdPrepared>(inventoryValue); break; case PlanType.POFixedFSSrvOrdReceipts: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOFixedFSSrvOrdReceipts>(inventoryValue); break; case PlanType.InTransitToProduction: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyInTransitToProduction>(inventoryValue); break; case PlanType.ProductionSupplyPrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProductionSupplyPrepared>(inventoryValue); break; case PlanType.ProductionSupply: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProductionSupply>(inventoryValue); break; case PlanType.POFixedProductionPrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOFixedProductionPrepared>(inventoryValue); break; case PlanType.POFixedProductionOrders: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyPOFixedProductionOrders>(inventoryValue); break; case PlanType.ProductionDemandPrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProductionDemandPrepared>(inventoryValue); break; case PlanType.ProductionDemand: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProductionDemand>(inventoryValue); break; case PlanType.ProductionAllocated: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProductionAllocated>(inventoryValue); break; case PlanType.SOFixedProduction: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtySOFixedProduction>(inventoryValue); break; case PlanType.ProdFixedPurchase: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProdFixedPurchase>(inventoryValue); break; case PlanType.ProdFixedProduction: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProdFixedProduction>(inventoryValue); break; case PlanType.ProdFixedProdOrdersPrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProdFixedProdOrdersPrepared>(inventoryValue); break; case PlanType.ProdFixedProdOrders: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProdFixedProdOrders>(inventoryValue); break; case PlanType.ProdFixedSalesOrdersPrepared: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProdFixedSalesOrdersPrepared>(inventoryValue); break; case PlanType.ProdFixedSalesOrders: newRow.Quantities[colAttributeIndex] = GetQty <INSiteStatus.qtyProdFixedSalesOrders>(inventoryValue); break; default: throw new PXArgumentException(nameof(Header.Current.DisplayPlanType)); } }
protected abstract void FillInventoryMatrixItem(EntryMatrix newRow, int colAttributeIndex, InventoryMapValue inventoryValue);