Search Results for

    Show / Hide Table of Contents

    Class FinancialDateCalculator

    A helper class responsible for retrieving, and caching, the financial date to use for a given date taking into account entity IEntityPeriodClosing

    Inheritance
    System.Object
    FinancialDateCalculator
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: LemonEdge.API.Processors
    Assembly: API.dll
    Syntax
    public class FinancialDateCalculator

    Constructors

    FinancialDateCalculator(IEntityRetriever)

    Creates a new financial date calculator using the specified retriever

    Declaration
    public FinancialDateCalculator(IEntityRetriever retriever)
    Parameters
    Type Name Description
    IEntityRetriever retriever

    A context enabling querying of the entire system

    Methods

    GetFinancialDate(Guid, DateTime)

    Retrieves a valid financial date for the specified entity id and transaction date

    If the given entity has no IEntityPeriodClosing associated with it then this returns the transactionDate

    If a period closing exists that is greater or equal to the transactionDate then the returned date is one day after the latest period closing for that entity. In other words the next available open data for that entity.
    Declaration
    public Task<DateTime> GetFinancialDate(Guid entityID, DateTime transactionDate)
    Parameters
    Type Name Description
    System.Guid entityID

    The entity to retrieve a valid financial date for

    System.DateTime transactionDate

    The transaction date that we need to retrieve a financial date for

    Returns
    Type Description
    System.Threading.Tasks.Task<System.DateTime>

    A valid open financial date for the given entity and date

    GetFinancialDate(Guid, DateTime, Nullable<DateTime>)

    Retrieves a valid financial date for the specified entity id and transaction date

    If the given entity has no IEntityPeriodClosing associated with it then this returns the transactionDate unless the provided matchFinancialDateIfPrior is greater in which case that is returned

    If a period closing exists that is greater or equal to the transactionDate then the returned date is one day after the latest period closing for that entity. In other words the next available open data for that entity.
    Declaration
    public Task<DateTime> GetFinancialDate(Guid entityID, DateTime transactionDate, DateTime? matchFinancialDateIfPrior)
    Parameters
    Type Name Description
    System.Guid entityID

    The entity to retrieve a valid financial date for

    System.DateTime transactionDate

    The transaction date that we need to retrieve a financial date for

    System.Nullable<System.DateTime> matchFinancialDateIfPrior

    If null then and there are no period closings then the transactionDate is returned, otherwise this date is returned if it is greater than the transaction date. In other words it keeps this current financial date, and does not reset it back to a lower transaction date

    Returns
    Type Description
    System.Threading.Tasks.Task<System.DateTime>

    A valid open financial date for the given entity and date

    GetFinancialDate(Guid, DateTime, Nullable<DateTimeOffset>)

    Retrieves a valid financial date for the specified entity id and transaction date

    If the given entity has no IEntityPeriodClosing associated with it then this returns the transactionDate unless the provided matchFinancialDateIfPrior is greater in which case that is returned

    If a period closing exists that is greater or equal to the transactionDate then the returned date is one day after the latest period closing for that entity. In other words the next available open data for that entity.
    Declaration
    public Task<DateTime> GetFinancialDate(Guid entityID, DateTime transactionDate, DateTimeOffset? matchFinancialDateIfPrior)
    Parameters
    Type Name Description
    System.Guid entityID

    The entity to retrieve a valid financial date for

    System.DateTime transactionDate

    The transaction date that we need to retrieve a financial date for

    System.Nullable<System.DateTimeOffset> matchFinancialDateIfPrior

    If null then and there are no period closings then the transactionDate is returned, otherwise this date is returned if it is greater than the transaction date. In other words it keeps this current financial date, and does not reset it back to a lower transaction date

    Returns
    Type Description
    System.Threading.Tasks.Task<System.DateTime>

    A valid open financial date for the given entity and date

    Extension Methods

    MiscExtensions.SetIfNotEqual<T, P>(T, Expression<Func<T, P>>, P)
    ReflectionExtensions.ClearEventInvocations(Object, String)
    StringExtensions.ToCSVFormatString(Object, Type)
    SQLExtensions.ToSQLValue(Object, Boolean)
    In This Article
    Back to top © LemonEdge Technology. All rights reserved.