mirror of
https://github.com/frappe/books.git
synced 2026-08-24 10:04:45 -05:00
fix: hide unpaid status in sales quote
This commit is contained in:
@@ -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') {
|
||||||
|
|||||||
Reference in New Issue
Block a user