mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 13:09:17 +00:00
Merge pull request #44025 from Ninad1306/disable_rounded_total_for_quotation
This commit is contained in:
@@ -65,6 +65,7 @@
|
|||||||
"grand_total",
|
"grand_total",
|
||||||
"rounding_adjustment",
|
"rounding_adjustment",
|
||||||
"rounded_total",
|
"rounded_total",
|
||||||
|
"disable_rounded_total",
|
||||||
"in_words",
|
"in_words",
|
||||||
"section_break_44",
|
"section_break_44",
|
||||||
"apply_discount_on",
|
"apply_discount_on",
|
||||||
@@ -663,6 +664,7 @@
|
|||||||
"width": "200px"
|
"width": "200px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval:!doc.disable_rounded_total",
|
||||||
"fieldname": "base_rounding_adjustment",
|
"fieldname": "base_rounding_adjustment",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Rounding Adjustment (Company Currency)",
|
"label": "Rounding Adjustment (Company Currency)",
|
||||||
@@ -711,6 +713,7 @@
|
|||||||
"width": "200px"
|
"width": "200px"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"depends_on": "eval:!doc.disable_rounded_total",
|
||||||
"fieldname": "rounding_adjustment",
|
"fieldname": "rounding_adjustment",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Rounding Adjustment",
|
"label": "Rounding Adjustment",
|
||||||
@@ -1073,23 +1076,29 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_medium",
|
"fieldname": "utm_medium",
|
||||||
"print_hide": 1,
|
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Medium",
|
"label": "Medium",
|
||||||
"options": "UTM Medium"
|
"options": "UTM Medium",
|
||||||
|
"print_hide": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "utm_content",
|
"fieldname": "utm_content",
|
||||||
"print_hide": 1,
|
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Content"
|
"label": "Content",
|
||||||
|
"print_hide": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "disable_rounded_total",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Disable Rounded Total"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-shopping-cart",
|
"icon": "fa fa-shopping-cart",
|
||||||
"idx": 82,
|
"idx": 82,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-06-28 10:32:47.638342",
|
"modified": "2024-11-07 18:37:11.715189",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Selling",
|
"module": "Selling",
|
||||||
"name": "Quotation",
|
"name": "Quotation",
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ class Quotation(SellingController):
|
|||||||
customer_address: DF.Link | None
|
customer_address: DF.Link | None
|
||||||
customer_group: DF.Link | None
|
customer_group: DF.Link | None
|
||||||
customer_name: DF.Data | None
|
customer_name: DF.Data | None
|
||||||
|
disable_rounded_total: DF.Check
|
||||||
discount_amount: DF.Currency
|
discount_amount: DF.Currency
|
||||||
enq_det: DF.Text | None
|
enq_det: DF.Text | None
|
||||||
grand_total: DF.Currency
|
grand_total: DF.Currency
|
||||||
|
|||||||
@@ -738,6 +738,20 @@ class TestQuotation(IntegrationTestCase):
|
|||||||
item_doc.taxes = []
|
item_doc.taxes = []
|
||||||
item_doc.save()
|
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)
|
||||||
|
|
||||||
|
|
||||||
def enable_calculate_bundle_price(enable=1):
|
def enable_calculate_bundle_price(enable=1):
|
||||||
selling_settings = frappe.get_doc("Selling Settings")
|
selling_settings = frappe.get_doc("Selling Settings")
|
||||||
|
|||||||
Reference in New Issue
Block a user