0
0
Fork 0

fix: InvoiceIn sections

This commit is contained in:
Javier Segarra 2024-08-27 14:55:36 +02:00
parent ec979d11e0
commit 50de0aa072
2 changed files with 15 additions and 21 deletions

View File

@ -18,6 +18,7 @@ const { notify } = useNotify();
const { t } = useI18n(); const { t } = useI18n();
const arrayData = useArrayData(); const arrayData = useArrayData();
const invoiceIn = computed(() => arrayData.store.data); const invoiceIn = computed(() => arrayData.store.data);
const currency = computed(() => invoiceIn.value?.currency?.code);
const rowsSelected = ref([]); const rowsSelected = ref([]);
const banks = ref([]); const banks = ref([]);
@ -139,9 +140,9 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
<QTd> <QTd>
<VnInputNumber <VnInputNumber
:class="{ :class="{
'no-pointer-events': !isNotEuro(invoiceIn.currency.code), 'no-pointer-events': !isNotEuro(currency),
}" }"
:disable="!isNotEuro(invoiceIn.currency.code)" :disable="!isNotEuro(currency)"
v-model="row.foreignValue" v-model="row.foreignValue"
clearable clearable
clear-icon="close" clear-icon="close"
@ -154,9 +155,7 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
<QTd /> <QTd />
<QTd /> <QTd />
<QTd> <QTd>
{{ {{ toCurrency(getTotalAmount(rows), currency) }}
toCurrency(getTotalAmount(rows), invoiceIn.currency.code)
}}
</QTd> </QTd>
<QTd /> <QTd />
</QTr> </QTr>
@ -208,11 +207,9 @@ const getTotalAmount = (rows) => rows.reduce((acc, { amount }) => acc + +amount,
:label="t('Foreign value')" :label="t('Foreign value')"
class="full-width" class="full-width"
:class="{ :class="{
'no-pointer-events': !isNotEuro( 'no-pointer-events': !isNotEuro(currency),
invoiceIn.currency.code
),
}" }"
:disable="!isNotEuro(invoiceIn.currency.code)" :disable="!isNotEuro(currency)"
v-model="props.row.foreignValue" v-model="props.row.foreignValue"
clearable clearable
clear-icon="close" clear-icon="close"

View File

@ -242,11 +242,12 @@ const formatOpt = (row, { model, options }, prop) => {
</template> </template>
<template #body-cell-taxablebase="{ row }"> <template #body-cell-taxablebase="{ row }">
<QTd> <QTd>
{{ currency }}
<VnInputNumber <VnInputNumber
:class="{ :class="{
'no-pointer-events': isNotEuro(invoiceIn.currency.code), 'no-pointer-events': isNotEuro(currency),
}" }"
:disable="isNotEuro(invoiceIn.currency.code)" :disable="isNotEuro(currency)"
label="" label=""
clear-icon="close" clear-icon="close"
v-model="row.taxableBase" v-model="row.taxableBase"
@ -312,9 +313,9 @@ const formatOpt = (row, { model, options }, prop) => {
<QTd> <QTd>
<VnInputNumber <VnInputNumber
:class="{ :class="{
'no-pointer-events': !isNotEuro(invoiceIn.currency.code), 'no-pointer-events': !isNotEuro(currency),
}" }"
:disable="!isNotEuro(invoiceIn.currency.code)" :disable="!isNotEuro(currency)"
v-model="row.foreignValue" v-model="row.foreignValue"
/> />
</QTd> </QTd>
@ -361,12 +362,10 @@ const formatOpt = (row, { model, options }, prop) => {
<VnInputNumber <VnInputNumber
:label="t('Taxable base')" :label="t('Taxable base')"
:class="{ :class="{
'no-pointer-events': isNotEuro( 'no-pointer-events': isNotEuro(currency),
invoiceIn.currency.code
),
}" }"
class="full-width" class="full-width"
:disable="isNotEuro(invoiceIn.currency.code)" :disable="isNotEuro(currency)"
clear-icon="close" clear-icon="close"
v-model="props.row.taxableBase" v-model="props.row.taxableBase"
clearable clearable
@ -427,11 +426,9 @@ const formatOpt = (row, { model, options }, prop) => {
:label="t('Foreign value')" :label="t('Foreign value')"
class="full-width" class="full-width"
:class="{ :class="{
'no-pointer-events': !isNotEuro( 'no-pointer-events': !isNotEuro(currency),
invoiceIn.currency.code
),
}" }"
:disable="!isNotEuro(invoiceIn.currency.code)" :disable="!isNotEuro(currency)"
v-model="props.row.foreignValue" v-model="props.row.foreignValue"
/> />
</QItem> </QItem>