Skip to content

Instantly share code, notes, and snippets.

@nathando
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathando/1ba8890013464c26ad5c to your computer and use it in GitHub Desktop.
Save nathando/1ba8890013464c26ad5c to your computer and use it in GitHub Desktop.
Sales Invoice
cur_frm.cscript.custom_refresh = function(doc, dt, dn) {
var sales_invoice = locals[dt][dn];
var total_com = total_com_senior = 0;
cur_frm.set_value('sales_commission_value', -2);
wn.call({
method: "accounts.doctype.sales_invoice.sales_invoice.get_sale_commission",
args: {},
callback: function(r) {
console.log("Received value ", r); // Return {message:1"}
cur_frm.set_value('sales_commission_value', r.message);
}
});
}
@webnotes.whitelist()
def get_sale_commission():
return 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment