diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-02-24 16:07:55 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-02-24 16:07:55 +0700 |
| commit | 0f7f7fa273295fadde403c4ff9333b3bbe14489a (patch) | |
| tree | 9d2a29be2f561655b5357f20545b8e80e6b28376 | |
| parent | 4c8af381449f558389df5f821703e9a0acacdf5a (diff) | |
bug fix total margin in sale order
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 14 |
1 files 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): |
