From ee10f2f50d6aaedeaaff469007d7ac5f2276065c Mon Sep 17 00:00:00 2001 From: thefalconx33 Date: Mon, 23 Dec 2019 13:07:00 +0530 Subject: [PATCH] fix: bad query for debit_to field in sales invoice --- .../doctype/sales_invoice/sales_invoice.js | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 7f4ae3c1fc..db6ac55a11 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -556,22 +556,11 @@ cur_frm.cscript.cost_center = function(doc, cdt, cdn) { } cur_frm.set_query("debit_to", function(doc) { - // filter on Account - if (doc.customer) { - return { - filters: { - 'account_type': 'Receivable', - 'is_group': 0, - 'company': doc.company - } - } - } else { - return { - filters: { - 'report_type': 'Balance Sheet', - 'is_group': 0, - 'company': doc.company - } + return { + filters: { + 'account_type': 'Receivable', + 'is_group': 0, + 'company': doc.company } } });