0
1
Fork 0

Extra improvements

This commit is contained in:
William Buezas 2024-08-18 21:58:02 -03:00
parent ef35914f34
commit 25f4f822b4
6 changed files with 79 additions and 19 deletions

View File

@ -68,22 +68,26 @@ onMounted(() => getCountries());
rounded
no-caps
@click="goBack()"
/>
>
<QTooltip>
{{ t('back') }}
</QTooltip>
</QBtn>
</Teleport>
<VnForm
ref="vnFormRef"
:fetchFormDataSql="fetchAddressDataSql"
:columnsToIgnoreUpdate="['countryFk']"
:createModelDefault="{
:fetch-form-data-sql="fetchAddressDataSql"
:columns-to-ignore-update="['countryFk']"
:create-model-default="{
field: 'clientFk',
value: 'account.myUser_getId()'
}"
:pks="pks"
:isEditMode="isEditMode"
:title="t('addEditAddress')"
:is-edit-mode="isEditMode"
:title="t(isEditMode ? 'editAddress' : 'addAddress')"
table="myAddress"
schema="hedera"
@onDataSaved="goBack()"
@on-data-saved="goBack()"
>
<template #form="{ data }">
<VnInput v-model="data.nickname" :label="t('name')" />
@ -94,7 +98,7 @@ onMounted(() => getCountries());
v-model="data.countryFk"
:label="t('country')"
:options="countriesOptions"
@update:modelValue="data.provinceFk = null"
@update:model-value="data.provinceFk = null"
/>
<VnSelect
v-model="data.provinceFk"
@ -126,16 +130,20 @@ en-US:
country: Country
province: Province
addressChangedSuccessfully: Address changed successfully
addAddress: Add address
editAddress: Edit address
es-ES:
accept: Aceptar
addEditAddress: Añadir o modificar dirección
name: Consignatario
address: Morada
address: Dirección
city: Ciudad
postalCode: Código postal
country: País
province: Distrito
province: Provincia
addressChangedSuccessfully: Dirección modificada correctamente
addAddress: Añadir dirección
editAddress: Modificar dirección
ca-ES:
accept: Acceptar
addEditAddress: Afegir o modificar adreça
@ -146,6 +154,8 @@ ca-ES:
country: País
province: Província
addressChangedSuccessfully: Adreça modificada correctament
addAddress: Afegir adreça
editAddress: Modificar adreça
fr-FR:
accept: Accepter
addEditAddress: Ajouter ou modifier l'adresse
@ -156,6 +166,8 @@ fr-FR:
country: Pays
province: Province
addressChangedSuccessfully: Adresse modifié avec succès
addAddress: Ajouter adresse
editAddress: Modifier adresse
pt-PT:
accept: Aceitar
addEditAddress: Adicionar ou modificar morada
@ -166,4 +178,6 @@ pt-PT:
country: País
province: Distrito
addressChangedSuccessfully: Morada modificada corretamente
addAddress: Adicionar morada
editAddress: Modificar morada
</i18n>

View File

