blob: 201c47e2bb59a13868a90f4f0ca2e898edc15eb6 [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",
11 method: "controllers.accounts_controller.get_tax_rate",
12 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}