summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2026-02-02 07:56:00 +0000
committerIT Fixcomart <it@fixcomart.co.id>2026-02-02 07:56:00 +0000
commitd26a7bf2beed1500383fc65591e79e3648d3edfc (patch)
treecb2d9cda7355e2cd6dbbed083c759f22f8a35b5e /indoteknik_custom/models
parent50b9bc544cd837772c66ea3314558ef03a09fe21 (diff)
parent5118ff0549de5bea4e83b31da2c2347f227c488a (diff)
Merged in cashback_brand (pull request #488)
<hafid> pusing margin po
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py13
1 files changed, 0 insertions, 13 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index ebe0ae65..e16c8d61 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -53,9 +53,6 @@ class PurchaseOrder(models.Model):
total_so_percent_margin = fields.Float(
'SO Margin%', compute='compute_total_margin',
help="Total % Margin in Sales Order Header")
- amount_cashback = fields.Float(
- 'Cashback', compute='compute_total_margin',
- help="Total Cashback brand Altama")
amount_total_without_service = fields.Float('AmtTotalWithoutService', compute='compute_amt_total_without_service')
summary_qty_po = fields.Float('Total Qty', compute='_compute_summary_qty')
summary_qty_receipt = fields.Float('Summary Qty Receipt', compute='_compute_summary_qty')
@@ -1410,14 +1407,6 @@ class PurchaseOrder(models.Model):
purchase_price += line.delivery_amt_line
if line.order_id.delivery_amt > 0:
purchase_price += line.order_id.delivery_amt
-
- cashback_amount = 0.0
- if self.partner_id.id == 5571:
- cashback_percent = line.product_id.x_manufacture.cashback_percent or 0.0
- if cashback_percent > 0:
- cashback_amount = purchase_price * cashback_percent
- purchase_price -= cashback_amount
-
real_item_margin = sales_price - purchase_price
sum_margin += real_item_margin
@@ -1426,13 +1415,11 @@ class PurchaseOrder(models.Model):
self.total_so_percent_margin = round((sum_so_margin / sum_sales_price), 2) * 100
self.total_margin = sum_margin
self.total_percent_margin = round((sum_margin / sum_sales_price), 2) * 100
- self.amount_cashback = cashback_amount
else:
self.total_margin = 0
self.total_percent_margin = 0
self.total_so_margin = 0
self.total_so_percent_margin = 0
- self.amount_cashback = 0
def compute_total_margin_from_apo(self):
sum_so_margin = sum_sales_price = sum_margin = 0