Merge branch 'dev' into vnTable_multi_check
gitea/salix-front/pipeline/pr-dev This commit is unstable Details

This commit is contained in:
Javier Segarra 2025-04-23 13:41:41 +00:00
commit af8909177e
34 changed files with 645 additions and 248 deletions

2
Jenkinsfile vendored
View File

@ -125,7 +125,7 @@ pipeline {
sh "docker-compose ${env.COMPOSE_PARAMS} pull db"
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
def modules = sh(script: 'node test/cypress/docker/find/find.js', returnStdout: true).trim()
def modules = sh(script: "node test/cypress/docker/find/find.js ${env.COMPOSE_TAG}", returnStdout: true).trim()
echo "E2E MODULES: ${modules}"
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ --init") {
sh "sh test/cypress/docker/cypressParallel.sh 1 '${modules}'"

View File

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

View File

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

View File

@ -368,7 +368,6 @@ function getCaption(opt) {
hide-bottom-space
:input-debounce="useURL ? '300' : '0'"
:loading="someIsLoading"
:disable="someIsLoading"
@virtual-scroll="onScroll"
@keydown="handleKeyDown"
:data-cy="$attrs.dataCy ?? $attrs.label + '_select'"

View File

@ -222,7 +222,7 @@ defineExpose({
</script>
<template>
<div class="full-width" v-bind="attrs">
<div class="full-width">
<div
v-if="!store.data && !store.data?.length && !isLoading"
class="info-row q-pa-md text-center"

View File

@ -77,10 +77,10 @@ const isDefaultAddress = (address) => {
return client?.value?.defaultAddressFk === address.id ? 1 : 0;
};
const setDefault = (address) => {
const setDefault = async (address) => {
const url = `Clients/${route.params.id}`;
const payload = { defaultAddressFk: address.id };
axios.patch(url, payload).then((res) => {
await axios.patch(url, payload).then((res) => {
if (res.data) {
client.value.defaultAddressFk = res.data.defaultAddressFk;
sortAddresses();

View File

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

View File

@ -6,13 +6,18 @@ import { useRoute } from 'vue-router';
import { useSession } from 'src/composables/useSession';
import { toDateHourMin } from 'filters/index';
import { useStateStore } from 'src/stores/useStateStore';
import { dashIfEmpty } from 'src/filters';
import AgencyDescriptorProxy from '../Agency/Card/AgencyDescriptorProxy.vue';
import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import RouteDescriptorProxy from '../Card/RouteDescriptorProxy.vue';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import VnInput from 'src/components/common/VnInput.vue';
const route = useRoute();
const { t } = useI18n();
@ -30,39 +35,117 @@ const userParams = {
const columns = computed(() => [
{
align: 'left',
align: 'right',
name: 'cmrFk',
label: t('route.cmr.params.cmrFk'),
label: t('cmr.params.cmrFk'),
chip: {
condition: () => true,
},
isId: true,
},
{
align: 'center',
name: 'hasCmrDms',
label: t('route.cmr.params.hasCmrDms'),
component: 'checkbox',
cardVisible: true,
},
{
align: 'left',
label: t('route.cmr.params.ticketFk'),
align: 'right',
label: t('cmr.params.ticketFk'),
name: 'ticketFk',
},
{
align: 'left',
label: t('route.cmr.params.routeFk'),
align: 'right',
label: t('cmr.params.routeFk'),
name: 'routeFk',
},
{
align: 'left',
label: t('route.cmr.params.clientFk'),
label: t('cmr.params.client'),
name: 'clientFk',
component: 'select',
attrs: {
url: 'Clients',
fields: ['id', 'name'],
},
columnFilter: {
name: 'clientFk',
attrs: {
url: 'Clients',
fields: ['id', 'name'],
},
},
},
{
align: 'right',
label: t('route.cmr.params.countryFk'),
label: t('cmr.params.agency'),
name: 'agencyModeFk',
component: 'select',
attrs: {
url: 'Agencies',
fields: ['id', 'name'],
},
columnFilter: {
name: 'agencyModeFk',
attrs: {
url: 'Agencies',
fields: ['id', 'name'],
},
},
format: ({ agencyName }) => agencyName,
},
{
label: t('cmr.params.supplier'),
name: 'supplierFk',
component: 'select',
attrs: {
url: 'suppliers',
fields: ['id', 'name'],
},
columnFilter: {
name: 'supplierFk',
attrs: {
url: 'suppliers',
fields: ['id', 'name'],
},
},
},
{
label: t('cmr.params.sender'),
name: 'addressFromFk',
component: 'select',
attrs: {
url: 'Addresses',
fields: ['id', 'nickname'],
optionValue: 'id',
optionLabel: 'nickname',
},
columnFilter: {
name: 'addressFromFk',
attrs: {
url: 'Addresses',
fields: ['id', 'nickname'],
optionValue: 'id',
optionLabel: 'nickname',
},
},
format: ({ origin }) => origin,
},
{
label: t('cmr.params.destination'),
name: 'addressToFk',
component: 'select',
attrs: {
url: 'addresses',
fields: ['id', 'nickname'],
optionValue: 'id',
optionLabel: 'nickname',
},
columnFilter: {
name: 'addressToFk',
attrs: {
url: 'addresses',
fields: ['id', 'nickname'],
optionValue: 'id',
optionLabel: 'nickname',
},
},
format: ({ destination }) => destination,
},
{
label: t('cmr.params.country'),
name: 'countryFk',
component: 'select',
attrs: {
@ -79,16 +162,61 @@ const columns = computed(() => [
format: ({ countryName }) => countryName,
},
{
align: 'right',
label: t('route.cmr.params.shipped'),
name: 'shipped',
cardVisible: true,
label: t('cmr.params.created'),
name: 'created',
component: 'date',
format: ({ shipped }) => toDateHourMin(shipped),
format: ({ created }) => dashIfEmpty(toDateHourMin(created)),
},
{
align: 'right',
label: t('route.cmr.params.warehouseFk'),
label: t('cmr.params.shipped'),
name: 'shipped',
component: 'date',
format: ({ shipped }) => dashIfEmpty(toDateHourMin(shipped)),
},
{
label: t('cmr.params.etd'),
name: 'ead',
component: 'date',
format: ({ ead }) => dashIfEmpty(toDateHourMin(ead)),
toolTip: t('cmr.params.etdTooltip'),
},
{
label: t('globals.landed'),
name: 'landed',
component: 'date',
format: ({ landed }) => dashIfEmpty(toDateHourMin(landed)),
},
{
align: 'left',
label: t('cmr.params.packageList'),
name: 'packagesList',
columnFilter: false,
},
{
align: 'left',
label: t('cmr.params.observation'),
name: 'observation',
columnFilter: false,
},
{
align: 'left',
label: t('cmr.params.senderInstructions'),
name: 'senderInstruccions',
columnFilter: false,
},
{
align: 'left',
label: t('cmr.params.paymentInstructions'),
name: 'paymentInstruccions',
columnFilter: false,
},
{
align: 'left',
label: t('cmr.params.vehiclePlate'),
name: 'truckPlate',
},
{
label: t('cmr.params.warehouse'),
name: 'warehouseFk',
component: 'select',
attrs: {
@ -96,7 +224,6 @@ const columns = computed(() => [
fields: ['id', 'name'],
},
columnFilter: {
inWhere: true,
name: 'warehouseFk',
attrs: {
url: 'warehouses',
@ -105,12 +232,23 @@ const columns = computed(() => [
},
format: ({ warehouseName }) => warehouseName,
},
{
align: 'left',
name: 'specialAgreements',
label: t('cmr.params.specialAgreements'),
columnFilter: false,
},
{
name: 'hasCmrDms',
label: t('cmr.params.hasCmrDms'),
component: 'checkbox',
},
{
align: 'center',
name: 'tableActions',
actions: [
{
title: t('route.cmr.params.viewCmr'),
title: t('cmr.params.viewCmr'),
icon: 'visibility',
isPrimary: true,
action: (row) => window.open(getCmrUrl(row?.cmrFk), '_blank'),
@ -151,11 +289,7 @@ function downloadPdfs() {
}
</script>
<template>
<VnSearchbar
:data-key
:label="t('route.cmr.search')"
:info="t('route.cmr.searchInfo')"
/>
<VnSearchbar :data-key :label="t('cmr.search')" :info="t('cmr.searchInfo')" />
<VnSubToolbar>
<template #st-actions>
<QBtn
@ -165,7 +299,7 @@ function downloadPdfs() {
:disable="!selectedRows?.length"
@click="downloadPdfs"
>
<QTooltip>{{ t('route.cmr.params.downloadCmrs') }}</QTooltip>
<QTooltip>{{ t('cmr.params.downloadCmrs') }}</QTooltip>
</QBtn>
</template>
</VnSubToolbar>
@ -191,11 +325,72 @@ function downloadPdfs() {
<TicketDescriptorProxy :id="row.ticketFk" />
</span>
</template>
<template #column-routeFk="{ row }">
<span class="link" @click.stop>
{{ row.routeFk }}
<RouteDescriptorProxy :id="row.routeFk" />
</span>
</template>
<template #column-clientFk="{ row }">
<span class="link" @click.stop>
{{ row.clientFk }}
{{ row.clientName }}
<CustomerDescriptorProxy :id="row.clientFk" />
</span>
</template>
<template #column-agencyModeFk="{ row }">
<span class="link" @click.stop>
{{ row.agencyName }}
<AgencyDescriptorProxy :id="row.agencyModeFk" />
</span>
</template>
<template #column-supplierFk="{ row }">
<span class="link" @click.stop>
{{ row.carrierName }}
<SupplierDescriptorProxy :id="row.supplierFk" />
</span>
</template>
<template #column-observation="{ row }">
<VnInput
v-if="row.observation"
type="textarea"
v-model="row.observation"
readonly
dense
rows="2"
style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap"
/>
</template>
<template #column-packagesList="{ row }">
<span>
{{ row.packagesList }}
<QTooltip v-if="row.packagesList" :label="row.packagesList">
{{ row.packagesList }}
</QTooltip>
</span>
</template>
<template #column-senderInstruccions="{ row }">
<span>
{{ row.senderInstruccions }}
<QTooltip v-if="row.packagesList" :label="row.packagesList">
{{ row.senderInstruccions }}
</QTooltip>
</span>
</template>
<template #column-paymentInstruccions="{ row }">
<span>
{{ row.paymentInstruccions }}
<QTooltip v-if="row.packagesList" :label="row.packagesList">
{{ row.paymentInstruccions }}
</QTooltip>
</span>
</template>
<template #column-specialAgreements="{ row }">
<span>
{{ row.specialAgreements }}
<QTooltip v-if="row.packagesList" :label="row.packagesList">
{{ row.specialAgreements }}
</QTooltip>
</span>
</template>
</VnTable>
</template>

View File

@ -0,0 +1,31 @@
cmr:
search: Search Cmr
searchInfo: You can search Cmr by Id
params:
agency: Agency
client: Client
cmrFk: CMR id
country: Country
created: Created
destination: Destination
downloadCmrs: Download CMRs
etd: ETD
etdTooltip: Estimated Time Delivery
hasCmrDms: Attached in gestdoc
observation: Observation
packageList: Package List
paymentInstructions: Payment instructions
routeFk: Route id
results: results
search: General search
sender: Sender
senderInstructions: Sender instructions
shipped: Shipped
specialAgreements: Special agreements
supplier: Carrier
ticketFk: Ticket id
vehiclePlate: Vehicle plate
viewCmr: View CMR
warehouse: Warehouse
'true': 'Yes'
'false': 'No'

View File

@ -0,0 +1,31 @@
cmr:
search: Buscar Cmr
searchInfo: Puedes buscar cmr por id
params:
agency: Agencia
client: Cliente
cmrFk: Id cmr
country: País
created: Creado
destination: Destinatario
downloadCmrs: Descargar CMRs
etd: ETD
etdTooltip: Fecha estimada de entrega
hasCmrDms: Adjunto en gestdoc
observation: Observaciones
packageList: Listado embalajes
paymentInstructions: Instrucciones de pago
routeFk: Id ruta
results: Resultados
search: Busqueda general
sender: Remitente
senderInstructions: Instrucciones de envío
shipped: F. envío
specialAgreements: Acuerdos especiales
supplier: Transportista
ticketFk: Id ticket
vehiclePlate: Matrícula
viewCmr: Ver CMR
warehouse: Almacén
'true': 'Si'
'false': 'No'

View File

@ -51,6 +51,11 @@ route:
agencyModeName: Agency route
isOwn: Own
isAnyVolumeAllowed: Any volume allowed
created: Created
addressFromFk: Sender
addressToFk: Destination
landed: Landed
ead: EAD
Worker: Worker
Agency: Agency
Vehicle: Vehicle
@ -70,21 +75,3 @@ route:
searchInfo: You can search by route reference
dated: Dated
preview: Preview
cmr:
search: Search Cmr
searchInfo: You can search Cmr by Id
params:
results: results
cmrFk: CMR id
hasCmrDms: Attached in gestdoc
'true': 'Yes'
'false': 'No'
ticketFk: Ticketd id
routeFk: Route id
countryFk: Country
clientFk: Client id
warehouseFk: Warehouse
shipped: Preparation date
viewCmr: View CMR
downloadCmrs: Download CMRs
search: General search

View File

@ -47,11 +47,16 @@ route:
routeFk: Id ruta
clientFk: Id cliente
countryFk: Pais
shipped: Fecha preparación
shipped: F. envío
agencyModeName: Agencia Ruta
agencyAgreement: Agencia Acuerdo
isOwn: Propio
isAnyVolumeAllowed: Cualquier volumen
created: Creado
addressFromFk: Remitente
addressToFk: Destinatario
landed: F. entrega
ead: ETD
Worker: Trabajador
Agency: Agencia
Vehicle: Vehículo

View File

@ -239,6 +239,9 @@ async function getZone(options) {
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: true,
}"
auto-load
/>
<FetchData
@ -414,13 +417,6 @@ async function getZone(options) {
:rules="validate('ticketList.shipped')"
@update:model-value="setShipped"
/>
<VnInputTime
:label="t('basicData.shippedHour')"
v-model="formData.shipped"
:required="true"
:rules="validate('basicData.shippedHour')"
@update:model-value="setShipped"
/>
<VnInputDate
:label="t('basicData.landed')"
v-model="formData.landed"

View File

@ -55,8 +55,10 @@ async function handleSave(e) {
auto-load
url="ObservationTypes"
/>
<div class="flex justify-center">
<div class="full-width flex justify-center">
<QPage class="card-width q-pa-lg">
<CrudModel
class="fit"
ref="ticketNotesCrudRef"
data-key="TicketNotes"
url="TicketObservations"
@ -65,14 +67,13 @@ async function handleSave(e) {
:data-required="crudModelRequiredData"
:default-remove="false"
auto-load
style="max-width: 800px"
>
<template #body="{ rows }">
<QCard class="q-px-lg q-py-md">
<div
v-for="(row, index) in rows"
:key="index"
class="q-mb-md row q-gutter-x-md"
class="q-mb-md row items-center q-gutter-x-md"
>
<VnSelect
:label="t('ticketNotes.observationType')"
@ -123,5 +124,6 @@ async function handleSave(e) {
</QCard>
</template>
</CrudModel>
</QPage>
</div>
</template>

View File

@ -49,10 +49,14 @@ watch(
<FetchData
@on-fetch="(data) => (listPackagingsOptions = data)"
auto-load
:filter="{ fields: ['packagingFk', 'name'], order: 'name ASC' }"
url="Packagings/listPackaging"
:filter="{
fields: ['packagingFk', 'name'],
order: ['name ASC'],
}"
/>
<div class="flex justify-center">
<div class="full-width flex justify-center">
<QPage class="card-width q-pa-lg">
<CrudModel
ref="ticketPackagingsCrudRef"
data-key="TicketPackagings"
@ -62,7 +66,6 @@ watch(
:data-required="crudModelRequiredData"
:default-remove="false"
auto-load
style="max-width: 800px"
>
<template #body="{ rows, validate }">
<QCard class="q-px-lg q-py-md">
@ -102,7 +105,10 @@ watch(
@update:model-value="handleInputQuantityClear(row)"
:rules="validate('TicketPackaging.quantity')"
/>
<VnInputDate :label="t('package.added')" v-model="row.created" />
<VnInputDate
:label="t('package.added')"
v-model="row.created"
/>
<QIcon
name="delete"
size="sm"
@ -132,5 +138,6 @@ watch(
</QCard>
</template>
</CrudModel>
</QPage>
</div>
</template>

View File

@ -47,7 +47,14 @@ 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: true,
}"
auto-load
/>
<FetchData
url="ItemCategories"
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"

View File

@ -385,7 +385,12 @@ watch(
if (!$el) return;
const head = $el.querySelector('thead');
const firstRow = $el.querySelector('thead > tr');
const headSelectionCol = $el.querySelector(
'thead tr.bg-header th.q-table--col-auto-width',
);
if (headSelectionCol) {
headSelectionCol.classList.add('horizontal-separator');
}
const newRow = document.createElement('tr');
destinationElRef.value = document.createElement('th');
originElRef.value = document.createElement('th');
@ -394,8 +399,8 @@ watch(
destinationElRef.value.classList.add('text-uppercase', 'color-vn-label');
originElRef.value.classList.add('text-uppercase', 'color-vn-label');
destinationElRef.value.setAttribute('colspan', '7');
originElRef.value.setAttribute('colspan', '9');
destinationElRef.value.setAttribute('colspan', '10');
originElRef.value.setAttribute('colspan', '10');
destinationElRef.value.textContent = `${t(
'advanceTickets.destination',
@ -490,8 +495,6 @@ watch(
selection: 'multiple',
}"
v-model:selected="selectedTickets"
:pagination="{ rowsPerPage: 0 }"
:no-data-label="$t('globals.noResults')"
:right-search="false"
:order="['futureTotalWithVat ASC']"
auto-load

View File

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

View File

@ -70,11 +70,9 @@ const fetchAvailableAgencies = async (formData) => {
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,9 @@ const redirectToTicketList = (_, { id }) => {
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: true,
}"
order="name"
auto-load
/>

View File

@ -70,11 +70,9 @@ const fetchAvailableAgencies = async (formData) => {
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,9 @@ const redirectToTicketList = (_, { id }) => {
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptions = data)"
:where="{
isForTicket: true,
}"
order="name"
auto-load
/>

View File

@ -41,8 +41,19 @@ const groupedStates = ref([]);
@on-fetch="(data) => (agencies = data)"
auto-load
/>
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehouses = data)"
auto-load
:where="{
isForTicket: true,
}"
/>
<VnFilterPanel
:data-key="props.dataKey"
:search-button="true"
:unremovableParams="['from', 'to']"
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>

View File

@ -89,7 +89,7 @@ const ticketColumns = computed(() => [
},
{
label: t('advanceTickets.import'),
name: 'import',
name: 'totalWithVat',
align: 'left',
headerClass: 'horizontal-separator',
columnFilter: false,
@ -317,7 +317,7 @@ watch(
</QBadge>
<span v-else> {{ dashIfEmpty(row.state) }}</span>
</template>
<template #column-import="{ row }">
<template #column-totalWithVat="{ row }">
<QBadge
:text-color="
totalPriceColor(row.totalWithVat) === 'warning'

View File

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

View File

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

View File

@ -102,6 +102,9 @@ const columns = computed(() => [
attrs: {
url: 'Warehouses',
fields: ['id', 'name'],
where: {
isForTicket: true,
},
},
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,17 @@ const warehousesOptionsIn = ref([]);
url="Warehouses"
@on-fetch="(data) => (warehousesOptionsOut = data)"
auto-load
:filter="{ where: { isOrigin: TRUE } }"
:where="{
isOrigin: true,
}"
/>
<FetchData
url="Warehouses"
@on-fetch="(data) => (warehousesOptionsIn = data)"
auto-load
:filter="{ where: { isDestiny: TRUE } }"
:where="{
isDestiny: true,
}"
/>
<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 === true)
"
option-value="id"
option-label="name"
hide-selected
@ -197,7 +199,11 @@ warehouses();
<VnSelect
:label="t('extraCommunity.filter.warehouseInFk')"
v-model="params.warehouseInFk"
:options="warehousesOptions"
:options="
warehousesOptions.filter(
(option) => option.isDestiny === true,
)
"
option-value="id"
option-label="name"
hide-selected

View File

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

View File

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

View File

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

View File

@ -6,6 +6,9 @@ const FINDED_PATHS = ['src', E2E_PATH];
function getGitDiff(options) {
const TARGET_BRANCH = options[2] || 'dev';
execSync(`git fetch origin ${TARGET_BRANCH}`, {
encoding: 'utf-8',
});
const diff = execSync(`git diff --name-only origin/${TARGET_BRANCH}`, {
encoding: 'utf-8',
});

View File

@ -5,6 +5,9 @@ describe('Cmr list', () => {
const selectors = {
ticket: getLinkSelector('ticketFk'),
client: getLinkSelector('clientFk'),
route: getLinkSelector('routeFk'),
agency: getLinkSelector('agencyModeFk'),
carrier: getLinkSelector('supplierFk'),
lastRowSelectCheckBox:
'.q-virtual-scroll__content > tr:last-child > :nth-child(1) > .q-checkbox',
downloadBtn: '#subToolbar > .q-btn',
@ -21,6 +24,10 @@ describe('Cmr list', () => {
const data = {
ticket: '1',
client: 'Bruce Wayne',
route: 'first route',
routeId: '1',
agency: 'inhouse pickup',
carrier: 'PLANTS SL',
};
beforeEach(() => {
@ -68,6 +75,26 @@ describe('Cmr list', () => {
});
});
describe('Route pop-ups', () => {
it('Should redirect to the route summary from the route descriptor pop-up', () => {
cy.get(selectors.route).should('be.visible').click();
cy.containContent(selectors.descriptorId, data.routeId);
cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/route/1/summary');
cy.containContent(selectors.summaryTitle, data.route);
});
it('Should redirect to the route summary from summary pop-up from the route descriptor pop-up', () => {
cy.get(selectors.route).should('be.visible').click();
cy.containContent(selectors.descriptorId, data.routeId);
cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
cy.containContent(selectors.summaryTitle, data.route);
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/route/1/summary');
cy.containContent(selectors.summaryTitle, data.route);
});
});
describe('Client pop-ups', () => {
it('Should redirect to the client summary from the client descriptor pop-up', () => {
cy.get(selectors.client).should('be.visible').click();
@ -87,4 +114,44 @@ describe('Cmr list', () => {
cy.containContent(selectors.summaryTitle, data.client);
});
});
describe('Agency pop-ups', () => {
it('Should redirect to the agency summary from the agency descriptor pop-up', () => {
cy.get(selectors.agency).should('be.visible').click();
cy.containContent(selectors.descriptorTitle, data.agency);
cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/agency/1/summary');
cy.containContent(selectors.summaryTitle, data.agency);
});
it('Should redirect to the agency summary from summary pop-up from the agency descriptor pop-up', () => {
cy.get(selectors.agency).should('be.visible').click();
cy.containContent(selectors.descriptorTitle, data.agency);
cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
cy.containContent(selectors.summaryTitle, data.agency);
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/agency/1/summary');
cy.containContent(selectors.summaryTitle, data.agency);
});
});
describe('Carrier pop-ups', () => {
it('Should redirect to the supplier summary from the supplier descriptor pop-up', () => {
cy.get(selectors.carrier).should('be.visible').click();
cy.containContent(selectors.descriptorTitle, data.carrier);
cy.get(selectors.descriptorGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/supplier/1/summary');
cy.containContent(selectors.summaryTitle, data.carrier);
});
it('Should redirect to the supplier summary from summary pop-up from the supplier descriptor pop-up', () => {
cy.get(selectors.carrier).should('be.visible').click();
cy.containContent(selectors.descriptorTitle, data.carrier);
cy.get(selectors.descriptorOpenSummaryBtn).should('be.visible').click();
cy.containContent(selectors.summaryTitle, data.carrier);
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
cy.url().should('include', '/supplier/1/summary');
cy.containContent(selectors.summaryTitle, data.carrier);
});
});
});

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];
const data = interception.response.body[0];
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');
});
});