예제 #1
0
 public BudgetCategoryReport(BudgetCategory category, DateTime startDate, DateTime endDate)
 {
     Category  = category;
     Budget    = category.Budget;
     StartDate = startDate;
     EndDate   = endDate;
 }
예제 #2
0
 public void SetBudgetCategory(BudgetCategory budgetCategory)
 {
     if (budgetCategory == default)
     {
         throw new BusinessException(Localization.For(() => ErrorMessages.BudgetCategoryEmpty));
     }
     BudgetCategoryId = budgetCategory.BudgetCategoryId;
 }
예제 #3
0
            internal static BudgetedAmount Create(BudgetCategory budgetCategory, MoneyAmount amount, DateTime validFrom)
            {
                var instance = new BudgetedAmount()
                {
                    BudgetedAmountId = new BudgetedAmountId(),
                    BudgetCategoryId = budgetCategory.BudgetCategoryId
                };

                instance.SetAmount(amount);
                instance.SetValidFromDate(validFrom);
                return(instance);
            }
예제 #4
0
        public BudgetCategoryBalance(BudgetCategory category)
        {
            BudgetCategoryId         = category.Id;
            OverallBudgetBalance     = category.OverallBudgetBalance;
            ThisMonthBudgetBalance   = category.ThisMonthBudgetBalance;
            ThisMonthTransactionsSum = category.ThisMonthTransactionsSum;
            ThisMonthYetScheduledSum = category.ThisMonthYetScheduledSum;
            LeftToEndOfYear          = category.LeftToEndOfYear;
            ThisYearBudget           = category.ThisYearBudget;
            ThisYearYetScheduledSum  = category.ThisYearYetScheduledSum;
            ThisMonthBudget          = category.ThisMonthBudget;
            BudgetSoFar = category.BudgetSoFar;

            TotalTransactionsSum = category.TotalTransactionsSum;
            TotalAllocationsSum  = category.TotalAllocationsSum;
        }
        public static TransactionTemplate Create
            (string description,
            BudgetCategory budgetCategory,
            MoneyAmount amount)
        {
            var transaction = new TransactionTemplate
            {
                TransactionTemplateId = new TransactionTemplateId(),
                Description           = description
            };

            transaction.SetBudgetCategory(budgetCategory);
            transaction.SetAmount(amount);
            transaction.CreationDateTime = DateTime.Now;
            return(transaction);
        }
예제 #6
0
        public static BudgetCategory Create
            (Budget budget,
            string name,
            BudgetCategoryIcon icon,
            eBudgetCategoryType budgetCategoryType)
        {
            var category = new BudgetCategory()
            {
                BudgetCategoryId   = new BudgetCategoryId(),
                BudgetCategoryType = budgetCategoryType,
                BudgetId           = budget.BudgetId
            };

            category.SetIcon(icon);
            category.SetName(name);
            return(category);
        }
예제 #7
0
        public static Allocation Create
            (string description,
            BudgetCategory targetBudgetCategory,
            BudgetCategory sourceBudgetCategory,
            MoneyAmount amount,
            DateTime allocationDate)
        {
            var transaction = new Allocation
            {
                AllocationId = new AllocationId(),
                Description  = description
            };

            transaction.SetTargetBudgetCategory(targetBudgetCategory);
            transaction.SetSourceBudgetCategory(sourceBudgetCategory);
            transaction.SetAmount(amount);
            transaction.SetAllocationDate(allocationDate);
            transaction.CreationDateTime = DateTime.Now;

            return(transaction);
        }
예제 #8
0
        public static PeriodReport GetPeriodReport(BudgetCategory category, DateTime startDate, DateTime endDate)
        {
            var instance = new BudgetCategoryReport(category, startDate, endDate);

            return(instance.PeriodReport);
        }
예제 #9
0
        public static PeriodMonthlyReport GetMonthByMonth(BudgetCategory category, DateTime startDate, DateTime endDate)
        {
            var instance = new BudgetCategoryReport(category, startDate, endDate);

            return(instance.MonthByMonth);
        }
예제 #10
0
 public void SetSourceBudgetCategory(BudgetCategory budgetCategory)
 {
     SourceBudgetCategoryId = budgetCategory?.BudgetCategoryId;
 }