[fix] [minor] batch no get query

This commit is contained in:
Nabin Hait
2013-08-27 10:51:41 +05:30
parent 23b3610fe8
commit d608042de4

View File

@@ -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,7 +353,7 @@ 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