forked from verdnatura/salix-front
Reviewed-on: verdnatura/salix-front#640 Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
commit
b4d1a4dab4
|
@ -268,7 +268,6 @@ onMounted(async () => {
|
|||
stateStore.rightDrawer = true;
|
||||
const filteredColumns = columns.value.filter((col) => col.name !== 'history');
|
||||
allColumnNames.value = filteredColumns.map((col) => col.name);
|
||||
// await expeditionsArrayData.fetch({ append: false });
|
||||
});
|
||||
|
||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||
|
|
|
@ -153,14 +153,22 @@ const setReserved = async (reserved) => {
|
|||
};
|
||||
|
||||
const createRefund = async (withWarehouse) => {
|
||||
if (!props.sales) return;
|
||||
if (!props.ticket) return;
|
||||
|
||||
const salesIds = props.sales.map((sale) => sale.id);
|
||||
const params = { salesIds: salesIds, withWarehouse: withWarehouse, negative: true };
|
||||
const { data } = await axios.post('Sales/clone', params);
|
||||
const [refundTicket] = data;
|
||||
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
|
||||
router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
||||
const params = {
|
||||
ticketsIds: [props.ticket.id],
|
||||
withWarehouse: withWarehouse,
|
||||
negative: true,
|
||||
};
|
||||
|
||||
try {
|
||||
const { data } = await axios.post('Tickets/cloneAll', params);
|
||||
const [refundTicket] = data;
|
||||
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
|
||||
router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue