summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/automatic_purchase.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-07-02 10:06:29 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-07-02 10:06:29 +0700
commita10024fec206f68791c87a5a4e56e4c6bce28f5c (patch)
tree627d0ca2443eecbcb44b1b4eeda98f94c9ea3496 /indoteknik_custom/models/automatic_purchase.py
parent51c19eca13239fe20ae592f8e9ee0d23f8904c5f (diff)
parentf9c5b3dffcd71bfa9dea74c946d7b4277db66bd6 (diff)
Merge branch 'production' into feature/add_voucher_pastihemat_productsolr
Diffstat (limited to 'indoteknik_custom/models/automatic_purchase.py')
-rw-r--r--indoteknik_custom/models/automatic_purchase.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py
index 2c83c0ea..73416c48 100644
--- a/indoteknik_custom/models/automatic_purchase.py
+++ b/indoteknik_custom/models/automatic_purchase.py
@@ -506,13 +506,15 @@ class AutomaticPurchase(models.Model):
taxes = ''
human_last_update = purchase_price.human_last_update or datetime.min
system_last_update = purchase_price.system_last_update or datetime.min
-
- price = purchase_price.product_price
- taxes = purchase_price.taxes_product_id.id
+
+ if purchase_price.taxes_product_id.type_tax_use == 'purchase':
+ price = purchase_price.product_price
+ taxes = purchase_price.taxes_product_id.id
if system_last_update > human_last_update:
- price = purchase_price.system_price
- taxes = purchase_price.taxes_system_id.id
+ if purchase_price.taxes_system_id.type_tax_use == 'purchase':
+ price = purchase_price.system_price
+ taxes = purchase_price.taxes_system_id.id
return price, taxes