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);
});
cur_frm.set_query("account_head", "taxes", function(doc) {
if(cur_frm.cscript.tax_table == "Sales Taxes and Charges") {
// setup queries for taxes
frappe.ui.form.on(cur_frm.doctype, "onload", function(frm) {
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"];
} else {
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 {
filters: {
'company': doc.company,
@ -164,6 +166,10 @@ cur_frm.set_query("cost_center", "taxes", function(doc) {
}
}
});
}
});
// For customizing print
cur_frm.pformat.total = function(doc) { return ''; }