From 7944ea3067a32a8bf470abbb1f54f05c3f0d07f8 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 31 Oct 2013 19:05:38 +0530 Subject: [PATCH 1/3] [minor] [fix] plugin patch --- patches/october_2013/p05_server_custom_script_to_file.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/patches/october_2013/p05_server_custom_script_to_file.py b/patches/october_2013/p05_server_custom_script_to_file.py index 3a7e770265..b1d4f2116d 100644 --- a/patches/october_2013/p05_server_custom_script_to_file.py +++ b/patches/october_2013/p05_server_custom_script_to_file.py @@ -21,8 +21,12 @@ def execute(): for name, dt, script in webnotes.conn.sql("""select name, dt, script from `tabCustom Script` where script_type='Server'"""): if script.strip(): - script = indent_using_tabs(script) - make_custom_server_script_file(dt, script) + try: + script = indent_using_tabs(script) + make_custom_server_script_file(dt, script) + except IOError, e: + if "already exists" not in repr(e): + raise def indent_using_tabs(script): for line in script.split("\n"): From b950a71fb281859e61ad4709fbdf6a0576cb21ef Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 31 Oct 2013 19:06:11 +0530 Subject: [PATCH 2/3] [minor] [fix] sales funnel --- selling/page/sales_funnel/sales_funnel.js | 6 +++--- selling/page/sales_funnel/sales_funnel.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/selling/page/sales_funnel/sales_funnel.js b/selling/page/sales_funnel/sales_funnel.js index e2c3a98bf5..5ad61f7ad4 100644 --- a/selling/page/sales_funnel/sales_funnel.js +++ b/selling/page/sales_funnel/sales_funnel.js @@ -8,14 +8,14 @@ wn.pages['sales-funnel'].onload = function(wrapper) { single_column: true }); - wrapper.crm_funnel = new erpnext.CRMFunnel(wrapper); + wrapper.sales_funnel = new erpnext.SalesFunnel(wrapper); wrapper.appframe.add_module_icon("Selling", "sales-funnel", function() { wn.set_route("selling-home"); }); } -erpnext.CRMFunnel = Class.extend({ +erpnext.SalesFunnel = Class.extend({ init: function(wrapper) { var me = this; // 0 setTimeout hack - this gives time for canvas to get width and height @@ -72,7 +72,7 @@ erpnext.CRMFunnel = Class.extend({ var me = this; wn.call({ module: "selling", - page: "crm_funnel", + page: "sales_funnel", method: "get_funnel_data", args: { from_date: this.options.from_date, diff --git a/selling/page/sales_funnel/sales_funnel.py b/selling/page/sales_funnel/sales_funnel.py index be0aebe7bb..dfcf5e8a9b 100644 --- a/selling/page/sales_funnel/sales_funnel.py +++ b/selling/page/sales_funnel/sales_funnel.py @@ -7,23 +7,23 @@ import webnotes @webnotes.whitelist() def get_funnel_data(from_date, to_date): active_leads = webnotes.conn.sql("""select count(*) from `tabLead` - where (`modified` between %s and %s) + where (date(`modified`) between %s and %s) and status != "Do Not Contact" """, (from_date, to_date))[0][0] active_leads += webnotes.conn.sql("""select count(distinct customer) from `tabContact` - where (`modified` between %s and %s) + where (date(`modified`) between %s and %s) and status != "Passive" """, (from_date, to_date))[0][0] opportunities = webnotes.conn.sql("""select count(*) from `tabOpportunity` - where docstatus = 1 and (`modified` between %s and %s) + where docstatus = 1 and (date(`creation`) between %s and %s) and status != "Lost" """, (from_date, to_date))[0][0] quotations = webnotes.conn.sql("""select count(*) from `tabQuotation` - where docstatus = 1 and (`modified` between %s and %s) + where docstatus = 1 and (date(`creation`) between %s and %s) and status != "Lost" """, (from_date, to_date))[0][0] sales_orders = webnotes.conn.sql("""select count(*) from `tabQuotation` - where docstatus = 1 and (`modified` between %s and %s)""", (from_date, to_date))[0][0] + where docstatus = 1 and (date(`creation`) between %s and %s)""", (from_date, to_date))[0][0] return [ { "title": "Active Leads / Customers", "value": active_leads, "color": "#B03B46" }, From cb72e01e9d1639cab03debf560b59cd6762a822e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 31 Oct 2013 19:06:34 +0530 Subject: [PATCH 3/3] [minor] email footer link points to erpnext.org --- startup/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup/__init__.py b/startup/__init__.py index 802daac9b3..1d963232e7 100644 --- a/startup/__init__.py +++ b/startup/__init__.py @@ -29,7 +29,7 @@ profile_defaults = { # add startup propertes mail_footer = """
Sent via - ERPNext
""" + ERPNext""" def get_monthly_bulk_mail_limit(): import webnotes