mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
[fix] [minor] batch no get query
This commit is contained in:
@@ -340,7 +340,7 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
and batch_no like '%(txt)s'
|
and batch_no like '%(txt)s'
|
||||||
and exists(select * from `tabBatch`
|
and exists(select * from `tabBatch`
|
||||||
where name = sle.batch_no
|
where name = sle.batch_no
|
||||||
and expiry_date >= '%(posting_date)s'
|
and (ifnull(expiry_date, '')='' or expiry_date >= '%(posting_date)s')
|
||||||
and docstatus != 2)
|
and docstatus != 2)
|
||||||
%(mcond)s
|
%(mcond)s
|
||||||
group by batch_no having sum(actual_qty) > 0
|
group by batch_no having sum(actual_qty) > 0
|
||||||
@@ -353,11 +353,11 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
return webnotes.conn.sql("""select name from tabBatch
|
return webnotes.conn.sql("""select name from tabBatch
|
||||||
where docstatus != 2
|
where docstatus != 2
|
||||||
and item = '%(item_code)s'
|
and item = '%(item_code)s'
|
||||||
and expiry_date >= '%(posting_date)s'
|
and (ifnull(expiry_date, '')='' or expiry_date >= '%(posting_date)s')
|
||||||
and name like '%(txt)s'
|
and name like '%(txt)s'
|
||||||
%(mcond)s
|
%(mcond)s
|
||||||
order by name desc
|
order by name desc
|
||||||
limit %(start)s, %(page_len)s""" % {'item_code': filters['item_code'],
|
limit %(start)s, %(page_len)s""" % {'item_code': filters['item_code'],
|
||||||
'posting_date': filters['posting_date'], 'txt': "%%%s%%" % txt,
|
'posting_date': filters['posting_date'], 'txt': "%%%s%%" % txt,
|
||||||
'mcond':get_match_cond(doctype, searchfield),'start': start,
|
'mcond':get_match_cond(doctype, searchfield),'start': start,
|
||||||
'page_len': page_len})
|
'page_len': page_len})
|
||||||
|
|||||||
Reference in New Issue
Block a user