From fb5ef1ffd3a52997044a4bcd1f6bef8cc70861ff Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Mon, 12 Feb 2024 16:37:46 +0700 Subject: bug fix discount zero in flash sale --- indoteknik_api/models/product_product.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py index bd6f516d..3ecad627 100644 --- a/indoteknik_api/models/product_product.py +++ b/indoteknik_api/models/product_product.py @@ -287,7 +287,8 @@ class ProductProduct(models.Model): elif item.fixed_price > 0: price_flashsale = item.fixed_price # ask darren for include or exclude price_flashsale = price_flashsale + (price_flashsale * default_tax / 100) - discount = (base_price - price_flashsale) // base_price * 100 + discount = (base_price - price_flashsale) * 100 / base_price + discount = (math.ceil(discount*100)/100) price_flashsale = item.fixed_price # price_flashsale = price_flashsale / default_divide_tax # darren must fill the fixed price with price exclude -- cgit v1.2.3