Merge branch 'dev' into 8673-viewEntryNotesField
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Benjamin Esteve 2025-03-26 09:45:12 +00:00
commit bb77f771da
11 changed files with 62 additions and 18 deletions

View File

@ -35,6 +35,10 @@ const $props = defineProps({
type: String, type: String,
default: null, default: null,
}, },
hasFile: {
type: Boolean,
default: false,
},
}); });
const warehouses = ref(); const warehouses = ref();
@ -90,6 +94,7 @@ function defaultData() {
if ($props.formInitialData) return (dms.value = $props.formInitialData); if ($props.formInitialData) return (dms.value = $props.formInitialData);
return addDefaultData({ return addDefaultData({
reference: route.params.id, reference: route.params.id,
hasFile: $props.hasFile,
}); });
} }

View File

@ -884,7 +884,7 @@ components:
openCard: View openCard: View
openSummary: Summary openSummary: Summary
viewSummary: Summary viewSummary: Summary
cardDescriptor: vnDescriptor:
mainList: Main list mainList: Main list
summary: Summary summary: Summary
moreOptions: More options moreOptions: More options

View File

@ -968,7 +968,7 @@ components:
openCard: Ficha openCard: Ficha
openSummary: Detalles openSummary: Detalles
viewSummary: Vista previa viewSummary: Vista previa
cardDescriptor: vnDescriptor:
mainList: Listado principal mainList: Listado principal
summary: Resumen summary: Resumen
moreOptions: Más opciones moreOptions: Más opciones

View File

