Beispiel #1
0
 public static decimal CashFlowAmountForMonth(this Budget budget)
 {
     return(budget.CashFlowAmountForMonth(DateTime.Now.Year, DateTime.Now.Month));
 }
Beispiel #2
0
        public static (DateTime startDate, IEnumerable <IEnumerable <CashFlow> > cashFlows) DailyCashflowsForMonth(this Budget budget, int year, int month)
        {
            var startDate = new DateTime(year, month, 1);

            startDate = startDate.AddDays(-(((int)startDate.DayOfWeek + 6) % 7));

            var endDate = startDate.AddDays(7 * 6 - 1);

            return(startDate, budget.DailyCashFlowsBetween(startDate, endDate));
        }
Beispiel #3
0
 public static (DateTime startDate, IEnumerable <IEnumerable <CashFlow> > cashFlows) DailyCashflowsForMonth(this Budget budget)
 {
     return(budget.DailyCashflowsForMonth(DateTime.Now.Year, DateTime.Now.Month));
 }
Beispiel #4
0
 public static decimal CashFlowAmountBetween(this Budget budget, DateTime startDate, DateTime endDate)
 {
     return(budget.DailyCashFlowsBetween(startDate, endDate)
            .SelectMany(x => x)
            .Sum(x => x.Amount));
 }