Compare commits

..

29 Commits

Author SHA1 Message Date
Benjamin Esteve 690bfcb547 Merge branch '8828-filterVnSelectWarehouses' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 14:03:00 +02:00
Benjamin Esteve eb8ffc6e16 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses 2025-04-15 14:02:26 +02:00
Benjamin Esteve 48eb945b36 Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 11:56:38 +00:00
Benjamin Esteve ca5576f0e1 Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 11:06:26 +00:00
Benjamin Esteve e32858374e Merge branch '8828-filterVnSelectWarehouses' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-15 10:31:27 +02:00
Benjamin Esteve 1a35c6e60b Merge branch 'dev' of https: refs #8828//gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses 2025-04-15 10:31:25 +02:00
Benjamin Esteve 907afc84e4 Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-14 09:16:47 +00:00
Benjamin Esteve 220e2dccd6 Merge branch '8828-filterVnSelectWarehouses' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-14 09:07:00 +02:00
Benjamin Esteve 8ea4163f05 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses 2025-04-14 09:06:39 +02:00
Benjamin Esteve 7a05b8e768 Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-14 06:51:27 +00:00
Benjamin Esteve 55e074754e Merge branch '8828-filterVnSelectWarehouses' of https: refs #8828//gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 11:14:47 +02:00
Benjamin Esteve b6b9e1d97d Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses 2025-04-11 11:14:17 +02:00
Benjamin Esteve b21720c79c Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-11 07:05:17 +00:00
Benjamin Esteve 0e0323a9e8 Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-09 07:27:00 +00:00
Benjamin Esteve fddeece32f Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-08 09:08:46 +00:00
Benjamin Esteve 971d27d349 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-08 09:13:56 +02:00
Alex Moreno ac969d18a6 Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-07 12:14:48 +00:00
Benjamin Esteve 7d813ab549 Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit looks good Details
2025-04-07 12:12:13 +00:00
Alex Moreno 4eb2fe9cee Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details
2025-04-07 11:32:08 +00:00
Alex Moreno ee2cbb7ae5 Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev Something is wrong with the build of this commit Details
2025-04-07 11:23:45 +00:00
Benjamin Esteve 25ad79639e Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-07 12:22:27 +02:00
Benjamin Esteve aa6cd82da3 Merge branch '8828-filterVnSelectWarehouses' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-07 11:56:00 +02:00
Benjamin Esteve e0e4a549c1 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses 2025-04-07 11:51:17 +02:00
Benjamin Esteve b6f7dbd1eb Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-07 09:09:13 +00:00
Benjamin Esteve eaa896852c fix: refs #8828 update warehouse selection in ticket list tests
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-07 10:15:37 +02:00
Benjamin Esteve 87a4e1d469 Merge branch '8828-filterVnSelectWarehouses' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-07 09:25:11 +02:00
Benjamin Esteve b2e022ed56 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into 8828-filterVnSelectWarehouses 2025-04-07 09:25:00 +02:00
Benjamin Esteve 9f9ae26d55 Merge branch 'dev' into 8828-filterVnSelectWarehouses
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-04 09:43:34 +00:00
Benjamin Esteve 84dbf9691e feat: refs #8828 add warehouse filtering for tickets and travels
gitea/salix-front/pipeline/pr-dev This commit is unstable Details
2025-04-03 12:25:11 +02:00
40 changed files with 255 additions and 245 deletions

View File

@ -156,6 +156,11 @@ const selectTravel = ({ id }) => {
option-label="name"
option-value="id"
v-model="travelFilterParams.warehouseOutFk"
:where="{
isOrigin: {
neq: 0,
},
}"
/>
<VnSelect
:label="t('globals.warehouseIn')"
@ -164,6 +169,11 @@ const selectTravel = ({ id }) => {
option-label="name"
option-value="id"
v-model="travelFilterParams.warehouseInFk"
:where="{
isDestiny: {
neq: 0,
},
}"
/>
<VnInputDate
:label="t('globals.shipped')"

View File

@ -69,7 +69,7 @@ const refresh = () => window.location.reload();
'no-visible': !stateQuery.isLoading().value,
}"
size="sm"
data-cy="navBar-spinner"
data-cy="loading-spinner"
/>
<QSpace />
<div id="searchbar" class="searchbar"></div>

