|
|
|
@@ -1872,83 +1872,85 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
|
|
|
|
// Utilities.
|
|
|
|
|
public List<StringPair> GetDisplayValues(SbmUserContext userContext)
|
|
|
|
|
{
|
|
|
|
|
SbmConfigConsole configConsole = SbmGlobals.Application.GetConfigConsole(userContext.SessionContext);
|
|
|
|
|
SbmAccountMgr accountMgr = null;
|
|
|
|
|
List<StringPair> lValue = new List<StringPair>();
|
|
|
|
|
// Commodities to exclude.
|
|
|
|
|
if (IncludedIds.Count > 0) lValue.Add("Included commodities", IncludedIds.Count.ToString());
|
|
|
|
|
if (ExcludedIds.Count > 0) lValue.Add("Excluded commodities", ExcludedIds.Count.ToString());
|
|
|
|
|
// Commodity type.
|
|
|
|
|
if (CommodityType > 0) lValue.Add("Type", SbmSystem.GetCodesOfType(userContext, Sbm.SystemCode.CommodityType).GetDescForType(CommodityType, CommodityType.ToString()));
|
|
|
|
|
else if (CommodityType == Sbm.CommodityType.AnyProduct) lValue.Add("Type", "Any product");
|
|
|
|
|
if (StockItemsOnly) lValue.Add("Stock items only", "True");
|
|
|
|
|
// Commodity code.
|
|
|
|
|
if (!StringUtil.IsEmpty(CodeFull)) lValue.Add("Code", CodeFull);
|
|
|
|
|
else if (!StringUtil.IsEmpty(CodePartial)) lValue.Add("Code contains", CodePartial);
|
|
|
|
|
// Drawing number.
|
|
|
|
|
if (!StringUtil.IsEmpty(DrawingNoFull)) lValue.Add("Drawing no", DrawingNoFull);
|
|
|
|
|
else if (!StringUtil.IsEmpty(DrawingNoPartial)) lValue.Add("Drawing no starts", DrawingNoPartial);
|
|
|
|
|
if (!StringUtil.IsEmpty(DrawingIssueFull)) lValue.Add("Drawing issue", DrawingIssueFull);
|
|
|
|
|
else if (!StringUtil.IsEmpty(DrawingIssuePartial)) lValue.Add("Drawing issue starts", DrawingIssuePartial);
|
|
|
|
|
// Commodity description.
|
|
|
|
|
if (!StringUtil.IsEmpty(DescBriefFull)) lValue.Add("Description", DescBriefFull);
|
|
|
|
|
if (!StringUtil.IsEmpty(DescBriefPartial)) lValue.Add("Description starts", DescBriefPartial);
|
|
|
|
|
// Category.
|
|
|
|
|
if (Categories.Count > 0) lValue.Add("Categories", Categories.Concat(","));
|
|
|
|
|
// Catalog reference.
|
|
|
|
|
if (!StringUtil.IsEmpty(CatalogRefPartial)) lValue.Add("Catalog ref start", CatalogRefPartial);
|
|
|
|
|
// Codings.
|
|
|
|
|
if (!StringUtil.IsEmpty(RangeCode)) lValue.Add("Range code", RangeCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(ColourCode)) lValue.Add("Colour code", ColourCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(SourceCode)) lValue.Add("Source code", SourceCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(SupplyMethodCode)) lValue.Add("SupplyMethod code", SupplyMethodCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(HandlingCode)) lValue.Add("Handling code", HandlingCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(DeliveryCode)) lValue.Add("Delivery code", DeliveryCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(MaterialCode)) lValue.Add(configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Commodity_MaterialCode, "Material") + " code", MaterialCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(FinishCode)) lValue.Add(configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Commodity_FinishCode, "Finish") + " code", FinishCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(PromotionCode)) lValue.Add(configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Commodity_PromotionCode, "Promotion") + " code", PromotionCode);
|
|
|
|
|
// Price sets.
|
|
|
|
|
if (PriceSetIdsIncluded.Count > 0) lValue.Add("Included in price sets", PriceSetIdsIncluded.Count.ToString());
|
|
|
|
|
if (PriceSetIdsExcluded.Count > 0) lValue.Add("Excluded from price sets", PriceSetIdsExcluded.Count.ToString());
|
|
|
|
|
// Customer.
|
|
|
|
|
if (SysId.IsValid(AssociationIdCustomer))
|
|
|
|
|
using (SbmConfigConsole configConsole = SbmGlobals.Application.CreateConfigConsole(userContext.SessionContext))
|
|
|
|
|
{
|
|
|
|
|
if (accountMgr == null) accountMgr = SbmGlobals.System.CreateAccountMgr(userContext);
|
|
|
|
|
lValue.Add("Customer", accountMgr.GetAssociationTargetName(AssociationIdCustomer));
|
|
|
|
|
// Commodities to exclude.
|
|
|
|
|
if (IncludedIds.Count > 0) lValue.Add("Included commodities", IncludedIds.Count.ToString());
|
|
|
|
|
if (ExcludedIds.Count > 0) lValue.Add("Excluded commodities", ExcludedIds.Count.ToString());
|
|
|
|
|
// Commodity type.
|
|
|
|
|
if (CommodityType > 0) lValue.Add("Type", SbmSystem.GetCodesOfType(userContext, Sbm.SystemCode.CommodityType).GetDescForType(CommodityType, CommodityType.ToString()));
|
|
|
|
|
else if (CommodityType == Sbm.CommodityType.AnyProduct) lValue.Add("Type", "Any product");
|
|
|
|
|
if (StockItemsOnly) lValue.Add("Stock items only", "True");
|
|
|
|
|
// Commodity code.
|
|
|
|
|
if (!StringUtil.IsEmpty(CodeFull)) lValue.Add("Code", CodeFull);
|
|
|
|
|
else if (!StringUtil.IsEmpty(CodePartial)) lValue.Add("Code contains", CodePartial);
|
|
|
|
|
// Drawing number.
|
|
|
|
|
if (!StringUtil.IsEmpty(DrawingNoFull)) lValue.Add("Drawing no", DrawingNoFull);
|
|
|
|
|
else if (!StringUtil.IsEmpty(DrawingNoPartial)) lValue.Add("Drawing no starts", DrawingNoPartial);
|
|
|
|
|
if (!StringUtil.IsEmpty(DrawingIssueFull)) lValue.Add("Drawing issue", DrawingIssueFull);
|
|
|
|
|
else if (!StringUtil.IsEmpty(DrawingIssuePartial)) lValue.Add("Drawing issue starts", DrawingIssuePartial);
|
|
|
|
|
// Commodity description.
|
|
|
|
|
if (!StringUtil.IsEmpty(DescBriefFull)) lValue.Add("Description", DescBriefFull);
|
|
|
|
|
if (!StringUtil.IsEmpty(DescBriefPartial)) lValue.Add("Description starts", DescBriefPartial);
|
|
|
|
|
// Category.
|
|
|
|
|
if (Categories.Count > 0) lValue.Add("Categories", Categories.Concat(","));
|
|
|
|
|
// Catalog reference.
|
|
|
|
|
if (!StringUtil.IsEmpty(CatalogRefPartial)) lValue.Add("Catalog ref start", CatalogRefPartial);
|
|
|
|
|
// Codings.
|
|
|
|
|
if (!StringUtil.IsEmpty(RangeCode)) lValue.Add("Range code", RangeCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(ColourCode)) lValue.Add("Colour code", ColourCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(SourceCode)) lValue.Add("Source code", SourceCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(SupplyMethodCode)) lValue.Add("SupplyMethod code", SupplyMethodCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(HandlingCode)) lValue.Add("Handling code", HandlingCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(DeliveryCode)) lValue.Add("Delivery code", DeliveryCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(MaterialCode)) lValue.Add(configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Commodity_MaterialCode, "Material") + " code", MaterialCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(FinishCode)) lValue.Add(configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Commodity_FinishCode, "Finish") + " code", FinishCode);
|
|
|
|
|
if (!StringUtil.IsEmpty(PromotionCode)) lValue.Add(configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Commodity_PromotionCode, "Promotion") + " code", PromotionCode);
|
|
|
|
|
// Price sets.
|
|
|
|
|
if (PriceSetIdsIncluded.Count > 0) lValue.Add("Included in price sets", PriceSetIdsIncluded.Count.ToString());
|
|
|
|
|
if (PriceSetIdsExcluded.Count > 0) lValue.Add("Excluded from price sets", PriceSetIdsExcluded.Count.ToString());
|
|
|
|
|
// Customer.
|
|
|
|
|
if (SysId.IsValid(AssociationIdCustomer))
|
|
|
|
|
{
|
|
|
|
|
if (accountMgr == null) accountMgr = SbmGlobals.System.CreateAccountMgr(userContext);
|
|
|
|
|
lValue.Add("Customer", accountMgr.GetAssociationTargetName(AssociationIdCustomer));
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtil.IsEmpty(CustomerName)) lValue.Add("Customer name starts", CustomerName);
|
|
|
|
|
if (!StringUtil.IsEmpty(SupplierName)) lValue.Add("Supplier name starts", SupplierName);
|
|
|
|
|
if (!StringUtil.IsEmpty(SalesOrderRef)) lValue.Add("SO reference starts", SalesOrderRef);
|
|
|
|
|
if (!StringUtil.IsEmpty(PurchaseOrderRef)) lValue.Add("PO reference starts", PurchaseOrderRef);
|
|
|
|
|
|
|
|
|
|
// Transaction.
|
|
|
|
|
if (!StringUtil.IsEmpty(OrderRef)) lValue.Add("Transaction reference", OrderRef);
|
|
|
|
|
|
|
|
|
|
// Stock:
|
|
|
|
|
if (StockLocationFilter == Sbm.LocationFilter.Sales) lValue.Add("Stock location", "Sales locations only");
|
|
|
|
|
else if (StockLocationFilter == Sbm.LocationFilter.Calc) lValue.Add("Stock location", "Calculated locations only");
|
|
|
|
|
else if (StockLocationFilter == Sbm.LocationFilter.All) lValue.Add("Stock location", "All locations");
|
|
|
|
|
if (SysId.IsValid(LocationIdStock)) lValue.Add("Stock location", SysId.ToString(LocationIdStock));
|
|
|
|
|
if (DateUtil.IsValid(StockSoldFrom)) lValue.Add("Stock sold from", DateUtil.Format(StockSoldFrom, "d-MMM-yyyy"));
|
|
|
|
|
if (DateUtil.IsValid(StockSoldTo)) lValue.Add("Stock sold to", DateUtil.Format(StockSoldTo, "d-MMM-yyyy"));
|
|
|
|
|
if (DateUtil.IsValid(ProjectedSalesFrom)) lValue.Add("Proj sales from", DateUtil.Format(ProjectedSalesFrom, "d-MMM-yyyy"));
|
|
|
|
|
if (DateUtil.IsValid(ProjectedSalesTo)) lValue.Add("Proj sales to", DateUtil.Format(ProjectedSalesTo, "d-MMM-yyyy"));
|
|
|
|
|
|
|
|
|
|
if (StockLevelMin > decimal.MinValue) lValue.Add("Stock level >= ", StockLevelMin.ToString("N2"));
|
|
|
|
|
if (StockLevelMax > decimal.MinValue) lValue.Add("Stock level <= ", StockLevelMax.ToString("N2"));
|
|
|
|
|
|
|
|
|
|
// Commodities with definitions for Customer.
|
|
|
|
|
if (SysId.IsValid(AssociationIdCommodityCustomer))
|
|
|
|
|
{
|
|
|
|
|
if (accountMgr == null) accountMgr = SbmGlobals.System.CreateAccountMgr(userContext);
|
|
|
|
|
lValue.Add("Commodity definitions for customer", accountMgr.GetAssociationTargetName(AssociationIdCommodityCustomer));
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtil.IsEmpty(AccountCodeCommodityCustomer))
|
|
|
|
|
lValue.Add("Commodity definitions for customer", AccountCodeCommodityCustomer);
|
|
|
|
|
|
|
|
|
|
// Commodity status category.
|
|
|
|
|
if (StatusCat == StatusCat.Current)
|
|
|
|
|
lValue.Add("Status", "Current");
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtil.IsEmpty(CustomerName)) lValue.Add("Customer name starts", CustomerName);
|
|
|
|
|
if (!StringUtil.IsEmpty(SupplierName)) lValue.Add("Supplier name starts", SupplierName);
|
|
|
|
|
if (!StringUtil.IsEmpty(SalesOrderRef)) lValue.Add("SO reference starts", SalesOrderRef);
|
|
|
|
|
if (!StringUtil.IsEmpty(PurchaseOrderRef)) lValue.Add("PO reference starts", PurchaseOrderRef);
|
|
|
|
|
|
|
|
|
|
// Transaction.
|
|
|
|
|
if (!StringUtil.IsEmpty(OrderRef)) lValue.Add("Transaction reference", OrderRef);
|
|
|
|
|
|
|
|
|
|
// Stock:
|
|
|
|
|
if (StockLocationFilter == Sbm.LocationFilter.Sales) lValue.Add("Stock location", "Sales locations only");
|
|
|
|
|
else if (StockLocationFilter == Sbm.LocationFilter.Calc) lValue.Add("Stock location", "Calculated locations only");
|
|
|
|
|
else if (StockLocationFilter == Sbm.LocationFilter.All) lValue.Add("Stock location", "All locations");
|
|
|
|
|
if (SysId.IsValid(LocationIdStock)) lValue.Add("Stock location", SysId.ToString(LocationIdStock));
|
|
|
|
|
if (DateUtil.IsValid(StockSoldFrom)) lValue.Add("Stock sold from", DateUtil.Format(StockSoldFrom, "d-MMM-yyyy"));
|
|
|
|
|
if (DateUtil.IsValid(StockSoldTo)) lValue.Add("Stock sold to", DateUtil.Format(StockSoldTo, "d-MMM-yyyy"));
|
|
|
|
|
if (DateUtil.IsValid(ProjectedSalesFrom)) lValue.Add("Proj sales from", DateUtil.Format(ProjectedSalesFrom, "d-MMM-yyyy"));
|
|
|
|
|
if (DateUtil.IsValid(ProjectedSalesTo)) lValue.Add("Proj sales to", DateUtil.Format(ProjectedSalesTo, "d-MMM-yyyy"));
|
|
|
|
|
|
|
|
|
|
if (StockLevelMin > decimal.MinValue) lValue.Add("Stock level >= ", StockLevelMin.ToString("N2"));
|
|
|
|
|
if (StockLevelMax > decimal.MinValue) lValue.Add("Stock level <= ", StockLevelMax.ToString("N2"));
|
|
|
|
|
|
|
|
|
|
// Commodities with definitions for Customer.
|
|
|
|
|
if (SysId.IsValid(AssociationIdCommodityCustomer))
|
|
|
|
|
{
|
|
|
|
|
if (accountMgr == null) accountMgr = SbmGlobals.System.CreateAccountMgr(userContext);
|
|
|
|
|
lValue.Add("Commodity definitions for customer", accountMgr.GetAssociationTargetName(AssociationIdCommodityCustomer));
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtil.IsEmpty(AccountCodeCommodityCustomer))
|
|
|
|
|
lValue.Add("Commodity definitions for customer", AccountCodeCommodityCustomer);
|
|
|
|
|
|
|
|
|
|
// Commodity status category.
|
|
|
|
|
if (StatusCat == StatusCat.Current)
|
|
|
|
|
lValue.Add("Status", "Current");
|
|
|
|
|
|
|
|
|
|
// Portfolio:
|
|
|
|
|
//PortfolioIdInclude;
|
|
|
|
|