mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 23:52:57 +00:00
[fix] Batch selected in the sales transaction for non batch item (#11713)
This commit is contained in:
committed by
Nabin Hait
parent
82ef26b327
commit
15f8fe0179
@@ -149,7 +149,7 @@ def get_batches(item_code, warehouse, qty=1, throw=False):
|
||||
'select batch_id, sum(actual_qty) as qty from `tabBatch` join `tabStock Ledger Entry` '
|
||||
'on `tabBatch`.batch_id = `tabStock Ledger Entry`.batch_no '
|
||||
'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 '
|
||||
'order by `tabBatch`.expiry_date DESC, `tabBatch`.creation ASC',
|
||||
(item_code, warehouse),
|
||||
|
||||
Reference in New Issue
Block a user