예제 #1
0
        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);
        }
예제 #2
0
        public void CreateTaxes(IInvoice invoice)
        {
            IItemCalculator itemCalculator = new ItemCalculator();

            invoice.Items.ForEach(item => itemCalculator.BuildItemTaxes(item));
        }