{{ _('Grand Total') }}
{{ formattedValue('grandTotal') }}
@@ -161,16 +175,17 @@
diff --git a/src/utils.js b/src/utils.js
index 4a166eb1..c27f4e49 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -264,4 +264,18 @@ export async function runWindowAction(name) {
break;
}
return name;
-}
\ No newline at end of file
+}
+
+export function getStatusAndColor(doc) {
+ let status = 'Unpaid';
+ let color = 'orange';
+ if (!doc.submitted) {
+ status = 'Draft';
+ color = 'gray';
+ }
+ if (doc.submitted === 1 && doc.outstandingAmount === 0.0) {
+ status = 'Paid';
+ color = 'green';
+ }
+ return { status, color };
+}