[fix] correctly choice 'Credit Limit' (#9932)

* [fix] correctly choice 'credit limit'

If 'Credit Days Based On' is empty in 'Supplier Type/Customer Group' then value 'Due Date' in 'Purchase/Sales Invoice' doesn't taken from the default settings

* Update party.py

* [fix] correctly choice 'Credit Limit'
This commit is contained in:
_JG_ 2017-07-18 23:57:09 -05:00 committed by Nabin Hait
parent e6c2ae3682
commit 96bb6099d6

View File

@ -284,12 +284,14 @@ def get_credit_days(party_type, party, company):
if not credit_days_based_on: if not credit_days_based_on:
if party_type == "Customer": if party_type == "Customer":
credit_days_based_on, credit_days = \ credit_days_based_on, credit_days = \
frappe.db.get_value("Customer Group", customer_group, ["credit_days_based_on", "credit_days"]) \ frappe.db.get_value("Customer Group", customer_group, ["credit_days_based_on", "credit_days"])
or frappe.db.get_value("Company", company, ["credit_days_based_on", "credit_days"])
else: else:
credit_days_based_on, credit_days = \ credit_days_based_on, credit_days = \
frappe.db.get_value("Supplier Type", supplier_type, ["credit_days_based_on", "credit_days"])\ frappe.db.get_value("Supplier Type", supplier_type, ["credit_days_based_on", "credit_days"])
or frappe.db.get_value("Company", company, ["credit_days_based_on", "credit_days"] )
if not (credit_days_based_on and credit_days):
credit_days_based_on, credit_days = \
frappe.db.get_value("Company", company, ["credit_days_based_on", "credit_days"])
return credit_days_based_on, credit_days return credit_days_based_on, credit_days