Merge pull request #15838 from codingCoffee/pal

fix(P&L): sql query
This commit is contained in:
Ameya Shenoy 2018-10-26 19:22:10 +05:30 committed by GitHub
commit 6535465ce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,8 +341,8 @@ def set_gl_entries_by_account(
accounts = frappe.db.sql_list("""select name from `tabAccount`
where lft >= %s and rgt <= %s""", (root_lft, root_rgt))
additional_conditions += " and account in ('{}')"\
.format("', '".join([frappe.db.escape(d) for d in accounts]))
additional_conditions += " and account in ({})"\
.format(", ".join([frappe.db.escape(d) for d in accounts]))
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year, debit_in_account_currency, credit_in_account_currency, account_currency from `tabGL Entry`
where company=%(company)s