0
0
Fork 0

fix: refs #6900 vat & dueday

This commit is contained in:
Jorge Penadés 2024-08-08 16:44:00 +02:00
parent d593866c7a
commit 1a4cf51246
2 changed files with 19 additions and 89 deletions

View File

@ -11,6 +11,8 @@ import VnSelect from 'src/components/common/VnSelect.vue';
import VnCurrency from 'src/components/common/VnCurrency.vue';
import { toCurrency } from 'src/filters';
import useNotify from 'src/composables/useNotify.js';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
const route = useRoute();
const { notify } = useNotify();
@ -22,9 +24,6 @@ const rowsSelected = ref([]);
const banks = ref([]);
const invoiceInFormRef = ref();
const invoiceId = +route.params.id;
const placeholder = 'yyyy/mm/dd';
const filter = { where: { invoiceInFk: invoiceId } };
const columns = computed(() => [
@ -104,42 +103,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
>
<template #body-cell-duedate="{ row }">
<QTd>
<QInput
v-model="row.dueDated"
mask="date"
:placeholder="placeholder"
clearable
clear-icon="close"
>
<template #append>
<QIcon name="event" class="cursor-pointer">
<QPopupProxy
cover
transition-show="scale"
transition-hide="scale"
>
<QDate v-model="row.dueDated" landscape>
<div
class="row items-center justify-end q-gutter-sm"
>
<QBtn
:label="t('globals.cancel')"
color="primary"
flat
v-close-popup
/>
<QBtn
:label="t('globals.confirm')"
color="primary"
flat
v-close-popup
/>
</div>
</QDate>
</QPopupProxy>
</QIcon>
</template>
</QInput>
<VnInputDate v-model="row.dueDated" />
</QTd>
</template>
<template #body-cell-bank="{ row, col }">
@ -174,7 +138,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
</template>
<template #body-cell-foreignvalue="{ row }">
<QTd>
<QInput
<VnInput
:class="{
'no-pointer-events': !isNotEuro(invoiceIn.currency.code),
}"
@ -207,51 +171,11 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
<QSeparator />
<QList>
<QItem>
<QInput
<VnInputDate
class="full-width"
:label="t('Date')"
v-model="props.row.dueDated"
mask="date"
:placeholder="placeholder"
clearable
clear-icon="close"
>
<template #append>
<QIcon name="event" class="cursor-pointer">
<QPopupProxy
cover
transition-show="scale"
transition-hide="scale"
>
<QDate
v-model="props.row.dueDated"
landscape
>
<div
class="row items-center justify-end q-gutter-sm"
>
<QBtn
:label="
t('globals.cancel')
"
color="primary"
flat
v-close-popup
/>
<QBtn
:label="
t('globals.confirm')
"
color="primary"
flat
v-close-popup
/>
</div>
</QDate>
</QPopupProxy>
</QIcon>
</template>
</QInput>
/>
</QItem>
<QItem>
<VnSelect
@ -274,7 +198,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
</VnSelect>
</QItem>
<QItem>
<QInput
<VnCurrency
:label="t('Amount')"
class="full-width"
v-model="props.row.amount"
@ -283,7 +207,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
/>
</QItem>
<QItem>
<QInput
<VnInput
:label="t('Foreign value')"
class="full-width"
:class="{

View File

@ -10,6 +10,7 @@ import FetchData from 'src/components/FetchData.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import CrudModel from 'src/components/CrudModel.vue';
import VnCurrency from 'src/components/common/VnCurrency.vue';
import VnInput from 'src/components/common/VnInput.vue';
const { t } = useI18n();
const quasar = useQuasar();
@ -205,7 +206,7 @@ const formatOpt = (row, { model, options }, prop) => {
:grid="$q.screen.lt.sm"
>
<template #body-cell-expense="{ row, col }">
<QTd auto-width>
<QTd>
<VnSelect
v-model="row[col.model]"
:options="col.options"
@ -223,6 +224,7 @@ const formatOpt = (row, { model, options }, prop) => {
name="close"
@click.stop="value = null"
class="cursor-pointer"
size="xs"
/>
<QIcon
@click.stop.prevent="newExpenseRef.show()"
@ -308,7 +310,7 @@ const formatOpt = (row, { model, options }, prop) => {
</template>
<template #body-cell-foreignvalue="{ row }">
<QTd>
<QInput
<VnInput
:class="{
'no-pointer-events': !isNotEuro(invoiceIn.currency.code),
}"
@ -421,7 +423,7 @@ const formatOpt = (row, { model, options }, prop) => {
{{ toCurrency(taxRate(props.row), currency) }}
</QItem>
<QItem>
<QInput
<VnInput
:label="t('Foreign value')"
class="full-width"
:class="{
@ -453,7 +455,11 @@ const formatOpt = (row, { model, options }, prop) => {
</QCardSection>
<QCardSection class="q-pt-none">
<QItem>
<QInput :label="`${t('Code')}*`" v-model="newExpense.code" />
<VnInput
:label="`${t('Code')}*`"
v-model="newExpense.code"
:required="true"
/>
<QCheckbox
dense
size="sm"
@ -462,7 +468,7 @@ const formatOpt = (row, { model, options }, prop) => {
/>
</QItem>
<QItem>
<QInput
<VnInput
:label="`${t('Descripction')}*`"
v-model="newExpense.description"
/>