blob: 789d72bfd5c258e35bc8dfa89d8bf59340715cb1 [file] [log] [blame]
Rushabh Mehtaf56d73c2013-10-10 16:35:09 +05301
2// get tax rate
3cur_frm.cscript.account_head = function(doc, cdt, cdn) {
4 var d = locals[cdt][cdn];
5 if(!d.charge_type && d.account_head){
6 msgprint("Please select Charge Type first");
7 wn.model.set_value(cdt, cdn, "account_head", "");
8 } else if(d.account_head && d.charge_type!=="Actual") {
9 wn.call({
10 type:"GET",
Anand Doshi9a4a13c2013-12-31 17:38:21 +053011 method: "erpnext.controllers.accounts_controller.get_tax_rate",
Rushabh Mehtaf56d73c2013-10-10 16:35:09 +053012 args: {"account_head":d.account_head},
13 callback: function(r) {
14 wn.model.set_value(cdt, cdn, "rate", r.message || 0);
15 }
16 })
17 }
18}