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

View File

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