From 5f63a9b05884aa80d09f619d21326e5f293b5e74 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 20 Aug 2024 10:02:23 +0200 Subject: [PATCH] refactor: refs #7553 & #7356 changed makeInvoice function and dialogs --- src/pages/Ticket/Card/TicketDescriptorMenu.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/Ticket/Card/TicketDescriptorMenu.vue b/src/pages/Ticket/Card/TicketDescriptorMenu.vue index 4c1cfad76..aec920002 100644 --- a/src/pages/Ticket/Card/TicketDescriptorMenu.vue +++ b/src/pages/Ticket/Card/TicketDescriptorMenu.vue @@ -194,23 +194,26 @@ async function createPdfInvoice() { } function makeInvoiceDialog() { - //TODO: lo de abajo? - // if (ticket.value.address?.incotermsFk && !ticket.value.weight && !force) dialog({ component: VnConfirm, componentProps: { + title: t('Are you sure you want to invoice this ticket?'), + message: t('You are going to invoice this ticket'), promise: makeInvoice, }, }); } async function makeInvoice() { - console.log(ticket.value); const params = { ticketsIds: [parseInt(ticketId)], }; - const { data } = await axios.post(`Tickets/invoiceTicketsAndPdf`, params); + await axios.post(`Tickets/invoiceTicketsAndPdf`, params); - if (data) window.location.reload(); + notify({ + message: t('Ticket invoiced'), + type: 'positive', + }); + window.location.reload(); } async function transferClient(client) { @@ -515,7 +518,6 @@ async function handleInvoiceOutData() { - @@ -628,4 +630,7 @@ es: Recalculate components: Recalcular componentes Are you sure you want to recalculate components?: ¿Seguro que quieres recalcular los componentes? Data saved: Datos guardados + Are you sure you want to invoice this ticket?: ¿Seguro que quieres facturar este ticket? + You are going to invoice this ticket: Vas a facturar este ticket + Ticket invoiced: Ticket facturado