View File

@ -40,6 +40,11 @@ const onDataSaved = (data) => {
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
auto-load
:where="{
isInventory: {
neq: 0,
},
}"
/>
<FormModelPopup
url-create="Items/regularize"

View File

@ -751,7 +751,6 @@ const rowCtrlClickFunction = computed(() => {
withFilters
"
:column="col"
:data-cy="`column-filter-${col.name}`"
:show-title="true"
:data-key="$attrs['data-key']"
v-model="params[columnName(col)]"

View File

@ -212,7 +212,6 @@ const getLocale = (label) => {
color="primary"
style="position: fixed; z-index: 1; right: 0; bottom: 0"
icon="search"
data-cy="vnFilterPanel_search"
@click="search()"
>
<QTooltip bottom anchor="bottom right">
@ -230,7 +229,6 @@ const getLocale = (label) => {
<QItemSection top side>
<QBtn
@click="clearFilters"
data-cy="clearFilters"
color="primary"
dense
flat
@ -294,7 +292,6 @@ const getLocale = (label) => {
</QList>
</QForm>
<QInnerLoading
data-cy="filterPanel-spinner"
:label="t('globals.pleaseWait')"
:showing="isLoading"
color="primary"

View File

@ -11,7 +11,7 @@ const $props = defineProps({
</script>
<template>
<QPopupProxy data-cy="CustomerDescriptor">
<QPopupProxy>
<CustomerDescriptor v-if="$props.id" :id="$props.id" :summary="CustomerSummary" />
</QPopupProxy>
</template>

View File

@ -162,6 +162,11 @@ const entryFilterPanel = ref();
v-model="params.warehouseOutFk"
@update:model-value="searchFn()"
url="Warehouses"
:where="{
isOrigin: {
neq: 0,
},
}"
:fields="['id', 'name']"
sort-by="name ASC"
hide-selected
@ -177,6 +182,11 @@ const entryFilterPanel = ref();
v-model="params.warehouseInFk"
@update:model-value="searchFn()"
url="Warehouses"
:where="{
isDestiny: {
neq: 0,
},
}"
:fields="['id', 'name']"
sort-by="name ASC"
hide-selected

View File

@ -228,15 +228,11 @@ async function handleTicketConfig(data) {
url="TicketConfigs"
:filter="{ fields: ['lackAlertPrice'] }"
@on-fetch="handleTicketConfig"
></FetchData>
<QInnerLoading
:showing="isLoading"
:label="t && t('globals.pleaseWait')"
color="primary"
auto-load
/>
<VnTable
v-if="!isLoading"
v-if="ticketConfig"
auto-load
data-cy="proposalTable"
ref="proposalTableRef"

View File

@ -8,14 +8,14 @@ import VnRow from 'src/components/ui/VnRow.vue';
class="q-pa-md"
:style="{ 'flex-direction': $q.screen.lt.lg ? 'column' : 'row', gap: '0px' }"
>
<div style="flex: 0.3" data-cy="clientsOnWebsite">
<div style="flex: 0.3">
<span
class="q-ml-md text-body1"
v-text="$t('salesMonitor.clientsOnWebsite')"
/>
<SalesClientTable />
</div>
<div style="flex: 0.7" data-cy="recentOrderActions">
<div style="flex: 0.7">
<span
class="q-ml-md text-body1"
v-text="$t('salesMonitor.recentOrderActions')"

View File

@ -9,7 +9,6 @@ import { toDateFormat, toDateTimeFormat } from 'src/filters/date.js';
import { toCurrency } from 'src/filters';
import { useVnConfirm } from 'composables/useVnConfirm';
import axios from 'axios';
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
import useOpenURL from 'src/composables/useOpenURL';
const { t } = useI18n();
@ -166,7 +165,16 @@ const openTab = (id) => useOpenURL(`#/order/${id}/summary`);
</div>
</template>
<template #column-dateSend="{ row }">
<VnDateBadge :date="row.date_send" />
<QTd>
<QBadge
:color="getBadgeColor(row.date_send)"
text-color="black"
class="q-pa-sm"
style="font-size: 14px"
>
{{ toDateFormat(row.date_send) }}
</QBadge>
</QTd>
</template>
<template #column-clientFk="{ row }">

View File

@ -9,7 +9,6 @@ import VnInput from 'src/components/common/VnInput.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import FetchData from 'src/components/FetchData.vue';
import { dateRange } from 'src/filters';
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
defineProps({ dataKey: { type: String, required: true } });
const { t, te } = useI18n();
@ -210,7 +209,7 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
<QCheckbox
:label="t('params.myTeam')"
v-model="params.myTeam"
toggle-indeterminate
@ -219,7 +218,7 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
<QCheckbox
:label="t('params.problems')"
v-model="params.problems"
toggle-indeterminate
@ -228,7 +227,7 @@ const getLocale = (label) => {
</QItem>
<QItem>
<QItemSection>
<VnCheckbox
<QCheckbox
:label="t('params.pending')"
v-model="params.pending"
toggle-indeterminate

View File

@ -1,6 +1,7 @@
<script setup>
import { ref, computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import FetchData from 'components/FetchData.vue';
import DepartmentDescriptorProxy from 'src/pages/Worker/Department/Card/DepartmentDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import TicketDescriptorProxy from 'src/pages/Ticket/Card/TicketDescriptorProxy.vue';
@ -167,11 +168,9 @@ const columns = computed(() => [
component: 'select',
name: 'provinceFk',
attrs: {
url: 'Provinces',
fields: ['id', 'name'],
sortBy: ['name ASC'],
optionValue: 'id',
optionLabel: 'name',
options: provinceOpts.value,
'option-value': 'id',
'option-label': 'name',
dense: true,
},
},
@ -184,11 +183,9 @@ const columns = computed(() => [
component: 'select',
name: 'stateFk',
attrs: {
sortBy: ['name ASC'],
url: 'States',
fields: ['id', 'name'],
optionValue: 'id',
optionLabel: 'name',
options: stateOpts.value,
'option-value': 'id',
'option-label': 'name',
dense: true,
},
},
@ -215,12 +212,9 @@ const columns = computed(() => [
component: 'select',
name: 'zoneFk',
attrs: {
url: 'Zones',
fields: ['id', 'name'],
sortBy: ['name ASC'],
optionValue: 'id',
optionLabel: 'name',
options: zoneOpts.value,
'option-value': 'id',
'option-label': 'name',
dense: true,
},
},
@ -231,12 +225,11 @@ const columns = computed(() => [
align: 'left',
columnFilter: {
component: 'select',
url: 'PayMethods',
attrs: {
url: 'PayMethods',
fields: ['id', 'name'],
sortBy: ['id ASC'],
optionLabel: 'name',
options: PayMethodOpts.value,
optionValue: 'id',
optionLabel: 'name',
dense: true,
},
},
@ -261,9 +254,7 @@ const columns = computed(() => [
columnFilter: {
component: 'select',
attrs: {
url: 'Departments',
fields: ['id', 'name'],
sortBy: ['id ASC'],
options: DepartmentOpts.value,
dense: true,
},
},
@ -274,12 +265,11 @@ const columns = computed(() => [
align: 'left',
columnFilter: {
component: 'select',
url: 'ItemPackingTypes',
attrs: {
url: 'ItemPackingTypes',
fields: ['code'],
sortBy: ['code ASC'],
optionValue: 'code',
optionCode: 'code',
options: ItemPackingTypeOpts.value,
'option-value': 'code',
'option-label': 'code',
dense: true,
},
},
@ -334,6 +324,60 @@ const totalPriceColor = (ticket) => {
const openTab = (id) => useOpenURL(`#/ticket/${id}/sale`);
</script>
<template>
<FetchData
url="Provinces"
:filter="{
fields: ['id', 'name'],
order: 'name ASC',
}"
auto-load
@on-fetch="(data) => (provinceOpts = data)"
/>
<FetchData
url="States"
:filter="{
fields: ['id', 'name'],
order: 'name ASC',
}"
auto-load
@on-fetch="(data) => (stateOpts = data)"
/>
<FetchData
url="Zones"
:filter="{
fields: ['id', 'name'],
order: 'name ASC',
}"
auto-load
@on-fetch="(data) => (zoneOpts = data)"
/>
<FetchData
url="ItemPackingTypes"
:filter="{
fields: ['code'],
order: 'code ASC',
}"
auto-load
@on-fetch="(data) => (ItemPackingTypeOpts = data)"
/>
<FetchData
url="Departments"
:filter="{
fields: ['id', 'name'],
order: 'id ASC',
}"
auto-load
@on-fetch="(data) => (DepartmentOpts = data)"
/>
<FetchData
url="PayMethods"
:filter="{
fields: ['id', 'name'],
order: 'id ASC',
}"
auto-load
@on-fetch="(data) => (PayMethodOpts = data)"
/>
<MonitorTicketSearchbar />
<RightMenu>
<template #right-panel>

View File

@ -239,6 +239,11 @@ async function getZone(options) {
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
}"
auto-load
/>
<FetchData

View File

@ -10,7 +10,7 @@ const $props = defineProps({
});
</script>
<template>
<QPopupProxy data-cy="TicketDescriptor">
<QPopupProxy>
<TicketDescriptor v-if="$props.id" :id="$props.id" :summary="TicketSummary" />
</QPopupProxy>
</template>

View File

@ -46,7 +46,16 @@ const setUserParams = (params) => {
</script>
<template>
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehouses = data)"
:where="{
isForTicket: {
neq: 0,
},
}"
auto-load
/>
<FetchData
url="ItemCategories"
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"

View File

@ -51,6 +51,11 @@ onMounted(async () => await getItemPackingTypes());
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
}"
auto-load
/>
<VnFilterPanel

View File

@ -67,14 +67,12 @@ const onClientSelected = async (formData) => {
const fetchAvailableAgencies = async (formData) => {
resetAgenciesSelector(formData);
const response= await getAgencies(formData, selectedClient.value);
const response = await getAgencies(formData, selectedClient.value);
if (!response) return;
const { options, agency } = response
if(options)
agenciesOptions.value = options;
if(agency)
formData.agencyModeId = agency;
const { options, agency } = response;
if (options) agenciesOptions.value = options;
if (agency) formData.agencyModeId = agency;
};
const redirectToTicketList = (_, { id }) => {
@ -92,6 +90,11 @@ const redirectToTicketList = (_, { id }) => {
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
}"
order="name"
auto-load
/>

View File

@ -40,7 +40,7 @@ onBeforeMount(async () => {
function resetAgenciesSelector(formData) {
agenciesOptions.value = [];
if(formData) formData.agencyModeId = null;
if (formData) formData.agencyModeId = null;
}
const fetchClient = async (formData) => {
@ -67,14 +67,12 @@ const onClientSelected = async (formData) => {
const fetchAvailableAgencies = async (formData) => {
resetAgenciesSelector(formData);
const response= await getAgencies(formData, selectedClient.value);
const response = await getAgencies(formData, selectedClient.value);
if (!response) return;
const { options, agency } = response
if(options)
agenciesOptions.value = options;
if(agency)
formData.agencyModeId = agency;
const { options, agency } = response;
if (options) agenciesOptions.value = options;
if (agency) formData.agencyModeId = agency;
};
const redirectToTicketList = (_, { id }) => {
@ -86,6 +84,11 @@ const redirectToTicketList = (_, { id }) => {
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
}"
order="name"
auto-load
/>

View File

@ -41,7 +41,16 @@ const groupedStates = ref([]);
@on-fetch="(data) => (agencies = data)"
auto-load
/>
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehouses = data)"
auto-load
:where="{
isForTicket: {
neq: 0,
},
}"
/>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"

View File

@ -55,6 +55,11 @@ onMounted(async () => {
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: {
neq: 0,
},
}"
auto-load
/>
<VnFilterPanel

View File

@ -202,6 +202,11 @@ const columns = computed(() => [
attrs: {
url: 'warehouses',
fields: ['id', 'name'],
where: {
isForTicket: {
neq: 0,
},
},
},
format: (row) => row.warehouse,
columnField: {
@ -668,9 +673,13 @@ function setReference(data) {
:sort-by="['name']"
:label="t('globals.warehouse')"
v-model="data.warehouseId"
:options="warehousesOptions"
hide-selected
required
:where="{
isForTicket: {
neq: 0,
},
}"
@update:model-value="() => fetchAvailableAgencies(data)"
/>
</div>

View File

@ -102,6 +102,9 @@ const columns = computed(() => [
attrs: {
url: 'Warehouses',
fields: ['id', 'name'],
where: {
isForTicket: { neq: 0 },
},
},
inWhere: true,
},

View File

@ -208,6 +208,7 @@ ticketList:
hour: Hour
rounding: Rounding
noVerifiedData: No verified data
warehouse: Warehouse
purchaseRequest: Purchase request
notVisible: Not visible
clientFrozen: Client frozen

View File

@ -28,13 +28,21 @@ const warehousesOptionsIn = ref([]);
url="Warehouses"
@on-fetch="(data) => (warehousesOptionsOut = data)"
auto-load
:filter="{ where: { isOrigin: TRUE } }"
:where="{
isOrigin: {
neq: 0,
},
}"
/>
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptionsIn = data)"
auto-load
:filter="{ where: { isDestiny: TRUE } }"
:where="{
isDestiny: {
neq: 0,
},
}"
/>
<FormModel :url-update="`Travels/${route.params.id}`" model="Travel">
<template #form="{ data }">

View File

@ -183,7 +183,9 @@ warehouses();
<VnSelect
:label="t('extraCommunity.filter.warehouseOutFk')"
v-model="params.warehouseOutFk"
:options="warehousesOptions"
:options="
warehousesOptions.filter((option) => option.isOrigin !== 0)
"
option-value="id"
option-label="name"
hide-selected
@ -197,7 +199,9 @@ warehouses();
<VnSelect
:label="t('extraCommunity.filter.warehouseInFk')"
v-model="params.warehouseInFk"
:options="warehousesOptions"
:options="
warehousesOptions.filter((option) => option.isDestiny !== 0)
"
option-value="id"
option-label="name"
hide-selected

View File

@ -81,6 +81,11 @@ const redirectToTravelBasicData = (_, { id }) => {
option-value="id"
option-label="name"
hide-selected
:where="{
isOrigin: {
neq: 0,
},
}"
/>
<VnSelect
:label="t('globals.warehouseIn')"
@ -89,6 +94,11 @@ const redirectToTravelBasicData = (_, { id }) => {
option-value="id"
option-label="name"
hide-selected
:where="{
isDestiny: {
neq: 0,
},
}"
/>
</VnRow>
</template>

View File

@ -64,6 +64,11 @@ defineExpose({ states });
option-filter="name"
dense
filled
:where="{
isDestiny: {
neq: 0,
},
}"
/>
<VnInputDate
:label="t('travel.shipped')"
@ -89,6 +94,11 @@ defineExpose({ states });
option-filter="name"
dense
filled
:where="{
isOrigin: {
neq: 0,
},
}"
/>
<VnInputDate
:label="t('travel.landed')"

View File

@ -99,6 +99,7 @@ const columns = computed(() => [
fields: ['id', 'name'],
optionLabel: 'name',
optionValue: 'id',
where: { isDestiny: { neq: 0 } },
},
format: (row) => row.warehouseInName,
columnField: {
@ -133,6 +134,7 @@ const columns = computed(() => [
attrs: {
url: 'warehouses',
fields: ['id', 'name'],
where: { isOrigin: { neq: 0 } },
},
format: (row) => row.warehouseOutName,
columnField: {

View File

@ -11,7 +11,7 @@ const $props = defineProps({
</script>
<template>
<QPopupProxy data-cy="DepartmentDescriptor">
<QPopupProxy>
<DepartmentDescriptor
v-if="$props.id"
:id="$props.id"

View File

@ -53,7 +53,7 @@ describe('invoiceInCorrective', () => {
it('should show/hide the section if it is a corrective invoice', () => {
cy.visit('/#/invoice-in/1/summary');
cy.get('[data-cy="InvoiceInCorrective-menu-item"]').should('not.exist');
cy.clickDescriptorAction(4);
cy.clicDescriptorAction(4);
cy.get('[data-cy="InvoiceInCorrective-menu-item"]').should('exist');
});
});

View File

@ -64,17 +64,17 @@ describe('InvoiceInDescriptor', () => {
beforeEach(() => cy.visit('/#/invoice-in/1/summary'));
it('should navigate to the supplier summary', () => {
cy.clickDescriptorAction(1);
cy.clicDescriptorAction(1);
cy.url().should('to.match', /supplier\/\d+\/summary/);
});
it('should navigate to the entry summary', () => {
cy.clickDescriptorAction(2);
cy.clicDescriptorAction(2);
cy.url().should('to.match', /entry\/\d+\/summary/);
});
it('should navigate to the invoiceIn list', () => {
cy.clickDescriptorAction(3);
cy.clicDescriptorAction(3);
cy.url().should('to.match', /invoice-in\/list\?table=\{.*supplierFk.+\}/);
});
});
@ -93,7 +93,7 @@ describe('InvoiceInDescriptor', () => {
createCorrective();
redirect(originalId);
cy.clickDescriptorAction(4);
cy.clicDescriptorAction(4);
cy.validateVnTableRows({
cols: [
{
@ -141,7 +141,7 @@ function createCorrective() {
function redirect(subtitle) {
const regex = new RegExp(`InvoiceIns/${subtitle}\\?filter=.*`);
cy.intercept('GET', regex).as('getOriginal');
cy.clickDescriptorAction(4);
cy.clicDescriptorAction(4);
cy.wait('@getOriginal');
cy.validateDescriptor({ subtitle });
}

View File

@ -1,47 +0,0 @@
/// <reference types="cypress" />
describe('Monitor Clients actions', () => {
beforeEach(() => {
cy.login('salesPerson');
cy.intercept('GET', '**/Departments**').as('departments');
cy.visit('/#/monitor/clients-actions');
cy.waitForElement('.q-page');
cy.wait('@departments').then((xhr) => {
cy.window().then((win) => {
const user = JSON.parse(win.sessionStorage.getItem('user'));
const { where } = JSON.parse(xhr.request.query.filter);
expect(where.id.like).to.include(user.departmentFk.toString());
});
});
cy.intercept('GET', '**/SalesMonitors/ordersFilter*').as('ordersFilter');
cy.intercept('GET', '**/SalesMonitors/clientsFilter*').as('clientsFilter');
});
it('Should filter by field', () => {
cy.get('.q-page').should('be.visible');
cy.dataCy('clientsOnWebsite')
.find('[data-cy="column-filter-departmentFk"] [data-cy="_select"]')
.click();
cy.dataCy('recentOrderActions').within(() => {
cy.getRowCol('clientFk').find('span').should('have.class', 'link').click();
});
cy.checkVisibleDescriptor('Customer');
cy.dataCy('recentOrderActions').within(() => {
cy.getRowCol('departmentFk', 2)
.find('span')
.should('have.class', 'link')
.click();
});
cy.checkVisibleDescriptor('Department');
cy.dataCy('clientsOnWebsite')
.find('.q-ml-md')
.should('have.text', 'Clients on website');
cy.dataCy('recentOrderActions')
.find('.q-ml-md')
.should('have.text', 'Recent order actions');
cy.dataCy('From_inputDate').should('have.value', '01/01/2001');
cy.dataCy('To_inputDate').should('have.value', '01/01/2001');
});
});

View File

@ -1,69 +0,0 @@
/// <reference types="cypress" />
describe('Monitor Tickets Table', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('salesPerson');
cy.visit('/#/monitor/tickets');
cy.waitForElement('.q-page');
cy.intercept('GET', '**/SalesMonitors/salesFilter*').as('filterRequest');
cy.openRightMenu();
});
it('should open new tab when ctrl+click on client link', () => {
cy.intercept('GET', '**/SalesMonitors/salesFilter*').as('filterRequest');
cy.window().then((win) => {
cy.stub(win, 'open').as('windowOpen');
});
cy.getRowCol('provinceFk').click({ ctrlKey: true });
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
});
it('should open the descriptorProxy and SummaryPopup', () => {
cy.getRowCol('totalProblems');
cy.getRowCol('id').find('span').should('have.class', 'link').click();
cy.checkVisibleDescriptor('Ticket');
cy.getRowCol('zoneFk').find('span').should('have.class', 'link').click();
cy.checkVisibleDescriptor('Zone');
cy.getRowCol('clientFk').find('span').should('have.class', 'link').click();
cy.checkVisibleDescriptor('Customer');
cy.getRowCol('departmentFk').find('span').should('have.class', 'link').click();
cy.checkVisibleDescriptor('Department');
cy.getRowCol('shippedDate').find('.q-badge');
cy.tableActions().click({ ctrlKey: true });
cy.tableActions(1).click();
cy.get('.summaryHeader').should('exist');
});
it('clear scopeDays', () => {
cy.get('[data-cy="Days onward_input"]').clear().type('2');
cy.searchInFilterPanel();
cy.get('.q-chip__content > span').should('have.text', '"2"');
cy.waitSpinner();
checkScopeDays(2);
cy.get('[data-cy="Days onward_input"]').clear();
cy.searchInFilterPanel();
cy.get('.q-chip__content > span').should('have.text', '"0"');
cy.waitSpinner();
checkScopeDays(0);
});
});
function checkScopeDays(scopeDays) {
cy.url().then((url) => {
const urlParams = new URLSearchParams(url.split('?')[1]);
const saleMonitorTickets = JSON.parse(
decodeURIComponent(urlParams.get('saleMonitorTickets')),
);
expect(saleMonitorTickets.scopeDays).to.equal(scopeDays);
const fromDate = new Date(saleMonitorTickets.from);
const toDate = new Date(saleMonitorTickets.to);
expect(toDate.getDate() - fromDate.getDate()).to.equal(
saleMonitorTickets.scopeDays,
);
});
}

View File

@ -2,7 +2,7 @@
describe('OrderCatalog', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.viewport(1920, 720);
cy.visit('/#/order/8/catalog');
});

View File

@ -6,7 +6,9 @@ describe('ParkingBasicData', () => {
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/shelving/parking/1/basic-data`);
cy.get('[data-cy="navBar-spinner"]', { timeout: 10000 }).should('not.be.visible');
cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should(
'not.be.visible',
);
});
it('should give an error if the code aldready exists', () => {

View File

@ -76,16 +76,13 @@ describe('TicketList', () => {
});
}).as('ticket');
cy.get('[data-cy="Warehouse_select"]').type('Warehouse Five');
cy.get('.q-menu .q-item').contains('Warehouse Five').click();
cy.get('[data-cy="Warehouse_select"]').type('Warehouse One');
cy.get('.q-menu .q-item').contains('Warehouse One').click();
cy.wait('@ticket').then((interception) => {
const data = interception.response.body[1];
expect(data.hasComponentLack).to.equal(1);
expect(data.isTooLittle).to.equal(1);
expect(data.hasItemShortage).to.equal(1);
});
cy.get('.icon-components').should('exist');
cy.get('.icon-unavailable').should('exist');
cy.get('.icon-isTooLittle').should('exist');
});
});

View File

@ -1,6 +0,0 @@
Cypress.Commands.add('checkVisibleDescriptor', (alias) =>
cy
.get(`[data-cy="${alias}Descriptor"] [data-cy="vnDescriptor"] > .header`)
.should('exist')
.and('be.visible'),
);

View File

@ -2,7 +2,9 @@ Cypress.Commands.add('getRow', (index = 1) =>
cy.get(`.vnTable .q-virtual-scroll__content tr:nth-child(${index})`),
);
Cypress.Commands.add('getRowCol', (field, index = 1) =>
cy.getRow(index).find(`[data-col-field="${field}"]`),
cy.get(
`.vnTable .q-virtual-scroll__content > :nth-child(${index}) > [data-col-field="${field}"]`,
),
);
Cypress.Commands.add('vnTableCreateBtn', () =>
@ -12,9 +14,3 @@ Cypress.Commands.add('vnTableCreateBtn', () =>
Cypress.Commands.add('waitTableScrollLoad', () =>
cy.waitForElement('[data-q-vs-anchor]'),
);
Cypress.Commands.add('tableActions', (n = 0, child = 1) =>
cy.get(
`:nth-child(${child}) > .q-table--col-auto-width > [data-cy="tableAction-${n}"] > .q-btn__content > .q-icon`,
),
);

View File

@ -78,21 +78,20 @@ Cypress.Commands.add('waitForElement', (element) => {
Cypress.Commands.add('getValue', (selector) => {
cy.get(selector).then(($el) => {
if ($el.find('.q-checkbox__inner').length > 0) {
return cy.get(`${selector}.q-checkbox__inner`);
return cy.get(selector + '.q-checkbox__inner');
}
// Si es un QSelect
if ($el.find('.q-select__dropdown-icon').length) {
return cy
.get(
`${
selector
}> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input`,
selector +
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input',
)
.invoke('val');
}
// Si es un QSelect
if ($el.find('span').length) {
return cy.get(`${selector} span`).then(($span) => {
return cy.get(selector + ' span').then(($span) => {
return $span[0].innerText;
});
}
@ -101,15 +100,10 @@ Cypress.Commands.add('getValue', (selector) => {
});
});
Cypress.Commands.add('waitSpinner', (_spinner = 'navBar') => {
const spinners = {
navBar: '[data-cy="navBar-spinner"]',
filterPanel: '[data-cy="filterPanel-spinner"]',
};
const spinner = spinners[_spinner];
Cypress.Commands.add('waitSpinner', () => {
cy.get('body').then(($body) => {
if ($body.find(spinner).length) {
cy.get(spinner).should('not.be.visible');
if ($body.find('[data-cy="loading-spinner"]').length) {
cy.get('[data-cy="loading-spinner"]').should('not.be.visible');
}
});
});
@ -148,7 +142,7 @@ function selectItem(selector, option, ariaControl, hasWrite = true) {
function getItems(ariaControl, startTime = Cypress._.now(), timeout = 2500) {
// Se intenta obtener la lista de opciones del desplegable de manera recursiva
return cy
.get(`#${ariaControl}`, { timeout })
.get('#' + ariaControl, { timeout })
.should('exist')
.find('.q-item')
.should('exist')
@ -358,21 +352,11 @@ Cypress.Commands.add('openListSummary', (row) => {
cy.get('.card-list-body .actions .q-btn:nth-child(2)').eq(row).click();
});
Cypress.Commands.add('openRightMenu', (element = 'toggle-right-drawer') => {
if (element) cy.waitForElement(`[data-cy="${element}"]`);
cy.dataCy(element).click();
Cypress.Commands.add('openRightMenu', (element) => {
if (element) cy.waitForElement(element);
cy.get('[data-cy="toggle-right-drawer"]').click();
});
Cypress.Commands.add('cleanFilterPanel', (element = 'clearFilters') => {
cy.get('#filterPanelForm').scrollIntoView();
if (element) cy.waitForElement(`[data-cy="${element}"]`);
cy.dataCy(element).click();
});
Cypress.Commands.add('searchInFilterPanel', (element = 'vnFilterPanel_search') => {
if (element) cy.waitForElement(`[data-cy="${element}"]`);
cy.dataCy(element).click();
});
Cypress.Commands.add('openLeftMenu', (element) => {
if (element) cy.waitForElement(element);
cy.get('.q-toolbar > .q-btn--round.q-btn--dense > .q-btn__content > .q-icon').click();
@ -470,9 +454,9 @@ Cypress.Commands.add('clickButtonWith', (type, value) => {
Cypress.Commands.add('clickButtonWithIcon', (iconClass) => {
cy.waitForElement('[data-cy="descriptor_actions"]');
cy.waitSpinner();
cy.get('[data-cy="loading-spinner"]', { timeout: 10000 }).should('not.be.visible');
cy.get('.q-btn')
.filter((index, el) => Cypress.$(el).find(`.q-icon.${iconClass}`).length > 0)
.filter((index, el) => Cypress.$(el).find('.q-icon.' + iconClass).length > 0)
.then(($btn) => {
cy.wrap($btn).click();
});
@ -607,7 +591,7 @@ Cypress.Commands.add('validatePdfDownload', (match, trigger) => {
});
});
Cypress.Commands.add('clickDescriptorAction', (index = 1) => {
Cypress.Commands.add('clicDescriptorAction', (index = 1) => {
cy.get(`[data-cy="descriptor_actions"] .q-btn:nth-of-type(${index})`).click();
});

View File

@ -68,7 +68,6 @@ const waitForApiReady = (url, maxRetries = 20, delay = 1000) => {
};
before(() => {
cy.viewport(1920, 1080);
waitForApiReady('/api/Applications/status');
});