8714-devToTest #1547

Merged
alexm merged 712 commits from 8714-devToTest into test 2025-03-04 14:08:01 +00:00
111 changed files with 1541 additions and 530 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
node_modules

96
Jenkinsfile vendored
View File

@ -1,6 +1,7 @@
#!/usr/bin/env groovy
def PROTECTED_BRANCH
def IS_LATEST
def BRANCH_ENV = [
test: 'test',
@ -10,19 +11,22 @@ def BRANCH_ENV = [
node {
stage('Setup') {
env.FRONT_REPLICAS = 1
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
PROTECTED_BRANCH = [
'dev',
'test',
'master',
'main',
'beta'
].contains(env.BRANCH_NAME)
]
IS_PROTECTED_BRANCH = PROTECTED_BRANCH.contains(env.BRANCH_NAME)
IS_LATEST = ['master', 'main'].contains(env.BRANCH_NAME)
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
echo "NODE_NAME: ${env.NODE_NAME}"
echo "WORKSPACE: ${env.WORKSPACE}"
echo "CHANGE_TARGET: ${env.CHANGE_TARGET}"
configFileProvider([
configFile(fileId: 'salix-front.properties',
@ -33,7 +37,7 @@ node {
props.each {key, value -> echo "${key}: ${value}" }
}
if (PROTECTED_BRANCH) {
if (IS_PROTECTED_BRANCH) {
configFileProvider([
configFile(fileId: "salix-front.branch.${env.BRANCH_NAME}",
variable: 'BRANCH_PROPS_FILE')
@ -58,6 +62,19 @@ pipeline {
PROJECT_NAME = 'lilium'
}
stages {
stage('Version') {
when {
expression { IS_PROTECTED_BRANCH }
}
steps {
script {
def packageJson = readJSON file: 'package.json'
def version = "${packageJson.version}-build${env.BUILD_ID}"
writeFile(file: 'VERSION.txt', text: version)
echo "VERSION: ${version}"
}
}
}
stage('Install') {
environment {
NODE_ENV = ""
@ -68,48 +85,85 @@ pipeline {
}
stage('Test') {
when {
expression { !PROTECTED_BRANCH }
expression { !IS_PROTECTED_BRANCH }
}
environment {
NODE_ENV = ""
NODE_ENV = ''
CI = 'true'
TZ = 'Europe/Madrid'
}
parallel {
stage('Unit') {
steps {
sh 'pnpm run test:unit:ci'
sh 'pnpm run test:front:ci'
}
post {
always {
junit(
testResults: 'junitresults.xml',
testResults: 'junit/vitest.xml',
allowEmptyResults: true
)
}
}
}
stage('Build') {
when {
expression { PROTECTED_BRANCH }
}
stage('E2E') {
environment {
CREDENTIALS = credentials('docker-registry')
COMPOSE_PROJECT = "${PROJECT_NAME}-${env.BUILD_ID}"
COMPOSE_PARAMS = "-p ${env.COMPOSE_PROJECT} -f test/cypress/docker-compose.yml --project-directory ."
}
steps {
sh 'quasar build'
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
sh 'rm junit/e2e-*.xml || true'
env.COMPOSE_TAG = PROTECTED_BRANCH.contains(env.CHANGE_TARGET) ? env.CHANGE_TARGET : 'dev'
def image = docker.build('lilium-dev', '-f docs/Dockerfile.dev docs')
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
sh 'cypress run --browser chromium || true'
}
}
}
post {
always {
sh "docker-compose ${env.COMPOSE_PARAMS} down -v"
junit(
testResults: 'junit/e2e-*.xml',
allowEmptyResults: true
)
}
}
}
}
}
stage('Build') {
when {
expression { IS_PROTECTED_BRANCH }
}
environment {
VERSION = readFile 'VERSION.txt'
}
steps {
script {
sh 'quasar build'
def baseImage = "salix-frontend:${env.VERSION}"
def image = docker.build(baseImage, ".")
docker.withRegistry("https://${env.REGISTRY}", 'docker-registry') {
image.push()
image.push(env.BRANCH_NAME)
if (IS_LATEST) image.push('latest')
}
}
dockerBuild()
}
}
stage('Deploy') {
when {
expression { PROTECTED_BRANCH }
expression { IS_PROTECTED_BRANCH }
}
environment {
VERSION = readFile 'VERSION.txt'
}
steps {
script {
def packageJson = readJSON file: 'package.json'
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
}
withKubeConfig([
serverUrl: "$KUBERNETES_API",
credentialsId: 'kubernetes',

View File

@ -23,7 +23,7 @@ quasar dev
### Run unit tests
```bash
pnpm run test:unit
pnpm run test:front
```
### Run e2e tests

View File

@ -1,12 +1,37 @@
import { defineConfig } from 'cypress';
// https://docs.cypress.io/app/tooling/reporters
// https://docs.cypress.io/app/references/configuration
// https://www.npmjs.com/package/cypress-mochawesome-reporter
let urlHost, reporter, reporterOptions;
if (process.env.CI) {
urlHost = 'front';
reporter = 'junit';
reporterOptions = {
mochaFile: 'junit/e2e-[hash].xml',
toConsole: false,
};
} else {
urlHost = 'localhost';
reporter = 'cypress-mochawesome-reporter';
reporterOptions = {
charts: true,
reportPageTitle: 'Cypress Inline Reporter',
reportFilename: '[status]_[datetime]-report',
embeddedScreenshots: true,
reportDir: 'test/cypress/reports',
inlineAssets: true,
};
}
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:9000/',
experimentalStudio: true,
baseUrl: `http://${urlHost}:9000`,
experimentalStudio: false,
defaultCommandTimeout: 10000,
trashAssetsBeforeRuns: false,
requestTimeout: 10000,
responseTimeout: 30000,
pageLoadTimeout: 60000,
defaultBrowser: 'chromium',
fixturesFolder: 'test/cypress/fixtures',
screenshotsFolder: 'test/cypress/screenshots',
supportFile: 'test/cypress/support/index.js',
@ -14,29 +39,19 @@ export default defineConfig({
downloadsFolder: 'test/cypress/downloads',
video: false,
specPattern: 'test/cypress/integration/**/*.spec.js',
experimentalRunAllSpecs: false,
watchForFileChanges: false,
reporter: 'cypress-mochawesome-reporter',
reporterOptions: {
charts: true,
reportPageTitle: 'Cypress Inline Reporter',
reportFilename: '[status]_[datetime]-report',
embeddedScreenshots: true,
reportDir: 'test/cypress/reports',
inlineAssets: true,
},
experimentalRunAllSpecs: true,
watchForFileChanges: true,
reporter,
reporterOptions,
component: {
componentFolder: 'src',
testFiles: '**/*.spec.js',
supportFile: 'test/cypress/support/unit.js',
},
setupNodeEvents: async (on, config) => {
const plugin = await import('cypress-mochawesome-reporter/plugin');
plugin.default(on);
return config;
},
viewportWidth: 1280,
viewportHeight: 720,
},
experimentalMemoryManagement: true,
defaultCommandTimeout: 10000,
numTestsKeptInMemory: 2,
});

View File

@ -1,7 +0,0 @@
version: '3.7'
services:
main:
image: registry.verdnatura.es/salix-frontend:${VERSION:?}
build:
context: .
dockerfile: ./Dockerfile

45
docs/Dockerfile.dev Normal file
View File

@ -0,0 +1,45 @@
FROM debian:12.9-slim
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg2 \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& npm install -g corepack@0.31.0 \
&& corepack enable pnpm \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get -y --no-install-recommends install \
apt-utils \
chromium \
libasound2 \
libgbm-dev \
libgtk-3-0 \
libgtk2.0-0 \
libnotify-dev \
libnss3 \
libxss1 \
libxtst6 \
xauth \
xvfb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -r -g 1000 app \
&& useradd -r -u 1000 -g app -m -d /home/app app
USER app
ENV SHELL=bash
ENV PNPM_HOME="/home/app/.local/share/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN pnpm setup \
&& pnpm install --global cypress@13.6.6 \
&& cypress install
WORKDIR /app

View File

@ -1,6 +1,6 @@
{
"name": "salix-front",
"version": "25.08.0",
"version": "25.10.0",
"description": "Salix frontend",
"productName": "Salix",
"author": "Verdnatura",
@ -14,8 +14,8 @@
"test:e2e": "cypress open",
"test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run",
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
"test:unit": "vitest",
"test:unit:ci": "vitest run",
"test:front": "vitest",
"test:front:ci": "vitest run",
"commitlint": "commitlint --edit",
"prepare": "npx husky install",
"addReferenceTag": "node .husky/addReferenceTag.js",

View File

@ -1,6 +1,6 @@
export default [
{
path: '/api',
rule: { target: 'http://0.0.0.0:3000' },
rule: { target: 'http://127.0.0.1:3000' },
},
];

View File

@ -11,6 +11,7 @@
import { configure } from 'quasar/wrappers';
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
import path from 'path';
const target = `http://${process.env.CI ? 'back' : 'localhost'}:3000`;
export default configure(function (/* ctx */) {
return {
@ -108,13 +109,17 @@ export default configure(function (/* ctx */) {
},
proxy: {
'/api': {
target: 'http://0.0.0.0:3000',
target: target,
logLevel: 'debug',
changeOrigin: true,
secure: false,
},
},
open: false,
allowedHosts: [
'front', // Agrega este nombre de host
'localhost', // Opcional, para pruebas locales
],
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework

View File

@ -12,6 +12,7 @@ import SkeletonForm from 'components/ui/SkeletonForm.vue';
import VnConfirm from './ui/VnConfirm.vue';
import { tMobile } from 'src/composables/tMobile';
import { useArrayData } from 'src/composables/useArrayData';
import { getDifferences, getUpdatedValues } from 'src/filters';
const { push } = useRouter();
const quasar = useQuasar();
@ -288,7 +289,12 @@ function trimData(data) {
}
return data;
}
function onBeforeSave(formData, originalData) {
return getUpdatedValues(
Object.keys(getDifferences(formData, originalData)),
formData,
);
}
async function onKeyup(evt) {
if (evt.key === 'Enter' && !('prevent-submit' in attrs)) {
const input = evt.target;
@ -325,6 +331,7 @@ defineExpose({
class="q-pa-md"
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
id="formModel"
:mapper="onBeforeSave"
>
<QCard>
<slot

View File

@ -85,7 +85,15 @@ const refresh = () => window.location.reload();
</QTooltip>
<PinnedModules ref="pinnedModulesRef" />
</QBtn>
<QBtn class="q-pa-none" rounded dense flat no-wrap id="user">
<QBtn
class="q-pa-none"
rounded
dense
flat
no-wrap
id="user"
data-cy="userPanel_btn"
>
<VnAvatar
:worker-id="user.id"
:title="user.name"

View File

@ -51,10 +51,6 @@ const $props = defineProps({
type: Boolean,
default: true,
},
rightSearchIcon: {
type: Boolean,
default: true,
},
rowClick: {
type: [Function, Boolean],
default: null,
@ -689,6 +685,7 @@ const rowCtrlClickFunction = computed(() => {
@update:selected="emit('update:selected', $event)"
@selection="(details) => handleSelection(details, rows)"
:hide-selected-banner="true"
:data-cy="$props.dataCy ?? 'vnTable'"
>
<template #top-left v-if="!$props.withoutHeader">
<slot name="top-left"> </slot>
@ -948,6 +945,7 @@ const rowCtrlClickFunction = computed(() => {
:key="index"
:title="btn.title"
:icon="btn.icon"
data-cy="cardBtn"
class="q-pa-xs"
:class="
btn.isPrimary

View File

@ -107,6 +107,7 @@ const manageDate = (date) => {
@click="isPopupOpen = !isPopupOpen"
@keydown="isPopupOpen = false"
hide-bottom-space
:data-cy="$attrs.dataCy ?? $attrs.label + '_inputDate'"
>
<template #append>
<QIcon

View File

@ -641,15 +641,7 @@ watch(
>
{{ prop.nameI18n }}:
</span>
<VnJsonValue :value="prop.val.val" />
<span
v-if="prop.val.id"
class="id-value"
>
#{{ prop.val.id }}
</span>
<span v-if="log.action == 'update'">
<VnJsonValue
:value="prop.old.val"
/>
@ -659,6 +651,26 @@ watch(
>
#{{ prop.old.id }}
</span>
<VnJsonValue
:value="prop.val.val"
/>
<span
v-if="prop.val.id"
class="id-value"
>
#{{ prop.val.id }}
</span>
</span>
<span v-else="prop.old.val">
<VnJsonValue
:value="prop.val.val"
/>
<span
v-if="prop.old.id"
class="id-value"
>#{{ prop.old.id }}</span
>
</span>
</div>
</span>

View File

@ -225,7 +225,7 @@ const toModule = computed(() =>
<div class="icons">
<slot name="icons" :entity="entity" />
</div>
<div class="actions justify-center">
<div class="actions justify-center" data-cy="descriptor_actions">
<slot name="actions" :entity="entity" />
</div>
<slot name="after" />

View File

@ -335,3 +335,7 @@ input::-webkit-inner-spin-button {
border: 1px solid;
box-shadow: 0 4px 6px #00000000;
}
.containerShrinked {
width: 80%;
}

View File

@ -790,7 +790,7 @@ worker:
notes: Notas
operator:
numberOfWagons: Número de vagones
train: tren
train: Tren
itemPackingType: Tipo de embalaje
warehouse: Almacén
sector: Sector

View File

@ -27,6 +27,7 @@ const claimActionsForm = ref();
const rows = ref([]);
const selectedRows = ref([]);
const destinationTypes = ref([]);
const shelvings = ref([]);
const totalClaimed = ref(null);
const DEFAULT_MAX_RESPONSABILITY = 5;
const DEFAULT_MIN_RESPONSABILITY = 1;
@ -56,6 +57,12 @@ const columns = computed(() => [
field: (row) => row.claimDestinationFk,
align: 'left',
},
{
name: 'shelving',
label: t('shelvings.shelving'),
field: (row) => row.shelvingFk,
align: 'left',
},
{
name: 'Landed',
label: t('Landed'),
@ -125,6 +132,10 @@ async function updateDestination(claimDestinationFk, row, options = {}) {
options.reload && claimActionsForm.value.reload();
}
}
async function updateShelving(shelvingFk, row) {
await axios.patch(`ClaimEnds/${row.id}`, { shelvingFk });
claimActionsForm.value.reload();
}
async function regularizeClaim() {
await post(`Claims/${claimId}/regularizeClaim`);
@ -200,6 +211,7 @@ async function post(query, params) {
auto-load
@on-fetch="(data) => (destinationTypes = data)"
/>
<FetchData url="Shelvings" auto-load @on-fetch="(data) => (shelvings = data)" />
<RightMenu v-if="claim">
<template #right-panel>
<QCard class="totalClaim q-my-md q-pa-sm no-box-shadow">
@ -312,6 +324,20 @@ async function post(query, params) {
/>
</QTd>
</template>
<template #body-cell-shelving="{ row }">
<QTd>
<VnSelect
v-model="row.shelvingFk"
:options="shelvings"
option-label="code"
option-value="id"
style="width: 100px"
hide-selected
@update:model-value="(value) => updateShelving(value, row)"
/>
</QTd>
</template>
<template #body-cell-price="{ value }">
<QTd align="center">
{{ toCurrency(value) }}
@ -354,7 +380,7 @@ async function post(query, params) {
(value) =>
updateDestination(
value,
props.row
props.row,
)
"
/>
@ -371,6 +397,17 @@ async function post(query, params) {
</QTable>
</template>
<template #moreBeforeActions>
<QBtn
color="primary"
text-color="white"
:unelevated="true"
:label="tMobile('Import claim')"
:title="t('Import claim')"
icon="Download"
@click="importToNewRefundTicket"
:disable="claim.claimStateFk == resolvedStateId"
:loading="loading"
/>
<QBtn
color="primary"
text-color="white"
@ -394,17 +431,6 @@ async function post(query, params) {
@click="dialogDestination = !dialogDestination"
:loading="loading"
/>
<QBtn
color="primary"
text-color="white"
:unelevated="true"
:label="tMobile('Import claim')"
:title="t('Import claim')"
icon="Upload"
@click="importToNewRefundTicket"
:disable="claim.claimStateFk == resolvedStateId"
:loading="loading"
/>
</template>
</CrudModel>
<QDialog v-model="dialogDestination">

View File

@ -40,7 +40,7 @@ const workersOptions = ref([]);
</VnRow>
<VnRow>
<VnSelect
:label="t('claim.assignedTo')"
:label="t('claim.attendedBy')"
v-model="data.workerFk"
:options="workersOptions"
option-value="id"

View File

@ -233,20 +233,27 @@ function claimUrl(section) {
<ClaimDescriptorMenu :claim="entity.claim" />
</template>
<template #body="{ entity: { claim, salesClaimed, developments } }">
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
<QCard class="vn-one">
<VnTitle
:url="claimUrl('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
<VnLv :label="t('claim.created')" :value="toDate(claim.created)" />
<VnLv :label="t('claim.state')">
<VnLv
v-if="$route.name != 'ClaimSummary'"
:label="t('claim.created')"
:value="toDate(claim.created)"
/>
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.state')">
<template #value>
<QChip :color="stateColor(claim.claimState.code)" dense>
{{ claim.claimState.description }}
</QChip>
</template>
</VnLv>
<VnLv :label="t('globals.salesPerson')">
<VnLv
v-if="$route.name != 'ClaimSummary'"
:label="t('globals.salesPerson')"
>
<template #value>
<VnUserLink
:name="claim.client?.salesPersonUser?.name"
@ -254,7 +261,7 @@ function claimUrl(section) {
/>
</template>
</VnLv>
<VnLv :label="t('claim.attendedBy')">
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.attendedBy')">
<template #value>
<VnUserLink
:name="claim.worker?.user?.nickname"
@ -262,7 +269,7 @@ function claimUrl(section) {
/>
</template>
</VnLv>
<VnLv :label="t('claim.customer')">
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.customer')">
<template #value>
<span class="link cursor-pointer">
{{ claim.client?.name }}
@ -274,6 +281,11 @@ function claimUrl(section) {
:label="t('claim.pickup')"
:value="`${dashIfEmpty(claim.pickup)}`"
/>
<VnLv
:label="t('globals.packages')"
:value="`${dashIfEmpty(claim.packages)}`"
:translation="(value) => t(`claim.packages`)"
/>
</QCard>
<QCard class="vn-two">
<VnTitle :url="claimUrl('notes')" :text="t('claim.notes')" />

View File

@ -19,30 +19,36 @@ const columns = [
name: 'itemFk',
label: t('Id item'),
columnFilter: false,
align: 'left',
align: 'right',
},
{
name: 'ticketFk',
label: t('Ticket'),
columnFilter: false,
align: 'left',
align: 'right',
},
{
name: 'claimDestinationFk',
label: t('Destination'),
columnFilter: false,
align: 'left',
align: 'right',
},
{
name: 'shelvingCode',
label: t('Shelving'),
columnFilter: false,
align: 'right',
},
{
name: 'landed',
label: t('Landed'),
format: (row) => toDate(row.landed),
align: 'left',
align: 'center',
},
{
name: 'quantity',
label: t('Quantity'),
align: 'left',
align: 'right',
},
{
name: 'concept',
@ -52,18 +58,18 @@ const columns = [
{
name: 'price',
label: t('Price'),
align: 'left',
align: 'right',
},
{
name: 'discount',
label: t('Discount'),
format: ({ discount }) => toPercentage(discount / 100),
align: 'left',
align: 'right',
},
{
name: 'total',
label: t('Total'),
align: 'left',
align: 'right',
},
];
</script>

View File

@ -106,7 +106,6 @@ const props = defineProps({
:label="t('claim.zone')"
v-model="params.zoneFk"
url="Zones"
:use-like="false"
outlined
rounded
dense

View File

@ -13,7 +13,6 @@ claim:
province: Province
zone: Zone
customerId: client ID
assignedTo: Assigned
created: Created
details: Details
item: Item

View File

@ -13,7 +13,6 @@ claim:
province: Provincia
zone: Zona
customerId: ID de cliente
assignedTo: Asignado a
created: Creado
details: Detalles
item: Artículo

View File

@ -656,7 +656,6 @@ onMounted(() => {
:without-header="!editableMode"
:with-filters="editableMode"
:right-search="editableMode"
:right-search-icon="true"
:row-click="false"
:columns="columns"
:beforeSaveFn="beforeSave"

View File

@ -65,7 +65,7 @@ const entriesTableColumns = computed(() => [
]);
function downloadCSV(rows) {
const headers = ['id', 'itemFk', 'name', 'stickers', 'packing', 'comment'];
const headers = ['id', 'itemFk', 'name', 'stickers', 'packing', 'grouping', 'comment'];
const csvRows = rows.map((row) => {
const buy = row;
@ -77,6 +77,7 @@ function downloadCSV(rows) {
item.name || '',
buy.stickers,
buy.packing,
buy.grouping,
item.comment || '',
].join(',');
});

View File

@ -185,6 +185,7 @@ const getLink = (param) => `#/invoice-in/${entityId.value}/${param}`;
data-key="InvoiceInSummary"
:url="`InvoiceIns/${entityId}/summary`"
@on-fetch="(data) => init(data)"
module-name="InvoiceIn"
>
<template #header="{ entity }">
<div>{{ entity.id }} - {{ entity.supplier?.name }}</div>

View File

@ -103,7 +103,7 @@ const refundInvoice = async (withWarehouse) => {
t('refundInvoiceSuccessMessage', {
refundTicket: data[0].id,
}),
'positive'
'positive',
);
};
@ -124,6 +124,13 @@ const showRefundInvoiceForm = () => {
},
});
};
const showExportationLetter = () => {
openReport(`InvoiceOuts/${$props.invoiceOutData.ref}/exportation-pdf`, {
recipientId: $props.invoiceOutData.client.id,
refFk: $props.invoiceOutData.ref,
});
};
</script>
<template>
@ -156,10 +163,14 @@ const showRefundInvoiceForm = () => {
<QMenu anchor="top end" self="top start">
<QList>
<QItem v-ripple clickable @click="showSendInvoiceDialog('pdf')">
<QItemSection>{{ t('Send PDF') }}</QItemSection>
<QItemSection data-cy="InvoiceOutDescriptorMenuSendPdfOption">
{{ t('Send PDF') }}
</QItemSection>
</QItem>
<QItem v-ripple clickable @click="showSendInvoiceDialog('csv')">
<QItemSection>{{ t('Send CSV') }}</QItemSection>
<QItemSection data-cy="InvoiceOutDescriptorMenuSendCsvOption">
{{ t('Send CSV') }}
</QItemSection>
</QItem>
</QList>
</QMenu>
@ -172,7 +183,7 @@ const showRefundInvoiceForm = () => {
t('Confirm deletion'),
t('Are you sure you want to delete this invoice?'),
deleteInvoice,
redirectToInvoiceOutList
redirectToInvoiceOutList,
)
"
>
@ -185,7 +196,7 @@ const showRefundInvoiceForm = () => {
openConfirmationModal(
'',
t('Are you sure you want to book this invoice?'),
bookInvoice
bookInvoice,
)
"
>
@ -198,7 +209,7 @@ const showRefundInvoiceForm = () => {
openConfirmationModal(
t('Generate PDF invoice document'),
t('Are you sure you want to generate/regenerate the PDF invoice?'),
generateInvoicePdf
generateInvoicePdf,
)
"
>
@ -226,6 +237,14 @@ const showRefundInvoiceForm = () => {
{{ t('Create a single ticket with all the content of the current invoice') }}
</QTooltip>
</QItem>
<QItem
v-if="$props.invoiceOutData.serial === 'E'"
v-ripple
clickable
@click="showExportationLetter()"
>
<QItemSection>{{ t('Show CITES letter') }}</QItemSection>
</QItem>
</template>
<i18n>
@ -255,7 +274,7 @@ es:
Create a single ticket with all the content of the current invoice: Crear un ticket único con todo el contenido de la factura actual
refundInvoiceSuccessMessage: Se ha creado el siguiente ticket de abono {refundTicket}
The email can't be empty: El email no puede estar vacío
Show CITES letter: Ver carta CITES
en:
refundInvoiceSuccessMessage: The following refund ticket have been created {refundTicket}
</i18n>

View File

@ -22,7 +22,7 @@ const states = ref();
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<strong>{{ t(`invoiceOut.params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
@ -84,15 +84,6 @@ const states = ref();
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.issued"
:label="t('Issued')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
@ -110,37 +101,3 @@ const states = ref();
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
search: Contains
clientFk: Customer
fi: FI
amount: Amount
min: Min
max: Max
hasPdf: Has PDF
issued: Issued
created: Created
dued: Dued
es:
params:
search: Contiene
clientFk: Cliente
fi: CIF
amount: Importe
min: Min
max: Max
hasPdf: Tiene PDF
issued: Emitida
created: Creada
dued: Vencida
Customer ID: ID cliente
FI: CIF
Amount: Importe
Has PDF: Tiene PDF
Issued: Fecha emisión
Created: Fecha creación
Dued: Fecha vencimiento
</i18n>

View File

@ -21,7 +21,6 @@ import VnSection from 'src/components/common/VnSection.vue';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const tableRef = ref();
const invoiceOutSerialsOptions = ref([]);
const customerOptions = ref([]);
const selectedRows = ref([]);
const hasSelectedCards = computed(() => selectedRows.value.length > 0);
@ -71,14 +70,6 @@ const columns = computed(() => [
inWhere: true,
},
},
{
align: 'left',
name: 'issued',
label: t('invoiceOut.summary.issued'),
component: 'date',
format: (row) => toDate(row.issued),
columnField: { component: null },
},
{
align: 'left',
name: 'clientFk',
@ -376,7 +367,6 @@ watchEffect(selectedRows);
url="InvoiceOutSerials"
v-model="data.serial"
:label="t('invoiceOutModule.serial')"
:options="invoiceOutSerialsOptions"
option-label="description"
option-value="code"
option-filter

View File

@ -10,6 +10,8 @@ import CustomerDescriptorProxy from '../Customer/Card/CustomerDescriptorProxy.vu
import TicketDescriptorProxy from '../Ticket/Card/TicketDescriptorProxy.vue';
import WorkerDescriptorProxy from '../Worker/Card/WorkerDescriptorProxy.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import InvoiceOutNegativeBasesFilter from './InvoiceOutNegativeBasesFilter.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
const { t } = useI18n();
const tableRef = ref();
@ -157,6 +159,11 @@ const downloadCSV = async () => {
</QBtn>
</template>
</VnSubToolbar>
<RightMenu>
<template #right-panel>
<InvoiceOutNegativeBasesFilter data-key="negativeFilter" />
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="negativeFilter"
@ -177,6 +184,7 @@ const downloadCSV = async () => {
auto-load
:is-editable="false"
:use-model="true"
:right-search="false"
>
<template #column-clientId="{ row }">
<span class="link" @click.stop>

View File

@ -2,9 +2,10 @@
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputDate from 'components/common/VnInputDate.vue';
import VnInputNumber from 'src/components/common/VnInputNumber.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
const { t } = useI18n();
const props = defineProps({
@ -24,11 +25,11 @@ const props = defineProps({
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<strong>{{ t(`invoiceOut.params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params }">
<template #body="{ params, searchFn }">
<QItem>
<QItemSection>
<VnInputDate
@ -49,38 +50,70 @@ const props = defineProps({
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.company"
<VnSelect
url="Companies"
:label="t('globals.company')"
is-outlined
/>
v-model="params.company"
option-label="code"
option-value="code"
dense
outlined
rounded
@update:model-value="searchFn()"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.code }}
</QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
<VnSelect
url="Countries"
:label="t('globals.params.countryFk')"
v-model="params.country"
:label="t('globals.country')"
is-outlined
/>
option-label="name"
option-value="name"
outlined
dense
rounded
@update:model-value="searchFn()"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt?.name }}
</QItemLabel>
<QItemLabel caption>
{{ `#${scope.opt?.id}` }}
</QItemLabel>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.clientId"
:label="t('invoiceOut.negativeBases.clientId')"
is-outlined
/>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.clientSocialName"
<VnSelect
url="Clients"
:label="t('globals.client')"
is-outlined
v-model="params.clientId"
outlined
dense
rounded
@update:model-value="searchFn()"
/>
</QItemSection>
</QItem>
@ -90,15 +123,18 @@ const props = defineProps({
v-model="params.amount"
:label="t('globals.amount')"
is-outlined
:positive="false"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.comercialName"
<VnSelectWorker
:label="t('invoiceOut.negativeBases.comercial')"
v-model="params.workerName"
option-value="name"
is-outlined
@update:model-value="searchFn()"
/>
</QItemSection>
</QItem>

View File

@ -2,9 +2,10 @@ invoiceOut:
search: Search invoice
searchInfo: You can search by invoice reference
params:
id: ID
company: Company
country: Country
clientId: Client ID
clientId: Client
clientSocialName: Client
taxableBase: Base
ticketFk: Ticket
@ -12,6 +13,19 @@ invoiceOut:
hasToInvoice: Has to invoice
hasVerifiedData: Verified data
workerName: Worker
isTaxDataChecked: Verified data
amount: Amount
clientFk: Client
companyFk: Company
created: Created
dued: Dued
customsAgentFk: Custom Agent
ref: Reference
fi: FI
min: Min
max: Max
hasPdf: Has PDF
search: Contains
card:
issued: Issued
customerCard: Customer card
@ -53,7 +67,7 @@ invoiceOut:
active: Active
hasToInvoice: Has to Invoice
verifiedData: Verified Data
comercial: Commercial
comercial: Sales person
errors:
downloadCsvFailed: CSV download failed
invoiceOutModule:

View File

@ -2,9 +2,10 @@ invoiceOut:
search: Buscar factura emitida
searchInfo: Puedes buscar por referencia de la factura
params:
id: ID
company: Empresa
country: País
clientId: ID del cliente
clientId: Cliente
clientSocialName: Cliente
taxableBase: Base
ticketFk: Ticket
@ -12,6 +13,19 @@ invoiceOut:
hasToInvoice: Debe facturar
hasVerifiedData: Datos verificados
workerName: Comercial
isTaxDataChecked: Datos comprobados
amount: Importe
clientFk: Cliente
companyFk: Empresa
created: Creada
dued: Vencida
customsAgentFk: Agente aduanas
ref: Referencia
fi: CIF
min: Min
max: Max
hasPdf: Tiene PDF
search: Contiene
card:
issued: Fecha emisión
customerCard: Ficha del cliente

View File

@ -8,6 +8,7 @@ import VnInput from 'src/components/common/VnInput.vue';
import FetchData from 'components/FetchData.vue';
import { useArrayData } from 'src/composables/useArrayData';
import VnSelectWorker from 'src/components/common/VnSelectWorker.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
const { t } = useI18n();
const props = defineProps({
@ -52,7 +53,7 @@ onMounted(async () => {
name: key,
value,
selectedField: { name: key, label: t(`params.${key}`) },
})
}),
);
}
exprBuilder('state', arrayData.store?.userParams?.state);
@ -157,6 +158,32 @@ onMounted(async () => {
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.from"
:label="t('params.from')"
is-outlined
/>
</QItemSection>
<QItemSection>
<VnInputDate
v-model="params.to"
:label="t('params.to')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.daysOnward')"
v-model="params.daysOnward"
lazy-rules
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
@ -175,11 +202,10 @@ onMounted(async () => {
</QItem>
<QItem>
<QItemSection>
<VnInput
:label="t('params.daysOnward')"
v-model="params.daysOnward"
lazy-rules
is-outlined
<QCheckbox
:label="t('params.mine')"
v-model="params.mine"
:toggle-indeterminate="false"
/>
</QItemSection>
</QItem>

View File

@ -180,6 +180,7 @@ const onDmsSaved = async (dms, response) => {
rows: dmsDialog.value.rowsToCreateInvoiceIn,
dms: response.data,
});
notify(t('Data saved'), 'positive');
}
dmsDialog.value.show = false;
dmsDialog.value.initialForm = null;
@ -243,7 +244,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</template>
<template #column-invoiceInFk="{ row }">
<span class="link" @click.stop>
{{ row.invoiceInFk }}
{{ row.supplierRef }}
<InvoiceInDescriptorProxy v-if="row.invoiceInFk" :id="row.invoiceInFk" />
</span>
</template>

View File

@ -280,7 +280,7 @@ const openTicketsDialog = (id) => {
</QCardSection>
<QCardSection class="q-pt-none">
<VnInputDate
:label="t('route.Stating date')"
:label="t('route.Starting date')"
v-model="startingDate"
autofocus
/>

View File

@ -22,7 +22,12 @@ const links = {
};
</script>
<template>
<CardSummary data-key="Vehicle" :url="`Vehicles/${entityId}`" :filter="VehicleFilter">
<CardSummary
data-key="Vehicle"
:url="`Vehicles/${entityId}`"
module-name="Vehicle"
:filter="VehicleFilter"
>
<template #header="{ entity }">
<div>{{ entity.id }} - {{ entity.numberPlate }}</div>
</template>

View File

@ -45,8 +45,6 @@ const filter = {
:label="t('parking.sector')"
:value="entity.sector?.description"
/>
<VnLv :label="t('parking.row')" :value="entity.row" />
<VnLv :label="t('parking.column')" :value="entity.column" />
</QCard>
</template>
</CardSummary>

View File

@ -1,19 +1,15 @@
<script setup>
import { onMounted, onUnmounted } from 'vue';
import { useRouter } from 'vue-router';
import { computed, onMounted, onUnmounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import VnPaginate from 'components/ui/VnPaginate.vue';
import CardList from 'components/ui/CardList.vue';
import VnLv from 'components/ui/VnLv.vue';
import ParkingFilter from './ParkingFilter.vue';
import ParkingSummary from './Card/ParkingSummary.vue';
import exprBuilder from './ParkingExprBuilder.js';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
import ParkingFilter from './ParkingFilter.vue';
import exprBuilder from './ParkingExprBuilder.js';
import ParkingSummary from './Card/ParkingSummary.vue';
const stateStore = useStateStore();
const { push } = useRouter();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const dataKey = 'ParkingList';
@ -24,7 +20,48 @@ onUnmounted(() => (stateStore.rightDrawer = false));
const filter = {
fields: ['id', 'sectorFk', 'code', 'pickingOrder'],
};
const columns = computed(() => [
{
align: 'left',
name: 'code',
label: t('globals.code'),
isId: true,
isTitle: true,
columnFilter: false,
sortable: true,
},
{
align: 'left',
name: 'sector',
label: t('parking.sector'),
format: (val) => val.sector.description ?? '',
sortable: true,
cardVisible: true,
},
{
align: 'left',
name: 'pickingOrder',
label: t('parking.pickingOrder'),
sortable: true,
cardVisible: true,
},
{
align: 'right',
label: '',
name: 'tableActions',
actions: [
{
title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, ParkingSummary),
isPrimary: true,
},
],
},
]);
</script>
<template>
<VnSection
:data-key="dataKey"
@ -40,41 +77,24 @@ const filter = {
<ParkingFilter data-key="ParkingList" />
</template>
<template #body>
<QPage class="column items-center q-pa-md">
<div class="vn-card-list">
<VnPaginate :data-key="dataKey">
<template #body="{ rows }">
<CardList
v-for="row of rows"
:key="row.id"
:id="row.id"
:title="row.code"
@click="
push({ path: `/shelving/parking/${row.id}/summary` })
"
<VnTable
:data-key="dataKey"
:columns="columns"
is-editable="false"
:right-search="false"
:use-model="true"
:disable-option="{ table: true }"
redirect="shelving/parking"
default-mode="card"
>
<template #list-items>
<VnLv
label="Sector"
:value="row.sector?.description"
/>
<VnLv
:label="t('parking.pickingOrder')"
:value="row.pickingOrder"
/>
</template>
<template #actions>
<template #actions="{ row }">
<QBtn
:label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, ParkingSummary)"
color="primary"
/>
</template>
</CardList>
</template>
</VnPaginate>
</div>
</QPage>
</VnTable>
</template>
</VnSection>
</template>

View File

@ -31,7 +31,7 @@ const oldQuantity = ref(null);
watch(
() => route.params.id,
async () => nextTick(async () => await saleTrackingFetchDataRef.value.fetch())
async () => nextTick(async () => await saleTrackingFetchDataRef.value.fetch()),
);
const columns = computed(() => [
@ -212,7 +212,7 @@ const updateShelving = async (sale) => {
const { data: patchResponseData } = await axios.patch(
`ItemShelvings/${sale.itemShelvingFk}`,
params
params,
);
const filter = {
fields: ['parkingFk'],
@ -385,7 +385,7 @@ const qCheckBoxController = (sale, action) => {
</template>
<template #body-cell-parking="{ row }">
<QTd style="width: 10%">
{{ dashIfEmpty(row.parkingFk) }}
{{ dashIfEmpty(row.parkingCode) }}
</QTd>
</template>
<template #body-cell-actions="{ row }">

View File

@ -2,6 +2,7 @@
import { onMounted, ref, computed, watch } from 'vue';
import { QBtn } from 'quasar';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import SupplierDescriptorProxy from 'src/pages/Supplier/Card/SupplierDescriptorProxy.vue';
import TravelDescriptorProxy from 'src/pages/Travel/Card/TravelDescriptorProxy.vue';
@ -22,6 +23,8 @@ import VnPopup from 'src/components/common/VnPopup.vue';
const stateStore = useStateStore();
const { t } = useI18n();
const { openReport } = usePrintService();
const route = useRoute();
const tableParams = ref();
const shippedFrom = ref(Date.vnNew());
const landedTo = ref(Date.vnNew());
@ -143,7 +146,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('globals.pageTitles.supplier'),
label: t('extraCommunity.cargoShip'),
field: 'cargoSupplierNickname',
name: 'cargoSupplierNickname',
align: 'left',
@ -171,7 +174,7 @@ const columns = computed(() => [
? value.reduce((sum, entry) => {
return sum + (entry.invoiceAmount || 0);
}, 0)
: 0
: 0,
),
},
{
@ -200,7 +203,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('kg'),
label: t('extraCommunity.kg'),
field: 'kg',
name: 'kg',
align: 'left',
@ -208,7 +211,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('physicKg'),
label: t('extraCommunity.physicKg'),
field: 'loadedKg',
name: 'loadedKg',
align: 'left',
@ -232,7 +235,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('shipped'),
label: t('extraCommunity.shipped'),
field: 'shipped',
name: 'shipped',
align: 'left',
@ -249,7 +252,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('landed'),
label: t('extraCommunity.landed'),
field: 'landed',
name: 'landed',
align: 'left',
@ -258,7 +261,7 @@ const columns = computed(() => [
format: (value) => toDate(value),
},
{
label: t('notes'),
label: t('extraCommunity.notes'),
field: '',
name: 'notes',
align: 'center',
@ -284,7 +287,7 @@ watch(
if (!arrayData.store.data) return;
onStoreDataChange();
},
{ deep: true, immediate: true }
{ deep: true, immediate: true },
);
const openReportPdf = () => {
@ -451,13 +454,24 @@ const getColor = (percentage) => {
for (const { value, className } of travelKgPercentages.value)
if (percentage > value) return className;
};
const filteredEntries = (entries) => {
if (!tableParams?.value?.entrySupplierFk) return entries;
return entries?.filter(
(entry) => entry.supplierFk === tableParams?.value?.entrySupplierFk,
);
};
watch(route, () => {
tableParams.value = JSON.parse(route.query.table);
});
</script>
<template>
<VnSearchbar
data-key="ExtraCommunity"
:limit="20"
:label="t('searchExtraCommunity')"
:label="t('extraCommunity.searchExtraCommunity')"
/>
<RightMenu>
<template #right-panel>
@ -521,7 +535,7 @@ const getColor = (percentage) => {
? tableColumnComponents[col.name].event(
rows[props.rowIndex][col.field],
col.field,
props.rowIndex
props.rowIndex,
)
: {}
"
@ -546,7 +560,7 @@ const getColor = (percentage) => {
},
{
link: ['id', 'cargoSupplierNickname'].includes(
col.name
col.name,
),
},
]"
@ -564,9 +578,8 @@ const getColor = (percentage) => {
</component>
</QTd>
</QTr>
<QTr
v-for="(entry, index) in props.row.entries"
v-for="(entry, index) in filteredEntries(props.row.entries)"
:key="index"
:props="props"
class="bg-vn-secondary-row cursor-pointer"
@ -598,7 +611,7 @@ const getColor = (percentage) => {
name="warning"
color="negative"
size="md"
:title="t('requiresInspection')"
:title="t('extraCommunity.requiresInspection')"
>
</QIcon>
</QTd>
@ -709,24 +722,3 @@ const getColor = (percentage) => {
width: max-content;
}
</style>
<i18n>
en:
searchExtraCommunity: Search for extra community shipping
kg: BI. KG
physicKg: Phy. KG
shipped: W. shipped
landed: W. landed
requiresInspection: Requires inspection
BIP: Boder Inspection Point
notes: Notes
es:
searchExtraCommunity: Buscar por envío extra comunitario
kg: KG Bloq.
physicKg: KG físico
shipped: F. envío
landed: F. llegada
notes: Notas
Open as PDF: Abrir como PDF
requiresInspection: Requiere inspección
BIP: Punto de Inspección Fronteriza
</i18n>

View File

@ -80,7 +80,7 @@ warehouses();
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<strong>{{ t(`extraCommunity.filter.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
@ -93,7 +93,7 @@ warehouses();
<QItem>
<QItemSection>
<VnInput
:label="t('params.reference')"
:label="t('extraCommunity.filter.reference')"
v-model="params.reference"
is-outlined
/>
@ -104,7 +104,7 @@ warehouses();
<QInput
v-model="params.totalEntries"
type="number"
:label="t('params.totalEntries')"
:label="t('extraCommunity.filter.totalEntries')"
dense
outlined
rounded
@ -134,10 +134,10 @@ warehouses();
<QItem>
<QItemSection>
<VnSelect
:label="t('params.agencyModeFk')"
:label="t('extraCommunity.filter.agencyModeFk')"
v-model="params.agencyModeFk"
:options="agenciesOptions"
option-value="agencyFk"
option-value="id"
option-label="name"
hide-selected
dense
@ -149,7 +149,7 @@ warehouses();
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.shippedFrom')"
:label="t('extraCommunity.filter.shippedFrom')"
v-model="params.shippedFrom"
@update:model-value="searchFn()"
is-outlined
@ -159,7 +159,7 @@ warehouses();
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.landedTo')"
:label="t('extraCommunity.filter.landedTo')"
v-model="params.landedTo"
@update:model-value="searchFn()"
is-outlined
@ -169,7 +169,7 @@ warehouses();
<QItem v-if="warehousesByContinent[params.continent]">
<QItemSection>
<VnSelect
:label="t('params.warehouseOutFk')"
:label="t('extraCommunity.filter.warehouseOutFk')"
v-model="params.warehouseOutFk"
:options="warehousesByContinent[params.continent]"
option-value="id"
@ -184,7 +184,7 @@ warehouses();
<QItem v-else>
<QItemSection>
<VnSelect
:label="t('params.warehouseOutFk')"
:label="t('extraCommunity.filter.warehouseOutFk')"
v-model="params.warehouseOutFk"
:options="warehousesOptions"
option-value="id"
@ -199,7 +199,7 @@ warehouses();
<QItem>
<QItemSection>
<VnSelect
:label="t('params.warehouseInFk')"
:label="t('extraCommunity.filter.warehouseInFk')"
v-model="params.warehouseInFk"
:options="warehousesOptions"
option-value="id"
@ -214,6 +214,7 @@ warehouses();
<QItem>
<QItemSection>
<VnSelectSupplier
:label="t('extraCommunity.cargoShip')"
v-model="params.cargoSupplierFk"
hide-selected
dense
@ -222,10 +223,21 @@ warehouses();
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectSupplier
v-model="params.entrySupplierFk"
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
:label="t('params.continent')"
:label="t('extraCommunity.filter.continent')"
v-model="params.continent"
:options="continentsOptions"
option-value="code"
@ -241,30 +253,3 @@ warehouses();
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
id: Id
reference: Reference
totalEntries: Total entries
agencyModeFk: Agency
warehouseInFk: Warehouse In
warehouseOutFk: Warehouse Out
shippedFrom: Shipped from
landedTo: Landed to
cargoSupplierFk: Supplier
continent: Continent out
es:
params:
id: Id
reference: Referencia
totalEntries: Ent. totales
agencyModeFk: Agencia
warehouseInFk: Alm. entrada
warehouseOutFk: Alm. salida
shippedFrom: Llegada desde
landedTo: Llegada hasta
cargoSupplierFk: Proveedor
continent: Cont. Salida
</i18n>

View File

@ -0,0 +1,22 @@
extraCommunity:
cargoShip: Cargo ship
searchExtraCommunity: Search for extra community shipping
kg: BI. KG
physicKg: Phy. KG
shipped: W. shipped
landed: W. landed
requiresInspection: Requires inspection
BIP: Boder Inspection Point
notes: Notes
filter:
id: Id
reference: Reference
totalEntries: Total entries
agencyModeFk: Agency
warehouseInFk: Warehouse In
warehouseOutFk: Warehouse Out
shippedFrom: Shipped from
landedTo: Landed to
cargoSupplierFk: Cargo supplier
continent: Continent out
entrySupplierFk: Supplier

View File

@ -0,0 +1,23 @@
extraCommunity:
cargoShip: Carguera
searchExtraCommunity: Buscar por envío extra comunitario
kg: KG Bloq.
physicKg: KG físico
shipped: F. envío
landed: F. llegada
notes: Notas
Open as PDF: Abrir como PDF
requiresInspection: Requiere inspección
BIP: Punto de Inspección Fronteriza
filter:
id: Id
reference: Referencia
totalEntries: Ent. totales
agencyModeFk: Agencia
warehouseInFk: Alm. entrada
warehouseOutFk: Alm. salida
shippedFrom: Llegada desde
landedTo: Llegada hasta
cargoSupplierFk: Carguera
continent: Cont. Salida
entrySupplierFk: Proveedor

View File

@ -46,8 +46,18 @@ async function setAdvancedSummary(data) {
>
<template #form="{ data }">
<VnRow>
<VnInput :label="t('Name')" clearable v-model="data.firstName" />
<VnInput :label="t('Last name')" clearable v-model="data.lastName" />
<VnInput
:label="t('Name')"
clearable
v-model="data.firstName"
:required="true"
/>
<VnInput
:label="t('Last name')"
clearable
v-model="data.lastName"
:required="true"
/>
</VnRow>
<VnRow>
<VnInput v-model="data.phone" :label="t('Business phone')" clearable />

View File

@ -54,9 +54,8 @@ watch(
selected.value = [];
}
},
{ immediate: true, deep: true }
{ immediate: true, deep: true },
);
</script>
<template>
@ -105,6 +104,7 @@ watch(
:options="trainsData"
hide-selected
v-model="row.trainFk"
:required="true"
/>
</VnRow>
<VnRow>
@ -115,12 +115,14 @@ watch(
option-label="code"
option-value="code"
v-model="row.itemPackingTypeFk"
:required="true"
/>
<VnSelect
:label="t('worker.operator.warehouse')"
:options="warehousesData"
hide-selected
v-model="row.warehouseFk"
:required="true"
/>
</VnRow>
<VnRow>
@ -175,6 +177,7 @@ watch(
:label="t('worker.operator.isOnReservationMode')"
v-model="row.isOnReservationMode"
lazy-rules
:required="true"
/>
</VnRow>
<VnRow>

View File

@ -1,8 +1,8 @@
src/pages/Worker/Card/WorkerPBX.vue
<script setup>
import { useI18n } from 'vue-i18n';
import FormModel from 'src/components/FormModel.vue';
import VnInput from 'src/components/common/VnInput.vue';
const { t } = useI18n();
</script>
<template>
@ -26,3 +26,8 @@ import VnInput from 'src/components/common/VnInput.vue';
</template>
</FormModel>
</template>
<i18n>
es:
It must be a 4-digit number and must not end in 00: Debe ser un número de 4 cifras y no terminar en 00
</i18n>

View File

@ -140,6 +140,7 @@ function reloadData() {
id="deviceProductionFk"
hide-selected
data-cy="pda-dialog-select"
:required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">

View File

@ -176,6 +176,7 @@ const deleteRelative = async (id) => {
:label="t('isDescendant')"
v-model="row.isDescendant"
class="q-gutter-xs q-mb-xs"
data-cy="Descendant/Ascendant"
/>
<VnSelect
:label="t('disabilityGrades')"

View File

@ -39,7 +39,12 @@ const agencies = ref([]);
<template #body="{ params, searchFn }">
<QItem>
<QItemSection>
<VnInput :label="t('list.name')" v-model="params.name" is-outlined />
<VnInput
:label="t('list.name')"
v-model="params.name"
is-outlined
data-cy="zoneFilterPanelNameInput"
/>
</QItemSection>
</QItem>
<QItem>
@ -54,6 +59,7 @@ const agencies = ref([]);
dense
outlined
rounded
data-cy="zoneFilterPanelAgencySelect"
>
</VnSelect>
</QItemSection>

View File

@ -56,7 +56,7 @@ onMounted(() => weekdayStore.initStore());
<ZoneSearchbar />
<VnSubToolbar />
<QPage class="column items-center q-pa-md">
<QCard class="full-width q-pa-md">
<QCard class="containerShrinked q-pa-md">
<div
v-for="(detail, index) in details"
:key="index"

View File

@ -44,6 +44,8 @@ summary:
filterPanel:
name: Name
agencyModeFk: Agency
id: ID
price: Price
deliveryPanel:
pickup: Pick up
delivery: Delivery

View File

@ -45,6 +45,8 @@ summary:
filterPanel:
name: Nombre
agencyModeFk: Agencia
id: ID
price: Precio
deliveryPanel:
pickup: Recogida
delivery: Entrega

View File

@ -1,3 +1,7 @@
reports/*
videos/*
screenshots/*
downloads/*
storage/*
reports/*
docker/logs/*

View File

@ -0,0 +1,149 @@
{
"db": {
"connector": "memory",
"timezone": "local"
},
"vn": {
"connector": "vn-mysql",
"database": "vn",
"debug": false,
"host": "db",
"port": "3306",
"username": "root",
"password": "root",
"connectionLimit": 100,
"queueLimit": 100,
"multipleStatements": true,
"legacyUtcDateProcessing": false,
"timezone": "local",
"connectTimeout": 40000,
"acquireTimeout": 90000,
"waitForConnections": true,
"maxIdleTime": 60000,
"idleTimeout": 60000
},
"osticket": {
"connector": "memory",
"timezone": "local"
},
"tempStorage": {
"name": "tempStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./storage/tmp",
"maxFileSize": "262144000",
"allowedContentTypes": [
"application/x-7z-compressed",
"application/x-zip-compressed",
"application/x-rar-compressed",
"application/octet-stream",
"application/pdf",
"application/zip",
"application/rar",
"multipart/x-zip",
"image/png",
"image/jpeg",
"image/jpg",
"image/webp",
"video/mp4"
]
},
"dmsStorage": {
"name": "dmsStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./storage/dms",
"maxFileSize": "262144000",
"allowedContentTypes": [
"application/x-7z-compressed",
"application/x-zip-compressed",
"application/x-rar-compressed",
"application/octet-stream",
"application/pdf",
"application/zip",
"application/rar",
"multipart/x-zip",
"image/png",
"image/jpeg",
"image/jpg",
"image/webp"
]
},
"imageStorage": {
"name": "imageStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./storage/image",
"maxFileSize": "52428800",
"allowedContentTypes": [
"image/png",
"image/jpeg",
"image/jpg",
"image/webp"
]
},
"invoiceStorage": {
"name": "invoiceStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./storage/pdfs/invoice",
"maxFileSize": "52428800",
"allowedContentTypes": [
"application/octet-stream",
"application/pdf"
]
},
"claimStorage": {
"name": "claimStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./storage/dms",
"maxFileSize": "31457280",
"allowedContentTypes": [
"image/png",
"image/jpeg",
"image/jpg",
"image/webp",
"video/mp4"
]
},
"entryStorage": {
"name": "entryStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./storage/dms",
"maxFileSize": "31457280",
"allowedContentTypes": [
"image/png",
"image/jpeg",
"image/jpg",
"image/webp",
"video/mp4"
]
},
"supplierStorage": {
"name": "supplierStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./storage/dms",
"maxFileSize": "31457280",
"allowedContentTypes": [
"image/png",
"image/jpeg",
"image/jpg",
"image/webp",
"video/mp4",
"application/pdf"
]
},
"accessStorage": {
"name": "accessStorage",
"connector": "loopback-component-storage",
"provider": "filesystem",
"root": "./storage/access",
"maxFileSize": "524288000",
"allowedContentTypes": [
"application/x-7z-compressed"
]
}
}

View File

@ -0,0 +1,21 @@
version: '3.7'
services:
back:
image: 'registry.verdnatura.es/salix-back:${COMPOSE_TAG:-dev}'
volumes:
- ./test/cypress/storage:/salix/storage
- ./test/cypress/back/datasources.json:/salix/loopback/server/datasources.json
depends_on:
- db
dns_search: .
front:
image: lilium-dev:latest
command: pnpm exec quasar dev
volumes:
- .:/app
environment:
- CI
- TZ
dns_search: .
db:
image: 'registry.verdnatura.es/salix-db:${COMPOSE_TAG:-dev}'

View File

@ -41,7 +41,7 @@ describe('OrderCatalog', () => {
}
});
cy.get(
'[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control'
'[data-cy="vn-searchbar"] > .q-field > .q-field__inner > .q-field__control',
).type('{enter}');
cy.get(':nth-child(1) > [data-cy="catalogFilterCategory"]').click();
cy.dataCy('catalogFilterValueDialogBtn').last().click();

View File

@ -1,6 +1,6 @@
/// <reference types="cypress" />
describe('ClaimAction', () => {
const claimId = 2;
const claimId = 1;
const firstRow = 'tbody > :nth-child(1)';
const destinationRow = '.q-item__section > .q-field';
@ -24,9 +24,9 @@ describe('ClaimAction', () => {
const rowData = [true];
cy.fillRow(firstRow, rowData);
cy.get('[title="Change destination"]').click();
cy.get('[title="Change destination"]').click({ force: true });
cy.selectOption(destinationRow, 'Confeccion');
cy.get('.q-card > .q-card__actions > .q-btn--standard').click();
cy.get('.q-card > .q-card__actions > .q-btn--standard').click({ force: true });
});
it('should regularize', () => {

View File

@ -35,8 +35,7 @@ describe('ClaimDevelopment', () => {
cy.saveCard();
});
// TODO: #8112
xit('should add and remove new line', () => {
it('should add and remove new line', () => {
cy.wait(['@workers', '@workers']);
cy.addCard();

View File

@ -1,4 +1,4 @@
describe('ClaimNotes', () => {
describe.skip('ClaimNotes', () => {
const saveBtn = '.q-field__append > .q-btn > .q-btn__content > .q-icon';
const firstNote = '.q-infinite-scroll :nth-child(1) > .q-card__section--vert';
beforeEach(() => {
@ -8,7 +8,8 @@ describe('ClaimNotes', () => {
it('should add a new note', () => {
const message = 'This is a new message.';
cy.get('.q-textarea').type(message);
cy.get('.q-textarea').should('not.be.disabled').type(message);
cy.get(saveBtn).click();
cy.get(firstNote).should('have.text', message);
});

View File

@ -23,37 +23,35 @@ describe.skip('ClaimPhoto', () => {
});
it('should open first image dialog change to second and close', () => {
cy.get(
':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image'
).click();
cy.get(':nth-last-child(1) > .q-card').click();
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
'be.visible'
'be.visible',
);
cy.get('.q-carousel__control > .q-btn > .q-btn__content > .q-icon').click();
cy.get('.q-carousel__control > button').click();
cy.get(
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon'
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon',
).click();
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
'not.be.visible'
'not.be.visible',
);
});
it('should remove third and fourth file', () => {
cy.get(
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
'.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon',
).click();
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
).click();
cy.get('.q-notification__message').should('have.text', 'Data deleted');
cy.get(
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
'.multimediaParent > :nth-last-child(1) > .q-btn > .q-btn__content > .q-icon',
).click();
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
).click();
cy.get('.q-notification__message').should('have.text', 'Data deleted');
});

View File

@ -4,7 +4,6 @@ describe('Client consignee', () => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/customer/1107/address');
cy.domContentLoad();
});
it('Should load layout', () => {
cy.get('.q-card').should('be.visible');

View File

@ -8,7 +8,7 @@ describe('Client basic data', () => {
it('Should load layout', () => {
cy.get('.q-card').should('be.visible');
cy.dataCy('customerPhone').find('input').should('be.visible');
cy.dataCy('customerPhone').find('input').type('123456789');
cy.dataCy('customerPhone').find('input').clear().type('123456789');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.intercept('PATCH', '/api/Clients/1102', (req) => {
const { body } = req;

View File

@ -4,7 +4,6 @@ describe('Client fiscal data', () => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/customer/1107/fiscal-data');
cy.domContentLoad();
});
it('Should change required value when change customer', () => {
cy.get('.q-card').should('be.visible');

View File

@ -1,7 +1,6 @@
/// <reference types="cypress" />
describe('Client list', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/customer/list', {
timeout: 5000,
@ -28,7 +27,7 @@ describe('Client list', () => {
Email: { val: `user.test${randomInt}@cypress.com` },
'Sales person': { val: 'salesPerson', type: 'select' },
Location: { val: '46000', type: 'select' },
'Business type': { val: 'Otros', type: 'select' },
'Business type': { val: 'others', type: 'select' },
};
cy.fillInForm(data);
@ -37,6 +36,7 @@ describe('Client list', () => {
cy.checkNotification('Data created');
cy.url().should('include', '/summary');
});
it('Client list search client', () => {
const search = 'Jessica Jones';
cy.searchByLabel('Name', search);
@ -59,6 +59,7 @@ describe('Client list', () => {
cy.checkValueForm(1, search);
cy.checkValueForm(2, search);
});
it('Client founded create order', () => {
const search = 'Jessica Jones';
cy.searchByLabel('Name', search);

View File

@ -184,9 +184,8 @@ describe('Entry', () => {
}
function deleteEntry() {
cy.get('[data-cy="descriptor-more-opts"]').click();
cy.waitForElement('div[data-cy="delete-entry"]');
cy.get('div[data-cy="delete-entry"]').should('be.visible').click();
cy.get('[data-cy="descriptor-more-opts"]').should('be.visible').click();
cy.waitForElement('div[data-cy="delete-entry"]').click();
cy.url().should('include', 'list');
}

View File

@ -10,9 +10,7 @@ describe('EntryMy when is supplier', () => {
});
it('should open buyLabel when is supplier', () => {
cy.get(
'[to="/null/3"] > .q-card > :nth-child(2) > .q-btn > .q-btn__content > .q-icon'
).click();
cy.dataCy('cardBtn').eq(2).click();
cy.dataCy('printLabelsBtn').click();
cy.window().its('open').should('be.called');
});

View File

@ -9,16 +9,16 @@ describe('EntryStockBought', () => {
cy.get('[data-col-field="reserve"][data-row-index="0"]').click();
cy.get('input[name="reserve"]').type('10{enter}');
cy.get('button[title="Save"]').click();
cy.get('.q-notification__message').should('have.text', 'Data saved');
cy.checkNotification('Data saved');
});
it('Should add a new reserved space for buyerBoss', () => {
cy.addBtnClick();
cy.get('input[aria-label="Reserve"]').type('1');
cy.get('input[aria-label="Date"]').eq(1).clear();
cy.get('input[aria-label="Date"]').eq(1).type('01-01');
cy.get('input[aria-label="Buyer"]').type('buyerBossNick');
cy.get('input[aria-label="Buyer"]').type('itNick');
cy.get('div[role="listbox"] > div > div[role="option"]')
.eq(0)
.eq(1)
.should('be.visible')
.click();

View File

@ -9,7 +9,7 @@ describe('InvoiceInList', () => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/invoice-in/list`);
cy.get('#searchbar input').should('be.visible').type('{enter}');
cy.get('#searchbar input').type('{enter}');
});
it('should redirect on clicking a invoice', () => {
@ -21,7 +21,7 @@ describe('InvoiceInList', () => {
cy.url().should('include', `/invoice-in/${id}/summary`);
});
});
// https://redmine.verdnatura.es/issues/8420
it('should open the details', () => {
cy.get(firstDetailBtn).click();
cy.get(summaryHeaders).eq(1).contains('Basic data');

View File

@ -1,6 +1,16 @@
/// <reference types="cypress" />
describe('InvoiceOut list', () => {
const serial = 'Española rapida';
const columnCheckbox =
'.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner';
const firstRowDescriptor =
'tbody > :nth-child(1) > [data-col-field="clientFk"] > .no-padding > .link';
const firstRowCheckbox =
'tbody > :nth-child(1) > :nth-child(1) > .q-checkbox > .q-checkbox__inner ';
const summaryPopupIcon = '.header > :nth-child(2) > .q-btn__content > .q-icon';
const filterBtn = '.q-scrollarea__content > .q-btn--standard > .q-btn__content';
const firstSummaryIcon =
':nth-child(1) > .text-right > [data-cy="tableAction-0"] > .q-btn__content > .q-icon';
beforeEach(() => {
cy.viewport(1920, 1080);
@ -9,18 +19,32 @@ describe('InvoiceOut list', () => {
cy.typeSearchbar('{enter}');
});
it('should search and filter an invoice and enter to the summary', () => {
cy.typeSearchbar('1{enter}');
cy.get('.q-virtual-scroll__content > :nth-child(2) > :nth-child(7)').click();
cy.get('.header > a.q-btn > .q-btn__content').click();
cy.typeSearchbar('{enter}');
cy.dataCy('InvoiceOutFilterAmountBtn').find('input').type('8.88{enter}');
it('should download one pdf from the subtoolbar button', () => {
cy.get(firstRowCheckbox).click();
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
});
it('should download all pdfs', () => {
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
cy.get(columnCheckbox).click();
cy.dataCy('InvoiceOutDownloadPdfBtn').click();
cy.get('.bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner').click();
});
it('should open the invoice descriptor from table icon', () => {
cy.get(firstSummaryIcon).click();
cy.get('.cardSummary').should('be.visible');
cy.get('.summaryHeader > div').should('include.text', 'A1111111');
});
it('should open the client descriptor', () => {
cy.get(firstRowDescriptor).click();
cy.get(summaryPopupIcon).click();
});
it('should filter the results by client ID, then check the first result is correct', () => {
cy.dataCy('Customer ID_input').type('1103');
cy.get(filterBtn).click();
cy.get(firstRowDescriptor).click();
cy.get('.q-item > .q-item__label').should('include.text', '1103');
});
it('should give an error when manual invoicing a ticket that is already invoiced', () => {
@ -31,11 +55,14 @@ describe('InvoiceOut list', () => {
cy.checkNotification('This ticket is already invoiced');
});
it('should create a manual invoice and enter to its summary', () => {
it('should create a manual invoice and enter to its summary, then delete that invoice', () => {
cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('InvoiceOutCreateTicketinput').type(8);
cy.dataCy('InvoiceOutCreateTicketinput').type(9);
cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial);
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(4)').click();
cy.dataCy('VnConfirm_confirm').click();
});
});

View File

@ -1,11 +1,26 @@
/// <reference types="cypress" />
describe('InvoiceOut negative bases', () => {
const getDescriptors = (opt) =>
`:nth-child(1) > [data-col-field="${opt}"] > .no-padding > .link`;
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/invoice-out/negative-bases`);
});
it('should open the posible descriptors', () => {
cy.get(getDescriptors('clientId')).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1101');
cy.get(getDescriptors('ticketFk')).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '23');
cy.get(getDescriptors('workerName')).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '18');
});
it('should filter and download as CSV', () => {
cy.get('input[name="ticketFk"]').type('23{enter}');
cy.get('#subToolbar > .q-btn').click();

View File

@ -5,40 +5,91 @@ describe('InvoiceOut summary', () => {
Type: { val: 'Error in customer data', type: 'select' },
};
const firstRowDescriptors = (opt) =>
`tbody > :nth-child(1) > :nth-child(${opt}) > .q-btn`;
const toCustomerSummary = '[href="#/customer/1101"]';
const toTicketList = '[href="#/ticket/list?table={%22refFk%22:%22T1111111%22}"]';
const selectMenuOption = (opt) => `.q-menu > .q-list > :nth-child(${opt})`;
const confirmSend = '.q-btn--unelevated';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/invoice-out/list`);
cy.visit(`/#/invoice-out/1/summary`);
});
it('should generate the invoice PDF', () => {
cy.typeSearchbar('T1111111{enter}');
cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(6)').click();
cy.dataCy('VnConfirm_confirm').click();
cy.checkNotification('The invoice PDF document has been regenerated');
it('open the descriptors', () => {
cy.get(firstRowDescriptors(1)).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1');
cy.get(firstRowDescriptors(2)).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1101');
});
it('should refund the invoice ', () => {
it('should open the client summary and the ticket list', () => {
cy.get(toCustomerSummary).click();
cy.get('.descriptor').should('be.visible');
cy.get('.q-item > .q-item__label').should('include.text', '1101');
});
it.skip('should open the ticket list', () => {
cy.get(toTicketList).click();
cy.get('.descriptor').should('be.visible');
cy.dataCy('vnFilterPanelChip').should('include.text', 'T1111111');
});
it('should transfer the invoice ', () => {
cy.typeSearchbar('T1111111{enter}');
cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(7)').click();
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
cy.checkNotification('The following refund ticket have been created');
cy.get(selectMenuOption(1)).click();
cy.fillInForm(transferInvoice);
cy.get('.q-mt-lg > .q-btn').click();
cy.checkNotification('Transferred invoice');
});
it('should send the invoice as PDF', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(3)).click();
cy.dataCy('InvoiceOutDescriptorMenuSendPdfOption').click();
cy.get(confirmSend).click();
cy.checkNotification('Notification sent');
});
it('should send the invoice as CSV', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(3)).click();
cy.dataCy('InvoiceOutDescriptorMenuSendCsvOption').click();
cy.get(confirmSend).click();
cy.checkNotification('Notification sent');
});
it('should delete an invoice ', () => {
cy.typeSearchbar('T2222222{enter}');
cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(4)').click();
cy.get(selectMenuOption(4)).click();
cy.dataCy('VnConfirm_confirm').click();
cy.checkNotification('InvoiceOut deleted');
});
it('should transfer the invoice ', () => {
cy.typeSearchbar('T1111111{enter}');
it('should book the invoice', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get('.q-menu > .q-list > :nth-child(1)').click();
cy.fillInForm(transferInvoice);
cy.get('.q-mt-lg > .q-btn').click();
cy.checkNotification('Transferred invoice');
cy.get(selectMenuOption(5)).click();
cy.dataCy('VnConfirm_confirm').click();
cy.checkNotification('InvoiceOut booked');
});
it('should generate the invoice PDF', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(6)).click();
cy.dataCy('VnConfirm_confirm').click();
cy.checkNotification('The invoice PDF document has been regenerated');
});
it('should refund the invoice ', () => {
cy.dataCy('descriptor-more-opts').click();
cy.get(selectMenuOption(7)).click();
cy.get('#q-portal--menu--3 > .q-menu > .q-list > :nth-child(2)').click();
cy.checkNotification('The following refund ticket have been created');
});
});

View File

@ -11,7 +11,7 @@ describe('Handle Items FixedPrice', () => {
cy.visit('/#/item/fixed-price', { timeout: 5000 });
cy.waitForElement('.q-table');
cy.get(
'.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon'
'.q-header > .q-toolbar > :nth-child(1) > .q-btn__content > .q-icon',
).click();
});
it.skip('filter', function () {
@ -38,7 +38,7 @@ describe('Handle Items FixedPrice', () => {
cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click();
cy.get(`${firstRow} > .text-right > .q-btn > .q-btn__content > .q-icon`).click();
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
).click();
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
@ -56,7 +56,7 @@ describe('Handle Items FixedPrice', () => {
cy.get(' .bg-header > :nth-child(1) > .q-checkbox > .q-checkbox__inner ').click();
cy.get('#subToolbar > .q-btn--flat').click();
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
).click();
cy.get('.q-notification__message').should('have.text', 'Data saved');
});

View File

@ -15,6 +15,7 @@ describe('Item list', () => {
cy.get('.q-menu .q-item').contains('Anthurium').click();
cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click();
});
// https://redmine.verdnatura.es/issues/8421
it.skip('should create an item', () => {
const data = {
@ -28,7 +29,7 @@ describe('Item list', () => {
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
cy.get(
':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content'
':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content',
).should('be.visible');
});
});

View File

@ -24,7 +24,7 @@ describe('Recover Password', () => {
it('should change password to user', () => {
// Get token from mail
cy.request(
`http://localhost:3000/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
`/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
).then((response) => {
const regex = /access_token=([a-zA-Z0-9]+)/;
const [match] = response.body[0].body.match(regex);

View File

@ -11,7 +11,7 @@ describe('Two Factor', () => {
it('should enable two factor to sysadmin', () => {
cy.request(
'PATCH',
`http://localhost:3000/api/VnUsers/${userId}/update-user?access_token=DEFAULT_TOKEN`,
`/api/VnUsers/${userId}/update-user?access_token=DEFAULT_TOKEN`,
{ twoFactor: 'email' }
);
});
@ -41,7 +41,7 @@ describe('Two Factor', () => {
// Get code from mail
cy.request(
`http://localhost:3000/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
`/api/Mails?filter=%7B%22where%22%3A%20%7B%22receiver%22%3A%20%22${username}%40mydomain.com%22%7D%2C%20%22order%22%3A%20%5B%22id%20DESC%22%5D%7D&access_token=DEFAULT_TOKEN`
).then((response) => {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = response.body[0].body;

View File

@ -1,23 +0,0 @@
/// <reference types="cypress" />
describe('ParkingBasicData', () => {
const codeInput = 'form .q-card .q-input input';
const sectorSelect = 'form .q-card .q-select input';
const sectorOpt = '.q-menu .q-item';
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/shelving/parking/1/basic-data`);
});
it('should edit the code and sector', () => {
cy.get(sectorSelect).type('Second');
cy.get(sectorOpt).click();
cy.get(codeInput).eq(0).clear();
cy.get(codeInput).eq(0).type('900-001');
cy.saveCard();
cy.get(sectorSelect).should('have.value', 'Second sector');
cy.get(codeInput).should('have.value', '900-001');
});
});

View File

@ -1,33 +0,0 @@
/// <reference types="cypress" />
describe('ParkingList', () => {
const searchbar = '#searchbar input';
const firstCard = '.q-card:nth-child(1)';
const firstChipId =
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
const firstDetailBtn =
':nth-child(1) > :nth-child(1) > .card-list-body > .actions > .q-btn';
const summaryHeader = '.summaryBody .header';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/shelving/parking/list`);
});
it('should redirect on clicking a parking', () => {
cy.get(searchbar).type('{enter}');
cy.get(firstChipId)
.invoke('text')
.then((content) => {
const id = content.substring(4);
cy.get(firstCard).click();
cy.url().should('include', `/parking/${id}/summary`);
});
});
it('should open the details', () => {
cy.get(searchbar).type('{enter}');
cy.get(firstDetailBtn).click();
cy.get(summaryHeader).contains('Basic data');
});
});

View File

@ -1,4 +1,4 @@
describe('AgencyWorkCenter', () => {
describe.skip('AgencyWorkCenter', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');

View File

@ -0,0 +1,121 @@
describe('RouteAutonomous', () => {
const getLinkSelector = (colField) =>
`tr:first-child > [data-col-field="${colField}"] > .no-padding > .link`;
const selectors = {
reference: 'Reference_input',
date: 'tr:first-child > [data-col-field="dated"]',
total: '.value > .text-h6',
received: getLinkSelector('invoiceInFk'),
autonomous: getLinkSelector('supplierName'),
firstRowCheckbox: '.q-virtual-scroll__content tr:first-child .q-checkbox__bg',
secondRowCheckbox: '.q-virtual-scroll__content tr:nth-child(2) .q-checkbox__bg',
createInvoiceBtn: '.q-card > .q-btn',
saveFormBtn: 'FormModelPopup_save',
summaryIcon: 'tableAction-0',
summaryPopupBtn: '.header > :nth-child(2) > .q-btn__content > .q-icon',
summaryHeader: '.summaryHeader > :nth-child(2)',
descriptorHeader: '.summaryHeader > div',
descriptorTitle: '.q-item__label--header > .title > span',
summaryGoToSummaryBtn: '.header > .q-icon',
descriptorGoToSummaryBtn: '.descriptor > .header > a[href] > .q-btn',
};
const data = {
reference: 'Test invoice',
total: '€206.40',
supplier: 'PLANTS SL',
route: 'first route',
};
const summaryUrl = '/summary';
const dataSaved = 'Data saved';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/agency-term`);
cy.typeSearchbar('{enter}');
});
it('Should list autonomous routes', () => {
cy.get('.q-table')
.children()
.should('be.visible')
.should('have.length.greaterThan', 0);
});
it('Should create invoice in to selected route', () => {
cy.get(selectors.firstRowCheckbox).click();
cy.get(selectors.createInvoiceBtn).click();
cy.dataCy(selectors.reference).type(data.reference);
cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', {
force: true,
});
cy.dataCy(selectors.saveFormBtn).click();
cy.checkNotification(dataSaved);
cy.typeSearchbar('{enter}');
});
it('Should display the total price of the selected rows', () => {
cy.get(selectors.firstRowCheckbox).click();
cy.get(selectors.secondRowCheckbox).click();
cy.validateContent(selectors.total, data.total);
});
it('Should redirect to the summary when clicking a route', () => {
cy.get(selectors.date).click();
cy.get(selectors.summaryHeader).should('contain', data.route);
cy.url().should('include', summaryUrl);
});
describe('Received pop-ups', () => {
it('Should redirect to invoice in summary from the received descriptor pop-up', () => {
cy.get(selectors.received).click();
cy.validateContent(selectors.descriptorTitle, data.reference);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.get(selectors.descriptorHeader).should('contain', data.supplier);
cy.url().should('include', summaryUrl);
});
it('Should redirect to the invoiceIn summary from summary pop-up from the received descriptor pop-up', () => {
cy.get(selectors.received).click();
cy.validateContent(selectors.descriptorTitle, data.reference);
cy.get(selectors.summaryPopupBtn).click();
cy.get(selectors.descriptorHeader).should('contain', data.supplier);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.descriptorHeader).should('contain', data.supplier);
cy.url().should('include', summaryUrl);
});
});
describe('Autonomous pop-ups', () => {
it('Should redirect to the supplier summary from the received descriptor pop-up', () => {
cy.get(selectors.autonomous).click();
cy.validateContent(selectors.descriptorTitle, data.supplier);
cy.get(selectors.descriptorGoToSummaryBtn).click();
cy.get(selectors.summaryHeader).should('contain', data.supplier);
cy.url().should('include', summaryUrl);
});
it('Should redirect to the supplier summary from summary pop-up from the autonomous descriptor pop-up', () => {
cy.get(selectors.autonomous).click();
cy.get(selectors.descriptorTitle).should('contain', data.supplier);
cy.get(selectors.summaryPopupBtn).click();
cy.get(selectors.summaryHeader).should('contain', data.supplier);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.summaryHeader).should('contain', data.supplier);
cy.url().should('include', summaryUrl);
});
});
describe('Route pop-ups', () => {
it('Should redirect to the summary from the route summary pop-up', () => {
cy.dataCy(selectors.summaryIcon).first().click();
cy.get(selectors.summaryHeader).should('contain', data.route);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.get(selectors.summaryHeader).should('contain', data.route);
cy.url().should('include', summaryUrl);
});
});
});

View File

@ -0,0 +1,205 @@
describe.skip('Route extended list', () => {
const getSelector = (colField) => `tr:last-child > [data-col-field="${colField}"]`;
const selectors = {
worker: getSelector('workerFk'),
agency: getSelector('agencyModeFk'),
vehicle: getSelector('vehicleFk'),
date: getSelector('dated'),
description: getSelector('description'),
served: getSelector('isOk'),
lastRowSelectCheckBox: 'tbody > tr:last-child > :nth-child(1) .q-checkbox__inner',
removeBtn: '[title="Remove"]',
resetBtn: '[title="Reset"]',
confirmBtn: 'VnConfirm_confirm',
saveBtn: 'crudModelDefaultSaveBtn',
saveFormBtn: 'FormModelPopup_save',
cloneBtn: '#st-actions > .q-btn-group > :nth-child(1)',
downloadBtn: '#st-actions > .q-btn-group > :nth-child(2)',
markServedBtn: '#st-actions > .q-btn-group > :nth-child(3)',
searchbar: 'searchbar',
firstTicketsRowSelectCheckBox:
'.q-card > :nth-child(2) > .q-table__container > .q-table__middle > .q-table > tbody > :nth-child(1) > .q-table--col-auto-width > .q-checkbox > .q-checkbox__inner > .q-checkbox__bg > .q-checkbox__svg',
};
const checkboxState = {
check: 'check',
uncheck: 'close',
};
const url = '/#/route/extended-list';
const dataCreated = 'Data created';
const dataSaved = 'Data saved';
const originalFields = [
{ selector: selectors.worker, type: 'select', value: 'logistic' },
{ selector: selectors.agency, type: 'select', value: 'Super-Man delivery' },
{ selector: selectors.vehicle, type: 'select', value: '3333-IMK' },
{ selector: selectors.date, type: 'date', value: '01/02/2024' },
{ selector: selectors.description, type: 'input', value: 'Test route' },
{ selector: selectors.served, type: 'checkbox', value: checkboxState.uncheck },
];
const updateFields = [
{ selector: selectors.worker, type: 'select', value: 'salesperson' },
{ selector: selectors.agency, type: 'select', value: 'inhouse pickup' },
{ selector: selectors.vehicle, type: 'select', value: '1111-IMK' },
{ selector: selectors.date, type: 'date', value: '01/01/2001' },
{ selector: selectors.description, type: 'input', value: 'Description updated' },
{ selector: selectors.served, type: 'checkbox', value: checkboxState.check },
];
function fillField(selector, type, value) {
switch (type) {
case 'select':
cy.get(selector).should('be.visible').click();
cy.dataCy('null_select').clear().type(value);
cy.get('.q-item').contains(value).click();
break;
case 'input':
cy.get(selector).should('be.visible').click();
cy.dataCy('null_input').clear().type(`${value}{enter}`);
break;
case 'date':
cy.get(selector).should('be.visible').click();
cy.dataCy('null_inputDate').clear().type(`${value}{enter}`);
break;
case 'checkbox':
cy.get(selector).should('be.visible').click().click();
break;
}
}
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(url);
cy.typeSearchbar('{enter}');
});
after(() => {
cy.visit(url);
cy.typeSearchbar('{enter}');
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.removeBtn).click();
cy.dataCy(selectors.confirmBtn).click();
});
it('Should list routes', () => {
cy.get('.q-table')
.children()
.should('be.visible')
.should('have.length.greaterThan', 0);
});
it('Should create new route', () => {
cy.addBtnClick();
const data = {
Worker: { val: 'logistic', type: 'select' },
Agency: { val: 'Super-Man delivery', type: 'select' },
Vehicle: { val: '3333-IMK', type: 'select' },
Date: { val: '02-01-2024', type: 'date' },
From: { val: '01-01-2024', type: 'date' },
To: { val: '10-01-2024', type: 'date' },
'Km start': { val: 1000 },
'Km end': { val: 1200 },
Description: { val: 'Test route' },
};
cy.fillInForm(data);
cy.dataCy(selectors.saveFormBtn).click();
cy.checkNotification(dataCreated);
cy.url().should('include', '/summary');
});
it('Should reset changed values when click reset button', () => {
updateFields.forEach(({ selector, type, value }) => {
fillField(selector, type, value);
});
cy.get('[title="Reset"]').click();
originalFields.forEach(({ selector, value }) => {
cy.validateContent(selector, value);
});
});
it('Should clone selected route', () => {
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.cloneBtn).click();
cy.dataCy('route.Starting date_inputDate').type('10-05-2001{enter}');
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
cy.validateContent(selectors.date, '05/10/2001');
});
it('Should download selected route', () => {
const downloadsFolder = Cypress.config('downloadsFolder');
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.downloadBtn).click();
cy.wait(5000);
const fileName = 'download.zip';
cy.readFile(`${downloadsFolder}/${fileName}`).should('exist');
cy.task('deleteFile', `${downloadsFolder}/${fileName}`).then((deleted) => {
expect(deleted).to.be.true;
});
});
it('Should mark as served the selected route', () => {
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.markServedBtn).click();
cy.typeSearchbar('{enter}');
cy.validateContent(selectors.served, checkboxState.check);
});
it('Should delete the selected route', () => {
cy.get(selectors.lastRowSelectCheckBox).click();
cy.get(selectors.removeBtn).click();
cy.dataCy(selectors.confirmBtn).click();
cy.checkNotification(dataSaved);
});
it('Should save changes in route', () => {
updateFields.forEach(({ selector, type, value }) => {
fillField(selector, type, value);
});
cy.dataCy(selectors.saveBtn).should('not.be.disabled').click();
cy.checkNotification(dataSaved);
cy.typeSearchbar('{enter}');
updateFields.forEach(({ selector, value }) => {
cy.validateContent(selector, value);
});
});
it('Should add ticket to route', () => {
cy.dataCy('tableAction-0').last().click();
cy.get(selectors.firstTicketsRowSelectCheckBox).click();
cy.get('.q-card__actions > .q-btn--standard > .q-btn__content').click();
cy.checkNotification(dataSaved);
});
it('Should open summary pop-up when click summuary icon', () => {
cy.dataCy('tableAction-1').last().click();
cy.get('.summaryHeader > :nth-child(2').should('contain', updateFields[4].value);
});
it('Should redirect to the summary from the route summary pop-up', () => {
cy.dataCy('tableAction-1').last().click();
cy.get('.header > .q-icon').should('be.visible').click();
cy.url().should('include', '/summary');
});
it('Should redirect to the summary when click go to summary icon', () => {
cy.dataCy('tableAction-2').last().click();
cy.url().should('include', '/summary');
});
});

View File

@ -7,7 +7,7 @@ describe('Route', () => {
it('Route list create route', () => {
cy.addBtnClick();
cy.get('input[name="description"]').type('routeTestOne{enter}');
cy.get('.q-card input[name="description"]').type('routeTestOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
cy.url().should('include', '/summary');
});

View File

@ -0,0 +1,59 @@
describe('Vehicle list', () => {
const selectors = {
saveFormBtn: 'FormModelPopup_save',
summaryPopupBtn: 'tr:last-child > .q-table--col-auto-width > .q-btn',
summaryGoToSummaryBtn: '.header > .q-icon',
summaryHeader: '.summaryHeader > div',
numberPlate: 'tr:last-child > [data-col-field="numberPlate"] > .no-padding',
};
const data = {
'Nº Plate': { val: '9465-LPA' },
'Trade Mark': { val: 'WAYNE INDUSTRIES' },
Model: { val: 'BATREMOLQUE' },
Type: { val: 'remolque', type: 'select' },
Warehouse: { val: 'Warehouse One', type: 'select' },
Country: { val: 'Portugal', type: 'select' },
Description: { val: 'Exclusive for batpod transport' },
};
const expected = data['Nº Plate'].val;
const summaryUrl = '/summary';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/route/vehicle/list`);
cy.typeSearchbar('{enter}');
});
it('should list vehicles', () => {
cy.get('.q-table')
.children()
.should('be.visible')
.should('have.length.greaterThan', 0);
});
it('Should add new vehicle', () => {
cy.addBtnClick();
cy.fillInForm(data);
cy.dataCy(selectors.saveFormBtn).should('be.visible').click();
cy.checkNotification('Data created');
cy.get(selectors.summaryHeader).should('contain', expected);
cy.url().should('include', summaryUrl);
});
it('should open summary by clicking a vehicle', () => {
cy.get(selectors.numberPlate).click();
cy.get(selectors.summaryHeader).should('contain', expected);
cy.url().should('include', summaryUrl);
});
it('should redirect to vehicle summary when click summary icon on summary pop-up', () => {
cy.get(selectors.summaryPopupBtn).click();
cy.get(selectors.summaryHeader).should('contain', expected);
cy.get(selectors.summaryGoToSummaryBtn).click();
cy.url().should('include', summaryUrl);
});
});

View File

@ -0,0 +1,32 @@
/// <reference types="cypress" />
describe('ParkingBasicData', () => {
const codeInput = 'form .q-card .q-input input';
const sectorSelect = 'form .q-card .q-select input';
const sectorOpt = '.q-menu .q-item';
beforeEach(() => {
cy.login('developer');
cy.visit(`/#/shelving/parking/1/basic-data`);
});
it('should give an error if the code aldready exists', () => {
cy.get(codeInput).eq(0).should('have.value', '700-01').clear();
cy.get(codeInput).eq(0).type('700-02');
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'The code already exists');
});
it('should edit the code and sector', () => {
cy.get(sectorSelect).type('First');
cy.get(sectorOpt).click();
cy.get(codeInput).eq(0).clear();
cy.get(codeInput).eq(0).type('700-01');
cy.dataCy('Picking order_input').clear().type(80230);
cy.saveCard();
cy.get('.q-notification__message').should('have.text', 'Data saved');
cy.get(sectorSelect).should('have.value', 'First sector');
cy.get(codeInput).should('have.value', '700-01');
cy.dataCy('Picking order_input').should('have.value', 80230);
});
});

View File

@ -0,0 +1,30 @@
/// <reference types="cypress" />
describe('ParkingList', () => {
const searchbar = '#searchbar input';
const firstCard = ':nth-child(1) > .q-card > .no-margin > .q-py-none';
const summaryHeader = '.summaryBody .header';
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/shelving/parking/list`);
});
it('should redirect on clicking a parking', () => {
cy.get(searchbar).type('{enter}');
cy.get(firstCard).click();
cy.get(summaryHeader).contains('Basic data');
});
it('should filter and redirect if there is only one result', () => {
cy.dataCy('Code_input').type('1{enter}');
cy.dataCy('Sector_select').type('Normal{enter}');
cy.get(summaryHeader).contains('Basic data');
});
it('should filter and redirect to summary if only one result', () => {
cy.dataCy('Code_input').type('A{enter}');
cy.dataCy('Sector_select').type('First Sector{enter}');
cy.url().should('match', /\/shelving\/parking\/\d+\/summary/);
});
});

View File

@ -30,8 +30,6 @@ describe('Ticket descriptor', () => {
it('should set the weight of the ticket', () => {
cy.visit('/#/ticket/10/summary');
cy.intercept('GET', /\/api\/Tickets\/\d/).as('ticket');
cy.wait('@ticket');
cy.openActionsDescriptor();
cy.contains(listItem, setWeightOpt).click();
cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight');

View File

@ -1,6 +1,5 @@
/// <reference types="cypress" />
// https://redmine.verdnatura.es/issues/8423
describe.skip('Ticket expedtion', () => {
describe('Ticket expedtion', () => {
const tableContent = '.q-table .q-virtual-scroll__content';
const stateTd = 'td:nth-child(9)';

View File

@ -4,7 +4,6 @@ describe('TicketFilter', () => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/ticket/list');
cy.domContentLoad();
});
it('use search button', function () {

View File

@ -6,7 +6,6 @@ describe('TicketList', () => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/ticket/list');
cy.domContentLoad();
});
const searchResults = (search) => {

View File

@ -1,12 +1,11 @@
/// <reference types="cypress" />
describe('TicketSale', () => {
describe('Free ticket #31', () => {
describe.skip('Free ticket #31', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/ticket/31/sale');
cy.domContentLoad();
});
const firstRow = 'tbody > :nth-child(1)';
@ -121,7 +120,7 @@ describe('TicketSale', () => {
cy.url().should('match', /\/ticket\/31\/log/);
});
});
describe('Ticket prepared #23', () => {
describe.skip('Ticket prepared #23', () => {
beforeEach(() => {
cy.login('developer');
cy.viewport(1920, 1080);

View File

@ -3,7 +3,6 @@ describe('VnInput Component', () => {
cy.login('developer');
cy.viewport(1920, 1080);
cy.visit('/#/supplier/1/fiscal-data');
cy.domContentLoad();
});
it('should replace character at cursor position in insert mode', () => {
@ -14,8 +13,7 @@ describe('VnInput Component', () => {
cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
// Escribe un número y verifica que se reemplace correctamente
cy.dataCy('supplierFiscalDataAccount').type('999');
cy.dataCy('supplierFiscalDataAccount')
.should('have.value', '9990000001');
cy.dataCy('supplierFiscalDataAccount').should('have.value', '9990000001');
});
it('should replace character at cursor position in insert mode', () => {
@ -26,14 +24,12 @@ describe('VnInput Component', () => {
cy.dataCy('supplierFiscalDataAccount').type('{movetostart}');
// Escribe un número y verifica que se reemplace correctamente en la posicion incial
cy.dataCy('supplierFiscalDataAccount').type('999');
cy.dataCy('supplierFiscalDataAccount')
.should('have.value', '9990000001');
cy.dataCy('supplierFiscalDataAccount').should('have.value', '9990000001');
});
it('should respect maxlength prop', () => {
cy.dataCy('supplierFiscalDataAccount').clear();
cy.dataCy('supplierFiscalDataAccount').type('123456789012345');
cy.dataCy('supplierFiscalDataAccount')
.should('have.value', '1234567890'); // asumiendo que maxlength es 10
cy.dataCy('supplierFiscalDataAccount').should('have.value', '1234567890'); // asumiendo que maxlength es 10
});
});

View File

@ -17,7 +17,6 @@ describe('VnLocation', () => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/supplier/567/fiscal-data', { timeout: 7000 });
cy.domContentLoad();
cy.get(createLocationButton).click();
});
it('should filter provinces based on selected country', () => {

View File

@ -18,6 +18,6 @@ describe('WagonCreate', () => {
).type('100');
cy.dataCy('Type_select').type('{downarrow}{enter}');
cy.get('[title="Remove"] > .q-btn__content > .q-icon').click();
cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
});
});

View File

@ -8,7 +8,7 @@ describe('WagonTypeCreate', () => {
it('should create a new wagon type and then delete it', () => {
cy.get('.q-page-sticky > div > .q-btn').click();
cy.get('input').first().type('Example for testing');
cy.dataCy('Name_input').type('Example for testing');
cy.get('[data-cy="FormModelPopup_save"]').click();
cy.get('[title="Remove"] > .q-btn__content > .q-icon').first().click();
});

View File

@ -1,10 +1,25 @@
describe('WorkerCreate', () => {
describe.skip('WorkerCreate', () => {
const externalRadio = '.q-radio:nth-child(2)';
const developerBossId = 120;
const payMethodCross =
'.grid-create .full-width > :nth-child(9) .q-select .q-field__append:not(.q-anchor--skip)';
':nth-child(9) > .q-select > .q-field__inner > .q-field__control > :nth-child(2)';
const saveBtn = '.q-mt-lg > .q-btn--standard';
const internalWithOutPay = {
Fi: { val: '78457139E' },
'Web user': { val: 'manolo' },
Name: { val: 'Manolo' },
'Last name': { val: 'Hurtado' },
'Personal email': { val: 'manolo@mydomain.com' },
Company: { val: 'VNL', type: 'select' },
Street: { val: 'S/ DEFAULTWORKERSTREET' },
Location: { val: 1, type: 'select' },
Phone: { val: '123456789' },
'Worker code': { val: 'DWW' },
Boss: { val: developerBossId, type: 'select' },
Birth: { val: '11-12-2022', type: 'date' },
};
const internal = {
Fi: { val: '78457139E' },
'Web user': { val: 'manolo' },
@ -14,6 +29,7 @@ describe('WorkerCreate', () => {
Company: { val: 'VNL', type: 'select' },
Street: { val: 'S/ DEFAULTWORKERSTREET' },
Location: { val: 1, type: 'select' },
'Pay method': { val: 1, type: 'select' },
Phone: { val: '123456789' },
'Worker code': { val: 'DWW' },
Boss: { val: developerBossId, type: 'select' },
@ -37,17 +53,14 @@ describe('WorkerCreate', () => {
});
it('should throw an error if a pay method has not been selected', () => {
cy.fillInForm(internal);
cy.fillInForm(internalWithOutPay);
cy.get(payMethodCross).click();
cy.get(saveBtn).click();
cy.checkNotification('Payment method is required');
});
it('should create an internal', () => {
cy.fillInForm({
...internal,
'Pay method': { val: 'PayMethod one', type: 'select' },
});
cy.fillInForm(internal);
cy.get(saveBtn).click();
cy.checkNotification('Data created');
});

View File

@ -18,11 +18,11 @@ describe('WorkerNotificationsManager', () => {
cy.visit(`/#/worker/${salesPersonId}/notifications`);
cy.get(firstAvailableNotification).click();
cy.checkNotification(
'The notification subscription of this worker cant be modified'
'The notification subscription of this worker cant be modified',
);
});
it('should active a notification that is yours', () => {
it.skip('should active a notification that is yours', () => {
cy.login('developer');
cy.visit(`/#/worker/${developerId}/notifications`);
cy.waitForElement(activeList);

View File

@ -8,7 +8,8 @@ describe('WorkerPit', () => {
const spousePensionInput = '[data-cy="Spouse Pension_input"]';
const spousePension = '120';
const addRelative = '[data-cy="addRelative"]';
const isDescendantSelect = '[data-cy="Descendant/Ascendant_select"]';
const isDescendantSelect = '[data-cy="Descendant/Ascendant"]';
const Descendant = 'Descendiente';
const birthedInput = '[data-cy="Birth Year_input"]';
const birthed = '2002';
const adoptionYearInput = '[data-cy="Adoption Year_input"]';
@ -28,11 +29,8 @@ describe('WorkerPit', () => {
cy.get(spouseNifInput).type(spouseNif);
cy.get(spousePensionInput).type(spousePension);
cy.get(savePIT).click();
});
it('complete relative', () => {
cy.get(addRelative).click();
cy.get(isDescendantSelect).type('{downArrow}{downArrow}{enter}');
cy.get(isDescendantSelect).type(Descendant);
cy.get(birthedInput).type(birthed);
cy.get(adoptionYearInput).type(adoptionYear);
cy.get(saveRelative).click();

View File

@ -9,13 +9,7 @@ describe('ZoneBasicData', () => {
});
it('should throw an error if the name is empty', () => {
cy.intercept('GET', /\/api\/Zones\/4./).as('zone');
cy.wait('@zone').then(() => {
cy.get('[data-cy="zone-basic-data-name"] input').type(
'{selectall}{backspace}',
);
});
cy.get('[data-cy="zone-basic-data-name"] input').type('{selectall}{backspace}');
cy.get(saveBtn).click();
cy.checkNotification("can't be blank");

Some files were not shown because too many files have changed in this diff Show More