BusinessMgr 3.0.1.3
This commit is contained in:
@@ -424,7 +424,7 @@ namespace Sacs.Web.Components
|
||||
// Reference data.
|
||||
|
||||
// Tax codes.
|
||||
public class TaxCode
|
||||
public class TaxCodeData
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Code { get; set; }
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Sarand.Net.Standard.Base.Core
|
||||
public ColumnAlignment Alignment { get; set; } = ColumnAlignment.Default;
|
||||
/// <summary>Data value name (may be an alias).</summary>
|
||||
public String DataName { get; set; } = String.Empty;
|
||||
public byte NumDecimals { get; set; } = 2;
|
||||
public ushort NumDecimals { get; set; } = 2;
|
||||
public char NumThousands { get; set; } = ',';
|
||||
/// <summary>Default: Zero values hidden.</summary>
|
||||
public bool ShowZeroValues { get; set; } = false;
|
||||
|
||||
@@ -12,11 +12,29 @@ namespace Sarand.Net.Standard.Base.ReferenceData
|
||||
//=======================================================================
|
||||
partial class SaReferenceDataConsole
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
public static String GetDefaultCurrencyCode()
|
||||
{
|
||||
return GetCurrencyCode(SaCurrencyCode.Sterling);
|
||||
}
|
||||
public static String GetCurrencyCode(SaCurrencyCode currencyCode)
|
||||
{
|
||||
switch (currencyCode)
|
||||
{
|
||||
case SaCurrencyCode.Sterling: return "GBP";
|
||||
case SaCurrencyCode.Euro: return "EUR";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public abstract short CurrencyItemType { get; }
|
||||
public abstract String TableName_Currency { get; }
|
||||
public abstract bool DatabaseIsValid_Currency { get; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve Currency.
|
||||
public abstract SaCurrency GetCurrency(SaCurrency.Params prmCurrency);
|
||||
|
||||
|
||||
@@ -12,8 +12,23 @@ namespace Sarand.Net.Standard.Base.ReferenceData
|
||||
//=======================================================================
|
||||
partial class SaReferenceDataConsole
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
public static String GetStdTaxCode()
|
||||
{
|
||||
return GetTaxCode(SaTaxCodeType.Std);
|
||||
}
|
||||
public static String GetTaxCode(SaTaxCodeType taxCode)
|
||||
{
|
||||
switch (taxCode)
|
||||
{
|
||||
case SaTaxCodeType.Zero: return "ZERO";
|
||||
case SaTaxCodeType.Std: return "STD";
|
||||
case SaTaxCodeType.Exempt: return "EXEMPT";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
public static String GetSageTaxCode(SaTaxCodeType taxCode)
|
||||
{
|
||||
switch (taxCode)
|
||||
{
|
||||
@@ -24,11 +39,13 @@ namespace Sarand.Net.Standard.Base.ReferenceData
|
||||
return "";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public abstract short TaxCodeItemType { get; }
|
||||
public abstract String TableName_TaxCode { get; }
|
||||
public abstract bool DatabaseIsValid_TaxCode { get; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve Tax Code.
|
||||
public abstract SaTaxCode GetTaxCode(SaTaxCode.Params prmTaxCode);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Sarand.Net.Standard.Base.ReferenceData
|
||||
{
|
||||
@@ -189,7 +190,10 @@ namespace Sarand.Net.Standard.Base.ReferenceData
|
||||
public String GetCaption()
|
||||
{
|
||||
DateTime today = DateTime.Today;
|
||||
String caption = $"{Code} (" + (!StringUtil.IsBlank(CodeAlt1) ? $"{CodeAlt1}: " : "") + $"{TaxRate.ToString("N2")})";
|
||||
String caption = $"{Code} (";
|
||||
if (!StringUtil.IsBlank(CodeAlt1) && !CodeAlt1.EqualsCI(Code))
|
||||
caption += $"{CodeAlt1}: ";
|
||||
caption += $"{Regex.Replace(TaxRate.ToString("N2"), @"\.0+$", "")}%)";
|
||||
if (DateUtil.IsValid(EffectFrom) || DateUtil.IsValid(EffectTo))
|
||||
{
|
||||
String effectiveFrom = (DateUtil.IsValid(EffectFrom) ? (EffectFrom.Year == today.Year ? EffectFrom.ToString("d-MMM") : EffectFrom.ToString("d-MMM-yy")) : "");
|
||||
|
||||
Reference in New Issue
Block a user