chore: orderby in gle
This commit is contained in:
parent
47c78a5a73
commit
005c5a587f
@ -4,6 +4,7 @@
|
|||||||
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
|
||||||
@ -2235,13 +2236,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):
|
||||||
return frappe.db.sql(
|
gle = frappe.qb.DocType("GL Entry")
|
||||||
"""select account, debit, credit, cost_center, is_cancelled
|
return (
|
||||||
from `tabGL Entry` where voucher_type=%s and voucher_no=%s
|
frappe.qb.from_(gle)
|
||||||
order by account desc""",
|
.select(gle.account, gle.debit, gle.credit, gle.cost_center, gle.is_cancelled)
|
||||||
(voucher_type, voucher_no),
|
.where((gle.voucher_type == voucher_type) & (gle.voucher_no == voucher_no))
|
||||||
as_dict=1,
|
.orderby(gle.account, gle.debit, order=Order.desc)
|
||||||
)
|
).run(as_dict=True)
|
||||||
|
|
||||||
|
|
||||||
def get_taxes(**args):
|
def get_taxes(**args):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user