@@ -222,19 +222,21 @@ def get_project_name(doctype, txt, searchfield, start, page_len, filters):
222
222
"_txt" : txt .replace ('%' , '' )
223
223
})
224
224
225
- def get_delivery_notes_to_be_billed (doctype , txt , searchfield , start , page_len , filters ):
226
- return frappe .db .sql ("""select `tabDelivery Note`.name, `tabDelivery Note`.customer_name
225
+ def get_delivery_notes_to_be_billed (doctype , txt , searchfield , start , page_len , filters , as_dict ):
226
+ return frappe .db .sql ("""
227
+ select `tabDelivery Note`.name, `tabDelivery Note`.customer, `tabDelivery Note`.posting_date
227
228
from `tabDelivery Note`
228
229
where `tabDelivery Note`.`%(key)s` like %(txt)s and
229
- `tabDelivery Note`.docstatus = 1 and status not in ("Stopped", "Closed") %(fcond)s
230
+ `tabDelivery Note`.docstatus = 1 and `tabDelivery Note`.is_return = 0
231
+ and status not in ("Stopped", "Closed") %(fcond)s
230
232
and (`tabDelivery Note`.per_billed < 100 or `tabDelivery Note`.grand_total = 0)
231
233
%(mcond)s order by `tabDelivery Note`.`%(key)s` asc
232
- limit %(start)s, %(page_len)s """ % {
233
- "key" : searchfield ,
234
- "fcond" : get_filters_cond (doctype , filters , []),
235
- "mcond" : get_match_cond (doctype ),
236
- "start" : "%(start)s" , "page_len" : "%(page_len)s" , "txt" : "%(txt)s"
237
- }, { "start" : start , "page_len" : page_len , " txt" : ("%%%s%%" % txt ) })
234
+ """ % {
235
+ "key" : searchfield ,
236
+ "fcond" : get_filters_cond (doctype , filters , []),
237
+ "mcond" : get_match_cond (doctype ),
238
+ "txt" : "%(txt)s"
239
+ }, { "txt" : ("%%%s%%" % txt ) }, as_dict = as_dict )
238
240
239
241
def get_batch_no (doctype , txt , searchfield , start , page_len , filters ):
240
242
cond = ""
0 commit comments