diff --git a/models/doctype/Invoice/InvoiceList.js b/models/doctype/Invoice/InvoiceList.js index a09af228..2cca530c 100644 --- a/models/doctype/Invoice/InvoiceList.js +++ b/models/doctype/Invoice/InvoiceList.js @@ -1,4 +1,5 @@ import { _ } from 'frappejs/utils'; +import indicators from 'frappejs/ui/constants/indicators'; export default { doctype: 'Invoice', @@ -8,7 +9,16 @@ export default { { label: 'Status', getValue(doc) { - return doc.submitted ? 'Paid' : 'Pending'; + if (doc.submitted === 1 && doc.outstandingAmount === 0.0) { + return 'Paid'; + } + return 'Pending'; + }, + getIndicator(doc) { + if (doc.submitted === 1 && doc.outstandingAmount === 0.0) { + return indicators.GREEN; + } + return indicators.ORANGE; } }, 'grandTotal', diff --git a/src/pages/ListView/List.vue b/src/pages/ListView/List.vue index 2c924141..d1564142 100644 --- a/src/pages/ListView/List.vue +++ b/src/pages/ListView/List.vue @@ -6,8 +6,9 @@ - - {{ frappe.format(column.getValue(doc), column.fieldtype || {}) }} + + + {{ frappe.format(column.getValue(doc), column.fieldtype || {}) }}