Revert "[Fix] Error in sales invoice and POS if customer group not defined in the customer (#10148)" (#10159)
This reverts commit 4d2e782e42e9875429b5c55934c41dbc5d1d7b20.
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 0f8b92f..005abe6 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -273,7 +273,6 @@
return due_date
def get_credit_days(party_type, party, company):
- credit_days = 0
if party_type and party:
if party_type == "Customer":
credit_days_based_on, credit_days, customer_group = \
@@ -283,10 +282,10 @@
frappe.db.get_value(party_type, party, ["credit_days_based_on", "credit_days", "supplier_type"])
if not credit_days_based_on:
- if party_type == "Customer" and customer_group:
+ if party_type == "Customer":
credit_days_based_on, credit_days = \
frappe.db.get_value("Customer Group", customer_group, ["credit_days_based_on", "credit_days"])
- elif party_type == "Supplier" and supplier_type:
+ else:
credit_days_based_on, credit_days = \
frappe.db.get_value("Supplier Type", supplier_type, ["credit_days_based_on", "credit_days"])