Portal application - initial.

This commit is contained in:
2021-07-08 20:50:46 +01:00
parent 13c79a8da4
commit 01ae03ddfc
1208 changed files with 186342 additions and 1690 deletions
@@ -280,13 +280,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
{
// Only populated when needed as reads Code Types from db.
contexts_StockCategoryAction = new List<CodeDesc>();
codes_StockCategoryAction = SbmGlobals.GetCodeTypeConsole(UserContext).GetCodeDescsForCodeType(SbmSystem.GetCodeTypeCode(Sbm.ApplCodeType.CommodityCategory));
foreach (CodeDesc commodityCategory in codes_StockCategoryAction)
using (SaCodeTypeConsole codeTypeConsole = SbmGlobals.Application.CreateCodeTypeConsole(UserContext))
{
// Ignore categories where code is same as description.
// We're only interested in the ones which have been given a description.
if (commodityCategory.Code.EqualsCI(commodityCategory.Desc)) continue;
contexts_StockCategoryAction.Add(commodityCategory);
codes_StockCategoryAction = codeTypeConsole.GetCodeDescsForCodeType(SbmSystem.GetCodeTypeCode(Sbm.ApplCodeType.CommodityCategory));
foreach (CodeDesc commodityCategory in codes_StockCategoryAction)
{
// Ignore categories where code is same as description.
// We're only interested in the ones which have been given a description.
if (commodityCategory.Code.EqualsCI(commodityCategory.Desc)) continue;
contexts_StockCategoryAction.Add(commodityCategory);
}
}
}
return new List<CodeDesc>(contexts_StockCategoryAction);
@@ -329,6 +329,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
// Data members.
private readonly Data data = new Data();
public static readonly Byte Flag_Prospect = 0x01;
public static readonly Byte Flag_KeepLoggedIn_Portal = 0x02;
public static readonly Byte Flag_KeepLoggedIn_Control = 0x03;
//-------------------------------------------------------------------
// Construction.
@@ -697,6 +699,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
get { return GetFlag(Flag_Prospect); }
set { SetFlag(Flag_Prospect, value); }
}
public bool KeepLoggedIn_Portal
{
get { return GetFlag(Flag_KeepLoggedIn_Portal); }
set { SetFlag(Flag_KeepLoggedIn_Portal, value); }
}
public bool KeepLoggedIn_Control
{
get { return GetFlag(Flag_KeepLoggedIn_Control); }
set { SetFlag(Flag_KeepLoggedIn_Control, value); }
}
//-------------------------------------------------------------------
// A s s o c i a t e d D a t a E l e m e n t s
+75 -73
View File
@@ -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;
@@ -857,9 +857,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
// Nov-08 Current thinking is that the only differences is whether the 'In Progress' date has been specified and whether that should be used in preference to the 'Raised' date.
if (DateUtil.IsValid(inProgress) && (transactionStatusCat == SbmTransaction.StatusCat.Open || transactionStatusCat == SbmTransaction.StatusCat.Closed))
{
SbmConfigConsole configConsole = SbmGlobals.GetConfigConsole(userContext.SessionContext);
if (configConsole != null && configConsole.UseInProgressTaxDateAsTaxPoint(userContext, transactionType))
return inProgress;
using (SbmConfigConsole configConsole = SbmGlobals.Application.CreateConfigConsole(userContext.SessionContext))
{
if (configConsole != null && configConsole.UseInProgressTaxDateAsTaxPoint(userContext, transactionType))
return inProgress;
}
}
// Otherwise, use 'Raised' date.
if (DateUtil.IsValid(raised))