brotherton-erpnext/erpnext/public/js/controllers/accounts.js

19 lines
546 B
JavaScript
Raw Normal View History

2013-10-10 11:05:09 +00:00
// get tax rate
cur_frm.cscript.account_head = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.account_head){
msgprint("Please select Charge Type first");
2014-02-14 10:17:51 +00:00
frappe.model.set_value(cdt, cdn, "account_head", "");
2013-10-10 11:05:09 +00:00
} else if(d.account_head && d.charge_type!=="Actual") {
2014-02-14 10:17:51 +00:00
frappe.call({
2013-10-10 11:05:09 +00:00
type:"GET",
method: "erpnext.controllers.accounts_controller.get_tax_rate",
2013-10-10 11:05:09 +00:00
args: {"account_head":d.account_head},
callback: function(r) {
2014-02-14 10:17:51 +00:00
frappe.model.set_value(cdt, cdn, "rate", r.message || 0);
2013-10-10 11:05:09 +00:00
}
})
}
}