From 1a943151d7b3930af8c5f46137732331c9fd339e Mon Sep 17 00:00:00 2001 From: shreyas Date: Fri, 29 Jan 2016 12:39:58 +0530 Subject: [PATCH] [Refactor/Cleanup] Cleaned debug print statement Refactored code to use format() instead of string formatting using %s --- .../sales_person_target_variance_item_group_wise.py | 1 - .../sales_person_wise_transaction_summary.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py index 8beefbe34b..d27816cf71 100644 --- a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py +++ b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py @@ -111,7 +111,6 @@ def get_achieved_details(filters, sales_person, item_groups): item_actual_details = {} for d in item_details: item_group = item_groups[d.item_code] - print item_group item_actual_details.setdefault(item_group, frappe._dict()).setdefault(d.month_name,\ frappe._dict({ "quantity" : 0, diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py index 155bec6bd8..e9930f32fa 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.py @@ -13,9 +13,9 @@ def execute(filters=None): entries = get_entries(filters) item_details = get_item_details() data = [] - total_contribution_amoount = 0 + total_contribution_amount = 0 for d in entries: - total_contribution_amoount += flt(d.contribution_amt) + total_contribution_amount += flt(d.contribution_amt) data.append([ d.name, d.customer, d.territory, d.posting_date, d.item_code, @@ -26,7 +26,7 @@ def execute(filters=None): if data: total_row = [""]*len(data[0]) total_row[0] = _("Total") - total_row[-1] = total_contribution_amoount + total_row[-1] = total_contribution_amount data.append(total_row) return columns, data @@ -71,7 +71,7 @@ def get_conditions(filters, date_field): if filters.get("sales_person"): lft, rgt = frappe.get_value("Sales Person", filters.get("sales_person"), ["lft", "rgt"]) - conditions.append("exists(select name from `tabSales Person` where lft >= %s and rgt <= %s and name=st.sales_person)" % (lft, rgt)) + conditions.append("exists(select name from `tabSales Person` where lft >= {0} and rgt <= {1} and name=st.sales_person)".format(lft, rgt)) if filters.get("from_date"): conditions.append("dt.{0}>=%s".format(date_field))