Added Disabled field to Supplier and Customer doctype
Frozen field is moved to More Information section for Customer and Supplier. Any Supplier/Customer which is disabled will not be shown while creating PO/SO
This commit is contained in:
@@ -89,7 +89,7 @@ def customer_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
return frappe.db.sql("""select {fields} from `tabCustomer`
|
||||
where docstatus < 2
|
||||
and ({key} like %(txt)s
|
||||
or customer_name like %(txt)s)
|
||||
or customer_name like %(txt)s) and disabled=0
|
||||
{mcond}
|
||||
order by
|
||||
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
|
||||
@@ -118,7 +118,7 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters):
|
||||
return frappe.db.sql("""select {field} from `tabSupplier`
|
||||
where docstatus < 2
|
||||
and ({key} like %(txt)s
|
||||
or supplier_name like %(txt)s)
|
||||
or supplier_name like %(txt)s) and disabled=0
|
||||
{mcond}
|
||||
order by
|
||||
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
|
||||
@@ -216,12 +216,8 @@ def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len,
|
||||
return frappe.db.sql("""select `tabDelivery Note`.name, `tabDelivery Note`.customer_name
|
||||
from `tabDelivery Note`
|
||||
where `tabDelivery Note`.`%(key)s` like %(txt)s and
|
||||
`tabDelivery Note`.docstatus = 1 and status not in ("Stopped", "Closed") %(fcond)s and
|
||||
(ifnull((select sum(qty) from `tabDelivery Note Item` where
|
||||
`tabDelivery Note Item`.parent=`tabDelivery Note`.name), 0) >
|
||||
ifnull((select sum(qty) from `tabSales Invoice Item` where
|
||||
`tabSales Invoice Item`.docstatus = 1 and
|
||||
`tabSales Invoice Item`.delivery_note=`tabDelivery Note`.name), 0))
|
||||
`tabDelivery Note`.docstatus = 1 and status not in ("Stopped", "Closed") %(fcond)s
|
||||
and `tabDelivery Note`.per_billed < 100
|
||||
%(mcond)s order by `tabDelivery Note`.`%(key)s` asc
|
||||
limit %(start)s, %(page_len)s""" % {
|
||||
"key": searchfield,
|
||||
|
||||
Reference in New Issue
Block a user