@ -97,7 +97,11 @@ onMounted(async () => {
@click="goToAddressDetails()"
rounded
no-caps
/>
>
<QTooltip>
{{ t('addAddress') }}
</QTooltip>
</QBtn>
</Teleport>
<QPage class="vn-w-sm">
<QList class="rounded-borders shadow-1 shadow-transition" separator>
@ -137,13 +141,21 @@ onMounted(async () => {
() => removeAddress(address.id)
)
"
/>
>
<QTooltip>
{{ t('deleteAddress') }}
</QTooltip>
</QBtn>
<QBtn
icon="edit"
flat
rounded
@click.stop="goToAddressDetails(address.id)"
/>
>
<QTooltip>
{{ t('editAddress') }}
</QTooltip>
</QBtn>
</template>
</CardList>
</QList>
@ -155,20 +167,30 @@ en-US:
addAddress: Add address
defaultAddressModified: Default address modified
confirmDeleteAddress: Are you sure you want to delete the address?
editAddress: Edit address
deleteAddress: Delete address
es-ES:
addAddress: Añadir dirección
defaultAddressModified: Dirección por defecto modificada
confirmDeleteAddress: ¿Estás seguro de que quieres borrar la dirección?
editAddress: Modificar dirección
deleteAddress: Borrar dirección
ca-ES:
addAddress: Afegir adreça
defaultAddressModified: Adreça per defecte modificada
confirmDeleteAddress: Estàs segur que vols esborrar l'adreça?
editAddress: Modificar adreça
deleteAddress: Esborrar adreça
fr-FR:
addAddress: Ajouter une adresse
defaultAddressModified: Adresse par défaut modifiée
confirmDeleteAddress: Êtes-vous sûr de vouloir supprimer l'adresse?
editAddress: Modifier adresse
deleteAddress: Supprimer adresse
pt-PT:
addAddress: Adicionar Morada
defaultAddressModified: Endereço padrão modificado
confirmDeleteAddress: Tem a certeza de que deseja excluir o endereço?
editAddress: Modificar morada
deleteAddress: Eliminar morada
</i18n>

View File

@ -20,18 +20,26 @@ const years = ref([]);
const invoices = ref([]);
const columns = computed(() => [
{ name: 'ref', label: t('invoice'), field: 'ref', align: 'left' },
{
name: 'ref',
label: t('invoice'),
field: 'ref',
align: 'left',
sortable: true
},
{
name: 'issued',
label: t('issued'),
field: 'issued',
align: 'left',
sortable: true,
format: val => formatDate(val, 'D MMM YYYY')
},
{
name: 'amount',
label: t('amount'),
field: 'amount',
align: 'right',
format: val => currency(val)
},
{

View File

@ -7,12 +7,18 @@ import CardList from 'src/components/ui/CardList.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnConfirm from 'src/components/ui/VnConfirm.vue';
import useNotify from 'src/composables/useNotify.js';
import { currency, formatDateTitle } from 'src/lib/filters.js';
import { tpvStore } from 'stores/tpv';
import { useAppStore } from 'stores/app';
import { storeToRefs } from 'pinia';
const { t } = useI18n();
const route = useRoute();
const jApi = inject('jApi');
const { notify } = useNotify();
const appStore = useAppStore();
const { isHeaderMounted } = storeToRefs(appStore);
const showAmountToPayDialog = ref(null);
const amountToPay = ref(null);
@ -36,11 +42,14 @@ const onPayClick = async () => {
};
const onConfirmPay = async () => {
if (amountToPay.value) {
const amount = amountToPay.value.toString().replace('.', ',');
amountToPay.value = parseFloat(amount);
await tpv.pay(amountToPay.value);
if (!amountToPay.value || amountToPay.value <= 0) {
notify(t('amountError'), 'negative');
return;
}
const amount = amountToPay.value.toString().replace('.', ',');
amountToPay.value = parseFloat(amount);
await tpv.pay(amountToPay.value);
};
</script>
@ -126,6 +135,8 @@ const onConfirmPay = async () => {
v-model="amountToPay"
:clearable="false"
class="full-width"
type="number"
min="0"
/>
</template>
</VnConfirm>
@ -170,6 +181,7 @@ en-US:
equal to or greater than 0. If you want to make a down payment, click the
payment button, delete the suggested amount and enter the amount you want.
amountToPay: 'Amount to pay (€):'
amountError: The amount must be a positive number less than or equal to the outstanding amount
es-ES:
startOrder: Empezar pedido
noOrdersFound: No se encontrado pedidos
@ -183,6 +195,7 @@ es-ES:
cuenta, pulsa el botón de pago, borra la cantidad sugerida e introduce la
cantidad que desees.
amountToPay: 'Cantidad a pagar (€):'
amountError: La cantidad debe ser un número positivo e inferior o igual al importe pendiente
ca-ES:
startOrder: Començar encàrrec
noOrdersFound: No s'han trobat comandes
@ -196,6 +209,7 @@ ca-ES:
lliurament a compte, prem el botó de pagament, esborra la quantitat suggerida
e introdueix la quantitat que vulguis.
amountToPay: 'Quantitat a pagar (€):'
amountError: La quantitat ha de ser un nombre positiu i inferior o igual a l'import pendent
fr-FR:
startOrder: Acheter
noOrdersFound: Aucune commande trouvée
@ -209,6 +223,7 @@ fr-FR:
voulez faire un versement, le montant suggéré effacé et entrez le montant que
vous souhaitez.
amountToPay: 'Montant à payer (€):'
amountError: La quantité doit être un neméro positif et inférieur ou égal à la somme restant à payer
pt-PT:
startOrder: Iniciar encomenda
noOrdersFound: Nenhum pedido encontrado
@ -222,4 +237,5 @@ pt-PT:
conta, clique no botão de pagamento, apague a quantidade sugerida e introduza
a quantidade que deseje.
amountToPay: 'Valor a pagar (€):'
amountError: A quantidade deve ser um número positivo e inferior ou igual ao importe pendiente
</i18n>

View File

@ -3,7 +3,7 @@ import { onMounted, inject, ref } from 'vue';
import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import TicketDetails from 'src/components/ui/TicketDetails.vue';
import TicketDetails from 'src/pages/Ecomerce/TicketDetails.vue';
import { useUserStore } from 'stores/user';
import { useAppStore } from 'stores/app';