using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CAPI.Custom.Domain.Quotes { public class QuoteItemsTotals { public readonly decimal VATRate; public QuoteItemsTotals(decimal vatRate) { VATRate = vatRate; } public decimal Cost { get; set; } public decimal GrossProfit { get; set; } public decimal VATExcluded { get; set; } public decimal WeightKG { get; set; } //totals.VAT = vatRate != 0 ? totals.VATExcluded * vatRate / 100 : 0; public decimal VAT => VATRate != 0 ? VATExcluded * VATRate / 100 : 0; public decimal VATIncluded => VAT + VATExcluded; //margin = (subtotalEx == 0 ? 0 : (subtotalEx - cost) / subtotalEx) * 100; public decimal Margin => (VATExcluded == 0 ? 0 : (VATExcluded - Cost) / VATExcluded) * 100m; } }