From 0f7f7fa273295fadde403c4ff9333b3bbe14489a Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 24 Feb 2023 16:07:55 +0700 Subject: bug fix total margin in sale order --- indoteknik_custom/models/sale_order.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 9cc95e57..ae769ae7 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -306,15 +306,15 @@ class SaleOrder(models.Model): order.total_percent_margin = 0 continue total_margin += line.item_margin - sales_price = line.price_reduce_taxexcl * line.product_uom_qty - if line.order_id.shipping_cost_covered == 'indoteknik': - sales_price -= line.delivery_amt_line - if line.order_id.fee_third_party > 0: - sales_price -= line.fee_third_party_line - sum_sales_price += sales_price + # sales_price = line.price_reduce_taxexcl * line.product_uom_qty + # if line.order_id.shipping_cost_covered == 'indoteknik': + # sales_price -= line.delivery_amt_line + # if line.order_id.fee_third_party > 0: + # sales_price -= line.fee_third_party_line + # sum_sales_price += sales_price order.total_margin = total_margin if order.amount_untaxed > 0: - total_percent_margin = round((total_margin / sum_sales_price), 2) * 100 + total_percent_margin = round((total_margin / order.amount_untaxed), 2) * 100 order.total_percent_margin = total_percent_margin def compute_count_line_product(self): -- cgit v1.2.3