added debit and credit note status
This commit is contained in:
parent
2f1db57fe1
commit
2285f90b64
@ -2787,7 +2787,7 @@
|
||||
"label": "Status",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "\nDraft\nSubmitted\nPaid\nUnpaid\nOverdue\nCancelled",
|
||||
"options": "\nDraft\nReturn\nDebit Note Issued\nSubmitted\nPaid\nUnpaid\nOverdue\nCancelled",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
@ -3293,7 +3293,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-11-08 11:49:00.752417",
|
||||
"modified": "2016-11-09 14:18:47.094777",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Purchase Invoice",
|
||||
|
@ -14,7 +14,9 @@ frappe.listview_settings['Purchase Invoice'] = {
|
||||
} else {
|
||||
return [__("Unpaid"), "orange", "outstanding_amount,>,0|due,>=,Today"];
|
||||
}
|
||||
} else if(flt(doc.outstanding_amount)==0 && doc.docstatus==1) {
|
||||
} else if(flt(doc.outstanding_amount) < 0 && doc.docstatus == 1) {
|
||||
return [__("Debit Note Issued"), "darkgrey", "outstanding_amount,<,0"]
|
||||
}else if(flt(doc.outstanding_amount)==0 && doc.docstatus==1) {
|
||||
return [__("Paid"), "green", "outstanding_amount,=,0"];
|
||||
}
|
||||
}
|
||||
|
@ -3081,7 +3081,7 @@
|
||||
"label": "Status",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
"options": "\nDraft\nSubmitted\nPaid\nUnpaid\nOverdue\nCancelled",
|
||||
"options": "\nDraft\nReturn\nCredit Note Issued\nSubmitted\nPaid\nUnpaid\nOverdue\nCancelled",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 1,
|
||||
@ -4039,7 +4039,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-11-08 11:47:43.494612",
|
||||
"modified": "2016-11-09 14:18:24.760263",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice",
|
||||
|
@ -10,7 +10,9 @@ frappe.listview_settings['Sales Invoice'] = {
|
||||
return [__("Return"), "darkgrey", "is_return,=,Yes"];
|
||||
} else if(flt(doc.outstanding_amount)==0) {
|
||||
return [__("Paid"), "green", "outstanding_amount,=,0"]
|
||||
} else if (flt(doc.outstanding_amount) > 0 && doc.due_date >= frappe.datetime.get_today()) {
|
||||
} else if(flt(doc.outstanding_amount) < 0) {
|
||||
return [__("Credit Note Issued"), "darkgrey", "outstanding_amount,<,0"]
|
||||
}else if (flt(doc.outstanding_amount) > 0 && doc.due_date >= frappe.datetime.get_today()) {
|
||||
return [__("Unpaid"), "orange", "outstanding_amount,>,0|due_date,>,Today"]
|
||||
} else if (flt(doc.outstanding_amount) > 0 && doc.due_date < frappe.datetime.get_today()) {
|
||||
return [__("Overdue"), "red", "outstanding_amount,>,0|due_date,<=,Today"]
|
||||
|
@ -44,7 +44,9 @@ status_map = {
|
||||
"Sales Invoice": [
|
||||
["Draft", None],
|
||||
["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"],
|
||||
["Credit Note Issued", "eval:self.outstanding_amount < 0 and self.docstatus==1"],
|
||||
["Paid", "eval:self.outstanding_amount==0 and self.docstatus==1 and self.is_return==0"],
|
||||
["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"],
|
||||
@ -52,7 +54,9 @@ status_map = {
|
||||
"Purchase Invoice": [
|
||||
["Draft", None],
|
||||
["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"],
|
||||
["Paid", "eval:self.outstanding_amount==0 and self.docstatus==1 and self.is_return==0"],
|
||||
["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"],
|
||||
|
@ -12,9 +12,11 @@ def execute():
|
||||
update
|
||||
`tabPurchase Invoice`
|
||||
set
|
||||
status = (Case When outstanding_amount = 0 and docstatus = 1 then 'Paid'
|
||||
status = (Case When outstanding_amount = 0 and docstatus = 1 and is_return = 0 then 'Paid'
|
||||
when due_date < CURDATE() and outstanding_amount > 0 and docstatus =1 then 'Overdue'
|
||||
when due_date >= CURDATE() and outstanding_amount > 0 and docstatus =1 then 'Unpaid'
|
||||
when outstanding_amount < 0 and docstatus =1 then 'Debit Note Issued'
|
||||
when is_return = 1 and docstatus =1 then 'Return'
|
||||
when docstatus = 2 then 'Cancelled'
|
||||
else 'Draft'
|
||||
End)""")
|
||||
@ -22,9 +24,11 @@ def execute():
|
||||
frappe.db.sql("""
|
||||
update
|
||||
`tabSales Invoice`
|
||||
set status = (Case When outstanding_amount = 0 and docstatus = 1 then 'Paid'
|
||||
set status = (Case When outstanding_amount = 0 and docstatus = 1 and is_return = 0 then 'Paid'
|
||||
when due_date < CURDATE() and outstanding_amount > 0 and docstatus =1 then 'Overdue'
|
||||
when due_date >= CURDATE() and outstanding_amount > 0 and docstatus =1 then 'Unpaid'
|
||||
when outstanding_amount < 0 and docstatus =1 then 'Credit Note Issued'
|
||||
when is_return = 1 and docstatus =1 then 'Return'
|
||||
when docstatus = 2 then 'Cancelled'
|
||||
else 'Draft'
|
||||
End)""")
|
Loading…
x
Reference in New Issue
Block a user