511 lines
34 KiB
C#
511 lines
34 KiB
C#
using Sarand.BusinessMgr.Net.Standard.Base.Core;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
|
using Sarand.Net.Standard.Base.App;
|
|
using Sarand.Net.Standard.Base.Core;
|
|
using Sarand.Net.Standard.Base.Utils;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
|
{
|
|
//=======================================================================
|
|
public abstract partial class SbmSystem : SacsSystem
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private static short assetCommodityTypeAllowed = -1;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Extended logging options.
|
|
public enum ExtendedLogginOption
|
|
{
|
|
SecurityProfile,
|
|
DbQueryExecution,
|
|
Printing,
|
|
}
|
|
public static readonly String ExtendedLogging_SecurityProfile = "SecurityProfile";
|
|
public static readonly String ExtendedLogging_DbQueryExecution = "DbQueryExecution";
|
|
public static readonly String ExtendedLogging_Printing = "Printing";
|
|
private List<String> extendedLoggingOptions;
|
|
|
|
public object StringList { get; }
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction - use derived objects.
|
|
protected SbmSystem(PropertySet properties)
|
|
{
|
|
// Configure extended logging.
|
|
extendedLoggingOptions = StringListUtil.Split(properties.GetPropertyValue("Logging", "ExtendedLogging"));
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Application definitions.
|
|
public static Sbm.ConfigConsole GetConfigConsoleType(String consoleProperty)
|
|
{
|
|
if (consoleProperty.ContainsCI("Sarand"))
|
|
return Sbm.ConfigConsole.Sarand;
|
|
if (consoleProperty.ContainsCI("MPE"))
|
|
return Sbm.ConfigConsole.MPE;
|
|
if (consoleProperty.ContainsCI("BPE"))
|
|
return Sbm.ConfigConsole.BPE;
|
|
if (consoleProperty.ContainsCI("Cadix") || consoleProperty.ContainsCI("CUL"))
|
|
return Sbm.ConfigConsole.Cadix;
|
|
return Sbm.ConfigConsole.Generic;
|
|
}
|
|
public static String GetCopyrightNotice(bool html = false)
|
|
{
|
|
return (html ? "©" : "(c)") + "2002- " + DateTime.Today.Year + "Sarand Ltd";
|
|
}
|
|
public static bool IsSysAdminSession()
|
|
{
|
|
// Dev mode.
|
|
if (IsDevHost()) return true;
|
|
// Production servers.
|
|
if (UserName.ContainsCI("Sarand"))
|
|
{
|
|
if (ComputerName.EqualsCI("SS-APP-S1")) return true;
|
|
if (ComputerName.EqualsCI("SS-APP-S2")) return true;
|
|
if (ComputerName.EqualsCI("SS-APP-LG1")) return true;
|
|
}
|
|
// Development.
|
|
if (ComputerName.ContainsCI("Sarand")) return true;
|
|
return false;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// S y s t e m C o d e s
|
|
//-------------------------------------------------------------------
|
|
private static String GetOwnerOption_Caption(ISbmUserContext userContext, Sbm.OrgOption_Caption orgOption_Caption, String defaultValue)
|
|
{
|
|
// In case user context not specified, eg. Security Console initialising list of transaction types before user logged in.
|
|
if (userContext != null)
|
|
return userContext.GetOwnerOption_Caption(orgOption_Caption, defaultValue);
|
|
return defaultValue;
|
|
}
|
|
public static List<TypeCodeDesc> GetCodesOfType(ISbmUserContext userContext, Sbm.SystemCode systemCode)
|
|
{
|
|
SbmConfigConsole configConsole = null; // SbmGlobals.GetConfigConsole(userContext.SessionContext);
|
|
switch (systemCode)
|
|
{
|
|
case Sbm.SystemCode.ItemType:
|
|
return new List<TypeCodeDesc>(itemTypes);
|
|
case Sbm.SystemCode.AffiliateType:
|
|
return new List<TypeCodeDesc>(affiliateTypes);
|
|
case Sbm.SystemCode.AssociationType:
|
|
return new List<TypeCodeDesc>(associationTypes);
|
|
case Sbm.SystemCode.TransactionType:
|
|
// Transaction types.
|
|
return new List<TypeCodeDesc>()
|
|
{
|
|
new TypeCodeDesc((int) Sbm.TransactionType.Project, "PRO", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_Project, "Project")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.SalesLead, "SLD", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesLead, "Sales Lead")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.SalesQuote, "SQT", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesQuote, "Sales Quote")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.SalesPO, "SPO", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesPO, "Sales Purchase Order")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.ProformaSalesOrder, "SAP", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_ProformaSalesOrder, "Proforma Sales Order")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.SalesOrder, "SAL", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesOrder, "Sales Order")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.SalesDispatch, "SDP", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesDispatch, "Sales Dispatch")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.ProformaSalesInvoice, "PSI", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_ProformaSalesInvoice, "Proforma Sales Invoice")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.SalesInvoice, "SAI", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_SalesInvoice, "Sales Invoice")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.PurchaseQuote, "PQT", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseQuote, "Purchase Quote")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.PurchaseSO, "PSO", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseSO, "Purchase Sales Order")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.ProformaPurchaseOrder, "PUP", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_ProformaPurchaseOrder, "Proforma Purchase Order")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.PurchaseOrder, "PUR", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseOrder, "Purchase Order")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.PurchaseDelivery, "PDL", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseDelivery, "Purchase Delivery")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.ProformaPurchaseInvoice, "PPI", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_ProformaPurchaseInvoice, "Proforma Purchase Invoice")),
|
|
new TypeCodeDesc((int)Sbm.TransactionType.PurchaseInvoice, "PUI", GetOwnerOption_Caption(userContext, Sbm.OrgOption_Caption.TransType_PurchaseInvoice, "Purchase Invoice")),
|
|
};
|
|
case Sbm.SystemCode.TransactionStatusCat:
|
|
return new List<TypeCodeDesc>(transactionStatusCats);
|
|
case Sbm.SystemCode.RequirementType:
|
|
return new List<TypeCodeDesc>(requirementTypes);
|
|
case Sbm.SystemCode.TaskCodeType:
|
|
return new List<TypeCodeDesc>(taskCodeTypes);
|
|
case Sbm.SystemCode.RequirementStatusCat:
|
|
return new List<TypeCodeDesc>(requirementStatusCats);
|
|
case Sbm.SystemCode.ConstituentType:
|
|
return new List<TypeCodeDesc>(constituentTypes);
|
|
case Sbm.SystemCode.ConstituentStatusCat:
|
|
return new List<TypeCodeDesc>(constituentStatusCats);
|
|
case Sbm.SystemCode.ItemLinkData:
|
|
return new List<TypeCodeDesc>(itemLinkDatas);
|
|
case Sbm.SystemCode.PortfolioItemType:
|
|
return new List<TypeCodeDesc>(portfolioItemTypes);
|
|
case Sbm.SystemCode.LocationCategory:
|
|
return new List<TypeCodeDesc>(locationCategories);
|
|
case Sbm.SystemCode.LocationFilter:
|
|
return new List<TypeCodeDesc>(locationFilters);
|
|
case Sbm.SystemCode.ContainerCategory:
|
|
return new List<TypeCodeDesc>(containerCategories);
|
|
case Sbm.SystemCode.ContainerType:
|
|
return new List<TypeCodeDesc>(containerTypes);
|
|
case Sbm.SystemCode.CommodityType:
|
|
{
|
|
// CommodityType.
|
|
List<TypeCodeDesc> CommodityType = new List<TypeCodeDesc>();
|
|
CommodityType.Add(Sbm.CommodityType.Stock, "STK", "Stock");
|
|
CommodityType.Add(Sbm.CommodityType.NonStock, "NST", "Non-stock");
|
|
CommodityType.Add(Sbm.CommodityType.Service, "SRV", "Service");
|
|
if (assetCommodityTypeAllowed < 0)
|
|
{
|
|
// ToDo SbmSystem assetCommodityTypeAllowed
|
|
|
|
using (SbmAssetMgr assetMgr = SbmGlobals.System.CreateAssetMgr(userContext))
|
|
{
|
|
//assetCommodityTypeAllowed = assetMgr != null && assetMgr.DatabaseIsValid();
|
|
}
|
|
}
|
|
if (assetCommodityTypeAllowed > 0)
|
|
CommodityType.Add(Sbm.CommodityType.Asset, "AST", "Asset");
|
|
return CommodityType;
|
|
}
|
|
case Sbm.SystemCode.CommodityStatusCat:
|
|
return new List<TypeCodeDesc>(commodityStatusCats);
|
|
case Sbm.SystemCode.MovementType:
|
|
return new List<TypeCodeDesc>(movementTypes);
|
|
case Sbm.SystemCode.StockLevelType:
|
|
return new List<TypeCodeDesc>(stockLevelTypes);
|
|
case Sbm.SystemCode.StockLevelSource:
|
|
return new List<TypeCodeDesc>(stockLevelSources);
|
|
case Sbm.SystemCode.AddressType:
|
|
return new List<TypeCodeDesc>(addressTypes);
|
|
case Sbm.SystemCode.SysParamCategory:
|
|
return new List<TypeCodeDesc>(sysParamCategories);
|
|
case Sbm.SystemCode.ProcessCategory:
|
|
{
|
|
List<TypeCodeDesc> ProcessCategory = new List<TypeCodeDesc>();
|
|
if (configConsole != null)
|
|
{
|
|
if (configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities))
|
|
ProcessCategory.Add(Sbm.ProcessCategory.Commodity, "CMD", "Commodity");
|
|
if (configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowAssets))
|
|
ProcessCategory.Add(Sbm.ProcessCategory.Asset, "ASSET", "Asset");
|
|
}
|
|
return ProcessCategory;
|
|
}
|
|
case Sbm.SystemCode.ProcessType:
|
|
return new List<TypeCodeDesc>(processTypes);
|
|
case Sbm.SystemCode.PaymentType:
|
|
return new List<TypeCodeDesc>(paymentTypes);
|
|
case Sbm.SystemCode.AssetIncomeType:
|
|
return new List<TypeCodeDesc>(assetIncomeTypes);
|
|
case Sbm.SystemCode.AssetType:
|
|
return new List<TypeCodeDesc>(assetTypes);
|
|
case Sbm.SystemCode.VehicleType:
|
|
return new List<TypeCodeDesc>(vehicleTypes);
|
|
case Sbm.SystemCode.VehicleEventType:
|
|
return new List<TypeCodeDesc>(vehicleEventTypes);
|
|
case Sbm.SystemCode.VehicleFeatureSource:
|
|
return new List<TypeCodeDesc>(vVehicleFeatureSources);
|
|
case Sbm.SystemCode.VehicleFeatureType:
|
|
return new List<TypeCodeDesc>(vehicleFeatureTypes);
|
|
case Sbm.SystemCode.VehicleOptionType:
|
|
return new List<TypeCodeDesc>(vehicleOptionTypes);
|
|
case Sbm.SystemCode.VehicleTransType:
|
|
return new List<TypeCodeDesc>(vehicleTransTypes);
|
|
case Sbm.SystemCode.FuelType:
|
|
return new List<TypeCodeDesc>(fuelTypes);
|
|
case Sbm.SystemCode.OdometerUnits:
|
|
return new List<TypeCodeDesc>(odometerUnits);
|
|
case Sbm.SystemCode.DiscountType:
|
|
return new List<TypeCodeDesc>(discountTypes);
|
|
case Sbm.SystemCode.DiscountMarkup:
|
|
return new List<TypeCodeDesc>(discountMarkups);
|
|
case Sbm.SystemCode.RegionType:
|
|
return new List<TypeCodeDesc>(regionTypes);
|
|
case Sbm.SystemCode.UnitMeasureCategory:
|
|
return new List<TypeCodeDesc>(unitMeasureCategories);
|
|
case Sbm.SystemCode.UnitMeasureType:
|
|
return new List<TypeCodeDesc>(unitMeasureTypes);
|
|
case Sbm.SystemCode.FinancialType:
|
|
{
|
|
List<TypeCodeDesc> FinancialType = new List<TypeCodeDesc>();
|
|
if (configConsole != null)
|
|
{
|
|
if (configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowCommodities))
|
|
FinancialType.Add(Sbm.FinancialType.CommoditySupply, "CmdSup", "Commodity supply");
|
|
}
|
|
FinancialType.Add(Sbm.FinancialType.CommoditySales, "CmdSal", "Commodity sales");
|
|
return FinancialType;
|
|
}
|
|
case Sbm.SystemCode.PriceType:
|
|
return new List<TypeCodeDesc>(priceTypes);
|
|
case Sbm.SystemCode.PriceCalcMethod:
|
|
return new List<TypeCodeDesc>(priceCalcMethods);
|
|
case Sbm.SystemCode.PriceRounderMethod:
|
|
return new List<TypeCodeDesc>(priceRounderMethods);
|
|
case Sbm.SystemCode.PriceRounderDirection:
|
|
return new List<TypeCodeDesc>(priceRounderDirections);
|
|
case Sbm.SystemCode.SystemAccountType:
|
|
return new List<TypeCodeDesc>(systemAccountTypes);
|
|
case Sbm.SystemCode.ItemStatus:
|
|
return new List<TypeCodeDesc>(itemStatuses);
|
|
case Sbm.SystemCode.EventStatus:
|
|
return new List<TypeCodeDesc>(eventStatuses);
|
|
case Sbm.SystemCode.AssociationTab:
|
|
return new List<TypeCodeDesc>(associationTabs);
|
|
case Sbm.SystemCode.InterfaceType_Website:
|
|
{
|
|
// Interface types - Website.
|
|
// Duplicate static list and remove unsupported options.
|
|
List<TypeCodeDesc> codes = new List<TypeCodeDesc>(interfaceTypes_Website);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.Website, (short)(Sbm.InterfaceType_Website.WebStore)))
|
|
interfaceTypes_Website.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_Website.WebStore);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.Website, (short)(Sbm.InterfaceType_Website.JoomlaVirtueMart)))
|
|
interfaceTypes_Website.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_Website.JoomlaVirtueMart);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.Website, (short)(Sbm.InterfaceType_Website.MiMoWeb)))
|
|
interfaceTypes_Website.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_Website.MiMoWeb);
|
|
return new List<TypeCodeDesc>(codes);
|
|
}
|
|
case Sbm.SystemCode.InterfaceType_Accounts:
|
|
{
|
|
// Interface Type - Accounts.
|
|
// Duplicate static list and remove unsupported options.
|
|
List<TypeCodeDesc> codes = new List<TypeCodeDesc>(interfaceTypes_Accounts);
|
|
return new List<TypeCodeDesc>(codes);
|
|
}
|
|
case Sbm.SystemCode.InterfaceType_System:
|
|
{
|
|
// Interface Type - System.
|
|
// Duplicate static list and remove unsupported options.
|
|
List<TypeCodeDesc> codes = new List<TypeCodeDesc>(interfaceTypes_System);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.MSOutlook))
|
|
interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.MSOutlook);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.PostcodeAnywhere))
|
|
interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.PostcodeAnywhere);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Bac))
|
|
interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Bac);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Pvh))
|
|
interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Pvh);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Cap))
|
|
interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Cap);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Hpi))
|
|
interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Hpi);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Anchor_OrderFulfilment))
|
|
interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Anchor_OrderFulfilment);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Argos))
|
|
interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Argos);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Homebase))
|
|
interfaceTypes_System.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_System.Cadix_OrderSpreadsheet_Homebase);
|
|
return new List<TypeCodeDesc>(codes);
|
|
}
|
|
case Sbm.SystemCode.InterfaceType_File:
|
|
{
|
|
// Interface Type - File.
|
|
// Duplicate static list and remove unsupported options.
|
|
List<TypeCodeDesc> codes = new List<TypeCodeDesc>(interfaceTypes_File);
|
|
if (configConsole == null || !configConsole.AllowInterface(userContext, SaInterfaceCategory.System, (short)Sbm.InterfaceType_File.LeasewayInvoice))
|
|
codes.RemoveAll(item => item.Type == (int)Sbm.InterfaceType_File.LeasewayInvoice);
|
|
return new List<TypeCodeDesc>(codes);
|
|
}
|
|
case Sbm.SystemCode.InterfaceDataType:
|
|
return new List<TypeCodeDesc>(interfaceDataTypes);
|
|
case Sbm.SystemCode.ItemDataType:
|
|
return new List<TypeCodeDesc>(itemDataTypes);
|
|
case Sbm.SystemCode.OrgOption_Value:
|
|
return new List<TypeCodeDesc>(orgOption_Values);
|
|
case Sbm.SystemCode.OrgOption_Folder:
|
|
return new List<TypeCodeDesc>(orgOption_Folders);
|
|
case Sbm.SystemCode.OrgOption_Minutes:
|
|
return new List<TypeCodeDesc>(OrgOption_Minutes);
|
|
case Sbm.SystemCode.OrgOption_PeriodDays:
|
|
{
|
|
List<TypeCodeDesc> OrgOption_PeriodDays = new List<TypeCodeDesc>();
|
|
|
|
OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.TransactionDatesInFuture, "TransDatesInFut", "Days in future that transaction dates can be set", "");
|
|
OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.UpdateClosedTransaction, "UpdClosedTrans", "Grace period (days) for updating closed transactions", "Period after transaction closure during which updates are allowed (0-30 days)");
|
|
if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.AllowDeliveryPlanning))
|
|
OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.UpdateClosedTransaction_DispatchDetails, "UpdDisDetCloTrans", "Grace period (days) for updating dispatch details on closed order", "Period after transaction closure during which dispatch updates are allowed (0-30 days)");
|
|
if (configConsole != null && configConsole.GetStockControlConfig(userContext).AllowStockControl())
|
|
OrgOption_PeriodDays.Add(Sbm.OrgOption_PeriodDays.UpdateStockLevelsInPast, "UpdStkLvlInPast", "Update stock levels in past");
|
|
return OrgOption_PeriodDays;
|
|
}
|
|
case Sbm.SystemCode.OrgOption_PeriodWeeks:
|
|
{
|
|
List<TypeCodeDesc> OrgOption_PeriodWeeks = new List<TypeCodeDesc>();
|
|
if (configConsole != null && configConsole.AllowOption(userContext, Sbm.ConfigOption.TimeRecording))
|
|
{
|
|
OrgOption_PeriodWeeks.Add(Sbm.OrgOption_PeriodWeeks.Timesheets, "Timesheets", "Weeks of timesheets to list (default 8)");
|
|
OrgOption_PeriodWeeks.Add(Sbm.OrgOption_PeriodWeeks.UpdateTimeRecords_Control, "UpdTimeRecsCtrl", "Weeks in past for admin user to update time records (default 2)");
|
|
}
|
|
OrgOption_PeriodWeeks.Add(Sbm.OrgOption_PeriodWeeks.ImminentStockDue, "ImminStkDue", "Weeks of due stock to treat as imminent", "Weeks for which stock due is treated as imminent (0-12 weeks, default: 0)");
|
|
return OrgOption_PeriodWeeks;
|
|
}
|
|
case Sbm.SystemCode.OrgOption_AllowOption:
|
|
return new List<TypeCodeDesc>(orgOption_AllowOptions);
|
|
case Sbm.SystemCode.OrgOption_Caption:
|
|
{
|
|
List<TypeCodeDesc> OrgOption_Caption = new List<TypeCodeDesc>();
|
|
if (configConsole != null)
|
|
{
|
|
// Transaction type captions.
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.Project))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_Project, "Project", "Transaction type - Project");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesLead))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesLead, "SalLead", "Transaction type - Sales Lead");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesQuote))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesQuote, "SalQuote", "Transaction type - Sales quote");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesPO))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesPO, "SalPO", "Transaction type - Sales PO");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaSalesOrder))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_ProformaSalesOrder, "SalPfOrder", "Transaction type - sales proforma order");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesOrder))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesOrder, "SalOrder", "Transaction type - sales order");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesDispatch))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesDispatch, "SalDispatch", "Transaction type - Sales dispatch");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaSalesInvoice))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_ProformaSalesInvoice, "SalPfInvoice", "Transaction type - Proforma sales invoice");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesInvoice))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_SalesInvoice, "SalInvoice", "Transaction type - Sales invoice");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseQuote))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseQuote, "PurQuote", "Transaction type - Purchase quote");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseSO))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseSO, "PurSO", "Transaction type - Purchase SO");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseOrder))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_ProformaPurchaseOrder, "PurPfOrder", "Transaction type - Purchase proforma order");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseOrder))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseOrder, "PurOrder", "Transaction type - Purchase order");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseDelivery))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseDelivery, "PurDelivery", "Transaction type - Purchase Delivery");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseInvoice))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_ProformaPurchaseInvoice, "PurPfInvoice", "Transaction type - Proforma Purchase invoice");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseInvoice))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.TransType_PurchaseInvoice, "PurInvoice", "Transaction type - Purchase invoice");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.Project))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_Projects, "MnuOptProject", "Caption - Projects menu option");
|
|
// Menu option captions:
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesLead))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesLeads, "MnuOptSalLead", "Caption - Sales leads menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesPO))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesPOs, "MnuOptSalPO", "Caption - Sales POs menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesQuote))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesQuotes, "MnuOptSalQuote", "Caption - Sales quotes menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaSalesOrder))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_ProformaSalesOrders, "MnuOptSalPfOrder", "Caption - Proforma sales orders menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesOrder))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesOrders, "MnuOptSalOrder", "Caption - Sales orders menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesDispatch))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesDispatches, "MnuOptSalDispatch", "Caption - Sales dispatches menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaSalesInvoice))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_ProformaSalesInvoices, "MnuOptSalPfInvoice", "Caption - Proforma sales invoices menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.SalesInvoice))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_SalesInvoices, "MnuOptSalInvoice", "Caption - Sales invoices menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseQuote))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseQuotes, "MnuOptPurQuote", "Caption - Purchase quotes menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseSO))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseSOs, "MnuOptPurSO", "Caption - Purchase SOs menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseOrder))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_ProformaPurchaseOrders, "MnuOptPurPfOrder", "Caption - Proforma purchase orders menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseOrder))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseOrders, "MnuOptPurOrder", "Caption - Purchase orders menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseDelivery))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseDeliveries, "MnuOptPurDelivery", "Caption - Purchase Deliveries menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.ProformaPurchaseInvoice))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_ProformaPurchaseInvoices, "MnuOptPurPfInvoice", "Caption - Proforma purchase invoices menu option");
|
|
if (configConsole.AllowTransactionType(userContext, Sbm.TransactionType.PurchaseInvoice))
|
|
OrgOption_Caption.Add(Sbm.OrgOption_Caption.MenuOpt_PurchaseInvoices, "MnuOptPurInvoice", "Caption - Purchase invoices menu option");
|
|
}
|
|
return OrgOption_Caption;
|
|
}
|
|
case Sbm.SystemCode.OrgOption_ShowColumn:
|
|
{
|
|
List<TypeCodeDesc> OrgOption_ShowColumn = new List<TypeCodeDesc>();
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_AnnualSalesTarget, "Association:AnnualSalesTarget", "Association: Annual sales target");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Trans_LastSaleRaised, "Association:Trans:LastSaleRaised", "Association: Last SO raised");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Trans_SalesValue_Open, "Association:Trans:SalesValue:Open", "Association: SO value: Open");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Trans_SalesValue_Cytd, "Association:Trans:SalesValue:Cytd", "Association: SO value: YTD");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Trans_SalesValue_Lcy, "Association:Trans:SalesValue:Lcy", "Association: SO value: LCY");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Association_Group, "Association:Group", "Association: Group");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_CatalogRef, "Commodity:CatalogRef", "Commodity: Catalog reference");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_Weight, "Commodity:Weight", "Commodity: Weight");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_PackQtySale, "Commodity:PackQtySale", "Commodity: Pack qty - sale");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_StockAllocated, "Commodity:StockAllocated", "Commodity: Allocated stock");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_StockLevelSales, "Commodity:StockLevelSales", "Commodity: Stock level (Sales)");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Commodity_StockAvailable, "Commodity:StockAvailable", "Commodity: Available stock");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Order_AllocationInd, "Order:AllocationInd", "Order: Allocation indicator");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrder_DeliveryCourier, "SalesOrder:DeliveryCourier", "Order: Delivery courier");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrder_HasInvoice, "SalesOrder:HasInvoice", "Order: Has invoice flag");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Transaction_ContactArea, "Transaction:ContactArea", "Transaction: " + configConsole.GetAttributeCaption(userContext, SbmDbDfn.ColumnIdx.Association_ContactAreaCode, "Contact area"));
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Accounts_InvoiceRef, "Accounts:InvoiceRef", "Accounts: Invoice reference");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.OrderItem_AllocationInd, "OrderItem:AllocationInd", "Order item: Allocation indicator");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.OrderItem_Stock_Current, "OrderItem:StockCurrent", "Order item: Stock current");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.OrderItem_Stock_Available, "OrderItem:StockAvailable", "Order item: Stock available");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.OrderItem_Stock_BySalesLocation, "OrderItem:StockBySalesLocation", "Order item: Stock by sales location");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrderItem_QtyDispatched, "SalesOrderItem:QuantityDispatched", "Sales order item: qty dispatched");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrderItem_QtyInvoiced, "SalesOrderItem:QuantityInvoiced", "Sales order item: qty invoiced");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.SalesOrderItem_NextProcess, "SalesOrderItem:NextProcess", "Sales order item: Next process");
|
|
OrgOption_ShowColumn.Add(Sbm.OrgOption_ShowColumn.Vehicle_KeyLocation, "Vehicle:KeyLocation", "Vehicle: Key location");
|
|
return OrgOption_ShowColumn;
|
|
}
|
|
case Sbm.SystemCode.OrgOption_ShowField:
|
|
return new List<TypeCodeDesc>(orgOption_ShowFields);
|
|
case Sbm.SystemCode.OrgOption_FieldLabel:
|
|
return new List<TypeCodeDesc>(orgOption_FieldLabels);
|
|
case Sbm.SystemCode.OrgOption_TransactionCreationStatus:
|
|
return new List<TypeCodeDesc>(orgOption_TransactionCreationStatuses);
|
|
case Sbm.SystemCode.OrgOption_ContainerStatusCaption:
|
|
return new List<TypeCodeDesc>(orgOption_ContainerStatusCaptions);
|
|
case Sbm.SystemCode.OrgOption_NumericDecimals:
|
|
return new List<TypeCodeDesc>(orgOption_NumericDecimals);
|
|
case Sbm.SystemCode.OrgOption_CommodityType:
|
|
return new List<TypeCodeDesc>(orgOption_CommodityTypes);
|
|
case Sbm.SystemCode.OrgOption_StockLocation:
|
|
return new List<TypeCodeDesc>(orgOption_StockLocations);
|
|
case Sbm.SystemCode.OrgOption_TaxCodeColumn:
|
|
return new List<TypeCodeDesc>(orgOption_TaxCodeColumns);
|
|
case Sbm.SystemCode.OrgOption_SystemUserRight:
|
|
return new List<TypeCodeDesc>(orgOption_SystemUserRights);
|
|
case Sbm.SystemCode.SystemUserOption:
|
|
return new List<TypeCodeDesc>(systemUserOptions);
|
|
case Sbm.SystemCode.AssociationOption:
|
|
return new List<TypeCodeDesc>(associationOptions);
|
|
case Sbm.SystemCode.InterfaceOption:
|
|
return new List<TypeCodeDesc>(interfaceOptions);
|
|
case Sbm.SystemCode.InterfaceOption_WebFlag:
|
|
return new List<TypeCodeDesc>(interfaceOption_WebFlags);
|
|
case Sbm.SystemCode.InterfaceOption_WebUploadData:
|
|
return new List<TypeCodeDesc>(interfaceOption_WebUploadDatas);
|
|
case Sbm.SystemCode.InterfaceOption_WebUploadMethod:
|
|
return new List<TypeCodeDesc>(interfaceOption_WebUploadMethods);
|
|
case Sbm.SystemCode.InterfaceOption_WebDownloadData:
|
|
return new List<TypeCodeDesc>(interfaceOption_WebDownloadDatas);
|
|
case Sbm.SystemCode.InterfaceOption_WebDownloadMethod:
|
|
return new List<TypeCodeDesc>(interfaceOption_WebDownloadMethods);
|
|
case Sbm.SystemCode.FileInterface_RowColValue:
|
|
return new List<TypeCodeDesc>(fileInterface_RowColValues);
|
|
case Sbm.SystemCode.FileInterface_Mode:
|
|
return new List<TypeCodeDesc>(fileInterface_Modes);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// D a t a M a n a g e r s
|
|
//-------------------------------------------------------------------
|
|
public abstract SbmAccountMgr CreateAccountMgr(ISbmUserContext userContext);
|
|
public abstract SbmAssetMgr CreateAssetMgr(ISbmUserContext userContext);
|
|
public abstract SbmCommodityMgr CreateCommodityMgr(ISbmUserContext userContext);
|
|
public abstract SbmPriceMgr CreatePriceMgr(ISbmUserContext userContext);
|
|
public abstract SbmDataItemMgr CreateDataItemMgr(ISbmUserContext userContext);
|
|
public abstract SbmProcessMgr CreateProcessMgr(ISbmUserContext userContext);
|
|
public abstract SbmStockMgr CreateStockMgr(ISbmUserContext userContext);
|
|
public abstract SbmTransactionMgr CreateTransactionMgr(ISbmUserContext userContext);
|
|
|
|
//-------------------------------------------------------------------
|
|
// A p p l i c a t i o n P r o p e r t i e s
|
|
//-------------------------------------------------------------------
|
|
public bool IsExtendedLogging(ExtendedLogginOption extendedLoggingOption)
|
|
{
|
|
if (extendedLoggingOptions == null) return false;
|
|
if (extendedLoggingOption == ExtendedLogginOption.SecurityProfile)
|
|
return extendedLoggingOptions.ContainsCI(ExtendedLogging_SecurityProfile);
|
|
if (extendedLoggingOption == ExtendedLogginOption.DbQueryExecution)
|
|
return extendedLoggingOptions.ContainsCI(ExtendedLogging_DbQueryExecution);
|
|
if (extendedLoggingOption == ExtendedLogginOption.Printing)
|
|
return extendedLoggingOptions.ContainsCI(ExtendedLogging_Printing);
|
|
return false;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
} |