Files
BusinessMgr-2019/SaBusMgrStandardBase/Base/Bus/SbmStockControlConfig.cs
T
2021-05-05 21:00:33 +01:00

89 lines
3.0 KiB
C#

using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Core;
using System;
namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
{
//=======================================================================
public class SbmStockControlConfig
{
//-------------------------------------------------------------------
// Data members.
protected bool allowCommodityStock = false;
protected bool allowStockLocations = false;
protected bool allowStockContainers = false;
// Stock control logic.
protected bool allocateByProductionQuantity = false;
protected bool actionByDispatchedQuantity = false;
// Status at which Transactions should be automatically allocated.
// Unknown: no automatic allocation.
protected SaStatus status_AutomaticStockAllocation_SalesOrder = SaStatus.Unknown;
protected SaStatus status_AutomaticStockAllocation_PurchaseOrder = SaStatus.Unknown;
// Period to display stock events on Stock Control view [min: 90].
protected int stockEventsDisplayDaysInPast = 90;
// Stock display options:
// Apr2015 MPE [default: false]
protected bool showStockHistoryTabOnCommodityView = false;
// May2015 MPE [default: false]
protected bool showStockBaysColOnCommodityView = false;
// Apr2015 MPE Hide all 3 location columns on Stock History. [default: false]
protected bool hideStockEventsPanelLocations = false;
//-------------------------------------------------------------------
// Contruction.
public SbmStockControlConfig()
{
// Default version allows no Stock Control. See SapphireConsole for correct context.
}
//-------------------------------------------------------------------
// Properties.
// Stock Control modules.
public bool AllowStockControl()
{
return (allowCommodityStock && allowStockLocations);
}
public bool AllowStockLocations()
{
return allowStockLocations;
}
public bool AllowStockContainers()
{
return allowStockContainers;
}
public bool AllocateByProductionQuantity()
{
return allocateByProductionQuantity;
}
public bool ActionByDispatchedQuantity()
{
return actionByDispatchedQuantity;
}
public SaStatus GetAutomaticStockAllocationStatus(Sbm.TransactionType transType)
{
if (transType == Sbm.TransactionType.SalesOrder) return status_AutomaticStockAllocation_SalesOrder;
if (transType == Sbm.TransactionType.PurchaseOrder) return status_AutomaticStockAllocation_PurchaseOrder;
return SaStatus.Unknown;
}
public int GetStockEventsDisplayDaysInPast()
{
return Math.Max(90, stockEventsDisplayDaysInPast);
}
public bool ShowStockHistoryTabOnCommodityView()
{
return showStockHistoryTabOnCommodityView;
}
public bool ShowStockBaysColOnCommodityView()
{
return showStockBaysColOnCommodityView;
}
public bool HideStockEventsPanelLocations()
{
return hideStockEventsPanelLocations;
}
//-------------------------------------------------------------------
}
//=======================================================================
}