forked from verdnatura/salix-front
fix: refs #6900 vat & dueday
This commit is contained in:
parent
d593866c7a
commit
1a4cf51246
|
@ -11,6 +11,8 @@ import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import VnCurrency from 'src/components/common/VnCurrency.vue';
|
import VnCurrency from 'src/components/common/VnCurrency.vue';
|
||||||
import { toCurrency } from 'src/filters';
|
import { toCurrency } from 'src/filters';
|
||||||
import useNotify from 'src/composables/useNotify.js';
|
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 route = useRoute();
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
@ -22,9 +24,6 @@ const rowsSelected = ref([]);
|
||||||
const banks = ref([]);
|
const banks = ref([]);
|
||||||
const invoiceInFormRef = ref();
|
const invoiceInFormRef = ref();
|
||||||
const invoiceId = +route.params.id;
|
const invoiceId = +route.params.id;
|
||||||
|
|
||||||
const placeholder = 'yyyy/mm/dd';
|
|
||||||
|
|
||||||
const filter = { where: { invoiceInFk: invoiceId } };
|
const filter = { where: { invoiceInFk: invoiceId } };
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
|
@ -104,42 +103,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
|
||||||
>
|
>
|
||||||
<template #body-cell-duedate="{ row }">
|
<template #body-cell-duedate="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QInput
|
<VnInputDate v-model="row.dueDated" />
|
||||||
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>
|
|
||||||
</QTd>
|
</QTd>
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-bank="{ row, col }">
|
<template #body-cell-bank="{ row, col }">
|
||||||
|
@ -174,7 +138,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-foreignvalue="{ row }">
|
<template #body-cell-foreignvalue="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QInput
|
<VnInput
|
||||||
:class="{
|
:class="{
|
||||||
'no-pointer-events': !isNotEuro(invoiceIn.currency.code),
|
'no-pointer-events': !isNotEuro(invoiceIn.currency.code),
|
||||||
}"
|
}"
|
||||||
|
@ -207,51 +171,11 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
|
||||||
<QSeparator />
|
<QSeparator />
|
||||||
<QList>
|
<QList>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QInput
|
<VnInputDate
|
||||||
class="full-width"
|
class="full-width"
|
||||||
:label="t('Date')"
|
:label="t('Date')"
|
||||||
v-model="props.row.dueDated"
|
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>
|
||||||
<QItem>
|
<QItem>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
|
@ -274,7 +198,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
|
||||||
</VnSelect>
|
</VnSelect>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QInput
|
<VnCurrency
|
||||||
:label="t('Amount')"
|
:label="t('Amount')"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
v-model="props.row.amount"
|
v-model="props.row.amount"
|
||||||
|
@ -283,7 +207,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
|
||||||
/>
|
/>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QInput
|
<VnInput
|
||||||
:label="t('Foreign value')"
|
:label="t('Foreign value')"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
:class="{
|
:class="{
|
||||||
|
|
|
@ -10,6 +10,7 @@ import FetchData from 'src/components/FetchData.vue';
|
||||||
import VnSelect from 'src/components/common/VnSelect.vue';
|
import VnSelect from 'src/components/common/VnSelect.vue';
|
||||||
import CrudModel from 'src/components/CrudModel.vue';
|
import CrudModel from 'src/components/CrudModel.vue';
|
||||||
import VnCurrency from 'src/components/common/VnCurrency.vue';
|
import VnCurrency from 'src/components/common/VnCurrency.vue';
|
||||||
|
import VnInput from 'src/components/common/VnInput.vue';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const quasar = useQuasar();
|
const quasar = useQuasar();
|
||||||
|
@ -205,7 +206,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
:grid="$q.screen.lt.sm"
|
:grid="$q.screen.lt.sm"
|
||||||
>
|
>
|
||||||
<template #body-cell-expense="{ row, col }">
|
<template #body-cell-expense="{ row, col }">
|
||||||
<QTd auto-width>
|
<QTd>
|
||||||
<VnSelect
|
<VnSelect
|
||||||
v-model="row[col.model]"
|
v-model="row[col.model]"
|
||||||
:options="col.options"
|
:options="col.options"
|
||||||
|
@ -223,6 +224,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
name="close"
|
name="close"
|
||||||
@click.stop="value = null"
|
@click.stop="value = null"
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
|
size="xs"
|
||||||
/>
|
/>
|
||||||
<QIcon
|
<QIcon
|
||||||
@click.stop.prevent="newExpenseRef.show()"
|
@click.stop.prevent="newExpenseRef.show()"
|
||||||
|
@ -308,7 +310,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-foreignvalue="{ row }">
|
<template #body-cell-foreignvalue="{ row }">
|
||||||
<QTd>
|
<QTd>
|
||||||
<QInput
|
<VnInput
|
||||||
:class="{
|
:class="{
|
||||||
'no-pointer-events': !isNotEuro(invoiceIn.currency.code),
|
'no-pointer-events': !isNotEuro(invoiceIn.currency.code),
|
||||||
}"
|
}"
|
||||||
|
@ -421,7 +423,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
{{ toCurrency(taxRate(props.row), currency) }}
|
{{ toCurrency(taxRate(props.row), currency) }}
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QInput
|
<VnInput
|
||||||
:label="t('Foreign value')"
|
:label="t('Foreign value')"
|
||||||
class="full-width"
|
class="full-width"
|
||||||
:class="{
|
:class="{
|
||||||
|
@ -453,7 +455,11 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
</QCardSection>
|
</QCardSection>
|
||||||
<QCardSection class="q-pt-none">
|
<QCardSection class="q-pt-none">
|
||||||
<QItem>
|
<QItem>
|
||||||
<QInput :label="`${t('Code')}*`" v-model="newExpense.code" />
|
<VnInput
|
||||||
|
:label="`${t('Code')}*`"
|
||||||
|
v-model="newExpense.code"
|
||||||
|
:required="true"
|
||||||
|
/>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
dense
|
dense
|
||||||
size="sm"
|
size="sm"
|
||||||
|
@ -462,7 +468,7 @@ const formatOpt = (row, { model, options }, prop) => {
|
||||||
/>
|
/>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem>
|
<QItem>
|
||||||
<QInput
|
<VnInput
|
||||||
:label="`${t('Descripction')}*`"
|
:label="`${t('Descripction')}*`"
|
||||||
v-model="newExpense.description"
|
v-model="newExpense.description"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue