mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
fix: validate percentage total
This commit is contained in:
committed by
Nabin Hait
parent
78827d8d79
commit
76eddcc29f
@@ -123,5 +123,11 @@ frappe.ui.form.on("Customer", {
|
|||||||
},
|
},
|
||||||
validate: function(frm) {
|
validate: function(frm) {
|
||||||
if(frm.doc.lead_name) frappe.model.clear_doc("Lead", frm.doc.lead_name);
|
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"));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user