Account type=Income/Expense allowed in income/expense account searching in sales/pur invoice

This commit is contained in:
Nabin Hait 2012-06-05 15:27:12 +05:30
parent f24d2efe2c
commit 252a7a189b
2 changed files with 2 additions and 2 deletions

View File

@ -292,7 +292,7 @@ cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn)
// Expense Head
// -------------
cur_frm.fields_dict['entries'].grid.get_field("expense_head").get_query = function(doc) {
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.debit_or_credit="Debit" AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"';
return 'SELECT tabAccount.name FROM tabAccount WHERE (tabAccount.debit_or_credit="Debit" OR tabAccount.account_type = "Expense Account") AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"';
}
cur_frm.cscript.expense_head = function(doc, cdt, cdn){
var d = locals[cdt][cdn];

View File

@ -390,7 +390,7 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
// Income Account in Details Table
// --------------------------------
cur_frm.fields_dict.entries.grid.get_field("income_account").get_query = function(doc) {
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.debit_or_credit="Credit" AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus!=2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"';
return 'SELECT tabAccount.name FROM tabAccount WHERE (tabAccount.debit_or_credit="Credit" OR tabAccount.account_type = "Income Account") AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus!=2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"';
}
// warehouse in detail table