diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-01-16 10:36:23 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-01-16 10:36:23 +0700 |
| commit | dc573e5c5f3922f0d0d031d616b779fa157fd679 (patch) | |
| tree | 5e6f9a551dacb73bbd54b0499fbcdec24929d17f | |
| parent | 27f333cc14b8673b3c46e1969736d2fb60d9924f (diff) | |
cr margin po
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 777e8ed2..d487ada3 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -965,7 +965,14 @@ class PurchaseOrder(models.Model): sales_price -= (sale_order_line.fee_third_party_line / sale_order_line.product_uom_qty) * line.qty_po sum_sales_price += sales_price - purchase_price = po_line.price_subtotal / po_line.product_qty * line.qty_po + + purchase_price = po_line.price_subtotal + if po_line.ending_price > 0: + if po_line.taxes_id.id == 22: + ending_price = po_line.ending_price / 1.11 + purchase_price = ending_price + else: + purchase_price = po_line.ending_price if line.purchase_order_id.delivery_amount > 0: purchase_price += (po_line.delivery_amt_line / po_line.product_qty) * line.qty_po if line.purchase_order_id.delivery_amt > 0: |
