mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
[get_query]to server side
This commit is contained in:
@@ -113,14 +113,12 @@ cur_frm.fields_dict['supplier_address'].get_query = function(doc, cdt, cdn) {
|
||||
return {
|
||||
filters: {'supplier': doc.supplier}
|
||||
}
|
||||
// return 'SELECT name,address_line1,city FROM tabAddress WHERE supplier = "'+ doc.supplier +'" AND docstatus != 2 AND name LIKE "%s" ORDER BY name ASC LIMIT 50';
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
|
||||
return {
|
||||
filters: {'supplier': doc.supplier}
|
||||
}
|
||||
// return 'SELECT name,CONCAT(first_name," ",ifnull(last_name,"")) As FullName,department,designation FROM tabContact WHERE supplier = "'+ doc.supplier +'" AND docstatus != 2 AND name LIKE "%s" ORDER BY name ASC LIMIT 50';
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['po_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) {
|
||||
@@ -131,18 +129,6 @@ cur_frm.fields_dict['po_details'].grid.get_field('project_name').get_query = fun
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['indent_no'].get_query = function(doc) {
|
||||
return{
|
||||
filters:[
|
||||
['Material Request', 'material_request_type', '=', 'Purchase'],
|
||||
['Material Request', 'company', '=', doc.company],
|
||||
['Material Request', 'docstatus', '=', '1'],
|
||||
['Material Request', 'status', '!=', 'Stopped'],
|
||||
['Material Request', 'per_ordered', '<', 99.99]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.get_last_purchase_rate = function(doc, cdt, cdn){
|
||||
$c_obj(make_doclist(doc.doctype, doc.name), 'get_last_purchase_rate', '', function(r, rt) {
|
||||
refresh_field(cur_frm.cscript.fname);
|
||||
|
||||
@@ -48,12 +48,10 @@ cur_frm.fields_dict['item_code'].get_query = function(doc, cdt, cdn) {
|
||||
filter:{
|
||||
'parent': doc.purchase_receipt_no
|
||||
}
|
||||
// return 'SELECT item_code, item_name, description FROM `tabPurchase Receipt Item` WHERE parent = "'+ doc.purchase_receipt_no +'" and docstatus != 2 AND item_code LIKE "%s" ORDER BY item_code ASC LIMIT 50';
|
||||
else if (doc.delivery_note_no)
|
||||
filter:{
|
||||
'parent': doc.delivery_note_no
|
||||
}
|
||||
// return 'SELECT item_code, item_name, description FROM `tabDelivery Note Item` WHERE parent = "'+ doc.delivery_note_no +'" and docstatus != 2 AND item_code LIKE "%s" ORDER BY item_code ASC LIMIT 50';
|
||||
return{
|
||||
filters: filter
|
||||
}
|
||||
|
||||
@@ -72,18 +72,6 @@ cur_frm.fields_dict['quotation_items'].grid.get_field('project_name').get_query
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['indent_no'].get_query = function(doc) {
|
||||
return{
|
||||
filters:[
|
||||
['Material Request', 'material_request_type', '=', 'Purchase'],
|
||||
['Material Request', 'company', '=', doc.company],
|
||||
['Material Request', 'docstatus', '=', 1],
|
||||
['Material Request', 'status', '!=', 'Stopped'],
|
||||
['Material Request', 'per_ordered', '<', 99.99]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.supplier_address = function(doc, dt, dn) {
|
||||
if (doc.supplier) {
|
||||
get_server_fields("get_supplier_address", JSON.stringify({supplier: doc.supplier,
|
||||
@@ -102,4 +90,4 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
|
||||
return {
|
||||
filters:{'supplier': doc.supplier}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user