568 lines
36 KiB
C#
568 lines
36 KiB
C#
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Consoles;
|
|
using Sarand.Net.Standard.Base.Bus;
|
|
using Sarand.Net.Standard.Base.Core;
|
|
using Sarand.Net.Standard.Base.ItemOptions;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
|
{
|
|
//=======================================================================
|
|
public partial class SbmAccountMgr
|
|
{
|
|
//*******************************************************************
|
|
// O r g a n i s a t i o n
|
|
//*******************************************************************
|
|
// Logic associated with Owner Orgsniation, eg. Item Options.
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private class OrganisationOptionData
|
|
{
|
|
// Option groups.
|
|
public String OptionGroup_Display { get; } = "Display";
|
|
public String OptionGroup_Control { get; } = "Contol";
|
|
public String OptionGroup_Commodity { get; } = "Commodity";
|
|
public String OptionGroup_Container { get; } = "Container";
|
|
public String OptionGroup_Stock { get; } = "Stock";
|
|
public String OptionGroup_Security { get; } = "Security";
|
|
// Option types.
|
|
public List<TypeCodeDesc> associationOptionTypes { get; } = new List<TypeCodeDesc>();
|
|
// Options contexts.
|
|
public List<CodeDesc> Contexts_Value { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_Folder { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_AllowOption { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_Caption { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_ShowField { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_ShowColumn { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_FieldLabelAssoc { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_ContainerStatus { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_Minutes { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_PeriodDays { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_PeriodWeeks { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_NumericDecimals { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_CommodityType { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Contexts_SalesLocation { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_YesNo { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_Minutes { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_PeriodDays { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_PeriodWeeks { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_Decimals_0To2 { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_Decimals_0To4 { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_CommodityTypes { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_CommodityStatusCat { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_CommodityStockCat { get; } = new List<CodeDesc>();
|
|
public List<CodeDesc> Values_SalesLocation { get; } = new List<CodeDesc>();
|
|
// Option values.
|
|
public String Value_Yes { get; } = "YES";
|
|
public String Value_No { get; } = "NO";
|
|
public String Default_UpdateLimitDaysInPast { get; } = "14";
|
|
public String Default_NumericDecimals { get; } = "2";
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// I t e m O p t i o n D e f i n i t i o n s
|
|
//-------------------------------------------------------------------
|
|
public List<SaItemOptionDfn> GetOrganisationItemOptionDfns(SysId associationId)
|
|
{
|
|
List<SaItemOptionDfn> itemOptionDfns = new List<SaItemOptionDfn>();
|
|
OrganisationOptionData orgOptData = InitOrganisationOptionData();
|
|
|
|
// Association item option types.
|
|
foreach (TypeCodeDesc associationOptionType in orgOptData.associationOptionTypes)
|
|
{
|
|
Sbm.OrganisationOption organisationOption = (Sbm.OrganisationOption)associationOptionType.Type;
|
|
if (IsOptionTypeValidForAssociation(orgOptData, organisationOption))
|
|
{
|
|
SaItemOptionDfn itemOptionDfn = new SaItemOptionDfn();
|
|
itemOptionDfn.Name = associationOptionType.Code;
|
|
itemOptionDfn.DisplayOptions.Caption = associationOptionType.Desc;
|
|
|
|
// Set the display caption for the option.
|
|
itemOptionDfn.DisplayOptions.RequiresContext = true;
|
|
itemOptionDfn.DisplayOptions.NonDisplayTemplate = true;
|
|
itemOptionDfn.DisplayOptions.CanAddOption = true;
|
|
itemOptionDfn.DisplayOptions.CanRemoveOption = true;
|
|
|
|
// Set additional characteristics against option:
|
|
switch (organisationOption)
|
|
{
|
|
case Sbm.OrganisationOption.Value:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Display;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_Value);
|
|
break;
|
|
case Sbm.OrganisationOption.Folder:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Display;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_Folder);
|
|
break;
|
|
case Sbm.OrganisationOption.AllowOption:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Display;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_AllowOption);
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_YesNo);
|
|
itemOptionDfn.DefaultValue = orgOptData.Value_No;
|
|
break;
|
|
case Sbm.OrganisationOption.Caption:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Display;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_Caption);
|
|
break;
|
|
case Sbm.OrganisationOption.ShowField:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Display;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_ShowField);
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_YesNo);
|
|
itemOptionDfn.DefaultValue = orgOptData.Value_No;
|
|
break;
|
|
case Sbm.OrganisationOption.ShowColumn:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Display;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_ShowColumn);
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_YesNo);
|
|
itemOptionDfn.DefaultValue = orgOptData.Value_No;
|
|
break;
|
|
case Sbm.OrganisationOption.FieldLabel:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Display;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_FieldLabelAssoc);
|
|
itemOptionDfn.DisplayOptions.MaxLength = 32;
|
|
break;
|
|
case Sbm.OrganisationOption.StatusCaption_Container:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Container;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_ContainerStatus);
|
|
itemOptionDfn.DisplayOptions.MaxLength = 32;
|
|
break;
|
|
case Sbm.OrganisationOption.Minutes:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Control;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_Minutes);
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_Minutes);
|
|
itemOptionDfn.DefaultValue = orgOptData.Default_UpdateLimitDaysInPast;
|
|
break;
|
|
case Sbm.OrganisationOption.PeriodDays:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Control;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_PeriodDays);
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_PeriodDays);
|
|
itemOptionDfn.DefaultValue = orgOptData.Default_UpdateLimitDaysInPast;
|
|
break;
|
|
case Sbm.OrganisationOption.PeriodWeeks:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Control;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_PeriodWeeks);
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_PeriodWeeks);
|
|
//itemOptionDfn.DefaultValue = sDefaultUpdateLimitWeeksInPast;
|
|
break;
|
|
case Sbm.OrganisationOption.NumericDecimals:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Control;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_NumericDecimals);
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_Decimals_0To4);
|
|
itemOptionDfn.DefaultValue = orgOptData.Default_NumericDecimals;
|
|
break;
|
|
case Sbm.OrganisationOption.CommodityType:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Commodity;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_CommodityType);
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_CommodityTypes);
|
|
break;
|
|
case Sbm.OrganisationOption.CommodityFilterDefaultStatusCat:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Commodity;
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_CommodityStatusCat);
|
|
itemOptionDfn.DisplayOptions.RequiresContext = false;
|
|
break;
|
|
case Sbm.OrganisationOption.CommodityFilterInitialStockCat:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Commodity;
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_CommodityStockCat);
|
|
itemOptionDfn.DisplayOptions.RequiresContext = false;
|
|
break;
|
|
case Sbm.OrganisationOption.SalesLocation:
|
|
itemOptionDfn.DisplayOptions.Group = orgOptData.OptionGroup_Stock;
|
|
itemOptionDfn.DisplayOptions.Contexts.AddRange(orgOptData.Contexts_SalesLocation);
|
|
itemOptionDfn.DisplayOptions.Values.AddRange(orgOptData.Values_SalesLocation);
|
|
break;
|
|
}
|
|
itemOptionDfns.Add(itemOptionDfn);
|
|
}
|
|
}
|
|
|
|
// Additonal organisation options - to support non-standard configuration options:
|
|
itemOptionDfns.AddRange(ConfigConsole.GetAdditionalOrganisationOptions());
|
|
|
|
return itemOptionDfns;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
private bool IsOptionTypeValidForAssociation(OrganisationOptionData orgOptData, Sbm.OrganisationOption organisationOption)
|
|
{
|
|
switch (organisationOption)
|
|
{
|
|
case Sbm.OrganisationOption.Value:
|
|
case Sbm.OrganisationOption.Folder:
|
|
case Sbm.OrganisationOption.AllowOption:
|
|
case Sbm.OrganisationOption.Caption:
|
|
case Sbm.OrganisationOption.ShowField:
|
|
case Sbm.OrganisationOption.ShowColumn:
|
|
case Sbm.OrganisationOption.FieldLabel:
|
|
case Sbm.OrganisationOption.Minutes:
|
|
case Sbm.OrganisationOption.PeriodDays:
|
|
case Sbm.OrganisationOption.PeriodWeeks:
|
|
case Sbm.OrganisationOption.NumericDecimals:
|
|
return true;
|
|
case Sbm.OrganisationOption.CommodityType:
|
|
return AllowConfigOption(Sbm.ConfigOption.AllowCommodities);
|
|
case Sbm.OrganisationOption.CommodityFilterDefaultStatusCat:
|
|
return AllowConfigOption(Sbm.ConfigOption.AllowCommodities) && orgOptData.Values_CommodityStatusCat.Count > 0;
|
|
case Sbm.OrganisationOption.CommodityFilterInitialStockCat:
|
|
return AllowConfigOption(Sbm.ConfigOption.AllowCommodities) && orgOptData.Values_CommodityStockCat.Count > 0;
|
|
case Sbm.OrganisationOption.StatusCaption_Container:
|
|
return StockControlConfig.AllowStockContainers();
|
|
case Sbm.OrganisationOption.SalesLocation:
|
|
return StockControlConfig.AllowStockLocations() && orgOptData.Values_SalesLocation.Count > 0;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
private OrganisationOptionData InitOrganisationOptionData()
|
|
{
|
|
OrganisationOptionData orgOptData = new OrganisationOptionData();
|
|
using (SbmConfigConsole console = SbmGlobals.Application.CreateConfigConsole(UserContext.SessionContext))
|
|
using (SbmAccountsDfn accounts = new SbmAccountsDfn(UserContext))
|
|
{
|
|
// Option types.
|
|
orgOptData.associationOptionTypes.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.AssociationOption));
|
|
|
|
// Yes/No.
|
|
orgOptData.Values_YesNo.Add(orgOptData.Value_Yes, "Yes");
|
|
orgOptData.Values_YesNo.Add(orgOptData.Value_No, "No");
|
|
|
|
// Organisation configuration.
|
|
bool bAllowContacts = (AllowConfigOption(Sbm.ConfigOption.AllowContacts));
|
|
bool bAllowCustomers = (AllowAssociationType(Sbm.AssociationType.Customer));
|
|
bool bAllowStockists = (AllowAssociationType(Sbm.AssociationType.Stockist));
|
|
bool bAllowFinanceAgencies = (AllowAssociationType(Sbm.AssociationType.FinanceAgency));
|
|
bool bAllowCommodities = (AllowConfigOption(Sbm.ConfigOption.AllowCommodities));
|
|
bool bAllowVehicles = (AllowConfigOption(Sbm.ConfigOption.AllowVehicles));
|
|
bool bAllowAssets = (AllowConfigOption(Sbm.ConfigOption.AllowAssets));
|
|
bool bAllowTransactions = (AllowConfigOption(Sbm.ConfigOption.AllowTransactions));
|
|
bool bAllowSalesOrders = ((AllowTransactionType(Sbm.TransactionType.SalesOrder) || AllowTransactionType(Sbm.TransactionType.ProformaSalesOrder)));
|
|
bool bAllowSalesDispatches = (AllowTransactionType(Sbm.TransactionType.SalesDispatch));
|
|
bool bAllowSalesInvoices = ((AllowTransactionType(Sbm.TransactionType.SalesInvoice) || AllowTransactionType(Sbm.TransactionType.ProformaSalesInvoice)));
|
|
bool bAllowPurchaseOrders = ((AllowTransactionType(Sbm.TransactionType.PurchaseOrder) || AllowTransactionType(Sbm.TransactionType.ProformaPurchaseOrder)));
|
|
bool bAllowInterfaces = (console.AllowInterfaces(UserContext));
|
|
bool bAllowInterfaces_File = (bAllowInterfaces && console.AllowInterfaceCategory(UserContext, SaInterfaceCategory.File));
|
|
|
|
// Values:
|
|
List<TypeCodeDesc> orgOptionValues = SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_Value);
|
|
if (bAllowTransactions)
|
|
{
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.MaxTransactionsQueriedForEmptyFilter));
|
|
if (CodeTypeHasCodes(Sbm.ApplCodeType.CommodityPromotion))
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.AlternativePromotionText));
|
|
if (console.GetRequirementCostingConfig(UserContext).AllowRequirementCosting(Sbm.TransactionType.SalesOrder))
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.CostLabourRateDefault));
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.CommoditiesAllowedNegativePrice));
|
|
if (AllowConfigOption(Sbm.ConfigOption.TransactionSplitTimes))
|
|
{
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.TransTimeChunk1Caption));
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.TransTimeChunk2Caption));
|
|
}
|
|
// Default Email content.
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.EmailSubject));
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.EmailBody));
|
|
}
|
|
if (accounts.IsUsingSageInterface())
|
|
{
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.DefaultSalesCarriageNominal));
|
|
orgOptData.Contexts_Value.Add(orgOptionValues.GetCodeDescForType(Sbm.OrgOption_Value.DefaultPurchaseCarriageNominal));
|
|
}
|
|
|
|
// Folders:
|
|
List<TypeCodeDesc> lOrgOptionFolder = SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_Folder);
|
|
if (bAllowCommodities)
|
|
{
|
|
orgOptData.Contexts_Folder.Add(lOrgOptionFolder.GetCodeDescForType(Sbm.OrgOption_Folder.CommodityImage));
|
|
orgOptData.Contexts_Folder.Add(lOrgOptionFolder.GetCodeDescForType(Sbm.OrgOption_Folder.CommodityBarcodeImage));
|
|
}
|
|
|
|
// Allow option contexts:
|
|
List<TypeCodeDesc> lAllowOption = SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_AllowOption);
|
|
if (bAllowContacts)
|
|
{
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.UpdateAssociationCode));
|
|
if (bAllowCustomers)
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.CustomerAccountDetails));
|
|
if (bAllowStockists)
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.StockistAssociations));
|
|
if (bAllowFinanceAgencies)
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.FinanceAgencyAssociations));
|
|
}
|
|
if (bAllowCommodities)
|
|
{
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.Commodity_SalesBudget));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.Commodity_PartialCodeFilter));
|
|
if (bAllowTransactions)
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.Commodity_EditHistoryItem));
|
|
}
|
|
if (bAllowTransactions)
|
|
{
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.TransactionFilter_AnyStatus));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.TransactionFilter_RetainRef));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.TransactionFilter_RetainRefExt));
|
|
if (bAllowInterfaces_File)
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.TransactionExport_FixedContent));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.Order_BillingAddress));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.OrderItem_ModifyCommodityDescription));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.OrderItem_ShowCommodityDetails));
|
|
if (StockControlConfig.AllowStockControl())
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.OrderItem_ShowStockDetails));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.Transaction_RetainCurrentViewOnRaise));
|
|
}
|
|
if (bAllowSalesOrders)
|
|
{
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.SalesOrder_OnHold));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.SalesOrder_ReplacementOrders));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.SalesOrder_DispatchDetails));
|
|
if (bAllowSalesInvoices)
|
|
{
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.SalesOrder_PartialInvoice));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.SalesOrder_RaiseInvoiceOnCompletion));
|
|
}
|
|
}
|
|
if (bAllowSalesOrders && bAllowPurchaseOrders)
|
|
{
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.PurchaseItem_AssociatedSalesItems));
|
|
}
|
|
if (StockControlConfig.AllowStockControl())
|
|
{
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.ImminentStock));
|
|
if (StockControlConfig.AllowStockContainers())
|
|
{
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.ManageContainerMovemements));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.AwaitingContainersInImminentStock));
|
|
}
|
|
}
|
|
if (bAllowAssets)
|
|
{
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.Asset_Sale));
|
|
orgOptData.Contexts_AllowOption.Add(lAllowOption.GetCodeDescForType(Sbm.OrgOption_AllowOption.Asset_Rental));
|
|
}
|
|
|
|
// Caption contexts:
|
|
orgOptData.Contexts_Caption.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_Caption));
|
|
|
|
// Show field contexts.
|
|
// NB This list must be kept up to date with equivalent in 'SapphireConsole::DisplayAttribute':
|
|
List<TypeCodeDesc> lShowField = SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_ShowField);
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Association_AnnualSalesTarget))
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_AnnualSalesTarget));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Address_LastVisitOn))
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Address_LastVisitOn));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_DrawingIssue));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_DrawingNo));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_Department));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_CatalogRef));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_Volume));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_Density));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_BoxQuantity));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_ICNTariffCode));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Commodity_PlaceOfOrigin))
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_PlaceOfOrigin));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Commodity_MaterialCost))
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_MaterialCost));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Commodity_ExWorksCost))
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_ExWorksCost));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Commodity_RetailPricePlanned))
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_RetailPricePlanned));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Commodity_CarriageCostIndicative))
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_CarriageCostIndicative));
|
|
if (StockControlConfig.AllowStockControl())
|
|
{
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.StockLevel_Bay1));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.StockLevel_Bay2));
|
|
orgOptData.Contexts_ShowField.Add(lShowField.GetCodeDescForType(SbmDbDfn.ColumnIdx.StockLevel_Bay3));
|
|
}
|
|
|
|
// Show column contexts:
|
|
List<TypeCodeDesc> lShowColumn = SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_ShowColumn);
|
|
if (bAllowSalesOrders)
|
|
{
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Association_AnnualSalesTarget))
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Association_AnnualSalesTarget));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Association_Trans_LastSaleRaised));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Association_Trans_SalesValue_Open));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Association_Trans_SalesValue_Cytd));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Association_Trans_SalesValue_Lcy));
|
|
}
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Association_Group))
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Association_Group));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Commodity_CatalogRef));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Commodity_Weight));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Commodity_PackQtySale));
|
|
if (StockControlConfig.AllowStockControl())
|
|
{
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Commodity_StockAllocated));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Commodity_StockLevelSales));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Commodity_StockAvailable));
|
|
}
|
|
if ((bAllowSalesOrders || bAllowPurchaseOrders) && StockControlConfig.AllowStockControl())
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Order_AllocationInd));
|
|
if (bAllowSalesOrders && CodeTypeHasCodes(Sbm.ApplCodeType.DeliveryCourier))
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.SalesOrder_DeliveryCourier));
|
|
if (bAllowSalesOrders || bAllowSalesInvoices)
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.SalesOrder_HasInvoice));
|
|
if (bAllowSalesInvoices)
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Transaction_ContactArea));
|
|
if (bAllowSalesInvoices && accounts.IsTransactionTypeManagedByAccounts(Sbm.TransactionType.SalesInvoice))
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Accounts_InvoiceRef));
|
|
if ((bAllowSalesOrders || bAllowPurchaseOrders) && StockControlConfig.AllowStockControl())
|
|
{
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.OrderItem_AllocationInd));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.OrderItem_Stock_Current));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.OrderItem_Stock_Available));
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.OrderItem_Stock_BySalesLocation));
|
|
}
|
|
if (bAllowSalesDispatches)
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.SalesOrderItem_QtyDispatched));
|
|
if (bAllowSalesInvoices)
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.SalesOrderItem_QtyInvoiced));
|
|
// Check for processes:
|
|
if (ProcessMgr.HasProcesses(Sbm.ProcessCategory.Commodity))
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.SalesOrderItem_NextProcess));
|
|
// Check for vehicles:
|
|
if (bAllowVehicles)
|
|
orgOptData.Contexts_ShowColumn.Add(lShowColumn.GetCodeDescForType(Sbm.OrgOption_ShowColumn.Vehicle_KeyLocation));
|
|
|
|
// Field label contexts:
|
|
List<TypeCodeDesc> lFieldLabel = SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_FieldLabel);
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_CatalogRef));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_Dimensions));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_ICNTariffCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_CostPrice));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Commodity_PlaceOfOrigin))
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_PlaceOfOrigin));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_MaterialCost));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_CurrencyIdMaterial));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Commodity_ExWorksCost))
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_ExWorksCost));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Commodity_CurrencyIdExWorks))
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_CurrencyIdExWorks));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_SpecSummary));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_MaterialCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_FinishCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_DescDetail));
|
|
if (ColumnExists(SbmDbDfn.ColumnIdx.Commodity_RetailPricePlanned))
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Commodity_RetailPricePlanned));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Affiliate_Abbrev));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Affiliate_Nature));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_Location));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_AccountManagerCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_AccountHandlerCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_AccountTypeCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_AccountRatingCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_ContactAreaCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_ContactHandlerCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_ContactMethodCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Association_ContactCallCycleCode));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Transaction_Ref));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.Transaction_RefExt));
|
|
if (StockControlConfig.AllowStockControl())
|
|
{
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.StockLevel_Bay1));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.StockLevel_Bay2));
|
|
orgOptData.Contexts_FieldLabelAssoc.Add(lFieldLabel.GetCodeDescForType(SbmDbDfn.ColumnIdx.StockLevel_Bay3));
|
|
}
|
|
|
|
// Commodity status filter.
|
|
List<TypeCodeDesc> lCmdStatusCat = SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.CommodityStatusCat);
|
|
orgOptData.Values_CommodityStatusCat.Add(lCmdStatusCat.GetCodeDescForType(SbmCommodity.StatusCat.Any));
|
|
orgOptData.Values_CommodityStatusCat.Add(lCmdStatusCat.GetCodeDescForType(SbmCommodity.StatusCat.Current));
|
|
|
|
// Commodity Stock Category filter.
|
|
List<CodeDesc> commodityCategories = GetCodeDescsForCodeType(Sbm.ApplCodeType.CommodityCategory, true);
|
|
orgOptData.Values_CommodityStockCat.AddRange(commodityCategories);
|
|
|
|
// Container status caption.
|
|
if (CommodityMgr.ContainerDatabaseIsValid && StockControlConfig.AllowStockContainers())
|
|
orgOptData.Contexts_ContainerStatus.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_ContainerStatusCaption));
|
|
|
|
// Generic options:
|
|
orgOptData.Contexts_Minutes.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_Minutes));
|
|
orgOptData.Contexts_PeriodDays.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_PeriodDays));
|
|
orgOptData.Contexts_PeriodWeeks.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_PeriodWeeks));
|
|
|
|
// Minutes.
|
|
for (int iMins = 0; iMins <= 30; iMins++)
|
|
orgOptData.Values_Minutes.Add(iMins.ToString(), iMins.ToString() + " min" + (iMins == 1 ? "" : "s"));
|
|
|
|
// Period - days.
|
|
orgOptData.Values_PeriodDays.Add("1", "1 day");
|
|
orgOptData.Values_PeriodDays.Add("2", "2 days");
|
|
orgOptData.Values_PeriodDays.Add("3", "3 days");
|
|
orgOptData.Values_PeriodDays.Add("7", "1 week");
|
|
orgOptData.Values_PeriodDays.Add("14", "2 weeks");
|
|
orgOptData.Values_PeriodDays.Add("21", "3 weeks");
|
|
orgOptData.Values_PeriodDays.Add("30", "30 days");
|
|
orgOptData.Values_PeriodDays.Add("60", "60 days");
|
|
orgOptData.Values_PeriodDays.Add("90", "90 days");
|
|
orgOptData.Values_PeriodDays.Add("120", "120 days");
|
|
orgOptData.Values_PeriodDays.Add("150", "150 days");
|
|
orgOptData.Values_PeriodDays.Add("300", "300 days");
|
|
|
|
// Period - weeks.
|
|
orgOptData.Values_PeriodWeeks.Add("0", "0 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("1", "1 week");
|
|
orgOptData.Values_PeriodWeeks.Add("2", "2 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("3", "3 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("4", "4 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("5", "5 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("6", "6 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("7", "7 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("8", "8 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("9", "9 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("10", "10 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("11", "11 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("12", "12 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("13", "13 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("14", "14 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("15", "15 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("16", "16 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("17", "17 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("18", "18 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("19", "19 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("20", "20 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("21", "21 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("22", "22 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("23", "23 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("24", "24 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("25", "25 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("26", "26 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("27", "27 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("28", "28 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("29", "29 weeks");
|
|
orgOptData.Values_PeriodWeeks.Add("30", "30 weeks");
|
|
|
|
// Numeric Decimals:
|
|
orgOptData.Contexts_NumericDecimals.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_NumericDecimals));
|
|
orgOptData.Values_Decimals_0To2.Add("0", "None");
|
|
orgOptData.Values_Decimals_0To2.Add("1", "1 places");
|
|
orgOptData.Values_Decimals_0To2.Add("2", "2 places");
|
|
orgOptData.Values_Decimals_0To4.Add("0", "None");
|
|
orgOptData.Values_Decimals_0To4.Add("1", "1 places");
|
|
orgOptData.Values_Decimals_0To4.Add("2", "2 places");
|
|
orgOptData.Values_Decimals_0To4.Add("3", "3 places");
|
|
orgOptData.Values_Decimals_0To4.Add("4", "4 places");
|
|
|
|
// Commodity types.
|
|
orgOptData.Contexts_CommodityType.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.CommodityType));
|
|
orgOptData.Values_CommodityTypes.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.CommodityType));
|
|
|
|
// Sales locations.
|
|
orgOptData.Contexts_SalesLocation.AddRange(SbmSystem.GetCodesOfType(UserContext, Sbm.SystemCode.OrgOption_StockLocation));
|
|
SbmLocation.Params prmLocation = new SbmLocation.Params();
|
|
prmLocation.RestrictToSalesStock = true;
|
|
prmLocation.StatusCat = SbmLocation.StatusCat.ActiveOnly;
|
|
foreach (SbmLocation location in StockMgr.GetLocationList(prmLocation))
|
|
orgOptData.Values_SalesLocation.Add(SysId.ToString(location.Id), location.Name);
|
|
}
|
|
|
|
return orgOptData;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|