diff --git a/src/components/ui/ChangePasswordForm.vue b/src/components/ui/ChangePasswordForm.vue index 3f5afd86..aad8ab17 100644 --- a/src/components/ui/ChangePasswordForm.vue +++ b/src/components/ui/ChangePasswordForm.vue @@ -214,7 +214,6 @@ en-US: newPassword: New password oldPassword: Old password repeatPassword: Repeat password - modify: Modify requirements: Requirements passwordRequirements: Password requirements charactersLong: '{length} characters long' @@ -229,7 +228,6 @@ es-ES: newPassword: Nueva contraseña oldPassword: Contraseña antigua repeatPassword: Repetir contraseña - modify: Modificar requirements: Requisitos passwordRequirements: Requisitos de contraseña charactersLong: '{length} caracteres de longitud' @@ -244,7 +242,6 @@ ca-ES: newPassword: Nova contrasenya oldPassword: Contrasenya antiga repeatPassword: Repetir contrasenya - modify: Modificar requirements: Requisits passwordRequirements: Requisits de contrasenya charactersLong: '{length} caràcters de longitud' @@ -259,7 +256,6 @@ fr-FR: newPassword: Nouveau mot de passe oldPassword: Ancien mot de passe repeatPassword: Répéter le mot de passe - modify: Modifier requirements: Exigences passwordRequirements: Mot de passe exigences charactersLong: '{length} caractères de longueur' @@ -274,7 +270,6 @@ pt-PT: newPassword: Nova palavra-passe oldPassword: Palavra-passe antiga repeatPassword: Repetir palavra-passe - modify: Modificar requirements: Requisitos passwordRequirements: Requisitos de palavra-passe charactersLong: '{length} caracteres de comprimento' diff --git a/src/i18n/ca-ES/index.js b/src/i18n/ca-ES/index.js index 694fe1a1..f479b45f 100644 --- a/src/i18n/ca-ES/index.js +++ b/src/i18n/ca-ES/index.js @@ -65,7 +65,7 @@ export default { Shelves: 'Prestatgeries', Account: 'Compte', Addresses: 'Adreces', - Confirm: 'Confirmar', + OrderSummary: 'Resum de la comanda', Checkout: `Configurar l'encarrec`, 'Address details': 'Configuració', 'Admin news details': `Afegir o editar notícia`, @@ -81,6 +81,7 @@ export default { noData: 'Sense dades', confirm: 'Confirmar', delete: 'Esborrar', - confirmDelete: 'Estàs segur que vols esborrar la línia?', - emptyList: 'Llista buida' + emptyList: 'Llista buida', + modify: 'Modificar', + confirmDelete: 'Estàs segur que vols esborrar la línia?' }; diff --git a/src/i18n/en-US/index.js b/src/i18n/en-US/index.js index 8709c5f2..f6c2c29c 100644 --- a/src/i18n/en-US/index.js +++ b/src/i18n/en-US/index.js @@ -77,7 +77,7 @@ export default { Shelves: 'Shelves', Account: 'Account', Addresses: 'Addresses', - Confirm: 'Confirm', + OrderSummary: 'Order summary', Checkout: 'Configure order', 'Address details': 'Configuration', 'Admin news details': 'Add or edit new', @@ -116,5 +116,6 @@ export default { dataSaved: 'Data saved', save: 'Save', cancel: 'Cancel', - of: 'of' + of: 'of', + modify: 'Modify' }; diff --git a/src/i18n/es-ES/index.js b/src/i18n/es-ES/index.js index 4001220c..0f4388f3 100644 --- a/src/i18n/es-ES/index.js +++ b/src/i18n/es-ES/index.js @@ -83,7 +83,7 @@ export default { Shelves: 'Estanterías', Account: 'Cuenta', Addresses: 'Direcciones', - Confirm: 'Confirmar', + OrderSummary: 'Resumen del pedido', Checkout: 'Configurar pedido', 'Address details': 'Configuración', 'Admin news details': 'Añadir o editar noticia', @@ -132,5 +132,6 @@ export default { dataSaved: 'Datos guardados', save: 'Guardar', cancel: 'Cancelar', - of: 'de' + of: 'de', + modify: 'Modificar' }; diff --git a/src/i18n/fr-FR/index.js b/src/i18n/fr-FR/index.js index 7b3f09f8..3ed13560 100644 --- a/src/i18n/fr-FR/index.js +++ b/src/i18n/fr-FR/index.js @@ -65,7 +65,7 @@ export default { Shelves: 'Étagères', Account: 'Compte', Addresses: 'Adresses', - Confirm: 'Confirmer', + OrderSummary: 'Résumé de la commande', Checkout: 'Configurer la commande', 'Address details': 'Configuration', 'Admin news details': 'Ajouter ou éditer une nouvelle', @@ -81,5 +81,7 @@ export default { noData: 'Aucune donnée', confirm: 'Confirmer', delete: 'Effacer', + emptyList: 'Vider la liste', + modify: 'Modifier', confirmDelete: 'Voulez-vous vraiment supprimer la ligne?' }; diff --git a/src/i18n/pt-PT/index.js b/src/i18n/pt-PT/index.js index fe16ce9c..e5685264 100644 --- a/src/i18n/pt-PT/index.js +++ b/src/i18n/pt-PT/index.js @@ -64,7 +64,7 @@ export default { Shelves: 'Estantes', Account: 'Conta', Addresses: 'Moradas', - Confirm: 'Confirme', + OrderSummary: 'Resumo da encomenda', Checkout: 'Configurar encomenda', 'Address details': 'Configuração', 'Admin news details': 'Adicionar ou editar notícia', @@ -79,5 +79,7 @@ export default { noData: 'Sem dados', confirm: 'Confirme', delete: 'Eliminar', + emptyList: 'Lista vazia', + modify: 'Modificar', confirmDelete: 'Tens certeza que queres eliminar esta linha?' }; diff --git a/src/pages/Ecomerce/BasketView.vue b/src/pages/Ecomerce/BasketView.vue index dab101a0..d9206d39 100644 --- a/src/pages/Ecomerce/BasketView.vue +++ b/src/pages/Ecomerce/BasketView.vue @@ -124,7 +124,6 @@ const fetchData = async () => { Confirm view + + + + + + + +en-US: + previousBalance: Previous balance + orderTotal: Order total + orderVat: Order VAT + totalDebt: Total debt + creditExceeded: You have exceeded your credit, in order to prepare your order please pay your debt. + credit: Credit + paymentMethod: Payment method + useMyBalance: Use my balance + favorableBalance: You do not need to perform any payment, you have a favorable balance. + useMyCredit: Use my credit + favorableCredit: You do not need to pay now, you have a favorable credit. + creditCard: Credit card + youWillBeRedirectedToPayment: By confirming the order you will be redirected to the payment platform. + bankTransfer: Bank Transfer + makeTransfer: Make a transfer to one of the following accounts and send the receipt to your salesperson. + payLater: Pay later + orderConfirmed: Your order has been confirmed successfully + exceededCredit: Exceeded credit + amountToPay: Amount to pay +es-ES: + previousBalance: Saldo anterior + orderTotal: Total pedido + orderVat: IVA pedido + totalDebt: Total deuda + creditExceeded: Has excedido tu crédito, por favor realiza el pago para que podamos preparar tu pedido. + credit: Crédito + paymentMethod: Método de pago + useMyBalance: Usar mi saldo + favorableBalance: No necesitas pagar nada, tienes un saldo favorable. + useMyCredit: Usar mi crédito + favorableCredit: No necesitas pagar nada, tienes crédito favorable. + creditCard: Tarjeta de crédito + youWillBeRedirectedToPayment: Al confirmar el pedido serás redirigido a la plataforma de pago. + bankTransfer: Transferencia bancaria + makeTransfer: Haz una transferecia a una de las siguientes cuentas y envía el justificante a tu comercial. + payLater: Pagar más tarde + orderConfirmed: Tu pedido ha sido realizado con éxito + exceededCredit: Crédito excedido + amountToPay: Cantidad a pagar +ca-ES: + previousBalance: Saldo anterior + orderTotal: Total comanda + orderVat: IVA comanda + totalDebt: Total deute + creditExceeded: Has excedit el teu crèdit, si us plau realitza el pagament perquè puguem preparar la teva comanda. + credit: Crèdit + paymentMethod: Mètode de pagament + useMyBalance: Utilitzar el meu saldo + favorableBalance: No necessites pagar res, tens un saldo favorable. + useMyCredit: Utilitzar el meu crèdit + favorableCredit: No necessites pagar res, tens crèdit favorable. + creditCard: Targeta de crèdit + youWillBeRedirectedToPayment: En confirmar la comanda seràs redirigit a la plataforma de pagament. + bankTransfer: Transferència bancària + makeTransfer: Fer una transferecia a una de les següents comptes i envia el justificant al teu comercial. + payLater: Pagar més tard + orderConfirmed: La teva comanda ha estat realitzat amb èxit + exceededCredit: Crèdit excedit + amountToPay: Quantitat a pagar +fr-FR: + previousBalance: Solde précédent + orderTotal: Total de la commande + orderVat: TVA de la commande + totalDebt: Total de la dette + creditExceeded: Vous avez dépassé votre crédit, s'il vous plaît effectuer le paiement afin que nous puissions préparer votre commande. + credit: Crédit + paymentMethod: Mode de paiement + useMyBalance: Utiliser mon équilibre + favorableBalance: Pas besoin de payer quoi que ce soit, vous avez un solde favorable. + useMyCredit: Utiliser mon crédit + favorableCredit: Pas besoin de payer quoi que ce soit, vous favorable crédit. + creditCard: Carte de crédit + youWillBeRedirectedToPayment: En confirmant la commande, vous serez redirigé vers la plateforme de paiement. + bankTransfer: Virement bancaire + makeTransfer: Faire Transféré à l'un des comptes suivants et envoyer le coupon à votre entreprise. + payLater: Payer plus tard + orderConfirmed: Votre commande a été complété avec succès + exceededCredit: Crédit dépassée + amountToPay: Montant à payer +pt-PT: + previousBalance: Saldo anterior + orderTotal: Total pedido + orderVat: IVA + totalDebt: Total dívida + creditExceeded: Ultrapassastes seu crédito, por favor, faça o pagamento para que possamos preparar sua encomenda. + credit: Crédito + paymentMethod: Método de pagamento + useMyBalance: Usar meu saldo + favorableBalance: Não há necessidade de pagar, tens um crédito a seu favor. + useMyCredit: Usar meu crédito + favorableCredit: Não há necessidade de pagar, tens um crédito à favor. + creditCard: Cartão de crédito + youWillBeRedirectedToPayment: Ao confirmar a encomenda, serás re-direcionado à plataforma de pagamento. + bankTransfer: Transferência bancária + makeTransfer: Faça a transferencia para uma das seguintes contas e envie o comprovativo para seu comercial. + payLater: Pagar mais tarde + orderConfirmed: Seu pedido foi realizado com êxito + exceededCredit: Crédito excedido + amountToPay: Valor a pagar + diff --git a/src/pages/Ecomerce/InvoicesView.vue b/src/pages/Ecomerce/InvoicesView.vue index cea29636..fb42b959 100644 --- a/src/pages/Ecomerce/InvoicesView.vue +++ b/src/pages/Ecomerce/InvoicesView.vue @@ -90,7 +90,11 @@ onMounted(async () => { + + en-US: noInvoicesFound: No invoices found diff --git a/src/pages/Ecomerce/TicketDetails.vue b/src/pages/Ecomerce/TicketDetails.vue index 71dd99a2..408cf944 100644 --- a/src/pages/Ecomerce/TicketDetails.vue +++ b/src/pages/Ecomerce/TicketDetails.vue @@ -16,10 +16,18 @@ defineProps({ type: Array, default: () => [] }, + showTotal: { + type: Boolean, + default: true + }, showTax: { type: Boolean, default: true }, + showItems: { + type: Boolean, + default: true + }, canDeleteItems: { type: Boolean, default: false @@ -77,7 +85,7 @@ const deleteRow = id => { {{ ticket.agency }} - +
{{ t('deliveryAddress') }}
@@ -91,7 +99,8 @@ const deleteRow = id => {
{{ t('total') }} {{ currency(ticket.taxBase) }} @@ -100,16 +109,8 @@ const deleteRow = id => { {{ t('totalTax') }} {{ currency(ticket.total) }} - -
- - {{ t('emptyList') }} -
- + + { +
+ + {{ t('emptyList') }} +
diff --git a/src/pages/Ecomerce/TicketView.vue b/src/pages/Ecomerce/TicketView.vue index 5e26df9c..a164514a 100644 --- a/src/pages/Ecomerce/TicketView.vue +++ b/src/pages/Ecomerce/TicketView.vue @@ -15,6 +15,7 @@ const route = useRoute(); const userStore = useUserStore(); const appStore = useAppStore(); const { isHeaderMounted } = storeToRefs(appStore); +const { user, token } = storeToRefs(userStore); const ticket = ref({}); const rows = ref([]); @@ -39,8 +40,8 @@ onMounted(async () => { const onPrintClick = () => { const params = new URLSearchParams({ - access_token: userStore.token, - recipientId: userStore.id, + access_token: token.value, + recipientId: user.value.id, type: 'deliveryNote' }); window.open( @@ -60,10 +61,7 @@ const onPrintClick = () => { /> - + diff --git a/src/router/routes.js b/src/router/routes.js index efa8fbab..e238a700 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -89,7 +89,7 @@ const routes = [ name: 'confirm', path: '/ecomerce/confirm/:id?', meta: { - title: 'Confirm' + title: 'OrderSummary' }, component: () => import('pages/Ecomerce/ConfirmView.vue') }, diff --git a/src/stores/tpv.js b/src/stores/tpv.js index b5ae151d..53f146c2 100644 --- a/src/stores/tpv.js +++ b/src/stores/tpv.js @@ -1,46 +1,46 @@ -import { defineStore } from 'pinia' -import { jApi } from 'boot/axios' +import { defineStore } from 'pinia'; +import { jApi } from 'boot/axios'; export const tpvStore = defineStore('tpv', { actions: { - async check (route) { - const order = route.query.tpvOrder - const status = route.query.tpvStatus - if (!(order && status)) return null + async check(route) { + const order = route.query.tpvOrder; + const status = route.query.tpvStatus; + if (!(order && status)) return null; await jApi.execQuery('CALL myTpvTransaction_end(#order, #status)', { order, status - }) + }); if (status === 'ko') { - const retry = confirm('retryPayQuestion') + const retry = confirm('retryPayQuestion'); if (retry) { - this.retryPay(order) + this.retryPay(order); } } - return status + return status; }, - async pay (amount, company) { - await this.realPay(amount * 100, company) + async pay(amount, company) { + await this.realPay(amount * 100, company); }, - async retryPay (order) { + async retryPay(order) { const payment = await jApi.getObject( `SELECT t.amount, m.companyFk FROM myTpvTransaction t JOIN tpvMerchant m ON m.id = t.merchantFk WHERE t.id = #order`, { order } - ) - await this.realPay(payment.amount, payment.companyFk) + ); + await this.realPay(payment.amount, payment.companyFk); }, - async realPay (amount, company) { + async realPay(amount, company) { if (!isNumeric(amount) || amount <= 0) { - throw new Error('payAmountError') + throw new Error('payAmountError'); } const json = await jApi.send('tpv/transaction', { @@ -48,46 +48,46 @@ export const tpvStore = defineStore('tpv', { urlOk: this.makeUrl('ok'), urlKo: this.makeUrl('ko'), company - }) + }); - const postValues = json.postValues + const postValues = json.postValues; - const form = document.createElement('form') - form.method = 'POST' - form.action = json.url - document.body.appendChild(form) + const form = document.createElement('form'); + form.method = 'POST'; + form.action = json.url; + document.body.appendChild(form); for (const field in postValues) { - const input = document.createElement('input') - input.type = 'hidden' - input.name = field - form.appendChild(input) + const input = document.createElement('input'); + input.type = 'hidden'; + input.name = field; + form.appendChild(input); if (postValues[field]) { - input.value = postValues[field] + input.value = postValues[field]; } } - form.submit() + form.submit(); }, - makeUrl (status) { - let path = location.protocol + '//' + location.hostname - path += location.port ? ':' + location.port : '' - path += location.pathname - path += location.search ? location.search : '' - path += '#/ecomerce/orders' + makeUrl(status) { + let path = location.protocol + '//' + location.hostname; + path += location.port ? ':' + location.port : ''; + path += location.pathname; + path += location.search ? location.search : ''; + path += '#/ecomerce/orders'; path += - '?' + - new URLSearchParams({ - tpvStatus: status, - tpvOrder: '_transactionId_' - }).toString() - return path + '?' + + new URLSearchParams({ + tpvStatus: status, + tpvOrder: '_transactionId_' + }).toString(); + return path; } } -}) +}); -function isNumeric (n) { - return !isNaN(parseFloat(n)) && isFinite(n) +function isNumeric(n) { + return !isNaN(parseFloat(n)) && isFinite(n); }