public void ApplyTaxes(IInvoice invoice) { IItemCalculator itemCalculator = new ItemCalculator(); invoice.Items.ForEach(item => itemCalculator.ApplyItemTaxes(item)); invoice.TotalTax = invoice.Items.Sum(x => x.TotalTaxes); invoice.TotalTax = Util.RoundTo2Decimal(invoice.TotalTax); invoice.Total = Util.RoundTo2Decimal(invoice.Items.Sum(x => x.Quantity * x.Price) + invoice.TotalTax); }
public void CreateTaxes(IInvoice invoice) { IItemCalculator itemCalculator = new ItemCalculator(); invoice.Items.ForEach(item => itemCalculator.BuildItemTaxes(item)); }