Created
April 7, 2015 12:16
-
-
Save rmehta/d93fa92611de4de00d93 to your computer and use it in GitHub Desktop.
Frappe Custom Script. Trigger on add row (version 4)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cur_frm.cscript.set_total = function(doc, dt, dn) { | |
var grand_total = 0; | |
$.each(doc.z_items, function(i, d) { grand_total += d.qty; }); | |
cur_frm.set_value("grand_total", grand_total); | |
} | |
cur_frm.cscript.z_items_add = function(doc) { | |
cur_frm.cscript.set_total(doc); | |
} | |
cur_frm.cscript.qty: function(doc) { | |
frm.cscript.set_total(doc); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
correction for line 11:
cur_frm.cscript.qty = function(doc){