Skip to content

Instantly share code, notes, and snippets.

@rmehta
Created July 6, 2014 07:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rmehta/8f4aedb91a6c58dfa31e to your computer and use it in GitHub Desktop.
Calcualate Total Quantity: ERPNext Custom Script Example
cur_frm.cscript.custom_validate = function() {
var sum = 0;
$.each(doc.entries, function(i, d) { sum += d.qty });
cur_frm.set_value(doc, "total_qty", sum);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment