diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-09-20 15:06:17 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-09-20 15:06:17 +0700 |
| commit | 79bf9729d10c8fb37ef9071ab6df2b6644ddea49 (patch) | |
| tree | 6226da5e38ad44673a1bb5d7d4e2b0fd5df1fada /indoteknik_api/models | |
| parent | eb7661705303a64c97e84061b53d48d5c46f6293 (diff) | |
| parent | d2bb21ae878db2a3b77dbb3341046c9d12ba1de5 (diff) | |
Merge branch 'production' into iman/new-register
# Conflicts:
# indoteknik_custom/models/res_users.py
Diffstat (limited to 'indoteknik_api/models')
| -rw-r--r-- | indoteknik_api/models/product_product.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py index 3ecad627..386ddb6a 100644 --- a/indoteknik_api/models/product_product.py +++ b/indoteknik_api/models/product_product.py @@ -234,19 +234,17 @@ class ProductProduct(models.Model): ('pricelist_id', '=', int(product_pricelist_tier)), ('product_id', '=', self.id) ], limit=1) - if pricelist_item: - # base_price = self._get_website_price_exclude_tax() - base_price_incl = self._get_website_price_include_tax() - if tier_number in ['1_v2', '2_v2', '3_v2', '4_v2', '5_v2']: - base_price_incl = self._v2_get_website_price_include_tax() - + base_price_incl = self._get_website_price_include_tax() + if tier_number in ['1_v2', '2_v2', '3_v2', '4_v2', '5_v2']: + base_price_incl = self._v2_get_website_price_include_tax() + if pricelist_item and base_price_incl: discount = pricelist_item.price_discount price = base_price_incl - (base_price_incl * discount / 100) price = price / default_divide_tax price = math.floor(price) data = { - f'discount_tier{tier_number}': discount or 0, - f'price_tier{tier_number}': price or 0 + f'discount_tier{tier_number}': discount if base_price_incl else 0, + f'price_tier{tier_number}': price if base_price_incl else 0, } return data |
