Exemple #1
0
        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);
        }
Exemple #2
0
        public static decimal GetTaxAmount(this tbl_BasketContent table)
        {
            Tuple <decimal, decimal> priceAndTax = PriceManager.GetPriceAndTaxAmounts(table.tbl_ProductPrice, table.BC_Quantity);

            return(priceAndTax.Item2);
        }
Exemple #3
0
 public static decimal GetTaxValue(this tbl_BasketContent table)
 {
     return(PriceManager.GetTaxPercentage(table.tbl_ProductPrice));
 }
Exemple #4
0
        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));
        }
Exemple #5
0
 public static string GetTaxValueString(this tbl_BasketContent table)
 {
     return(String.Format(percentageFormat, PriceManager.GetTaxPercentage(table.tbl_ProductPrice)));
 }
Exemple #6
0
        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));
        }