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) {