summaryrefslogtreecommitdiff
path: root/indoteknik_api/models/product_product.py
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_api/models/product_product.py')
-rw-r--r--indoteknik_api/models/product_product.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py
index 1db58d8e..3ecad627 100644
--- a/indoteknik_api/models/product_product.py
+++ b/indoteknik_api/models/product_product.py
@@ -278,12 +278,19 @@ class ProductProduct(models.Model):
discount = 0
price_flashsale = 0
+ default_divide_tax = float(1.11)
+ default_tax = float(11)
if item.price_discount > 0:
discount = item.price_discount
price_flashsale = base_price - (base_price * discount // 100)
+ price_flashsale = price_flashsale / default_divide_tax
elif item.fixed_price > 0:
price_flashsale = item.fixed_price # ask darren for include or exclude
- discount = (base_price - price_flashsale) // base_price * 100
+ price_flashsale = price_flashsale + (price_flashsale * default_tax / 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
if price_for == 'odoo':
base_price = self._v2_get_website_price_exclude_tax()