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"];
@ -154,17 +156,21 @@ cur_frm.set_query("account_head", "taxes", function(doc) {
"company": doc.company "company": doc.company
} }
} }
}); });
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,
'group_or_ledger': "Ledger" 'group_or_ledger': "Ledger"
} }
} }
});
}
}); });
// For customizing print // For customizing print
cur_frm.pformat.total = function(doc) { return ''; } cur_frm.pformat.total = function(doc) { return ''; }
cur_frm.pformat.discount_amount = function(doc) { return ''; } cur_frm.pformat.discount_amount = function(doc) { return ''; }