Ejemplo n.º 1
0
        /// <param name="roundingFunction">
        /// The function that should be used for rounding transaction amounts.
        /// </param>
        /// <param name="isDraft">
        /// Indicates whether the schedule to be created or reevaluated is a draft schedule.
        /// In particular, it affects whether credit line / deferral transactions would be
        /// generated for the schedule.
        /// </param>
        public SingleScheduleCreator(
            IDREntityStorage drEntityStorage,
            ISubaccountProvider subaccountProvider,
            IBusinessAccountProvider businessAccountProvider,
            IInventoryItemProvider inventoryItemProvider,
            IFinPeriodRepository finPeriodRepository,
            Func <decimal, decimal> roundingFunction,
            int?branchID,
            bool isDraft,
            Location location,
            CurrencyInfo currencyInfo)
        {
            if (drEntityStorage == null)
            {
                throw new ArgumentNullException(nameof(drEntityStorage));
            }
            if (subaccountProvider == null)
            {
                throw new ArgumentNullException(nameof(subaccountProvider));
            }
            if (businessAccountProvider == null)
            {
                throw new ArgumentNullException(nameof(businessAccountProvider));
            }
            if (inventoryItemProvider == null)
            {
                throw new ArgumentNullException(nameof(inventoryItemProvider));
            }
            if (roundingFunction == null)
            {
                throw new ArgumentNullException(nameof(roundingFunction));
            }

            FinPeriodRepository = finPeriodRepository;

            _drEntityStorage         = drEntityStorage;
            _subaccountProvider      = subaccountProvider;
            _businessAccountProvider = businessAccountProvider;
            _inventoryItemProvider   = inventoryItemProvider;

            _roundingFunction = roundingFunction;

            _isDraft      = isDraft;
            _branchID     = branchID;
            _location     = location;
            _currencyInfo = currencyInfo;
        }
Ejemplo n.º 2
0
 public SingleScheduleCreator(
     IDREntityStorage drEntityStorage,
     ISubaccountProvider subaccountProvider,
     IBusinessAccountProvider businessAccountProvider,
     IInventoryItemProvider inventoryItemProvider,
     ISingleScheduleViewProvider singleScheduleViewProvider,
     ISalesPriceProvider salesPriceProvider,
     IDRDataProvider dataProvider,
     IFinPeriodRepository finPeriodRepository,
     Func <decimal, decimal> roundingFunction,
     int?branchID,
     bool isDraft,
     Location location,
     CurrencyInfo currencyInfo)
     : this(drEntityStorage, subaccountProvider, businessAccountProvider, inventoryItemProvider, finPeriodRepository, roundingFunction, branchID, isDraft, location, currencyInfo)
 {
     _salesPriceProvider         = salesPriceProvider ?? throw new ArgumentNullException(nameof(salesPriceProvider));
     _singleScheduleViewProvider = singleScheduleViewProvider ?? throw new ArgumentNullException(nameof(singleScheduleViewProvider));
     _dataProvider = dataProvider ?? throw new ArgumentNullException(nameof(dataProvider));
 }
Ejemplo n.º 3
0
        /// <param name="roundingFunction">
        /// The function that should be used for rounding transaction amounts.
        /// </param>
        /// <param name="isDraft">
        /// Indicates whether the schedule to be created or reevaluated is a draft schedule.
        /// In particular, it affects whether credit line / deferral transactions would be
        /// generated for the schedule.
        /// </param>
        public ScheduleCreator(
            IDREntityStorage drEntityStorage,
            ISubaccountProvider subaccountProvider,
            IBusinessAccountProvider businessAccountProvider,
            IInventoryItemProvider inventoryItemProvider,
            Func <decimal, decimal> roundingFunction,
            int?branchID,
            bool isDraft)
        {
            if (drEntityStorage == null)
            {
                throw new ArgumentNullException(nameof(drEntityStorage));
            }
            if (subaccountProvider == null)
            {
                throw new ArgumentNullException(nameof(subaccountProvider));
            }
            if (businessAccountProvider == null)
            {
                throw new ArgumentNullException(nameof(businessAccountProvider));
            }
            if (inventoryItemProvider == null)
            {
                throw new ArgumentNullException(nameof(inventoryItemProvider));
            }
            if (roundingFunction == null)
            {
                throw new ArgumentNullException(nameof(roundingFunction));
            }

            _drEntityStorage         = drEntityStorage;
            _subaccountProvider      = subaccountProvider;
            _businessAccountProvider = businessAccountProvider;
            _inventoryItemProvider   = inventoryItemProvider;

            _roundingFunction = roundingFunction;

            _isDraft  = isDraft;
            _branchID = branchID;
        }