Merge pull request #18161 from deepeshgarg007/additional_discount
fix: Additonal discount not getting set in sales transactions
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 00efb4f..a2bae56 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -151,6 +151,11 @@
},
discount_amount: function(doc, cdt, cdn) {
+
+ if(doc.name === cdn) {
+ return;
+ }
+
var item = frappe.get_doc(cdt, cdn);
item.discount_percentage = 0.0;
this.apply_discount_on_item(doc, cdt, cdn, 'discount_amount');