From d608042de43dee12dafe1805a35a2a3d20799a60 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 27 Aug 2013 10:51:41 +0530 Subject: [PATCH] [fix] [minor] batch no get query --- selling/doctype/sales_common/sales_common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selling/doctype/sales_common/sales_common.py b/selling/doctype/sales_common/sales_common.py index 3c43c1ede7..baa8850a58 100644 --- a/selling/doctype/sales_common/sales_common.py +++ b/selling/doctype/sales_common/sales_common.py @@ -340,7 +340,7 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters): and batch_no like '%(txt)s' and exists(select * from `tabBatch` where name = sle.batch_no - and expiry_date >= '%(posting_date)s' + and (ifnull(expiry_date, '')='' or expiry_date >= '%(posting_date)s') and docstatus != 2) %(mcond)s 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 where docstatus != 2 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' %(mcond)s order by name desc limit %(start)s, %(page_len)s""" % {'item_code': filters['item_code'], 'posting_date': filters['posting_date'], 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield),'start': start, - 'page_len': page_len}) \ No newline at end of file + 'page_len': page_len})