summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/automatic_purchase.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-06-25 09:09:34 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-06-25 09:09:34 +0700
commitac01fa257abf2f12588d240689c42f0d12da644f (patch)
tree5014114abc523d13a944e2ecdd0929d469f9e08c /indoteknik_custom/models/automatic_purchase.py
parent6e256f5d35f48f75804829ddef08288905c33c68 (diff)
trying to fix ppn keluar on bill
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