fix: hide unpaid status in sales quote

This commit is contained in:
AbleKSaju
2025-11-05 13:02:01 +05:30
parent b3e957d39c
commit 3349140eda
+16 -1
View File
@@ -1,11 +1,14 @@
<template> <template>
<p class="pill font-medium" :class="styleClass">{{ text }}</p> <p v-if="showStatus" class="pill font-medium" :class="styleClass">
{{ text }}
</p>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Doc } from 'fyo/model/doc'; import { Doc } from 'fyo/model/doc';
import { isPesa } from 'fyo/utils'; import { isPesa } from 'fyo/utils';
import { Invoice } from 'models/baseModels/Invoice/Invoice'; import { Invoice } from 'models/baseModels/Invoice/Invoice';
import { Party } from 'models/baseModels/Party/Party'; import { Party } from 'models/baseModels/Party/Party';
import { ModelNameEnum } from 'models/types';
import { Money } from 'pesa'; import { Money } from 'pesa';
import { getBgTextColorClass } from 'src/utils/colors'; import { getBgTextColorClass } from 'src/utils/colors';
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
@@ -15,6 +18,11 @@ type UIColors = 'gray' | 'orange' | 'red' | 'green' | 'blue' | 'yellow';
export default defineComponent({ export default defineComponent({
props: { doc: { type: Doc, required: true } }, props: { doc: { type: Doc, required: true } },
data() {
return {
showStatus: true,
};
},
computed: { computed: {
styleClass(): string { styleClass(): string {
return getBgTextColorClass(this.color); return getBgTextColorClass(this.color);
@@ -23,6 +31,13 @@ export default defineComponent({
return getStatus(this.doc); return getStatus(this.doc);
}, },
text() { text() {
if (
this.doc.schemaName === ModelNameEnum.SalesQuote &&
this.doc.isSubmitted
) {
this.showStatus = false;
}
const hasOutstanding = isPesa(this.doc.outstandingAmount); const hasOutstanding = isPesa(this.doc.outstandingAmount);
if (hasOutstanding && this.status === 'Unpaid') { if (hasOutstanding && this.status === 'Unpaid') {