refactor: criteria for Credit Note Issued and Debit Note Issued
This commit is contained in:
parent
f6e4ac2b62
commit
8f695123cd
@ -1642,12 +1642,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:
|
||||||
|
|||||||
@ -1730,12 +1730,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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user