0
0
Fork 0

Merge pull request '#7710 - uses cloneAll' (!640) from 7710-cloneWithTicketPackaging into dev

Reviewed-on: verdnatura/salix-front#640
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
Javi Gallego 2024-08-23 13:42:42 +00:00
commit b4d1a4dab4
2 changed files with 15 additions and 8 deletions

View File

@ -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));

View File

@ -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>