Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Anand Doshi
2012-05-29 15:47:47 +05:30
28 changed files with 380 additions and 200 deletions

View File

@@ -17,7 +17,7 @@
import webnotes
@webnotes.whitelist()
def get_report_list(arg=None):
def get_sc_list(arg=None):
"""return list of reports for the given module module"""
webnotes.response['values'] = webnotes.conn.sql("""select
distinct criteria_name, doc_type, parent_doc_type
@@ -26,4 +26,16 @@ def get_report_list(arg=None):
and docstatus in (0, NULL)
and ifnull(disabled, 0) = 0
order by criteria_name
limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True)
@webnotes.whitelist()
def get_report_list():
"""return list on new style reports for modules"""
webnotes.response['values'] = webnotes.conn.sql("""select
distinct tabReport.name, tabReport.ref_doctype
from `tabReport`, `tabDocType`
where tabDocType.module='%(module)s'
and tabDocType.name = tabReport.ref_doctype
and tabReport.docstatus in (0, NULL)
order by tabReport.name
limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True)

View File

@@ -20,17 +20,17 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
var route = wn.get_route();
if(route[1]=='Supplier') {
var supplier = locals.Supplier[route[2]]
var supplier = wn.container.page.frm.doc;
doc.supplier = supplier.name;
doc.supplier_name = supplier.supplier_name;
doc.address_type = 'Office';
} else if(route[1]=='Customer') {
var customer = locals.Customer[route[2]]
var customer = wn.container.page.frm.doc;
doc.customer = customer.name;
doc.customer_name = customer.customer_name;
doc.address_type = 'Office';
} else if(route[1]=='Sales Partner') {
var sp = locals['Sales Partner'][route[2]];
var sp = wn.container.page.frm.doc;
doc.sales_partner = sp.name;
doc.address_type = 'Office';
}

View File

@@ -21,18 +21,18 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) {
var route = wn.get_route();
if(route[1]=='Supplier') {
var supplier = locals.Supplier[route[2]]
var supplier = wn.container.page.frm.doc;
doc.supplier = supplier.name;
doc.supplier_name = supplier.supplier_name;
} else if(route[1]=='Customer') {
var customer = locals.Customer[route[2]];
var customer = wn.container.page.frm.doc;
doc.customer = customer.name;
doc.customer_name = customer.customer_name;
if(customer.customer_type == 'Individual') {
doc.first_name = customer.customer_name;
}
} else if(route[1]=='Sales Partner') {
var sp = locals['Sales Partner'][route[2]];
var sp = wn.container.page.frm.doc;
doc.sales_partner = sp.name;
}
}