Пример #1
0
        public static string GetDeliveryAmountString(this tbl_Orders table, bool hideTax = false)
        {
            IDomain domainService = (IDomain)DependencyResolver.Current.GetService <IDomain>();

            bool useTax           = domainService.GetSettingsValueAsBool(SettingsKey.useTax, table.O_DomainID);
            bool priceIncludesVat = domainService.GetSettingsValueAsBool(SettingsKey.priceDisplayIncludesVAT, table.O_DomainID);

            return(PriceManager.FormatPrice((useTax && priceIncludesVat) ? table.TotalDeliveryAmount : table.DeliveryCharge.GetValueOrDefault(0), table.DeliveryTax.GetValueOrDefault(0), table.O_DomainID, hideTax));
        }
Пример #2
0
 public static string GetDeliveryAmountString(this tbl_Basket table, bool hideTax = false)
 {
     if (table.tbl_Postage != null && table.tbl_BasketContent.Count > 0)
     {
         decimal maxTax = table.tbl_BasketContent.Max(bc => bc.GetTaxValue());
         Tuple <decimal, decimal> postagePriceAndTax = PriceManager.GetPostagePriceAndTax(table.tbl_Postage, maxTax, table.B_DomainID);
         return(PriceManager.FormatPrice(postagePriceAndTax.Item1, postagePriceAndTax.Item2, table.B_DomainID, hideTax));
     }
     return(String.Empty);
 }
Пример #3
0
        public static string GetPriceString(this tbl_ProductPrice table, int amount = 1, bool hideTax = false)
        {
            Tuple <decimal, decimal> priceAndTax = PriceManager.GetPriceAndTaxAmounts(table, amount);

            return(PriceManager.FormatPrice(priceAndTax.Item1, priceAndTax.Item2, table.tbl_Products.tbl_SiteMap.SM_DomainID, hideTax));
        }
Пример #4
0
 public static string GetPriceString(this tbl_Orders table, bool hideTax = false)
 {
     return(PriceManager.FormatPrice(table.O_IsCustomAmount ? table.TotalAmount : table.Amount, table.TotalTaxAmount, table.O_DomainID, hideTax));
 }
Пример #5
0
        public static string GetItemPriceString(this tbl_OrderContent table, bool hideTax = false)
        {
            Tuple <decimal, decimal> priceAndTax = PriceManager.GetPrice(table.OC_Price.GetValueOrDefault(), table.OC_Tax.GetValueOrDefault(), 1, table.tbl_Orders.O_DomainID);

            return(PriceManager.FormatPrice(priceAndTax.Item1, priceAndTax.Item2, table.tbl_Orders.O_DomainID, hideTax));
        }
Пример #6
0
        public static string GetPriceString(this tbl_OrderContent table, bool hideTax = false)
        {
            var price = PriceManager.GetPrice(table.OC_Price.GetValueOrDefault(), table.OC_Tax.GetValueOrDefault(), (int)table.OC_Quantity.GetValueOrDefault(), table.tbl_Orders.O_DomainID);

            return(PriceManager.FormatPrice(price.Item1, price.Item2, table.tbl_Orders.O_DomainID, hideTax));
        }
Пример #7
0
        public static string GetProductsPriceString(this tbl_Basket table, bool hideTax = false)
        {
            Tuple <decimal, decimal> priceAndTax = GetBasketPriceAndTax(table, true);

            return(PriceManager.FormatPrice(priceAndTax.Item1, priceAndTax.Item2, table.B_DomainID, hideTax));
        }
Пример #8
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));
        }