mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-29 22:57:42 +00:00
fix(selling): list billable sales orders oldest first (backport #59010)
Billable Sales Orders are listed oldest first.
(cherry picked from commit 5dfd21cce6)
This commit is contained in:
@@ -2149,7 +2149,7 @@ def get_potentially_billable_sales_orders(
|
||||
item = qb.DocType("Item")
|
||||
|
||||
query = frappe.qb.get_query(
|
||||
"Sales Order", fields=["name", "customer", "transaction_date"], filters=filters
|
||||
"Sales Order", fields=["name", "customer", "transaction_date", "creation"], filters=filters
|
||||
)
|
||||
if txt:
|
||||
query = query.where(get_text_search_criterion(so, txt))
|
||||
@@ -2162,7 +2162,8 @@ def get_potentially_billable_sales_orders(
|
||||
.where(get_potentially_billable_item_criterion(so, so_item, item))
|
||||
.where(Criterion.all(build_qb_match_conditions("Sales Order")))
|
||||
.distinct()
|
||||
.orderby(so.transaction_date, order=Order.desc)
|
||||
.orderby(so.transaction_date, order=Order.asc)
|
||||
.orderby(so.creation, order=Order.asc)
|
||||
.limit(cint(page_len))
|
||||
.offset(cint(start))
|
||||
.run(as_dict=True)
|
||||
|
||||
Reference in New Issue
Block a user