private void OnIncomeAmountPropertyChanged(object sender, EventArgs propertyChangedEventArgs) { if (!this.isLoadingBudgetModel && IncomeTotal != 0) { Dirty = true; } IncomeTotal = Incomes.Sum(x => x.Amount); Surplus = IncomeTotal - ExpenseTotal; }
public int Balance() { if (Incomes != null && Expenses != null && TransfersTo != null && TransfersFrom != null) { return(OpeningBalance + Incomes.Sum(i => i.Amount) - Expenses.Sum(e => e.Amount) - TransfersFrom.Sum(t => t.Amount) + TransfersTo.Sum(t => t.Amount)); } return(0); }
private Amount TotalIncome() => Amount.FromDecimal(Incomes.Sum(i => i.Amount));
public virtual int Rest() { return(Incomes.Sum(income => income.QuantityCurrent)); }