This commit is contained in:
Rushabh Mehta 2015-03-02 16:29:56 +05:30
parent 3384cb7e63
commit 8c84fca182

View File

@ -139,9 +139,11 @@ frappe.ui.form.on(cur_frm.doctype, "taxes_on_form_rendered", function(frm) {
erpnext.taxes.set_conditional_mandatory_rate_or_amount(frm); erpnext.taxes.set_conditional_mandatory_rate_or_amount(frm);
}); });
// setup queries for taxes
cur_frm.set_query("account_head", "taxes", function(doc) { frappe.ui.form.on(cur_frm.doctype, "onload", function(frm) {
if(cur_frm.cscript.tax_table == "Sales Taxes and Charges") { if(frm.get_field("taxes")) {
frm.set_query("account_head", "taxes", function(doc) {
if(frm.cscript.tax_table == "Sales Taxes and Charges") {
var account_type = ["Tax", "Chargeable", "Expense Account"]; var account_type = ["Tax", "Chargeable", "Expense Account"];
} else { } else {
var account_type = ["Tax", "Chargeable", "Income Account"]; var account_type = ["Tax", "Chargeable", "Income Account"];
@ -156,7 +158,7 @@ cur_frm.set_query("account_head", "taxes", function(doc) {
} }
}); });
cur_frm.set_query("cost_center", "taxes", function(doc) { frm.set_query("cost_center", "taxes", function(doc) {
return { return {
filters: { filters: {
'company': doc.company, 'company': doc.company,
@ -164,6 +166,10 @@ cur_frm.set_query("cost_center", "taxes", function(doc) {
} }
} }
}); });
}
});
// For customizing print // For customizing print
cur_frm.pformat.total = function(doc) { return ''; } cur_frm.pformat.total = function(doc) { return ''; }