diff --git a/src/pages/Ticket/Card/TicketDescriptorMenu.vue b/src/pages/Ticket/Card/TicketDescriptorMenu.vue index 89c061507..1b64d7979 100644 --- a/src/pages/Ticket/Card/TicketDescriptorMenu.vue +++ b/src/pages/Ticket/Card/TicketDescriptorMenu.vue @@ -28,6 +28,7 @@ const ticket = ref(props.ticket); const ticketId = currentRoute.value.params.id; const client = ref(); const showTransferDialog = ref(false); +const showTurnDialog = ref(false); const dialogRef = ref(); const actions = { clone: async () => { @@ -195,6 +196,37 @@ async function transferClient(client) { if (data) window.location.reload(); } + +async function addTurn(day) { + const params = { + ticketFk: parseInt(ticketId), + weekDay: day, + agencyModeFk: ticket.value.agencyModeFk, + }; + await axios.patch(`TicketWeeklies`, params); + + notify({ + message: t('Current ticket deleted and added to shift'), + type: 'positive', + }); + window.location.reload(); +} + +async function createRefund(withWarehouse) { + const params = { + ticketsIds: [parseInt(ticketId)], + withWarehouse: withWarehouse, + }; + const { data } = await axios.post(`Tickets/refund`, params); + console.log('data: ', data); + + if (data) { + const refundTicket = data; + console.log('refundTicket: ', refundTicket); + + push({ name: 'TicketSale', params: { id: refundTicket[0].id } }); + } +} + + + + + {{ t('addTurn') }} + + + + + + @@ -338,6 +439,29 @@ async function transferClient(client) { {{ t('To clone ticket') }} + + + + + {{ t('Refund all...') }} + + + + + + + + {{ t('with warehouse') }} + + + + + {{ t('without warehouse') }} + + + + + + + +en: + addTurn: Add turn es: Show Delivery Note...: Ver albarán... Send Delivery Note...: Enviar albarán... @@ -374,4 +506,10 @@ es: The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado Transfer client: Transferir cliente Client: Cliente + addTurn: Añadir a turno + What is the day of receipt of the ticket?: ¿Cuál es el día de preparación del pedido? + Current ticket deleted and added to shift: Ticket actual eliminado y añadido al turno + Refund all...: Abonar todo... + with warehouse: con almacén + without warehouse: sin almacén