fix_customerConsumption_filter #1357

Merged
jsegarra merged 8 commits from fix_customerConsumption_filter into dev 2025-02-10 12:40:48 +00:00
1 changed files with 25 additions and 13 deletions
Showing only changes of commit b3fd818b13 - Show all commits

View File

@ -91,6 +91,7 @@ const columns = computed(() => [
name: 'quantity', name: 'quantity',
label: t('globals.quantity'), label: t('globals.quantity'),
cardVisible: true, cardVisible: true,
visible: true,
columnFilter: { columnFilter: {
inWhere: true, inWhere: true,
}, },
@ -155,11 +156,11 @@ const updateDateParams = (value, params) => {
const campaign = campaignList.value.find((c) => c.id === value); const campaign = campaignList.value.find((c) => c.id === value);
if (!campaign) return; if (!campaign) return;
const { dated, previousDays, scopeDays } = campaign; const { dated, scopeDays } = campaign;
const _date = new Date(dated); const from = new Date(dated);
const [from, to] = dateRange(_date); from.setDate(from.getDate() - scopeDays);
params.from = new Date(from.setDate(from.getDate() - previousDays)).toISOString(); params.from = from;
params.to = new Date(to.setDate(to.getDate() + scopeDays)).toISOString(); params.to = dated;
return params; return params;
}; };
</script> </script>
@ -261,19 +262,18 @@ const updateDateParams = (value, params) => {
:label="t('globals.campaign')" :label="t('globals.campaign')"
:filled="true" :filled="true"
class="q-px-sm q-pt-none fit" class="q-px-sm q-pt-none fit"
dense :option-label="(opt) => t(opt.code)"
option-label="code" :fields="['id', 'code', 'dated', 'scopeDays']"
@update:model-value="(data) => updateDateParams(data, params)" @update:model-value="(data) => updateDateParams(data, params)"
dense
> >
<template #option="scope"> <template #option="scope">
<QItem v-bind="scope.itemProps"> <QItem v-bind="scope.itemProps">
<QItemSection> <QItemSection>
<QItemLabel> <QItemLabel> {{ t(scope.opt?.code) }} </QItemLabel>
{{ scope.opt?.code }} <QItemLabel caption>
{{ {{ new Date(scope.opt?.dated).getFullYear() }}
new Date(scope.opt?.dated).getFullYear() </QItemLabel>
}}</QItemLabel
>
</QItemSection> </QItemSection>
</QItem> </QItem>
</template> </template>
@ -298,7 +298,19 @@ const updateDateParams = (value, params) => {
</template> </template>
<i18n> <i18n>
en:
valentinesDay: Valentine's Day
mothersDay: Mother's Day
allSaints: All Saints' Day
es: es:
Enter a new search: Introduce una nueva búsqueda Enter a new search: Introduce una nueva búsqueda
Group by items: Agrupar por artículos Group by items: Agrupar por artículos
valentinesDay: Día de San Valentín
mothersDay: Día de la Madre
allSaints: Día de Todos los Santos
Campaign consumption: Consumo campaña
Campaign: Campaña
From: Desde
To: Hasta
</i18n> </i18n>