fix: refs #8581 update field references for supplier withholding in InvoiceInDescriptorMenu
This commit is contained in:
parent
dfb5cfb513
commit
43e0134d41
|
@ -1,5 +1,5 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, toRefs, reactive } from 'vue';
|
import { ref, computed, toRefs, reactive, onBeforeMount } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { useQuasar } from 'quasar';
|
import { useQuasar } from 'quasar';
|
||||||
|
@ -111,10 +111,9 @@ async function cloneInvoice() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const isAgricultural = () => {
|
const isAgricultural = () => {
|
||||||
if (!config.value) return false;
|
|
||||||
return (
|
return (
|
||||||
invoiceIn.value?.supplier?.sageWithholdingFk ===
|
invoiceIn.value?.supplier?.sageWithholdingFk ==
|
||||||
config?.value[0]?.sageFarmerWithholdingFk
|
config.value?.sageFarmerWithholdingFk
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
function showPdfInvoice() {
|
function showPdfInvoice() {
|
||||||
|
@ -153,162 +152,179 @@ const createInvoiceInCorrection = async () => {
|
||||||
);
|
);
|
||||||
push({ path: `/invoice-in/${correctingId}/summary` });
|
push({ path: `/invoice-in/${correctingId}/summary` });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
config.value = (
|
||||||
|
await axios.get('invoiceinConfigs/findOne', {
|
||||||
|
params: { fields: ['sageFarmerWithholdingFk'] },
|
||||||
|
})
|
||||||
|
).data;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<FetchData
|
<template v-if="config">
|
||||||
url="InvoiceCorrectionTypes"
|
<FetchData
|
||||||
@on-fetch="(data) => (invoiceCorrectionTypes = data)"
|
url="InvoiceCorrectionTypes"
|
||||||
auto-load
|
@on-fetch="(data) => (invoiceCorrectionTypes = data)"
|
||||||
/>
|
auto-load
|
||||||
<FetchData
|
/>
|
||||||
url="CplusRectificationTypes"
|
<FetchData
|
||||||
@on-fetch="(data) => (cplusRectificationTypes = data)"
|
url="CplusRectificationTypes"
|
||||||
auto-load
|
@on-fetch="(data) => (cplusRectificationTypes = data)"
|
||||||
/>
|
auto-load
|
||||||
<FetchData
|
/>
|
||||||
url="SiiTypeInvoiceIns"
|
<FetchData
|
||||||
:where="{ code: { like: 'R%' } }"
|
url="SiiTypeInvoiceIns"
|
||||||
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
:where="{ code: { like: 'R%' } }"
|
||||||
auto-load
|
@on-fetch="(data) => (siiTypeInvoiceIns = data)"
|
||||||
/>
|
auto-load
|
||||||
<FetchData
|
/>
|
||||||
url="InvoiceInConfigs"
|
<InvoiceInToBook>
|
||||||
:where="{ fields: ['sageFarmerWithholdingFk'] }"
|
<template #content="{ book }">
|
||||||
auto-load
|
<QItem
|
||||||
@on-fetch="(data) => (config = data)"
|
v-if="!invoice?.isBooked && canEditProp('toBook')"
|
||||||
/>
|
v-ripple
|
||||||
<InvoiceInToBook>
|
clickable
|
||||||
<template #content="{ book }">
|
@click="book(entityId)"
|
||||||
<QItem
|
>
|
||||||
v-if="!invoice?.isBooked && canEditProp('toBook')"
|
<QItemSection>{{ t('invoiceIn.descriptorMenu.book') }}</QItemSection>
|
||||||
v-ripple
|
</QItem>
|
||||||
clickable
|
</template>
|
||||||
@click="book(entityId)"
|
</InvoiceInToBook>
|
||||||
|
<QItem
|
||||||
|
v-if="invoice?.isBooked && canEditProp('toUnbook')"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="triggerMenu('unbook')"
|
||||||
|
>
|
||||||
|
<QItemSection>
|
||||||
|
{{ t('invoiceIn.descriptorMenu.unbook') }}
|
||||||
|
</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="canEditProp('deleteById')"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="triggerMenu('delete')"
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('invoiceIn.descriptorMenu.deleteInvoice') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem
|
||||||
|
v-if="canEditProp('clone')"
|
||||||
|
v-ripple
|
||||||
|
clickable
|
||||||
|
@click="triggerMenu('clone')"
|
||||||
|
>
|
||||||
|
<QItemSection>{{ t('invoiceIn.descriptorMenu.cloneInvoice') }}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('showPdf')">
|
||||||
|
<QItemSection>{{
|
||||||
|
t('invoiceIn.descriptorMenu.showAgriculturalPdf')
|
||||||
|
}}</QItemSection>
|
||||||
|
</QItem>
|
||||||
|
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('sendPdf')">
|
||||||
|
<QItemSection
|
||||||
|
>{{ t('invoiceIn.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection
|
||||||
>
|
>
|
||||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.book') }}</QItemSection>
|
</QItem>
|
||||||
</QItem>
|
<QItem
|
||||||
</template>
|
v-if="!invoiceInCorrection.corrected"
|
||||||
</InvoiceInToBook>
|
v-ripple
|
||||||
<QItem
|
clickable
|
||||||
v-if="invoice?.isBooked && canEditProp('toUnbook')"
|
@click="triggerMenu('correct')"
|
||||||
v-ripple
|
data-cy="createCorrectiveItem"
|
||||||
clickable
|
|
||||||
@click="triggerMenu('unbook')"
|
|
||||||
>
|
|
||||||
<QItemSection>
|
|
||||||
{{ t('invoiceIn.descriptorMenu.unbook') }}
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem
|
|
||||||
v-if="canEditProp('deleteById')"
|
|
||||||
v-ripple
|
|
||||||
clickable
|
|
||||||
@click="triggerMenu('delete')"
|
|
||||||
>
|
|
||||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.deleteInvoice') }}</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem v-if="canEditProp('clone')" v-ripple clickable @click="triggerMenu('clone')">
|
|
||||||
<QItemSection>{{ t('invoiceIn.descriptorMenu.cloneInvoice') }}</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('showPdf')">
|
|
||||||
<QItemSection>{{
|
|
||||||
t('invoiceIn.descriptorMenu.showAgriculturalPdf')
|
|
||||||
}}</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem v-if="isAgricultural()" v-ripple clickable @click="triggerMenu('sendPdf')">
|
|
||||||
<QItemSection
|
|
||||||
>{{ t('invoiceIn.descriptorMenu.sendAgriculturalPdf') }}...</QItemSection
|
|
||||||
>
|
>
|
||||||
</QItem>
|
<QItemSection
|
||||||
<QItem
|
>{{ t('invoiceIn.descriptorMenu.createCorrective') }}...</QItemSection
|
||||||
v-if="!invoiceInCorrection.corrected"
|
>
|
||||||
v-ripple
|
</QItem>
|
||||||
clickable
|
<QItem
|
||||||
@click="triggerMenu('correct')"
|
v-if="invoice.dmsFk"
|
||||||
data-cy="createCorrectiveItem"
|
v-ripple
|
||||||
>
|
clickable
|
||||||
<QItemSection
|
@click="downloadFile(invoice.dmsFk)"
|
||||||
>{{ t('invoiceIn.descriptorMenu.createCorrective') }}...</QItemSection
|
|
||||||
>
|
>
|
||||||
</QItem>
|
<QItemSection>{{ t('components.smartCard.downloadFile') }}</QItemSection>
|
||||||
<QItem v-if="invoice.dmsFk" v-ripple clickable @click="downloadFile(invoice.dmsFk)">
|
</QItem>
|
||||||
<QItemSection>{{ t('components.smartCard.downloadFile') }}</QItemSection>
|
<QDialog ref="correctionDialogRef">
|
||||||
</QItem>
|
<QCard>
|
||||||
<QDialog ref="correctionDialogRef">
|
<QCardSection>
|
||||||
<QCard>
|
<QItem class="q-px-none">
|
||||||
<QCardSection>
|
<span class="text-primary text-h6 full-width">
|
||||||
<QItem class="q-px-none">
|
{{ t('Create rectificative invoice') }}
|
||||||
<span class="text-primary text-h6 full-width">
|
</span>
|
||||||
{{ t('Create rectificative invoice') }}
|
<QBtn icon="close" flat round dense v-close-popup />
|
||||||
</span>
|
</QItem>
|
||||||
<QBtn icon="close" flat round dense v-close-popup />
|
</QCardSection>
|
||||||
</QItem>
|
<QCardSection>
|
||||||
</QCardSection>
|
<QItem>
|
||||||
<QCardSection>
|
<QItemSection>
|
||||||
<QItem>
|
<QInput
|
||||||
<QItemSection>
|
:label="t('Original invoice')"
|
||||||
<QInput
|
v-model="entityId"
|
||||||
:label="t('Original invoice')"
|
readonly
|
||||||
v-model="entityId"
|
/>
|
||||||
readonly
|
<VnSelect
|
||||||
/>
|
:label="`${useCapitalize(t('globals.class'))}`"
|
||||||
<VnSelect
|
v-model="correctionFormData.invoiceClass"
|
||||||
:label="`${useCapitalize(t('globals.class'))}`"
|
:options="siiTypeInvoiceIns"
|
||||||
v-model="correctionFormData.invoiceClass"
|
option-value="id"
|
||||||
:options="siiTypeInvoiceIns"
|
option-label="code"
|
||||||
option-value="id"
|
:required="true"
|
||||||
option-label="code"
|
/>
|
||||||
:required="true"
|
</QItemSection>
|
||||||
/>
|
<QItemSection>
|
||||||
</QItemSection>
|
<VnSelect
|
||||||
<QItemSection>
|
:label="`${useCapitalize(t('globals.type'))}`"
|
||||||
<VnSelect
|
v-model="correctionFormData.invoiceType"
|
||||||
:label="`${useCapitalize(t('globals.type'))}`"
|
:options="cplusRectificationTypes"
|
||||||
v-model="correctionFormData.invoiceType"
|
option-value="id"
|
||||||
:options="cplusRectificationTypes"
|
option-label="description"
|
||||||
option-value="id"
|
:required="true"
|
||||||
option-label="description"
|
>
|
||||||
:required="true"
|
<template #option="{ itemProps, opt }">
|
||||||
>
|
<QItem v-bind="itemProps">
|
||||||
<template #option="{ itemProps, opt }">
|
<QItemSection>
|
||||||
<QItem v-bind="itemProps">
|
<QItemLabel
|
||||||
<QItemSection>
|
>{{ opt.id }} -
|
||||||
<QItemLabel
|
{{ opt.description }}</QItemLabel
|
||||||
>{{ opt.id }} -
|
>
|
||||||
{{ opt.description }}</QItemLabel
|
</QItemSection>
|
||||||
>
|
</QItem>
|
||||||
</QItemSection>
|
<div></div>
|
||||||
</QItem>
|
</template>
|
||||||
<div></div>
|
</VnSelect>
|
||||||
</template>
|
|
||||||
</VnSelect>
|
|
||||||
|
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="`${useCapitalize(t('globals.reason'))}`"
|
:label="`${useCapitalize(t('globals.reason'))}`"
|
||||||
v-model="correctionFormData.invoiceReason"
|
v-model="correctionFormData.invoiceReason"
|
||||||
:options="invoiceCorrectionTypes"
|
:options="invoiceCorrectionTypes"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
option-label="description"
|
option-label="description"
|
||||||
:required="true"
|
:required="true"
|
||||||
/>
|
/>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardActions class="justify-end q-mr-sm">
|
<QCardActions class="justify-end q-mr-sm">
|
||||||
<QBtn flat :label="t('globals.close')" color="primary" v-close-popup />
|
<QBtn
|
||||||
<QBtn
|
flat
|
||||||
:label="t('globals.save')"
|
:label="t('globals.close')"
|
||||||
color="primary"
|
color="primary"
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click="createInvoiceInCorrection"
|
/>
|
||||||
:disable="isNotFilled"
|
<QBtn
|
||||||
/>
|
:label="t('globals.save')"
|
||||||
</QCardActions>
|
color="primary"
|
||||||
</QCard>
|
v-close-popup
|
||||||
</QDialog>
|
@click="createInvoiceInCorrection"
|
||||||
|
:disable="isNotFilled"
|
||||||
|
/>
|
||||||
|
</QCardActions>
|
||||||
|
</QCard>
|
||||||
|
</QDialog>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
isNotLinked: The entry {bookEntry} has been deleted with {accountingEntries} entries
|
isNotLinked: The entry {bookEntry} has been deleted with {accountingEntries} entries
|
||||||
|
|
Loading…
Reference in New Issue