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,
model: 'siiTypeInvoiceOutFk',
optionValue: 'id',
optionLabel: 'id',
optionLabel: 'code',
sortable: true,
tabIndex: 1,
align: 'left',

View File

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

View File

@ -7,6 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import FetchData from 'components/FetchData.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import { useFirstUpper } from 'src/composables/useFirstUpper';
const { t } = useI18n();
const props = defineProps({
@ -36,6 +37,19 @@ const suppliersRef = ref();
</div>
</template>
<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>
<QItemSection>
<VnInput
@ -218,6 +232,7 @@ en:
serial: Serial
account: Account
isBooked: is booked
correctedFk: Rectificatives
es:
params:
search: Contiene
@ -234,6 +249,7 @@ es:
account: Cuenta
created: Creada
dued: Vencida
correctedFk: Rectificativas
From: Desde
To: Hasta
Amount: Importe

View File

@ -1,5 +1,4 @@
import { RouterView } from 'vue-router';
import axios from 'axios';
export default {
path: '/invoice-in',
@ -17,8 +16,8 @@ export default {
'InvoiceInVat',
'InvoiceInDueDay',
'InvoiceInIntrastat',
'InvoiceInLog',
'InvoiceInCorrective',
'InvoiceInLog',
],
},
children: [
@ -43,24 +42,6 @@ export default {
name: 'InvoiceInCard',
path: ':id',
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' },
children: [
{