3.0.1.5 Refresh Transaction. Assets tidy.
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
using System;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.ReferenceData;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -6,10 +10,25 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Base.Helpers
|
||||
{
|
||||
//=======================================================================
|
||||
// Transaction Helper.
|
||||
//=======================================================================
|
||||
public static class SbmTransactionHelper
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Currency.
|
||||
|
||||
/// <summary>Work out how many currency decimals should be used for the specified transaction.</summary>
|
||||
public static ushort GetCurrencyDecimals(SbmInternals internals, SbmTransaction transaction)
|
||||
{
|
||||
if (SysId.IsValid(transaction?.CurrencyId))
|
||||
{
|
||||
SaCurrency currency = internals.GetCurrencyById(transaction.CurrencyId);
|
||||
if (currency != null)
|
||||
return SbmInternals.GetCurrencyDecimals(currency.Decimals);
|
||||
}
|
||||
return internals.GetCurrentCurrencyDecimals();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user