From b6524946bc9a708b7d1dcc8c1c29b3d0feec7b4f Mon Sep 17 00:00:00 2001 From: Ninad1306 Date: Tue, 12 Nov 2024 15:25:14 +0530 Subject: [PATCH] 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")