batch.expiry should be sorted in ascending order too (#11960)
diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py
index 6dac647..760643c 100644
--- a/erpnext/stock/doctype/batch/batch.py
+++ b/erpnext/stock/doctype/batch/batch.py
@@ -151,7 +151,7 @@
'where `tabStock Ledger Entry`.item_code = %s and `tabStock Ledger Entry`.warehouse = %s '
'and (`tabBatch`.expiry_date >= CURDATE() or `tabBatch`.expiry_date IS NULL)'
'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),
as_dict=True
)