mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
refactor: criteria for Credit Note Issued and Debit Note Issued
(cherry picked from commit 8f695123cd)
This commit is contained in:
@@ -1538,12 +1538,8 @@ class PurchaseInvoice(BuyingController):
|
|||||||
elif outstanding_amount > 0 and getdate(self.due_date) >= getdate():
|
elif outstanding_amount > 0 and getdate(self.due_date) >= getdate():
|
||||||
self.status = "Unpaid"
|
self.status = "Unpaid"
|
||||||
# Check if outstanding amount is 0 due to debit note issued against invoice
|
# Check if outstanding amount is 0 due to debit note issued against invoice
|
||||||
elif (
|
elif self.is_return == 0 and frappe.db.get_value(
|
||||||
outstanding_amount <= 0
|
"Purchase Invoice", {"is_return": 1, "return_against": self.name, "docstatus": 1}
|
||||||
and self.is_return == 0
|
|
||||||
and frappe.db.get_value(
|
|
||||||
"Purchase Invoice", {"is_return": 1, "return_against": self.name, "docstatus": 1}
|
|
||||||
)
|
|
||||||
):
|
):
|
||||||
self.status = "Debit Note Issued"
|
self.status = "Debit Note Issued"
|
||||||
elif self.is_return == 1:
|
elif self.is_return == 1:
|
||||||
|
|||||||
@@ -1696,12 +1696,8 @@ class SalesInvoice(SellingController):
|
|||||||
elif outstanding_amount > 0 and getdate(self.due_date) >= getdate():
|
elif outstanding_amount > 0 and getdate(self.due_date) >= getdate():
|
||||||
self.status = "Unpaid"
|
self.status = "Unpaid"
|
||||||
# Check if outstanding amount is 0 due to credit note issued against invoice
|
# Check if outstanding amount is 0 due to credit note issued against invoice
|
||||||
elif (
|
elif self.is_return == 0 and frappe.db.get_value(
|
||||||
outstanding_amount <= 0
|
"Sales Invoice", {"is_return": 1, "return_against": self.name, "docstatus": 1}
|
||||||
and self.is_return == 0
|
|
||||||
and frappe.db.get_value(
|
|
||||||
"Sales Invoice", {"is_return": 1, "return_against": self.name, "docstatus": 1}
|
|
||||||
)
|
|
||||||
):
|
):
|
||||||
self.status = "Credit Note Issued"
|
self.status = "Credit Note Issued"
|
||||||
elif self.is_return == 1:
|
elif self.is_return == 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user