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;
|
stateStore.rightDrawer = true;
|
||||||
const filteredColumns = columns.value.filter((col) => col.name !== 'history');
|
const filteredColumns = columns.value.filter((col) => col.name !== 'history');
|
||||||
allColumnNames.value = filteredColumns.map((col) => col.name);
|
allColumnNames.value = filteredColumns.map((col) => col.name);
|
||||||
// await expeditionsArrayData.fetch({ append: false });
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => (stateStore.rightDrawer = false));
|
onUnmounted(() => (stateStore.rightDrawer = false));
|
||||||
|
|
|
@ -153,14 +153,22 @@ const setReserved = async (reserved) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const createRefund = async (withWarehouse) => {
|
const createRefund = async (withWarehouse) => {
|
||||||
if (!props.sales) return;
|
if (!props.ticket) return;
|
||||||
|
|
||||||
const salesIds = props.sales.map((sale) => sale.id);
|
const params = {
|
||||||
const params = { salesIds: salesIds, withWarehouse: withWarehouse, negative: true };
|
ticketsIds: [props.ticket.id],
|
||||||
const { data } = await axios.post('Sales/clone', params);
|
withWarehouse: withWarehouse,
|
||||||
const [refundTicket] = data;
|
negative: true,
|
||||||
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
|
};
|
||||||
router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
|
|
||||||
|
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>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue