0
0
Fork 0

fix: refs #4466 conficts

This commit is contained in:
Jorge Penadés 2024-02-02 15:28:10 +01:00
parent 814c8dc0e2
commit fed382d1fd
4 changed files with 40 additions and 37 deletions

View File

@ -48,7 +48,7 @@ const columns = computed(() => [
options: siiTypeInvoiceOuts.value, options: siiTypeInvoiceOuts.value,
model: 'siiTypeInvoiceOutFk', model: 'siiTypeInvoiceOutFk',
optionValue: 'id', optionValue: 'id',
optionLabel: 'id', optionLabel: 'code',
sortable: true, sortable: true,
tabIndex: 1, tabIndex: 1,
align: 'left', align: 'left',

View File

@ -113,14 +113,12 @@ const routes = reactive({
}, },
getCorrection: (invoiceInCorrection) => { getCorrection: (invoiceInCorrection) => {
if (invoiceInCorrection.correcting.length > 1) { if (invoiceInCorrection.correcting.length > 1) {
return; return {
// Se crea una sección aparte?
/* return {
name: 'InvoiceInList', name: 'InvoiceInList',
params: { query: {
search: invoiceInCorrection.correcting.join(), params: JSON.stringify({ correctedFk: entityId.value }),
}, },
}; */ };
} }
return { return {
@ -130,6 +128,9 @@ const routes = reactive({
}, },
}; };
}, },
getEntry: (id) => {
return { name: 'EntryCard', params: { id } };
},
}); });
const correctionFormData = reactive({ const correctionFormData = reactive({
id: +entityId.value, id: +entityId.value,
@ -143,7 +144,7 @@ onBeforeMount(async () => await setInvoiceCorrection(entityId.value));
watch( watch(
() => route.params.id, () => route.params.id,
async (newId, oldId) => { async (newId) => {
invoiceInCorrection.correcting.length = 0; invoiceInCorrection.correcting.length = 0;
invoiceInCorrection.corrected = null; invoiceInCorrection.corrected = null;
if (newId) await setInvoiceCorrection(entityId.value); if (newId) await setInvoiceCorrection(entityId.value);
@ -161,7 +162,7 @@ async function setInvoiceCorrection(id) {
}, },
}, },
}), }),
await axios.get('InvoiceInCorrections', { axios.get('InvoiceInCorrections', {
params: { params: {
filter: { filter: {
where: { where: {
@ -225,7 +226,6 @@ async function checkToBook() {
async function toBook() { async function toBook() {
await axios.post(`InvoiceIns/${entityId.value}/toBook`); await axios.post(`InvoiceIns/${entityId.value}/toBook`);
// Pendiente de sincronizar todo con arrayData
quasar.notify({ quasar.notify({
type: 'positive', type: 'positive',
message: t('globals.dataSaved'), message: t('globals.dataSaved'),
@ -327,7 +327,6 @@ const createInvoiceInCorrection = async () => {
@on-fetch="(data) => (invoiceCorrectionTypes = data)" @on-fetch="(data) => (invoiceCorrectionTypes = data)"
auto-load auto-load
/> />
<!--Refactor para añadir en el arrayData-->
<CardDescriptor <CardDescriptor
ref="cardDescriptorRef" ref="cardDescriptorRef"
module="InvoiceIn" module="InvoiceIn"
@ -417,16 +416,22 @@ const createInvoiceInCorrection = async () => {
</template> </template>
<template #actions="{ entity }"> <template #actions="{ entity }">
<QCardActions> <QCardActions>
<!--Falta crear supplier descriptor--> <QBtn
<!-- <QBtn
size="md" size="md"
icon="person" icon="vn:supplier"
color="primary" color="primary"
:to="routes.getSupplierRoute(entity.supplierFk)" :to="routes.getSupplier(entity.supplierFk)"
> >
<QTooltip>{{ t('invoiceIn.list.supplier') }}</QTooltip> <QTooltip>{{ t('invoiceIn.list.supplier') }}</QTooltip>
</QBtn> --> </QBtn>
<!--Sección entradas no disponible--> <QBtn
size="md"
icon="vn:entry"
color="primary"
:to="routes.getEntry(entity.entryFk)"
>
<QTooltip>{{ t('Entry') }}</QTooltip>
</QBtn>
<QBtn <QBtn
size="md" size="md"
icon="vn:ticket" icon="vn:ticket"
@ -552,4 +557,5 @@ es:
Create rectificative invoice: Crear factura rectificativa Create rectificative invoice: Crear factura rectificativa
Rectificative invoice: Factura rectificativa Rectificative invoice: Factura rectificativa
Original invoice: Factura origen Original invoice: Factura origen
Entry: entrada
</i18n> </i18n>

View File

@ -7,6 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import FetchData from 'components/FetchData.vue'; import FetchData from 'components/FetchData.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue'; import VnInputDate from 'components/common/VnInputDate.vue';
import { useFirstUpper } from 'src/composables/useFirstUpper';
const { t } = useI18n(); const { t } = useI18n();
const props = defineProps({ const props = defineProps({
@ -36,6 +37,19 @@ const suppliersRef = ref();
</div> </div>
</template> </template>
<template #body="{ params, searchFn }"> <template #body="{ params, searchFn }">
<QItem>
<QItemSection>
<VnInput
:label="useFirstUpper(t('params.correctedFk'))"
v-model="params.correctedFk"
is-outlined
>
<template #prepend>
<QIcon name="attachment" size="sm" />
</template>
</VnInput>
</QItemSection>
</QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnInput <VnInput
@ -218,6 +232,7 @@ en:
serial: Serial serial: Serial
account: Account account: Account
isBooked: is booked isBooked: is booked
correctedFk: Rectificatives
es: es:
params: params:
search: Contiene search: Contiene
@ -234,6 +249,7 @@ es:
account: Cuenta account: Cuenta
created: Creada created: Creada
dued: Vencida dued: Vencida
correctedFk: Rectificativas
From: Desde From: Desde
To: Hasta To: Hasta
Amount: Importe Amount: Importe

View File

@ -1,5 +1,4 @@
import { RouterView } from 'vue-router'; import { RouterView } from 'vue-router';
import axios from 'axios';
export default { export default {
path: '/invoice-in', path: '/invoice-in',
@ -17,8 +16,8 @@ export default {
'InvoiceInVat', 'InvoiceInVat',
'InvoiceInDueDay', 'InvoiceInDueDay',
'InvoiceInIntrastat', 'InvoiceInIntrastat',
'InvoiceInLog',
'InvoiceInCorrective', 'InvoiceInCorrective',
'InvoiceInLog',
], ],
}, },
children: [ children: [
@ -43,24 +42,6 @@ export default {
name: 'InvoiceInCard', name: 'InvoiceInCard',
path: ':id', path: ':id',
component: () => import('src/pages/InvoiceIn/Card/InvoiceInCard.vue'), component: () => import('src/pages/InvoiceIn/Card/InvoiceInCard.vue'),
beforeEnter: async (to, from, next) => {
const card = to.matched.find((match) => match.name == 'InvoiceInCard');
const corrective = card.children.find(
(child) => child.name == 'InvoiceInCorrective'
);
const { data: correctings } = await axios.get('InvoiceInCorrections', {
params: {
filter: {
where: {
correctingFk: to.params.id,
},
},
},
});
corrective.meta.hidden = !correctings.length > 0;
next();
},
redirect: { name: 'InvoiceInSummary' }, redirect: { name: 'InvoiceInSummary' },
children: [ children: [
{ {