mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 07:54:46 +00:00
Improvise and fix indicators in Portal list (#15552)
This commit is contained in:
committed by
Rushabh Mehta
parent
3b11debcd2
commit
7d115183e4
@@ -4,7 +4,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe, erpnext
|
import frappe, erpnext
|
||||||
import frappe.defaults
|
import frappe.defaults
|
||||||
from frappe.utils import cint, flt, add_months, today, date_diff, getdate, add_days, cstr
|
from frappe.utils import cint, flt, add_months, today, date_diff, getdate, add_days, cstr, nowdate
|
||||||
from frappe import _, msgprint, throw
|
from frappe import _, msgprint, throw
|
||||||
from erpnext.accounts.party import get_party_account, get_due_date
|
from erpnext.accounts.party import get_party_account, get_due_date
|
||||||
from erpnext.controllers.stock_controller import update_gl_entries_after
|
from erpnext.controllers.stock_controller import update_gl_entries_after
|
||||||
@@ -54,9 +54,18 @@ class SalesInvoice(SellingController):
|
|||||||
|
|
||||||
def set_indicator(self):
|
def set_indicator(self):
|
||||||
"""Set indicator for portal"""
|
"""Set indicator for portal"""
|
||||||
if self.outstanding_amount > 0:
|
if cint(self.is_return) == 1:
|
||||||
|
self.indicator_title = _("Return")
|
||||||
|
self.indicator_color = "darkgrey"
|
||||||
|
elif self.outstanding_amount > 0 and getdate(self.due_date) >= getdate(nowdate()):
|
||||||
self.indicator_color = "orange"
|
self.indicator_color = "orange"
|
||||||
self.indicator_title = _("Unpaid")
|
self.indicator_title = _("Unpaid")
|
||||||
|
elif self.outstanding_amount > 0 and getdate(self.due_date) < getdate(nowdate()):
|
||||||
|
self.indicator_color = "red"
|
||||||
|
self.indicator_title = _("Overdue")
|
||||||
|
elif self.outstanding_amount < 0:
|
||||||
|
self.indicator_title = _("Credit Note Issued")
|
||||||
|
self.indicator_color = "darkgrey"
|
||||||
else:
|
else:
|
||||||
self.indicator_color = "green"
|
self.indicator_color = "green"
|
||||||
self.indicator_title = _("Paid")
|
self.indicator_title = _("Paid")
|
||||||
|
|||||||
@@ -19,8 +19,9 @@
|
|||||||
|
|
||||||
<div class="row transaction-subheading">
|
<div class="row transaction-subheading">
|
||||||
<div class="col-xs-6">
|
<div class="col-xs-6">
|
||||||
|
|
||||||
<span class="indicator {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "darkgrey") }}">
|
<span class="indicator {{ doc.indicator_color or ("blue" if doc.docstatus==1 else "darkgrey") }}">
|
||||||
{{ _(doc.indicator_title) or _(doc.status) or _("Submitted") }}
|
{{ _(doc.get('indicator_title')) or _(doc.status) or _("Submitted") }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 text-muted text-right small">
|
<div class="col-xs-6 text-muted text-right small">
|
||||||
|
|||||||
Reference in New Issue
Block a user