batch.expiry should be sorted in ascending order too (#11960)

This commit is contained in:
Zarrar 2017-12-12 18:54:17 +05:30 committed by Nabin Hait
parent bb7fab52d1
commit 21ea6cdb91

View File

@ -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 '
'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
)