Merge branch 'master' into test
gitea/salix-front/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2025-02-18 10:13:46 +01:00
commit a3c91d702d
4 changed files with 31 additions and 24 deletions

View File

@ -53,3 +53,8 @@ const manaCode = ref(props.manaCode);
/> />
</div> </div>
</template> </template>
<i18n>
es:
Promotion mana: Maná promoción
Claim mana: Maná reclamación
</i18n>

View File

@ -47,7 +47,10 @@ const cancel = () => {
<div v-else> <div v-else>
<div class="header">Mana: {{ toCurrency(mana) }}</div> <div class="header">Mana: {{ toCurrency(mana) }}</div>
<div class="q-pa-md"> <div class="q-pa-md">
<slot /> <slot :popup="QPopupProxyRef" />
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
<VnUsesMana :mana-code="manaCode" />
</div>
<div v-if="newPrice" class="column items-center q-mt-lg"> <div v-if="newPrice" class="column items-center q-mt-lg">
<span class="text-primary">{{ t('New price') }}</span> <span class="text-primary">{{ t('New price') }}</span>
<span class="text-subtitle1"> <span class="text-subtitle1">
@ -56,9 +59,6 @@ const cancel = () => {
</div> </div>
</div> </div>
</div> </div>
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm">
<VnUsesMana :mana-code="manaCode" />
</div>
<div class="row"> <div class="row">
<QBtn <QBtn
color="primary" color="primary"

View File

@ -56,7 +56,7 @@ const canProceed = ref();
watch( watch(
() => route.params.id, () => route.params.id,
() => tableRef.value.reload() () => tableRef.value.reload(),
); );
const columns = computed(() => [ const columns = computed(() => [
@ -132,7 +132,7 @@ const columns = computed(() => [
align: 'left', align: 'left',
label: t('globals.amount'), label: t('globals.amount'),
name: 'amount', name: 'amount',
format: (row) => parseInt(row.amount * row.quantity), format: (row) => toCurrency(getSaleTotal(row)),
}, },
{ {
align: 'left', align: 'left',
@ -199,7 +199,7 @@ const changeQuantity = async (sale) => {
await updateQuantity(sale); await updateQuantity(sale);
} catch (e) { } catch (e) {
const { quantity } = tableRef.value.CrudModelRef.originalData.find( const { quantity } = tableRef.value.CrudModelRef.originalData.find(
(s) => s.id === sale.id (s) => s.id === sale.id,
); );
sale.quantity = quantity; sale.quantity = quantity;
throw e; throw e;
@ -330,8 +330,7 @@ const updateDiscount = async (sales, newDiscount = null) => {
}; };
await axios.post(`Tickets/${route.params.id}/updateDiscount`, params); await axios.post(`Tickets/${route.params.id}/updateDiscount`, params);
notify('globals.dataSaved', 'positive'); notify('globals.dataSaved', 'positive');
for (let sale of sales) sale.discount = _newDiscount; tableRef.value.reload();
edit.value = { ...DEFAULT_EDIT };
}; };
const getNewPrice = computed(() => { const getNewPrice = computed(() => {
@ -503,7 +502,7 @@ async function isSalePrepared(item) {
componentProps: { componentProps: {
title: t('Item prepared'), title: t('Item prepared'),
message: t( message: t(
'This item is already prepared. Do you want to continue?' 'This item is already prepared. Do you want to continue?',
), ),
data: item, data: item,
}, },
@ -525,7 +524,7 @@ watch(
if (newItemFk) { if (newItemFk) {
updateItem(newRow.value); updateItem(newRow.value);
} }
} },
); );
</script> </script>
@ -595,7 +594,7 @@ watch(
openConfirmationModal( openConfirmationModal(
t('Continue anyway?'), t('Continue anyway?'),
t('You are going to delete lines of the ticket'), t('You are going to delete lines of the ticket'),
removeSales removeSales,
) )
" "
> >
@ -833,21 +832,24 @@ watch(
:mana-code="manaCode" :mana-code="manaCode"
@save="changeDiscount(row)" @save="changeDiscount(row)"
> >
<template #default="{ popup }">
<VnInput <VnInput
autofocus
@keyup.enter="
() => {
changeDiscount(row);
popup.hide();
}
"
v-model.number="edit.discount" v-model.number="edit.discount"
:label="t('ticketSale.discount')" :label="t('ticketSale.discount')"
type="number" type="number"
/> />
<div v-if="usesMana" class="column q-gutter-y-sm q-mt-sm"> </template>
<VnUsesMana :mana-code="manaCode" />
</div>
</TicketEditManaProxy> </TicketEditManaProxy>
</template> </template>
<span v-else>{{ toPercentage(row.discount / 100) }}</span> <span v-else>{{ toPercentage(row.discount / 100) }}</span>
</template> </template>
<template #column-amount="{ row }">
{{ toCurrency(row.quantity * row.price) }}
</template>
</VnTable> </VnTable>
<QPageSticky :offset="[20, 20]" style="z-index: 2"> <QPageSticky :offset="[20, 20]" style="z-index: 2">

View File

@ -53,7 +53,7 @@ const showChangePasswordDialog = () => {
</QItemSection> </QItemSection>
</QItem> </QItem>
<QItem <QItem
v-if="!worker.user.emailVerified && user.id == worker.id" v-if="!worker.user.emailVerified && user.id != worker.id"
v-ripple v-ripple
clickable clickable
@click="showChangePasswordDialog" @click="showChangePasswordDialog"