def untaxed_discount_line_unit_price(cartitem, discount): """Returns the discounted line unit-price for this cart item""" price = cartitem.unit_price if discount and discount.valid_for_product(cartitem.product): price = calc_discounted_by_percentage(price, discount.percentage) return price
def untaxed_discount_line_total(cartitem, discount): """Returns the discounted line total for this cart item""" price = cartitem.line_total if discount and discount.valid_for_product(cartitem.product): price = calc_discounted_by_percentage(price, discount.percentage) return price
def untaxed_discount_line_unit_price(cartitem, discount): """Returns the discounted line unit-price for this cart item""" price = cartitem.unit_price if discount and discount.valid_for_product(cartitem.product): price = calc_discounted_by_percentage(price, discount.percentage) return price
def untaxed_discount_line_total(cartitem, discount): """Returns the discounted line total for this cart item""" price = cartitem.line_total if discount and discount.valid_for_product(cartitem.product): price = calc_discounted_by_percentage(price, discount.percentage) return price
def untaxed_sale_price(product): """Returns the product unit price with the best auto discount applied.""" discount = find_best_auto_discount(product) price = product.unit_price if discount and discount.valid_for_product(cartitem.product): price = calc_discounted_by_percentage(price, disc.percentage) return price
def untaxed_sale_price(product): """Returns the product unit price with the best auto discount applied.""" discount = find_best_auto_discount(product) price = product.unit_price if discount and discount.valid_for_product(product): price = calc_discounted_by_percentage(price, discount.percentage) return price
def untaxed_discount_price(product, discount): """Returns the product price with the discount applied. Ex: product|discount_price:sale """ up = product.unit_price if discount and discount.valid_for_product(product): pcnt = calc_discounted_by_percentage(up, discount.percentage) return pcnt else: return up
def untaxed_discount_price(product, discount): """Returns the product price with the discount applied. Ex: product|discount_price:sale """ up = product.unit_price if discount and discount.valid_for_product(product): pcnt = calc_discounted_by_percentage(up, discount.percentage) return pcnt else: return up
def untaxed_discount_saved(product, discount): """Returns the amount saved by the discount""" if discount and discount.valid_for_product(product): price = product.unit_price discounted = calc_discounted_by_percentage(price, discount.percentage) saved = price-discounted cents = Decimal("0.01") return saved.quantize(cents) else: return Decimal('0.00')