From 3349f1af10147f0c76ba0e2be7ef87ef84bdca69 Mon Sep 17 00:00:00 2001 From: akshayitzme Date: Tue, 1 Aug 2023 11:12:13 +0530 Subject: [PATCH] fix: return status colors --- models/helpers.ts | 6 +++--- src/components/StatusPill.vue | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/models/helpers.ts b/models/helpers.ts index 9d270ac3..024fcda6 100644 --- a/models/helpers.ts +++ b/models/helpers.ts @@ -273,14 +273,14 @@ function getSubmittableDocStatus(doc: RenderData | Doc) { if ( [ModelNameEnum.Shipment, ModelNameEnum.PurchaseReceipt].includes( - doc.schemaName as ModelNameEnum + doc.schema.name as ModelNameEnum ) ) { - if (doc.isReturn && doc.isSubmitted) { + if (!!doc.returnAgainst && doc.submitted && !doc.cancelled) { return 'Return'; } - if (doc.isItemsReturned && doc.isSubmitted) { + if (doc.isReturned && doc.submitted && !doc.cancelled) { return 'ReturnIssued'; } } diff --git a/src/components/StatusPill.vue b/src/components/StatusPill.vue index 7ee301ed..a6cafe24 100644 --- a/src/components/StatusPill.vue +++ b/src/components/StatusPill.vue @@ -63,8 +63,8 @@ const statusColorMap: Record = { Paid: 'green', Saved: 'blue', Submitted: 'blue', - Return: 'orange', - ReturnIssued: 'gray', + Return: 'green', + ReturnIssued: 'green', }; function getStatus(doc: Doc) {