From 67f96c66e40ecce72b1131e05ef7dd17c3aa6201 Mon Sep 17 00:00:00 2001 From: iamkhanraheel Date: Tue, 17 Jun 2025 12:19:28 +0530 Subject: [PATCH] fix: add missing margin related fields --- .../supplier_quotation_item.json | 52 ++++++++++++++++--- .../supplier_quotation_item.py | 3 ++ 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json index 34a6c0b9003..c131439463f 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json @@ -30,11 +30,15 @@ "stock_qty", "sec_break_price_list", "price_list_rate", + "base_price_list_rate", + "discount_and_margin_section", + "margin_type", + "margin_rate_or_amount", + "rate_with_margin", + "col_break_6", "discount_percentage", "discount_amount", "distributed_discount_amount", - "col_break_price_list", - "base_price_list_rate", "sec_break1", "rate", "amount", @@ -531,10 +535,6 @@ "fieldname": "sec_break_price_list", "fieldtype": "Section Break" }, - { - "fieldname": "col_break_price_list", - "fieldtype": "Column Break" - }, { "collapsible": 1, "fieldname": "ad_sec_break", @@ -572,21 +572,57 @@ "fieldtype": "Currency", "label": "Distributed Discount Amount", "options": "currency" + }, + { + "depends_on": "price_list_rate", + "fieldname": "margin_type", + "fieldtype": "Select", + "label": "Margin Type", + "options": "\nPercentage\nAmount", + "print_hide": 1 + }, + { + "depends_on": "eval:doc.margin_type && doc.price_list_rate", + "fieldname": "margin_rate_or_amount", + "fieldtype": "Float", + "label": "Margin Rate or Amount", + "print_hide": 1 + }, + { + "collapsible": 1, + "collapsible_depends_on": "eval: doc.margin_type || doc.discount_amount || doc.distributed_discount_amount", + "fieldname": "discount_and_margin_section", + "fieldtype": "Section Break", + "label": "Discount and Margin" + }, + { + "depends_on": "eval:doc.margin_type && doc.price_list_rate && doc.margin_rate_or_amount", + "fieldname": "rate_with_margin", + "fieldtype": "Currency", + "label": "Rate With Margin", + "options": "currency", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "col_break_6", + "fieldtype": "Column Break" } ], "idx": 1, "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2024-06-02 06:22:17.864822", + "modified": "2025-06-17 12:05:52.441645", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", "naming_rule": "Random", "owner": "Administrator", "permissions": [], + "row_format": "Dynamic", "sort_field": "creation", "sort_order": "DESC", "states": [], "track_changes": 1 -} \ No newline at end of file +} diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py index a51b9500fd8..ac313cbf182 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py @@ -38,6 +38,8 @@ class SupplierQuotationItem(Document): lead_time_days: DF.Int manufacturer: DF.Link | None manufacturer_part_no: DF.Data | None + margin_rate_or_amount: DF.Float + margin_type: DF.Literal["", "Percentage", "Amount"] material_request: DF.Link | None material_request_item: DF.Data | None net_amount: DF.Currency @@ -52,6 +54,7 @@ class SupplierQuotationItem(Document): project: DF.Link | None qty: DF.Float rate: DF.Currency + rate_with_margin: DF.Currency request_for_quotation: DF.Link | None request_for_quotation_item: DF.Data | None sales_order: DF.Link | None