#6317 create vnCurrency #181

Merged
jorgep merged 16 commits from 6317-createVnCurrency into dev 2024-03-01 07:39:06 +00:00
5 changed files with 9 additions and 22 deletions
Showing only changes of commit cbf9bff0e3 - Show all commits

View File

@ -6,7 +6,6 @@ import VnInput from 'src/components/common/VnInput.vue';
const props = defineProps({ const props = defineProps({
modelValue: { type: String, default: '' }, modelValue: { type: String, default: '' },
currency: { type: String, default: 'euro' },
icon: { type: Boolean, default: false }, icon: { type: Boolean, default: false },
}); });
@ -28,12 +27,7 @@ const amount = computed({
type="number" type="number"
step="any" step="any"
jorgep marked this conversation as resolved Outdated
Outdated
Review

Html(i quasar) te la posibilitat de gastar type="number"
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

En un component q soles accepta numeros (tambe dixa '.' i ',') seria lo mes apropiat

Html(i quasar) te la posibilitat de gastar type="number" https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number En un component q soles accepta numeros (tambe dixa '.' i ',') seria lo mes apropiat

Si gasto type="number" sale el banner predeterminado de html5 cuando escribes un número con coma, Una posible solución es añadir novalidate en el QForm.

https://www.w3schools.com/tags/att_form_novalidate.asp

Usando step="any" se admiten decimales con coma y punto.

Si gasto type="number" sale el banner predeterminado de html5 cuando escribes un número con coma, Una posible solución es añadir novalidate en el QForm. https://www.w3schools.com/tags/att_form_novalidate.asp Usando step="any" se admiten decimales con coma y punto.
:label="useCapitalize(t('amount'))" :label="useCapitalize(t('amount'))"
is-outlined />
>
<template #prepend v-if="icon">
<QIcon :name="currency" size="sm" />
</template>
</VnInput>
</template> </template>
<i18n> <i18n>
es: es:

View File

@ -47,7 +47,7 @@ const props = defineProps({
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnCurrency v-model="params.amount" /> <VnCurrency v-model="params.amount" is-outlined />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem> <QItem>

View File

@ -9,6 +9,7 @@ import { toCurrency } from 'src/filters';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
import CrudModel from 'src/components/CrudModel.vue'; import CrudModel from 'src/components/CrudModel.vue';
import VnCurrency from 'src/components/common/VnCurrency.vue';
const route = useRoute(); const route = useRoute();
const { t } = useI18n(); const { t } = useI18n();
@ -225,7 +226,7 @@ async function addExpense() {
</template> </template>
<template #body-cell-taxablebase="{ row }"> <template #body-cell-taxablebase="{ row }">
<QTd> <QTd>
<QInput <VnCurrency
:class="{ :class="{
'no-pointer-events': isNotEuro(invoiceIn.currency.code), 'no-pointer-events': isNotEuro(invoiceIn.currency.code),
}" }"
@ -234,11 +235,7 @@ async function addExpense() {
clear-icon="close" clear-icon="close"
v-model="row.taxableBase" v-model="row.taxableBase"
clearable clearable
> />
<template #prepend>
<QIcon name="euro" size="xs" flat />
</template>
</QInput>
</QTd> </QTd>
</template> </template>
<template #body-cell-sageiva="{ row, col }"> <template #body-cell-sageiva="{ row, col }">
@ -328,7 +325,7 @@ async function addExpense() {
</VnSelectFilter> </VnSelectFilter>
</QItem> </QItem>
<QItem> <QItem>
<QInput <VnCurrency
:label="t('Taxable base')" :label="t('Taxable base')"
:class="{ :class="{
'no-pointer-events': isNotEuro( 'no-pointer-events': isNotEuro(
@ -340,11 +337,7 @@ async function addExpense() {
clear-icon="close" clear-icon="close"
v-model="props.row.taxableBase" v-model="props.row.taxableBase"
clearable clearable
> />
<template #append>
<QIcon name="euro" size="xs" flat />
</template>
</QInput>
</QItem> </QItem>
<QItem> <QItem>
<VnSelectFilter <VnSelectFilter

View File

@ -138,7 +138,7 @@ const suppliersRef = ref();
</QItem> </QItem>
<QItem> <QItem>
<QItemSection> <QItemSection>
<VnCurrency v-model="params.amount" /> <VnCurrency v-model="params.amount" is-outlined />
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem class="q-mb-md"> <QItem class="q-mb-md">

View File

@ -88,7 +88,7 @@ const props = defineProps({
<VnCurrency <VnCurrency
v-model="params.amount" v-model="params.amount"
:label="t('invoiceOut.negativeBases.amount')" :label="t('invoiceOut.negativeBases.amount')"
:icon="false" is-outlined
/> />
</QItemSection> </QItemSection>
</QItem> </QItem>