fix: validate percentage total
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index 031cf14..356dcda 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -123,5 +123,11 @@
},
validate: function(frm) {
if(frm.doc.lead_name) frappe.model.clear_doc("Lead", frm.doc.lead_name);
+
+ var total = 0;
+ for (var idx in frm.doc.sales_team) {
+ total += frm.doc.sales_team[idx].allocated_percentage;
+ if (total > 100) frappe.throw(__("Total contribution percentage can't exceed 100"));
+ }
},
});
\ No newline at end of file