public static decimal GetPrice(this tbl_BasketContent table, bool?includeTax = null) { IDomain domainService = (IDomain)DependencyResolver.Current.GetService <IDomain>(); var priceIncludesTax = domainService.GetSettingsValueAsBool(SettingsKey.priceDisplayIncludesVAT, table.tbl_Basket.B_DomainID); Tuple <decimal, decimal> priceAndTax = PriceManager.GetPriceAndTaxAmounts(table.tbl_ProductPrice, table.BC_Quantity); if (includeTax.HasValue) { if (includeTax.Value) { return(priceIncludesTax ? priceAndTax.Item1 : priceAndTax.Item1 + priceAndTax.Item2); } return(priceIncludesTax ? priceAndTax.Item1 - priceAndTax.Item2 : priceAndTax.Item2); } return(priceAndTax.Item1); }
public static decimal GetTaxAmount(this tbl_BasketContent table) { Tuple <decimal, decimal> priceAndTax = PriceManager.GetPriceAndTaxAmounts(table.tbl_ProductPrice, table.BC_Quantity); return(priceAndTax.Item2); }
public static decimal GetTaxValue(this tbl_BasketContent table) { return(PriceManager.GetTaxPercentage(table.tbl_ProductPrice)); }
public static string GetTaxAmountString(this tbl_BasketContent table) { Tuple <decimal, decimal> priceAndTax = PriceManager.GetPriceAndTaxAmounts(table.tbl_ProductPrice, table.BC_Quantity); return(String.Format("{0:C}", priceAndTax.Item2)); }
public static string GetTaxValueString(this tbl_BasketContent table) { return(String.Format(percentageFormat, PriceManager.GetTaxPercentage(table.tbl_ProductPrice))); }
public static string GetItemPriceString(this tbl_BasketContent table, bool hideTax = false) { Tuple <decimal, decimal> priceAndTax = PriceManager.GetPriceAndTaxAmounts(table.tbl_ProductPrice, 1); return(PriceManager.FormatPrice(priceAndTax.Item1, priceAndTax.Item2, table.tbl_Basket.B_DomainID, hideTax)); }