fix: Sales and Purchase Invoice Status, Payment Reconciliation Credit/Debit Note (#19388)

This commit is contained in:
Marica
2019-11-07 12:52:23 +05:30
committed by Nabin Hait
parent 36520ef951
commit e37a67245e
4 changed files with 8 additions and 6 deletions

View File

@@ -49,7 +49,8 @@ status_map = {
["Submitted", "eval:self.docstatus==1"],
["Paid", "eval:self.outstanding_amount==0 and self.docstatus==1"],
["Return", "eval:self.is_return==1 and self.docstatus==1"],
["Debit Note Issued", "eval:self.outstanding_amount < 0 and self.docstatus==1"],
["Debit Note Issued",
"eval:self.outstanding_amount <= 0 and self.docstatus==1 and self.is_return==0 and get_value('Purchase Invoice', {'is_return': 1, 'return_against': self.name, 'docstatus': 1})"],
["Unpaid", "eval:self.outstanding_amount > 0 and getdate(self.due_date) >= getdate(nowdate()) and self.docstatus==1"],
["Overdue", "eval:self.outstanding_amount > 0 and getdate(self.due_date) < getdate(nowdate()) and self.docstatus==1"],
["Cancelled", "eval:self.docstatus==2"],
@@ -118,7 +119,6 @@ class StatusUpdater(Document):
if self.doctype in status_map:
_status = self.status
if status and update:
self.db_set("status", status)