mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
batch.expiry should be sorted in ascending order too (#11960)
This commit is contained in:
@@ -151,7 +151,7 @@ def get_batches(item_code, warehouse, qty=1, throw=False):
|
|||||||
'where `tabStock Ledger Entry`.item_code = %s and `tabStock Ledger Entry`.warehouse = %s '
|
'where `tabStock Ledger Entry`.item_code = %s and `tabStock Ledger Entry`.warehouse = %s '
|
||||||
'and (`tabBatch`.expiry_date >= CURDATE() or `tabBatch`.expiry_date IS NULL)'
|
'and (`tabBatch`.expiry_date >= CURDATE() or `tabBatch`.expiry_date IS NULL)'
|
||||||
'group by batch_id '
|
'group by batch_id '
|
||||||
'order by `tabBatch`.expiry_date DESC, `tabBatch`.creation ASC',
|
'order by `tabBatch`.expiry_date ASC, `tabBatch`.creation ASC',
|
||||||
(item_code, warehouse),
|
(item_code, warehouse),
|
||||||
as_dict=True
|
as_dict=True
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user