From 604eb9d689b9884735f1c5250adfa0c02271a797 Mon Sep 17 00:00:00 2001 From: ashish Date: Thu, 16 Nov 2017 11:05:59 +0530 Subject: [PATCH] added flag to function get_customer_outstanding and removed names in comments --- .../customer_credit_balance.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py index 87f1ee738a..194d12cb77 100644 --- a/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py +++ b/erpnext/selling/report/customer_credit_balance/customer_credit_balance.py @@ -19,11 +19,11 @@ def execute(filters=None): for d in customer_list: row = [] - #PR : 10861, Author : ashish-greycube & jigneshpshah, Email:mr.ashish.shah@gmail.com. 3rd arg is added - outstanding_amt = get_customer_outstanding(d.name, filters.get("company"),'customer_credit_balance_report') - credit_limit = get_credit_limit(d.name, filters.get("company")) + #3rd argument has flag + outstanding_amt = get_customer_outstanding(d.name, filters.get("company"),False) + credit_limit = get_credit_limit(d.name, filters.get("company")) bal = flt(credit_limit) - flt(outstanding_amt) - #PR : 10861, Author : ashish-greycube & jigneshpshah, Email:mr.ashish.shah@gmail.com. Value of new col is passed + #Value of new col is passed if customer_naming_type == "Naming Series": row = [d.name, d.customer_name, d.bypass_credit_limit_check_at_sales_order, credit_limit, outstanding_amt, bal] else: @@ -36,9 +36,8 @@ def execute(filters=None): def get_columns(customer_naming_type): columns = [ - #PR : 10861, Author : ashish-greycube & jigneshpshah, Email:mr.ashish.shah@gmail.com # New column is added to reflect status of bypass credit limit check flag of sales order - _("Customer") + ":Link/Customer:120",_("Bypass credit check at Sales Order ") + ":Check:30", _("Credit Limit") + ":Currency:120", + _("Customer") + ":Link/Customer:120", _("Bypass credit check at Sales Order ") + ":Check:30", _("Credit Limit") + ":Currency:120", _("Outstanding Amt") + ":Currency:100", _("Credit Balance") + ":Currency:120" ] @@ -52,7 +51,7 @@ def get_details(filters): if filters.get("customer"): conditions += " where name = %(customer)s" - #PR : 10861, Author : ashish-greycube & jigneshpshah, Email:mr.ashish.shah@gmail.com + # Return column bypass credit limit check at sales order level - return frappe.db.sql("""select name, customer_name,bypass_credit_limit_check_at_sales_order from `tabCustomer` %s""" - % conditions, filters, as_dict=1) + return frappe.db.sql("""select name, customer_name, bypass_credit_limit_check_at_sales_order from `tabCustomer` %s""" + % conditions, filters, as_dict=1) \ No newline at end of file