public double GetInvoicesAmountYear(int year, Invoice.InvoiceType type) { if (type == Invoice.InvoiceType.Total) { return Invoices.GetYearlyAmount(year); } return Invoices.GetYearlyAmount(type, year); }