From c98a0ccd1dc5007941544ca49e0c2ad68d050323 Mon Sep 17 00:00:00 2001 From: Ninad1306 Date: Fri, 8 Nov 2024 12:51:05 +0530 Subject: [PATCH 1/3] fix: added disable_rounded_total field (cherry picked from commit f8524d526b5922e8223e21409f2997f2e7cd2f5b) # Conflicts: # erpnext/selling/doctype/quotation/quotation.json --- .../selling/doctype/quotation/quotation.json | 47 +++++++++++++++++++ .../selling/doctype/quotation/quotation.py | 1 + 2 files changed, 48 insertions(+) diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 982e7326775..8d6b96c8e67 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -65,6 +65,7 @@ "grand_total", "rounding_adjustment", "rounded_total", + "disable_rounded_total", "in_words", "section_break_44", "apply_discount_on", @@ -661,6 +662,7 @@ "width": "200px" }, { + "depends_on": "eval:!doc.disable_rounded_total", "fieldname": "base_rounding_adjustment", "fieldtype": "Currency", "label": "Rounding Adjustment (Company Currency)", @@ -709,6 +711,7 @@ "width": "200px" }, { + "depends_on": "eval:!doc.disable_rounded_total", "fieldname": "rounding_adjustment", "fieldtype": "Currency", "label": "Rounding Adjustment", @@ -1067,13 +1070,57 @@ "fieldname": "named_place", "fieldtype": "Data", "label": "Named Place" +<<<<<<< HEAD +======= + }, + { + "fieldname": "utm_campaign", + "fieldtype": "Link", + "label": "Campaign", + "oldfieldname": "campaign", + "oldfieldtype": "Link", + "options": "UTM Campaign", + "print_hide": 1 + }, + { + "fieldname": "utm_source", + "fieldtype": "Link", + "label": "Source", + "oldfieldname": "source", + "oldfieldtype": "Select", + "options": "UTM Source", + "print_hide": 1 + }, + { + "fieldname": "utm_medium", + "fieldtype": "Link", + "label": "Medium", + "options": "UTM Medium", + "print_hide": 1 + }, + { + "fieldname": "utm_content", + "fieldtype": "Data", + "label": "Content", + "print_hide": 1 + }, + { + "default": "0", + "fieldname": "disable_rounded_total", + "fieldtype": "Check", + "label": "Disable Rounded Total" +>>>>>>> f8524d526b (fix: added disable_rounded_total field) } ], "icon": "fa fa-shopping-cart", "idx": 82, "is_submittable": 1, "links": [], +<<<<<<< HEAD "modified": "2024-03-20 16:04:21.567847", +======= + "modified": "2024-11-07 18:37:11.715189", +>>>>>>> f8524d526b (fix: added disable_rounded_total field) "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index a5994756c46..8e560b8d0ab 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -61,6 +61,7 @@ class Quotation(SellingController): customer_address: DF.Link | None customer_group: DF.Link | None customer_name: DF.Data | None + disable_rounded_total: DF.Check discount_amount: DF.Currency enq_det: DF.Text | None grand_total: DF.Currency From b6524946bc9a708b7d1dcc8c1c29b3d0feec7b4f Mon Sep 17 00:00:00 2001 From: Ninad1306 Date: Tue, 12 Nov 2024 15:25:14 +0530 Subject: [PATCH 2/3] test: test to validate rounded total (cherry picked from commit 5a6261d3b4b3084dc1f45bef6584c55043084336) --- .../selling/doctype/quotation/test_quotation.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 9a31e335a05..05f43f26559 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -715,6 +715,20 @@ class TestQuotation(FrappeTestCase): item_doc.taxes = [] item_doc.save() + def test_grand_total_and_rounded_total_values(self): + quotation = make_quotation(qty=6, rate=12.3, do_not_submit=1) + + self.assertEqual(quotation.grand_total, 73.8) + self.assertEqual(quotation.rounding_adjustment, 0.2) + self.assertEqual(quotation.rounded_total, 74) + + quotation.disable_rounded_total = 1 + quotation.save() + + self.assertEqual(quotation.grand_total, 73.8) + self.assertEqual(quotation.rounding_adjustment, 0) + self.assertEqual(quotation.rounded_total, 0) + test_records = frappe.get_test_records("Quotation") From 80f0d5b5ec8d20d70ec091650dba8ece6f2851c6 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Wed, 20 Nov 2024 12:51:29 +0530 Subject: [PATCH 3/3] chore: resolve conflict --- .../selling/doctype/quotation/quotation.json | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index 8d6b96c8e67..d6ee87b5dee 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -1070,57 +1070,19 @@ "fieldname": "named_place", "fieldtype": "Data", "label": "Named Place" -<<<<<<< HEAD -======= - }, - { - "fieldname": "utm_campaign", - "fieldtype": "Link", - "label": "Campaign", - "oldfieldname": "campaign", - "oldfieldtype": "Link", - "options": "UTM Campaign", - "print_hide": 1 - }, - { - "fieldname": "utm_source", - "fieldtype": "Link", - "label": "Source", - "oldfieldname": "source", - "oldfieldtype": "Select", - "options": "UTM Source", - "print_hide": 1 - }, - { - "fieldname": "utm_medium", - "fieldtype": "Link", - "label": "Medium", - "options": "UTM Medium", - "print_hide": 1 - }, - { - "fieldname": "utm_content", - "fieldtype": "Data", - "label": "Content", - "print_hide": 1 }, { "default": "0", "fieldname": "disable_rounded_total", "fieldtype": "Check", "label": "Disable Rounded Total" ->>>>>>> f8524d526b (fix: added disable_rounded_total field) } ], "icon": "fa fa-shopping-cart", "idx": 82, "is_submittable": 1, "links": [], -<<<<<<< HEAD - "modified": "2024-03-20 16:04:21.567847", -======= "modified": "2024-11-07 18:37:11.715189", ->>>>>>> f8524d526b (fix: added disable_rounded_total field) "modified_by": "Administrator", "module": "Selling", "name": "Quotation",