feat: remove dunning as possible reference from payment entry
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 5793ecf..5da89a3 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -386,7 +386,7 @@
def get_valid_reference_doctypes(self):
if self.party_type == "Customer":
- return ("Sales Order", "Sales Invoice", "Journal Entry", "Dunning")
+ return ("Sales Order", "Sales Invoice", "Journal Entry")
elif self.party_type == "Supplier":
return ("Purchase Order", "Purchase Invoice", "Journal Entry")
elif self.party_type == "Shareholder":
@@ -1693,11 +1693,7 @@
ref_doc.company
)
- if reference_doctype == "Dunning":
- total_amount = outstanding_amount = ref_doc.get("dunning_amount")
- exchange_rate = 1
-
- elif reference_doctype == "Journal Entry" and ref_doc.docstatus == 1:
+ if reference_doctype == "Journal Entry" and ref_doc.docstatus == 1:
total_amount = ref_doc.get("total_amount")
if ref_doc.multi_currency:
exchange_rate = get_exchange_rate(
@@ -1930,7 +1926,7 @@
def set_party_type(dt):
- if dt in ("Sales Invoice", "Sales Order", "Dunning"):
+ if dt in ("Sales Invoice", "Sales Order"):
party_type = "Customer"
elif dt in ("Purchase Invoice", "Purchase Order"):
party_type = "Supplier"
@@ -1957,7 +1953,7 @@
def set_payment_type(dt, doc):
if (
- dt == "Sales Order" or (dt in ("Sales Invoice", "Dunning") and doc.outstanding_amount > 0)
+ dt == "Sales Order" or (dt == "Sales Invoice" and doc.outstanding_amount > 0)
) or (dt == "Purchase Invoice" and doc.outstanding_amount < 0):
payment_type = "Receive"
else:
@@ -1975,9 +1971,6 @@
else:
grand_total = doc.rounded_total or doc.grand_total
outstanding_amount = doc.outstanding_amount
- elif dt == "Dunning":
- grand_total = doc.grand_total
- outstanding_amount = doc.grand_total
else:
if party_account_currency == doc.company_currency:
grand_total = flt(doc.get("base_rounded_total") or doc.get("base_grand_total"))