diff --git a/src/components/common/TableVisibleColumns.vue b/src/components/common/TableVisibleColumns.vue index 94e3bfbc7..5e077433a 100644 --- a/src/components/common/TableVisibleColumns.vue +++ b/src/components/common/TableVisibleColumns.vue @@ -1,8 +1,6 @@ - setUserConfigViewData(data)" - auto-load - /> diff --git a/src/filters/dateRange.js b/src/filters/dateRange.js new file mode 100644 index 000000000..4c0cfe654 --- /dev/null +++ b/src/filters/dateRange.js @@ -0,0 +1,8 @@ +export default function dateRange(value) { + const minHour = new Date(value); + minHour.setHours(0, 0, 0, 0); + const maxHour = new Date(value); + maxHour.setHours(23, 59, 59, 59); + + return [minHour, maxHour]; +} diff --git a/src/filters/index.js b/src/filters/index.js index b0c441641..f0120e663 100644 --- a/src/filters/index.js +++ b/src/filters/index.js @@ -7,6 +7,7 @@ import toCurrency from './toCurrency'; import toPercentage from './toPercentage'; import toLowerCamel from './toLowerCamel'; import dashIfEmpty from './dashIfEmpty'; +import dateRange from './dateRange'; export { toLowerCase, @@ -18,4 +19,5 @@ export { toCurrency, toPercentage, dashIfEmpty, + dateRange, }; diff --git a/src/pages/Customer/ExtendedList/CustomerExtendedListFilter.vue b/src/pages/Customer/ExtendedList/CustomerExtendedListFilter.vue index 3a9cebc96..7d54aaf0a 100644 --- a/src/pages/Customer/ExtendedList/CustomerExtendedListFilter.vue +++ b/src/pages/Customer/ExtendedList/CustomerExtendedListFilter.vue @@ -7,6 +7,7 @@ import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import VnSelectFilter from 'components/common/VnSelectFilter.vue'; import VnInput from 'src/components/common/VnInput.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; +import { dateRange } from 'src/filters'; const props = defineProps({ dataKey: { @@ -32,6 +33,48 @@ const sageTransactionTypesOptions = ref([]); const visibleColumnsSet = computed(() => new Set(props.visibleColumns)); +const exprBuilder = (param, value) => { + switch (param) { + case 'created': + return { + 'c.created': { + between: dateRange(value), + }, + }; + case 'id': + case 'name': + case 'socialName': + case 'fi': + case 'credit': + case 'creditInsurance': + case 'phone': + case 'mobile': + case 'street': + case 'city': + case 'postcode': + case 'email': + case 'isActive': + case 'isVies': + case 'isTaxDataChecked': + case 'isEqualizated': + case 'isFreezed': + case 'hasToInvoice': + case 'hasToInvoiceByAddress': + case 'isToBeMailed': + case 'hasSepaVnl': + case 'hasLcr': + case 'hasCoreVnl': + case 'countryFk': + case 'provinceFk': + case 'salesPersonFk': + case 'businessTypeFk': + case 'payMethodFk': + case 'sageTaxTypeFk': + case 'sageTransactionTypeFk': + return { [`c.${param}`]: value }; + } +}; + const shouldRenderColumn = (colName) => { return visibleColumnsSet.value.has(colName); }; @@ -88,7 +131,11 @@ const shouldRenderColumn = (colName) => { auto-load @on-fetch="(data) => (sageTransactionTypesOptions = data)" /> - + -import { reactive, ref } from 'vue'; +import { ref } from 'vue'; import { useI18n } from 'vue-i18n'; import FetchData from 'components/FetchData.vue';