Skip to content

Commit 67ddcf9

Browse files
committed
Merge branch 'develop'
2 parents 3bd15fb + def2e46 commit 67ddcf9

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

erpnext/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from __future__ import unicode_literals
33
import frappe
44

5-
__version__ = '8.0.27'
5+
__version__ = '8.0.28'
66

77
def get_default_company(user=None):
88
'''Get default company for user'''

erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
7979
get_query_filters: {
8080
docstatus: 1,
8181
status: ["!=", "Closed"],
82-
company: me.frm.doc.company
82+
company: me.frm.doc.company,
83+
is_return: 0
8384
}
8485
})
8586
}, __("Get items from"));

erpnext/accounts/doctype/sales_invoice/sales_invoice.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,12 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
142142
target: me.frm,
143143
date_field: "posting_date",
144144
setters: {
145-
company: me.frm.doc.company
145+
customer: me.frm.doc.customer || undefined
146146
},
147147
get_query: function() {
148148
var filters = {
149149
docstatus: 1,
150+
company: me.frm.doc.company
150151
};
151152
if(me.frm.doc.customer) filters["customer"] = me.frm.doc.customer;
152153
return {

erpnext/controllers/queries.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,21 @@ def get_project_name(doctype, txt, searchfield, start, page_len, filters):
222222
"_txt": txt.replace('%', '')
223223
})
224224

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
227228
from `tabDelivery Note`
228229
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
230232
and (`tabDelivery Note`.per_billed < 100 or `tabDelivery Note`.grand_total = 0)
231233
%(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)
238240

239241
def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
240242
cond = ""

0 commit comments

Comments
 (0)