@ -25,7 +25,8 @@ const invoiceInFormRef = ref();
const invoiceId = +route.params.id; const invoiceId = +route.params.id;
const filter = { where: { invoiceInFk: invoiceId } }; const filter = { where: { invoiceInFk: invoiceId } };
const areRows = ref(false); const areRows = ref(false);
const totals = ref(); const totalTaxableBase = ref();
const noMatch = computed(() => totalAmount.value != totalTaxableBase.value);
const columns = computed(() => [ const columns = computed(() => [
{ {
name: 'duedate', name: 'duedate',
@ -74,9 +75,12 @@ async function insert() {
notify(t('globals.dataSaved'), 'positive'); notify(t('globals.dataSaved'), 'positive');
} }
onBeforeMount(async () => { async function setTaxableBase() {
totals.value = (await axios.get(`InvoiceIns/${invoiceId}/getTotals`)).data; const { data } = await axios.get(`InvoiceIns/${invoiceId}/getTotals`);
}); totalTaxableBase.value = data.totalTaxableBase;
}
onBeforeMount(async () => await setTaxableBase());
</script> </script>
<template> <template>
<CrudModel <CrudModel
@ -89,13 +93,14 @@ onBeforeMount(async () => {
:data-required="{ invoiceInFk: invoiceId }" :data-required="{ invoiceInFk: invoiceId }"
v-model:selected="rowsSelected" v-model:selected="rowsSelected"
@on-fetch="(data) => (areRows = !!data.length)" @on-fetch="(data) => (areRows = !!data.length)"
@save-changes="setTaxableBase"
> >
<template #body="{ rows }"> <template #body="{ rows }">
<QTable <QTable
v-model:selected="rowsSelected" v-model:selected="rowsSelected"
selection="multiple" selection="multiple"
:columns="columns" :columns
:rows="rows" :rows
row-key="$index" row-key="$index"
:grid="$q.screen.lt.sm" :grid="$q.screen.lt.sm"
> >
@ -151,7 +156,18 @@ onBeforeMount(async () => {
<QTd /> <QTd />
<QTd /> <QTd />
<QTd> <QTd>
{{ toCurrency(totalAmount) }} <QChip
dense
:color="noMatch ? 'negative' : 'transparent'"
class="q-pa-xs"
:title="
noMatch
? t('invoiceIn.noMatch', { totalTaxableBase })
: ''
"
>
{{ toCurrency(totalAmount) }}
</QChip>
</QTd> </QTd>
<QTd> <QTd>
<template v-if="isNotEuro(invoiceIn.currency.code)"> <template v-if="isNotEuro(invoiceIn.currency.code)">
@ -237,7 +253,7 @@ onBeforeMount(async () => {
if (!areRows) insert(); if (!areRows) insert();
else else
invoiceInFormRef.insert({ invoiceInFormRef.insert({
amount: (totals.totalTaxableBase - totalAmount).toFixed(2), amount: (totalTaxableBase - totalAmount).toFixed(2),
invoiceInFk: invoiceId, invoiceInFk: invoiceId,
}); });
} }
@ -249,6 +265,10 @@ onBeforeMount(async () => {
.bg { .bg {
background-color: var(--vn-light-gray); background-color: var(--vn-light-gray);
} }
.q-chip {
color: var(--vn-text-color);
}
</style> </style>
<i18n> <i18n>
es: es:

View File

@ -304,7 +304,10 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
:color="amountsNotMatch ? 'negative' : 'transparent'" :color="amountsNotMatch ? 'negative' : 'transparent'"
:title=" :title="
amountsNotMatch amountsNotMatch
? t('invoiceIn.summary.noMatch') ? t('invoiceIn.noMatch', {
totalTaxableBase:
entity.totals.totalTaxableBase,
})
: t('invoiceIn.summary.dueTotal') : t('invoiceIn.summary.dueTotal')
" "
> >

View File

@ -156,7 +156,7 @@ const cols = computed(() => [
:create="{ :create="{
urlCreate: 'InvoiceIns', urlCreate: 'InvoiceIns',
title: t('globals.createInvoiceIn'), title: t('globals.createInvoiceIn'),
onDataSaved: ({ id }) => tableRef.redirect(id), onDataSaved: ({ id }) => tableRef.redirect(`${id}/basic-data`),
formInitialData: { companyFk: user.companyFk, issued: Date.vnNew() }, formInitialData: { companyFk: user.companyFk, issued: Date.vnNew() },
}" }"
redirect="invoice-in" redirect="invoice-in"

View File

@ -56,8 +56,9 @@ async function checkToBook(id) {
componentProps: { componentProps: {
title: t('Are you sure you want to book this invoice?'), title: t('Are you sure you want to book this invoice?'),
message: messages.reduce((acc, msg) => `${acc}<p>${msg}</p>`, ''), message: messages.reduce((acc, msg) => `${acc}<p>${msg}</p>`, ''),
promise: () => toBook(id),
}, },
}).onOk(() => toBook(id)); });
} }
async function toBook(id) { async function toBook(id) {

View File

@ -58,7 +58,6 @@ invoiceIn:
bank: Bank bank: Bank
foreignValue: Foreign value foreignValue: Foreign value
dueTotal: Due day dueTotal: Due day
noMatch: Do not match
code: Code code: Code
net: Net net: Net
stems: Stems stems: Stems
@ -69,3 +68,4 @@ invoiceIn:
isBooked: Is booked isBooked: Is booked
account: Ledger account account: Ledger account
correctingFk: Rectificative correctingFk: Rectificative
noMatch: No match with the vat({totalTaxableBase})

View File

@ -67,3 +67,4 @@ invoiceIn:
isBooked: Contabilizada isBooked: Contabilizada
account: Cuenta contable account: Cuenta contable
correctingFk: Rectificativa correctingFk: Rectificativa
noMatch: No cuadra con el iva({totalTaxableBase})

View File

@ -0,0 +1,14 @@
<script setup>
import ParkingDescriptor from './ParkingDescriptor.vue';
import ParkingSummary from './ParkingSummary.vue';
</script>
<template>
<QPopupProxy style="max-width: 10px">
<ParkingDescriptor
v-if="$attrs.id"
v-bind="$attrs.id"
:summary="ParkingSummary"
:proxy-render="true"
/>
</QPopupProxy>
</template>

View File

@ -41,12 +41,12 @@ describe('InvoiceInList', () => {
cy.fillInForm({ ...mock }, { attr: 'data-cy' }); cy.fillInForm({ ...mock }, { attr: 'data-cy' });
cy.dataCy('FormModelPopup_save').click(); cy.dataCy('FormModelPopup_save').click();
cy.intercept('GET', /\/api\/InvoiceIns\/\d+\/getTotals$/).as('invoice'); cy.intercept('GET', /\/api\/InvoiceIns\/\d+\/getTotals$/).as('invoice');
cy.wait('@invoice').then(() => cy.wait('@invoice').then(() => {
cy.validateDescriptor({ cy.validateDescriptor({
title: mockInvoiceRef, title: mockInvoiceRef,
listBox: { 0: '11/16/2001', 3: 'The farmer' }, listBox: { 0: '11/16/2001', 3: 'The farmer' },
}), });
); cy.dataCy('invoiceInBasicDataCompanyFk').should('have.value', 'ORN');
cy.get('[data-cy="vnLvCompany"]').should('contain.text', 'ORN'); });
}); });
}); });