Revert "chore: orderby in gle"

This reverts commit 005c5a587f.
This commit is contained in:
Deepesh Garg
2024-01-14 11:25:58 +05:30
parent 13e5578bc6
commit 9500254861

View File

@@ -4,7 +4,6 @@
import frappe import frappe
from frappe.tests.utils import FrappeTestCase, change_settings from frappe.tests.utils import FrappeTestCase, change_settings
from frappe.utils import add_days, cint, cstr, flt, nowtime, today from frappe.utils import add_days, cint, cstr, flt, nowtime, today
from pypika import Order
from pypika import functions as fn from pypika import functions as fn
import erpnext import erpnext
@@ -2254,13 +2253,13 @@ def get_sl_entries(voucher_type, voucher_no):
def get_gl_entries(voucher_type, voucher_no): def get_gl_entries(voucher_type, voucher_no):
gle = frappe.qb.DocType("GL Entry") return frappe.db.sql(
return ( """select account, debit, credit, cost_center, is_cancelled
frappe.qb.from_(gle) from `tabGL Entry` where voucher_type=%s and voucher_no=%s
.select(gle.account, gle.debit, gle.credit, gle.cost_center, gle.is_cancelled) order by account desc""",
.where((gle.voucher_type == voucher_type) & (gle.voucher_no == voucher_no)) (voucher_type, voucher_no),
.orderby(gle.account, gle.debit, order=Order.desc) as_dict=1,
).run(as_dict=True) )
def get_taxes(**args): def get_taxes(**args):