mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-03 16:40:19 +00:00
refactor(postgres): port General Ledger report query to the query builder
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@ def execute(filters=None):
|
|||||||
if filters and filters.get("print_in_account_currency") and not filters.get("account"):
|
if filters and filters.get("print_in_account_currency") and not filters.get("account"):
|
||||||
frappe.throw(_("Select an account to print in account currency"))
|
frappe.throw(_("Select an account to print in account currency"))
|
||||||
|
|
||||||
for acc in frappe.db.sql("""select name, is_group from tabAccount""", as_dict=1):
|
for acc in frappe.get_all("Account", fields=["name", "is_group"]):
|
||||||
account_details.setdefault(acc.name, acc)
|
account_details.setdefault(acc.name, acc)
|
||||||
|
|
||||||
if filters.get("party"):
|
if filters.get("party"):
|
||||||
@@ -650,10 +650,8 @@ def get_result_as_list(data, filters):
|
|||||||
|
|
||||||
def get_supplier_invoice_details():
|
def get_supplier_invoice_details():
|
||||||
inv_details = {}
|
inv_details = {}
|
||||||
for d in frappe.db.sql(
|
for d in frappe.get_all(
|
||||||
""" select name, bill_no from `tabPurchase Invoice`
|
"Purchase Invoice", filters={"docstatus": 1, "bill_no": ["is", "set"]}, fields=["name", "bill_no"]
|
||||||
where docstatus = 1 and bill_no is not null and bill_no != '' """,
|
|
||||||
as_dict=1,
|
|
||||||
):
|
):
|
||||||
inv_details[d.name] = d.bill_no
|
inv_details[d.name] = d.bill_no
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user