Compare commits

..

No commits in common. "dev" and "hotfix_agencyModes_sortBy" have entirely different histories.

154 changed files with 1530 additions and 3643 deletions

View File

@ -1 +0,0 @@
node_modules

1
.gitignore vendored
View File

@ -31,7 +31,6 @@ yarn-error.log*
# Cypress directories and files
/test/cypress/videos
/test/cypress/screenshots
/junit
# VitePress directories and files
/docs/.vitepress/cache

112
Jenkinsfile vendored
View File

@ -1,7 +1,6 @@
#!/usr/bin/env groovy
def PROTECTED_BRANCH
def IS_LATEST
def BRANCH_ENV = [
test: 'test',
@ -11,22 +10,19 @@ 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
// 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',
@ -37,7 +33,7 @@ node {
props.each {key, value -> echo "${key}: ${value}" }
}
if (IS_PROTECTED_BRANCH) {
if (PROTECTED_BRANCH) {
configFileProvider([
configFile(fileId: "salix-front.branch.${env.BRANCH_NAME}",
variable: 'BRANCH_PROPS_FILE')
@ -62,19 +58,6 @@ 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 = ""
@ -85,89 +68,48 @@ pipeline {
}
stage('Test') {
when {
expression { !IS_PROTECTED_BRANCH }
expression { !PROTECTED_BRANCH }
}
environment {
NODE_ENV = ''
CI = 'true'
TZ = 'Europe/Madrid'
NODE_ENV = ""
}
parallel {
stage('Unit') {
steps {
sh 'pnpm run test:front:ci'
}
post {
always {
junit(
testResults: 'junit/vitest.xml',
allowEmptyResults: true
)
}
}
}
stage('E2E') {
environment {
CREDS = 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 {
script {
sh 'rm -f junit/e2e-*.xml'
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 login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
sh "docker-compose ${env.COMPOSE_PARAMS} up -d"
image.inside("--network ${env.COMPOSE_PROJECT}_default -e CI -e TZ") {
sh 'sh test/cypress/cypressParallel.sh 2'
}
}
}
post {
always {
sh "docker-compose ${env.COMPOSE_PARAMS} down -v"
junit(
testResults: 'junit/e2e-*.xml',
allowEmptyResults: true
)
}
}
steps {
sh 'pnpm run test:unit:ci'
}
post {
always {
junit(
testResults: 'junitresults.xml',
allowEmptyResults: true
)
}
}
}
stage('Build') {
when {
expression { IS_PROTECTED_BRANCH }
expression { PROTECTED_BRANCH }
}
environment {
VERSION = readFile 'VERSION.txt'
CREDENTIALS = credentials('docker-registry')
}
steps {
sh 'quasar build'
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')
}
def packageJson = readJSON file: 'package.json'
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
}
dockerBuild()
}
}
stage('Deploy') {
when {
expression { IS_PROTECTED_BRANCH }
}
environment {
VERSION = readFile 'VERSION.txt'
expression { PROTECTED_BRANCH }
}
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:front
pnpm run test:unit
```
### Run e2e tests

View File

@ -1,44 +1,12 @@
import { defineConfig } from 'cypress';
let urlHost, reporter, reporterOptions, timeouts;
if (process.env.CI) {
urlHost = 'front';
reporter = 'junit';
reporterOptions = {
mochaFile: 'junit/e2e-[hash].xml',
};
timeouts = {
defaultCommandTimeout: 30000,
requestTimeout: 30000,
responseTimeout: 60000,
pageLoadTimeout: 60000,
};
} 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,
};
timeouts = {
defaultCommandTimeout: 10000,
requestTimeout: 10000,
responseTimeout: 30000,
pageLoadTimeout: 60000,
};
}
// https://docs.cypress.io/app/tooling/reporters
// https://docs.cypress.io/app/references/configuration
// https://www.npmjs.com/package/cypress-mochawesome-reporter
export default defineConfig({
e2e: {
baseUrl: `http://${urlHost}:9000`,
experimentalStudio: false,
trashAssetsBeforeRuns: false,
defaultBrowser: 'chromium',
baseUrl: 'http://localhost:9000/',
experimentalStudio: true,
fixturesFolder: 'test/cypress/fixtures',
screenshotsFolder: 'test/cypress/screenshots',
supportFile: 'test/cypress/support/index.js',
@ -46,19 +14,29 @@ export default defineConfig({
downloadsFolder: 'test/cypress/downloads',
video: false,
specPattern: 'test/cypress/integration/**/*.spec.js',
experimentalRunAllSpecs: true,
watchForFileChanges: true,
reporter,
reporterOptions,
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,
},
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,
...timeouts,
includeShadowDom: true,
waitForAnimations: true,
},
});

7
docker-compose.yml Normal file
View File

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

View File

@ -1,45 +0,0 @@
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@14.1.0 \
&& cypress install
WORKDIR /app

View File

@ -1,6 +1,6 @@
{
"name": "salix-front",
"version": "25.12.0",
"version": "25.08.0",
"description": "Salix frontend",
"productName": "Salix",
"author": "Verdnatura",
@ -13,11 +13,9 @@
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
"test:e2e": "cypress open",
"test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run",
"test:e2e:parallel": "bash ./test/cypress/cypressParallel.sh",
"test:e2e:summary": "bash ./test/cypress/summary.sh",
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
"test:front": "vitest",
"test:front:ci": "vitest run",
"test:unit": "vitest",
"test:unit:ci": "vitest run",
"commitlint": "commitlint --edit",
"prepare": "npx husky install",
"addReferenceTag": "node .husky/addReferenceTag.js",
@ -49,20 +47,18 @@
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
"@vue/test-utils": "^2.4.4",
"autoprefixer": "^10.4.14",
"cypress": "^14.1.0",
"cypress": "^13.6.6",
"cypress-mochawesome-reporter": "^3.8.2",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-vue": "^9.32.0",
"husky": "^8.0.0",
"mocha": "^11.1.0",
"postcss": "^8.4.23",
"prettier": "^3.4.2",
"sass": "^1.83.4",
"vitepress": "^1.6.3",
"vitest": "^0.34.0",
"xunit-viewer": "^10.6.1"
"vitest": "^0.34.0"
},
"engines": {
"node": "^20 || ^18 || ^16",

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -11,7 +11,6 @@
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 {
@ -109,17 +108,13 @@ export default configure(function (/* ctx */) {
},
proxy: {
'/api': {
target: target,
target: 'http://0.0.0.0:3000',
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,7 +12,6 @@ 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();
@ -289,12 +288,7 @@ 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;
@ -331,7 +325,6 @@ defineExpose({
class="q-pa-md"
:style="maxWidth ? 'max-width: ' + maxWidth : ''"
id="formModel"
:mapper="onBeforeSave"
>
<QCard>
<slot

View File

@ -57,7 +57,7 @@ const refresh = () => window.location.reload();
:class="{
'no-visible': !stateQuery.isLoading().value,
}"
size="sm"
size="xs"
data-cy="loading-spinner"
/>
<QSpace />
@ -85,15 +85,7 @@ const refresh = () => window.location.reload();
</QTooltip>
<PinnedModules ref="pinnedModulesRef" />
</QBtn>
<QBtn
class="q-pa-none"
rounded
dense
flat
no-wrap
id="user"
data-cy="userPanel_btn"
>
<QBtn class="q-pa-none" rounded dense flat no-wrap id="user">
<VnAvatar
:worker-id="user.id"
:title="user.name"

View File

@ -12,7 +12,7 @@ defineProps({ row: { type: Object, required: true } });
>
<QIcon name="vn:claims" size="xs">
<QTooltip>
{{ $t('ticketSale.claim') }}:
{{ t('ticketSale.claim') }}:
{{ row.claim?.claimFk }}
</QTooltip>
</QIcon>

View File

@ -51,6 +51,10 @@ const $props = defineProps({
type: Boolean,
default: true,
},
rightSearchIcon: {
type: Boolean,
default: true,
},
rowClick: {
type: [Function, Boolean],
default: null,
@ -685,7 +689,6 @@ 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>
@ -945,7 +948,6 @@ const rowCtrlClickFunction = computed(() => {
:key="index"
:title="btn.title"
:icon="btn.icon"
data-cy="cardBtn"
class="q-pa-xs"
:class="
btn.isPrimary

View File

@ -1,9 +1,12 @@
<script setup>
import { nextTick, ref } from 'vue';
import VnInput from './VnInput.vue';
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard';
import { nextTick, ref, watch } from 'vue';
import { QInput } from 'quasar';
const $props = defineProps({
modelValue: {
type: String,
default: '',
},
insertable: {
type: Boolean,
default: false,
@ -11,25 +14,70 @@ const $props = defineProps({
});
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
const model = defineModel({ prop: 'modelValue' });
const inputRef = ref(false);
function setCursorPosition(pos) {
const input = inputRef.value.vnInputRef.$el.querySelector('input');
input.focus();
input.setSelectionRange(pos, pos);
let internalValue = ref($props.modelValue);
watch(
() => $props.modelValue,
(newVal) => {
internalValue.value = newVal;
}
);
watch(
() => internalValue.value,
(newVal) => {
emit('update:modelValue', newVal);
accountShortToStandard();
}
);
const handleKeydown = (e) => {
if (e.key === 'Backspace') return;
if (e.key === '.') {
accountShortToStandard();
// TODO: Fix this setTimeout, with nextTick doesn't work
setTimeout(() => {
setCursorPosition(0, e.target);
}, 1);
return;
}
if ($props.insertable && e.key.match(/[0-9]/)) {
handleInsertMode(e);
}
};
function setCursorPosition(pos, el = vnInputRef.value) {
el.focus();
el.setSelectionRange(pos, pos);
}
async function handleUpdateModel(val) {
model.value = val?.at(-1) === '.' ? useAccountShortToStandard(val) : val;
await nextTick(() => setCursorPosition(0));
const vnInputRef = ref(false);
const handleInsertMode = (e) => {
e.preventDefault();
const input = e.target;
const cursorPos = input.selectionStart;
const { maxlength } = vnInputRef.value;
let currentValue = internalValue.value;
if (!currentValue) currentValue = e.key;
const newValue = e.key;
if (newValue && !isNaN(newValue) && cursorPos < maxlength) {
internalValue.value =
currentValue.substring(0, cursorPos) +
newValue +
currentValue.substring(cursorPos + 1);
}
nextTick(() => {
input.setSelectionRange(cursorPos + 1, cursorPos + 1);
});
};
function accountShortToStandard() {
internalValue.value = internalValue.value?.replace(
'.',
'0'.repeat(11 - internalValue.value.length)
);
}
</script>
<template>
<VnInput
v-model="model"
ref="inputRef"
:insertable
@update:model-value="handleUpdateModel"
/>
<QInput @keydown="handleKeydown" ref="vnInputRef" v-model="internalValue" />
</template>

View File

@ -83,7 +83,7 @@ const mixinRules = [
requiredFieldRule,
...($attrs.rules ?? []),
(val) => {
const maxlength = $props.maxlength;
const { maxlength } = vnInputRef.value;
if (maxlength && +val.length > maxlength)
return t(`maxLength`, { value: maxlength });
const { min, max } = vnInputRef.value.$attrs;
@ -108,7 +108,7 @@ const handleInsertMode = (e) => {
e.preventDefault();
const input = e.target;
const cursorPos = input.selectionStart;
const maxlength = $props.maxlength;
const { maxlength } = vnInputRef.value;
let currentValue = value.value;
if (!currentValue) currentValue = e.key;
const newValue = e.key;
@ -143,7 +143,7 @@ const handleUppercase = () => {
:rules="mixinRules"
:lazy-rules="true"
hide-bottom-space
:data-cy="($attrs['data-cy'] ?? $attrs.label) + '_input'"
:data-cy="$attrs.dataCy ?? $attrs.label + '_input'"
>
<template #prepend v-if="$slots.prepend">
<slot name="prepend" />

View File

@ -107,7 +107,6 @@ 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,7 +641,15 @@ 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"
/>
@ -651,26 +659,6 @@ 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" data-cy="descriptor_actions">
<div class="actions justify-center">
<slot name="actions" :entity="entity" />
</div>
<slot name="after" />

View File

@ -132,8 +132,7 @@ const card = toRef(props, 'item');
display: flex;
flex-direction: column;
gap: 4px;
white-space: nowrap;
width: 192px;
p {
margin-bottom: 0;
}

View File

@ -245,7 +245,7 @@ export function useArrayData(key, userOptions) {
async function loadMore() {
if (!store.hasMoreData) return;
store.skip = (store?.filter?.limit ?? store.limit) * store.page;
store.skip = store.limit * store.page;
store.page += 1;
await fetch({ append: true });

View File

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

View File

@ -369,7 +369,6 @@ globals:
countryFk: Country
countryCodeFk: Country
companyFk: Company
nickname: Alias
model: Model
fuel: Fuel
active: Active

View File

@ -370,7 +370,6 @@ globals:
countryFk: País
countryCodeFk: País
companyFk: Empresa
nickname: Alias
errors:
statusUnauthorized: Acceso denegado
statusInternalServerError: Ha ocurrido un error interno del servidor
@ -791,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,7 +27,6 @@ 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;
@ -57,12 +56,6 @@ 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'),
@ -132,10 +125,6 @@ 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`);
@ -211,7 +200,6 @@ 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">
@ -324,20 +312,6 @@ 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) }}
@ -380,7 +354,7 @@ async function post(query, params) {
(value) =>
updateDestination(
value,
props.row,
props.row
)
"
/>
@ -397,17 +371,6 @@ 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"
@ -431,6 +394,17 @@ 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.attendedBy')"
:label="t('claim.assignedTo')"
v-model="data.workerFk"
:options="workersOptions"
option-value="id"

View File

@ -210,7 +210,6 @@ function onDrag() {
class="all-pointer-events absolute delete-button zindex"
@click.stop="viewDeleteDms(index)"
round
:data-cy="`delete-button-${index+1}`"
/>
<QIcon
name="play_circle"
@ -228,7 +227,6 @@ function onDrag() {
class="rounded-borders cursor-pointer fit"
@click="openDialog(media.dmsFk)"
v-if="!media.isVideo"
:data-cy="`file-${index+1}`"
>
</QImg>
<video
@ -237,7 +235,6 @@ function onDrag() {
muted="muted"
v-if="media.isVideo"
@click="openDialog(media.dmsFk)"
:data-cy="`file-${index+1}`"
/>
</QCard>
</div>

View File

@ -233,27 +233,20 @@ function claimUrl(section) {
<ClaimDescriptorMenu :claim="entity.claim" />
</template>
<template #body="{ entity: { claim, salesClaimed, developments } }">
<QCard class="vn-one">
<QCard class="vn-one" v-if="$route.name != 'ClaimSummary'">
<VnTitle
:url="claimUrl('basic-data')"
:text="t('globals.pageTitles.basicData')"
/>
<VnLv
v-if="$route.name != 'ClaimSummary'"
:label="t('claim.created')"
:value="toDate(claim.created)"
/>
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.state')">
<VnLv :label="t('claim.created')" :value="toDate(claim.created)" />
<VnLv :label="t('claim.state')">
<template #value>
<QChip :color="stateColor(claim.claimState.code)" dense>
{{ claim.claimState.description }}
</QChip>
</template>
</VnLv>
<VnLv
v-if="$route.name != 'ClaimSummary'"
:label="t('globals.salesPerson')"
>
<VnLv :label="t('globals.salesPerson')">
<template #value>
<VnUserLink
:name="claim.client?.salesPersonUser?.name"
@ -261,7 +254,7 @@ function claimUrl(section) {
/>
</template>
</VnLv>
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.attendedBy')">
<VnLv :label="t('claim.attendedBy')">
<template #value>
<VnUserLink
:name="claim.worker?.user?.nickname"
@ -269,7 +262,7 @@ function claimUrl(section) {
/>
</template>
</VnLv>
<VnLv v-if="$route.name != 'ClaimSummary'" :label="t('claim.customer')">
<VnLv :label="t('claim.customer')">
<template #value>
<span class="link cursor-pointer">
{{ claim.client?.name }}
@ -281,11 +274,6 @@ 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,36 +19,30 @@ const columns = [
name: 'itemFk',
label: t('Id item'),
columnFilter: false,
align: 'right',
align: 'left',
},
{
name: 'ticketFk',
label: t('Ticket'),
columnFilter: false,
align: 'right',
align: 'left',
},
{
name: 'claimDestinationFk',
label: t('Destination'),
columnFilter: false,
align: 'right',
},
{
name: 'shelvingCode',
label: t('Shelving'),
columnFilter: false,
align: 'right',
align: 'left',
},
{
name: 'landed',
label: t('Landed'),
format: (row) => toDate(row.landed),
align: 'center',
align: 'left',
},
{
name: 'quantity',
label: t('Quantity'),
align: 'right',
align: 'left',
},
{
name: 'concept',
@ -58,18 +52,18 @@ const columns = [
{
name: 'price',
label: t('Price'),
align: 'right',
align: 'left',
},
{
name: 'discount',
label: t('Discount'),
format: ({ discount }) => toPercentage(discount / 100),
align: 'right',
align: 'left',
},
{
name: 'total',
label: t('Total'),
align: 'right',
align: 'left',
},
];
</script>

View File

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

View File

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

View File

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

View File

@ -118,6 +118,14 @@ const debtWarning = computed(() => {
>
<QTooltip>{{ t('Allowed substitution') }}</QTooltip>
</QIcon>
<QIcon
v-if="customer?.isFreezed"
name="vn:frozen"
size="xs"
color="primary"
>
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
</QIcon>
<QIcon
v-if="!entity.account?.active"
color="primary"
@ -142,14 +150,6 @@ const debtWarning = computed(() => {
>
<QTooltip>{{ t('customer.card.notChecked') }}</QTooltip>
</QIcon>
<QIcon
v-if="entity?.isFreezed"
name="vn:frozen"
size="xs"
color="primary"
>
<QTooltip>{{ t('customer.card.isFrozen') }}</QTooltip>
</QIcon>
<QBtn
v-if="entity.unpaid"
flat
@ -163,13 +163,13 @@ const debtWarning = computed(() => {
<br />
{{
t('unpaidDated', {
dated: toDate(entity.unpaid?.dated),
dated: toDate(customer.unpaid?.dated),
})
}}
<br />
{{
t('unpaidAmount', {
amount: toCurrency(entity.unpaid?.amount),
amount: toCurrency(customer.unpaid?.amount),
})
}}
</QTooltip>

View File

@ -17,21 +17,7 @@ describe('getAddresses', () => {
expect(axios.get).toHaveBeenCalledWith(`Clients/${clientId}/addresses`, {
params: {
filter: JSON.stringify({
include: [
{
relation: 'client',
scope: {
fields: ['defaultAddressFk'],
include: {
relation: 'defaultAddress',
scope: {
fields: ['id', 'agencyModeFk'],
},
},
},
},
],
fields: ['nickname', 'street', 'city', 'id', 'isActive', 'clientFk'],
fields: ['nickname', 'street', 'city', 'id', 'isActive'],
where: { isActive: true },
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
}),

View File

@ -4,21 +4,7 @@ export async function getAddresses(clientId, _filter = {}) {
if (!clientId) return;
const filter = {
..._filter,
include: [
{
relation: 'client',
scope: {
fields: ['defaultAddressFk'],
include: {
relation: 'defaultAddress',
scope: {
fields: ['id', 'agencyModeFk'],
},
},
},
},
],
fields: ['nickname', 'street', 'city', 'id', 'isActive', 'clientFk'],
fields: ['nickname', 'street', 'city', 'id', 'isActive'],
where: { isActive: true },
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
};

View File

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

View File

@ -185,7 +185,6 @@ 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,13 +124,6 @@ const showRefundInvoiceForm = () => {
},
});
};
const showExportationLetter = () => {
openReport(`InvoiceOuts/${$props.invoiceOutData.ref}/exportation-pdf`, {
recipientId: $props.invoiceOutData.client.id,
refFk: $props.invoiceOutData.ref,
});
};
</script>
<template>
@ -163,14 +156,10 @@ const showExportationLetter = () => {
<QMenu anchor="top end" self="top start">
<QList>
<QItem v-ripple clickable @click="showSendInvoiceDialog('pdf')">
<QItemSection data-cy="InvoiceOutDescriptorMenuSendPdfOption">
{{ t('Send PDF') }}
</QItemSection>
<QItemSection>{{ t('Send PDF') }}</QItemSection>
</QItem>
<QItem v-ripple clickable @click="showSendInvoiceDialog('csv')">
<QItemSection data-cy="InvoiceOutDescriptorMenuSendCsvOption">
{{ t('Send CSV') }}
</QItemSection>
<QItemSection>{{ t('Send CSV') }}</QItemSection>
</QItem>
</QList>
</QMenu>
@ -183,7 +172,7 @@ const showExportationLetter = () => {
t('Confirm deletion'),
t('Are you sure you want to delete this invoice?'),
deleteInvoice,
redirectToInvoiceOutList,
redirectToInvoiceOutList
)
"
>
@ -196,7 +185,7 @@ const showExportationLetter = () => {
openConfirmationModal(
'',
t('Are you sure you want to book this invoice?'),
bookInvoice,
bookInvoice
)
"
>
@ -209,7 +198,7 @@ const showExportationLetter = () => {
openConfirmationModal(
t('Generate PDF invoice document'),
t('Are you sure you want to generate/regenerate the PDF invoice?'),
generateInvoicePdf,
generateInvoicePdf
)
"
>
@ -237,14 +226,6 @@ const showExportationLetter = () => {
{{ 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>
@ -274,7 +255,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(`invoiceOut.params.${tag.label}`) }}: </strong>
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
@ -84,6 +84,15 @@ const states = ref();
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
v-model="params.issued"
:label="t('Issued')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInputDate
@ -101,3 +110,37 @@ 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,6 +21,7 @@ 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);
@ -70,6 +71,14 @@ 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',
@ -367,6 +376,7 @@ 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,8 +10,6 @@ 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();
@ -159,11 +157,6 @@ const downloadCSV = async () => {
</QBtn>
</template>
</VnSubToolbar>
<RightMenu>
<template #right-panel>
<InvoiceOutNegativeBasesFilter data-key="negativeFilter" />
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="negativeFilter"
@ -184,7 +177,6 @@ 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,10 +2,9 @@
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({
@ -25,11 +24,11 @@ const props = defineProps({
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`invoiceOut.params.${tag.label}`) }}: </strong>
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<template #body="{ params }">
<QItem>
<QItemSection>
<VnInputDate
@ -50,70 +49,38 @@ const props = defineProps({
</QItem>
<QItem>
<QItemSection>
<VnSelect
url="Companies"
:label="t('globals.company')"
<VnInput
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>
:label="t('globals.company')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
url="Countries"
:label="t('globals.params.countryFk')"
<VnInput
v-model="params.country"
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>
</template>
</VnSelect>
:label="t('globals.country')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnInput
v-model="params.clientId"
:label="t('invoiceOut.negativeBases.clientId')"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
url="Clients"
<VnInput
v-model="params.clientSocialName"
:label="t('globals.client')"
v-model="params.clientId"
outlined
dense
rounded
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
@ -123,18 +90,15 @@ const props = defineProps({
v-model="params.amount"
:label="t('globals.amount')"
is-outlined
:positive="false"
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectWorker
<VnInput
v-model="params.comercialName"
:label="t('invoiceOut.negativeBases.comercial')"
v-model="params.workerName"
option-value="name"
is-outlined
@update:model-value="searchFn()"
/>
</QItemSection>
</QItem>

View File

@ -2,10 +2,9 @@ invoiceOut:
search: Search invoice
searchInfo: You can search by invoice reference
params:
id: ID
company: Company
country: Country
clientId: Client
clientId: Client ID
clientSocialName: Client
taxableBase: Base
ticketFk: Ticket
@ -13,19 +12,6 @@ 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
@ -67,7 +53,7 @@ invoiceOut:
active: Active
hasToInvoice: Has to Invoice
verifiedData: Verified Data
comercial: Sales person
comercial: Commercial
errors:
downloadCsvFailed: CSV download failed
invoiceOutModule:

View File

@ -2,10 +2,9 @@ invoiceOut:
search: Buscar factura emitida
searchInfo: Puedes buscar por referencia de la factura
params:
id: ID
company: Empresa
country: País
clientId: Cliente
clientId: ID del cliente
clientSocialName: Cliente
taxableBase: Base
ticketFk: Ticket
@ -13,19 +12,6 @@ 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

@ -94,7 +94,6 @@ const submit = async (rows) => {
icon="add_circle"
v-shortcut="'+'"
flat
data-cy="addBarcode_input"
>
<QTooltip>
{{ t('Add barcode') }}

View File

@ -226,6 +226,7 @@ const onDenyAccept = (_, responseData) => {
order="shipped ASC, isOk ASC"
:columns="columns"
:user-params="userParams"
:is-editable="true"
:right-search="false"
auto-load
:disable-option="{ card: true }"

View File

@ -8,7 +8,6 @@ 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({
@ -53,7 +52,7 @@ onMounted(async () => {
name: key,
value,
selectedField: { name: key, label: t(`params.${key}`) },
}),
})
);
}
exprBuilder('state', arrayData.store?.userParams?.state);
@ -158,32 +157,6 @@ 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
@ -202,10 +175,11 @@ onMounted(async () => {
</QItem>
<QItem>
<QItemSection>
<QCheckbox
:label="t('params.mine')"
v-model="params.mine"
:toggle-indeterminate="false"
<VnInput
:label="t('params.daysOnward')"
v-model="params.daysOnward"
lazy-rules
is-outlined
/>
</QItemSection>
</QItem>

View File

@ -22,7 +22,7 @@ salesTicketsTable:
notVisible: Not visible
purchaseRequest: Purchase request
clientFrozen: Client frozen
risk: Excess risk
risk: Risk
componentLack: Component lack
tooLittle: Ticket too little
identifier: Identifier

View File

@ -22,7 +22,7 @@ salesTicketsTable:
notVisible: No visible
purchaseRequest: Petición de compra
clientFrozen: Cliente congelado
risk: Exceso de riesgo
risk: Riesgo
componentLack: Faltan componentes
tooLittle: Ticket demasiado pequeño
identifier: Identificador

View File

@ -1,6 +1,6 @@
<script setup>
import { useI18n } from 'vue-i18n';
import { computed, ref, onMounted, watch } from 'vue';
import { computed, ref, onMounted } from 'vue';
import { dashIfEmpty, toCurrency, toDate } from 'src/filters';
import { toDateTimeFormat } from 'src/filters/date';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
@ -16,7 +16,6 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnSection from 'src/components/common/VnSection.vue';
import { getAddresses } from '../Customer/composables/getAddresses';
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
@ -25,11 +24,6 @@ const agencyList = ref([]);
const route = useRoute();
const addressOptions = ref([]);
const dataKey = 'OrderList';
const formInitialData = ref({
active: true,
addressId: null,
clientFk: null,
});
const columns = computed(() => [
{
@ -153,47 +147,32 @@ const columns = computed(() => [
],
},
]);
onMounted(async () => {
if (!route.query) return;
if (route.query?.createForm) {
const query = JSON.parse(route.query?.createForm);
formInitialData.value = query;
await onClientSelected({ ...formInitialData.value, clientFk: query?.clientFk });
} else if (route.query?.table) {
const query = JSON.parse(route.query?.table);
const clientFk = query?.clientFk;
if (clientFk) await onClientSelected({ clientFk });
}
if (tableRef.value) tableRef.value.create.formInitialData = formInitialData.value;
onMounted(() => {
if (!route.query.createForm) return;
const clientId = route.query.createForm;
const id = JSON.parse(clientId);
fetchClientAddress(id.clientFk);
});
watch(
() => route.query.table,
async (newValue) => {
if (newValue) {
const clientFk = +JSON.parse(newValue)?.clientFk;
if (clientFk) await onClientSelected({ clientFk });
if (tableRef.value)
tableRef.value.create.formInitialData = formInitialData.value;
}
},
{ immediate: true },
);
async function onClientSelected({ clientFk }, formData = {}) {
if (!clientFk) {
addressOptions.value = [];
formData.defaultAddressFk = null;
formData.addressId = null;
return;
}
const { data } = await getAddresses(clientFk);
async function fetchClientAddress(id, formData = {}) {
const { data } = await axios.get(`Clients/${id}/addresses`, {
params: {
filter: JSON.stringify({
include: [
{
relation: 'client',
scope: {
fields: ['defaultAddressFk'],
},
},
],
order: ['isActive DESC'],
}),
},
});
addressOptions.value = data;
formData.defaultAddressFk = data[0].client.defaultAddressFk;
formData.addressId = formData.defaultAddressFk;
formInitialData.value = { addressId: formData.addressId, clientFk };
await fetchAgencies(formData);
formData.addressId = data[0].client.defaultAddressFk;
fetchAgencies(formData);
}
async function fetchAgencies({ landed, addressId }) {
@ -202,7 +181,7 @@ async function fetchAgencies({ landed, addressId }) {
const { data } = await axios.get('Agencies/landsThatDay', {
params: {
filter: JSON.stringify({
order: ['name ASC', 'agencyMode DESC', 'agencyModeFk ASC'],
order: ['agencyMode DESC', 'agencyModeFk ASC'],
}),
addressFk: addressId,
landed,
@ -245,7 +224,11 @@ const getDateColor = (date) => {
onDataSaved: (url) => {
tableRef.redirect(`${url}/catalog`);
},
formInitialData,
formInitialData: {
active: true,
addressId: null,
clientFk: null,
},
}"
:user-params="{ showEmpty: false }"
:columns="columns"
@ -277,9 +260,7 @@ const getDateColor = (date) => {
:include="{ relation: 'addresses' }"
v-model="data.clientFk"
:label="t('module.customer')"
@update:model-value="
(id) => onClientSelected({ clientFk: id }, data)
"
@update:model-value="(id) => fetchClientAddress(id, data)"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
@ -304,22 +285,7 @@ const getDateColor = (date) => {
@update:model-value="() => fetchAgencies(data)"
>
<template #option="scope">
<QItem
v-bind="scope.itemProps"
:class="{ disabled: !scope.opt.isActive }"
>
<QItemSection style="min-width: min-content" avatar>
<QIcon
v-if="
scope.opt.isActive &&
data.defaultAddressFk === scope.opt.id
"
size="sm"
color="grey"
name="star"
class="fill-icon"
/>
</QItemSection>
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel
:class="{
@ -347,7 +313,6 @@ const getDateColor = (date) => {
<VnInputDate
v-model="data.landed"
:label="t('module.landed')"
data-cy="landedDate"
@update:model-value="() => fetchAgencies(data)"
/>
<VnSelect

View File

@ -180,7 +180,6 @@ 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;
@ -244,7 +243,7 @@ onUnmounted(() => (stateStore.rightDrawer = false));
</template>
<template #column-invoiceInFk="{ row }">
<span class="link" @click.stop>
{{ row.supplierRef }}
{{ row.invoiceInFk }}
<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.Starting date')"
:label="t('route.Stating date')"
v-model="startingDate"
autofocus
/>

View File

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

View File

@ -45,6 +45,8 @@ 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,15 +1,19 @@
<script setup>
import { computed, onMounted, onUnmounted } from 'vue';
import { onMounted, onUnmounted } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
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 exprBuilder from './ParkingExprBuilder.js';
import ParkingSummary from './Card/ParkingSummary.vue';
import exprBuilder from './ParkingExprBuilder.js';
import VnSection from 'src/components/common/VnSection.vue';
const stateStore = useStateStore();
const { push } = useRouter();
const { t } = useI18n();
const { viewSummary } = useSummaryDialog();
const dataKey = 'ParkingList';
@ -20,48 +24,7 @@ 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"
@ -77,24 +40,41 @@ const columns = computed(() => [
<ParkingFilter data-key="ParkingList" />
</template>
<template #body>
<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 #actions="{ row }">
<QBtn
:label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, ParkingSummary)"
color="primary"
/>
</template>
</VnTable>
<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` })
"
>
<template #list-items>
<VnLv
label="Sector"
:value="row.sector?.description"
/>
<VnLv
:label="t('parking.pickingOrder')"
:value="row.pickingOrder"
/>
</template>
<template #actions>
<QBtn
:label="t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, ParkingSummary)"
color="primary"
/>
</template>
</CardList>
</template>
</VnPaginate>
</div>
</QPage>
</template>
</VnSection>
</template>

View File

@ -1,17 +1,14 @@
<script setup>
import { computed } from 'vue';
import VnPaginate from 'components/ui/VnPaginate.vue';
import CardList from 'components/ui/CardList.vue';
import VnLv from 'components/ui/VnLv.vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
import ShelvingFilter from 'pages/Shelving/Card/ShelvingFilter.vue';
import ShelvingSummary from './Card/ShelvingSummary.vue';
import ShelvingSummary from 'pages/Shelving/Card/ShelvingSummary.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import VnSection from 'src/components/common/VnSection.vue';
import exprBuilder from './ShelvingExprBuilder.js';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnCheckbox from 'src/components/common/VnCheckbox.vue';
const { t } = useI18n();
const router = useRouter();
const { viewSummary } = useSummaryDialog();
const dataKey = 'ShelvingList';
@ -20,56 +17,9 @@ const filter = {
include: [{ relation: 'parking' }],
};
const columns = computed(() => [
{
align: 'left',
name: 'code',
label: t('globals.code'),
isId: true,
isTitle: true,
columnFilter: false,
create: true,
},
{
align: 'left',
name: 'parking',
label: t('shelving.list.parking'),
sortable: true,
format: (val) => val?.code ?? '',
cardVisible: true,
},
{
align: 'left',
name: 'priority',
label: t('shelving.list.priority'),
sortable: true,
cardVisible: true,
create: true,
},
{
align: 'left',
name: 'isRecyclable',
label: t('shelving.summary.recyclable'),
sortable: true,
},
{
align: 'right',
label: '',
name: 'tableActions',
actions: [
{
title: t('components.smartCard.viewSummary'),
icon: 'preview',
action: (row) => viewSummary(row.id, ShelvingSummary),
isPrimary: true,
},
],
},
]);
const onDataSaved = ({ id }) => {
router.push({ name: 'ShelvingBasicData', params: { id } });
};
function navigate(id) {
router.push({ path: `/shelving/${id}` });
}
</script>
<template>
@ -87,75 +37,48 @@ const onDataSaved = ({ id }) => {
<ShelvingFilter data-key="ShelvingList" />
</template>
<template #body>
<VnTable
:data-key="dataKey"
:columns="columns"
is-editable="false"
:right-search="false"
:use-model="true"
:disable-option="{ table: true }"
redirect="shelving"
default-mode="card"
:create="{
urlCreate: 'Shelvings',
title: t('globals.pageTitles.shelvingCreate'),
onDataSaved,
formInitialData: {
parkingFk: null,
priority: null,
code: '',
isRecyclable: false,
},
}"
>
<template #more-create-dialog="{ data }">
<VnSelect
v-model="data.parkingFk"
url="Parkings"
option-value="id"
option-label="code"
:label="t('shelving.list.parking')"
:filter-options="['id', 'code']"
:fields="['id', 'code']"
/>
<VnCheckbox
v-model="data.isRecyclable"
:label="t('shelving.summary.recyclable')"
/>
</template>
</VnTable>
<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="navigate(row.id)"
>
<template #list-items>
<VnLv
:label="$t('shelving.list.parking')"
:title-label="$t('shelving.list.parking')"
:value="row.parking?.code"
/>
<VnLv
:label="$t('shelving.list.priority')"
:value="row?.priority"
/>
</template>
<template #actions>
<QBtn
:label="$t('components.smartCard.openSummary')"
@click.stop="viewSummary(row.id, ShelvingSummary)"
color="primary"
/>
</template>
</CardList>
</template>
</VnPaginate>
</div>
<QPageSticky :offset="[20, 20]">
<RouterLink :to="{ name: 'ShelvingCreate' }">
<QBtn fab icon="add" color="primary" v-shortcut="'+'" />
<QTooltip>
{{ $t('shelving.list.newShelving') }}
</QTooltip>
</RouterLink>
</QPageSticky>
</QPage>
</template>
</VnSection>
</template>
<style lang="scss" scoped>
.list {
display: flex;
flex-direction: column;
align-items: center;
width: 55%;
}
.list-container {
display: flex;
justify-content: center;
}
</style>
<i18n>
es:
shelving:
list:
parking: Estacionamiento
priority: Prioridad
summary:
recyclable: Reciclable
en:
shelving:
list:
parking: Parking
priority: Priority
summary:
recyclable: Recyclable
</i18n>

View File

@ -11,11 +11,6 @@ export default {
'isSerious',
'isTrucker',
'account',
'workerFk',
'note',
'isReal',
'isPayMethodChecked',
'companySize',
],
include: [
{

View File

@ -108,6 +108,7 @@ function handleLocation(data, location) {
<VnAccountNumber
v-model="data.account"
:label="t('supplier.fiscalData.account')"
clearable
data-cy="supplierFiscalDataAccount"
insertable
:maxlength="10"
@ -184,8 +185,8 @@ function handleLocation(data, location) {
/>
<VnCheckbox
v-model="data.isVies"
:label="t('globals.isVies')"
:info="t('whenActivatingIt')"
:label="t('globals.isVies')"
:info="t('whenActivatingIt')"
/>
</div>
</VnRow>

View File

@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n';
import VnTable from 'components/VnTable/VnTable.vue';
import VnSection from 'src/components/common/VnSection.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import FetchData from 'src/components/FetchData.vue';
import { useSummaryDialog } from 'src/composables/useSummaryDialog';
import SupplierSummary from './Card/SupplierSummary.vue';
@ -52,7 +53,7 @@ const columns = computed(() => [
label: t('globals.alias'),
name: 'alias',
columnFilter: {
name: 'nickname',
name: 'search',
},
cardVisible: true,
},
@ -119,21 +120,6 @@ const columns = computed(() => [
],
},
]);
const filterColumns = computed(() => {
const copy = [...columns.value];
copy.splice(copy.length - 1, 0, {
align: 'left',
label: t('globals.params.provinceFk'),
name: 'provinceFk',
options: provincesOptions.value,
columnFilter: {
component: 'select',
},
});
return copy;
});
</script>
<template>
<FetchData
@ -144,7 +130,7 @@ const filterColumns = computed(() => {
/>
<VnSection
:data-key="dataKey"
:columns="filterColumns"
:columns="columns"
prefix="supplier"
:array-data-props="{
url: 'Suppliers/filter',
@ -179,6 +165,17 @@ const filterColumns = computed(() => {
</template>
</VnTable>
</template>
<template #moreFilterPanel="{ params, searchFn }">
<VnSelect
:label="t('globals.params.provinceFk')"
v-model="params.provinceFk"
@update:model-value="searchFn()"
:options="provincesOptions"
filled
dense
class="q-px-sm q-pr-lg"
/>
</template>
</VnSection>
</template>

View File

@ -93,9 +93,9 @@ function ticketFilter(ticket) {
<VnLv :label="t('globals.warehouse')" :value="entity.warehouse?.name" />
<VnLv :label="t('globals.alias')" :value="entity.nickname" />
</template>
<template #icons="{ entity }">
<template #icons>
<QCardActions class="q-gutter-x-xs">
<TicketProblems :row="{ ...entity?.client, ...problems }" />
<TicketProblems :row="problems" />
</QCardActions>
</template>
<template #actions="{ entity }">

View File

@ -681,17 +681,6 @@ watch(
:disabled-attr="isTicketEditable"
>
<template #column-statusIcons="{ row }">
<QIcon
v-if="row.saleGroupFk"
name="inventory_2"
size="xs"
color="primary"
class="cursor-pointer"
>
<QTooltip class="no-pointer-events">
{{ `saleGroup: ${row.saleGroupFk}` }}
</QTooltip>
</QIcon>
<TicketProblems :row="row" />
</template>
<template #body-cell-picture="{ row }">
@ -751,7 +740,7 @@ watch(
{{ row?.item?.subName.toUpperCase() }}
</div>
</div>
<FetchedTags :item="row.item" :max-length="6" />
<FetchedTags :item="row" :max-length="6" />
<QPopupProxy v-if="row.id && isTicketEditable">
<VnInput
v-model="row.concept"

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.parkingCode) }}
{{ dashIfEmpty(row.parkingFk) }}
</QTd>
</template>
<template #body-cell-actions="{ row }">

View File

@ -81,7 +81,6 @@ const openCreateModal = () => createTrackingDialogRef.value.show();
ref="paginateRef"
data-key="TicketTracking"
:user-filter="paginateFilter"
search-url="table"
url="TicketTrackings"
auto-load
order="created DESC"

View File

@ -1,6 +1,6 @@
<script setup>
import axios from 'axios';
import { computed, ref, onBeforeMount, watch, onMounted } from 'vue';
import { computed, ref, onBeforeMount, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useStateStore } from 'stores/useStateStore';
import { useI18n } from 'vue-i18n';
@ -22,6 +22,7 @@ import { toTimeFormat } from 'src/filters/date';
import InvoiceOutDescriptorProxy from 'src/pages/InvoiceOut/Card/InvoiceOutDescriptorProxy.vue';
import TicketProblems from 'src/components/TicketProblems.vue';
import VnSection from 'src/components/common/VnSection.vue';
import { getClient } from 'src/pages/Customer/composables/getClient';
import { getAddresses } from 'src/pages/Customer/composables/getAddresses';
import { getAgencies } from 'src/pages/Route/Agency/composables/getAgencies';
@ -50,21 +51,10 @@ const userParams = {
onBeforeMount(() => {
initializeFromQuery();
stateStore.rightDrawer = true;
});
onMounted(async () => {
if (!route.query) return;
if (route.query?.createForm) {
formInitialData.value = JSON.parse(route.query?.createForm);
await onClientSelected(formInitialData.value);
} else if (route.query?.table) {
const query = route.query?.table;
const clientId = +JSON.parse(query)?.clientFk;
if (clientId) await onClientSelected({ clientId });
}
if (tableRef.value) tableRef.value.create.formInitialData = formInitialData.value;
if (!route.query.createForm) return;
onClientSelected(JSON.parse(route.query.createForm));
});
const initializeFromQuery = () => {
if (!route) return;
const query = route.query.table ? JSON.parse(route.query.table) : {};
from.value = query.from || from.toISOString();
to.value = query.to || to.toISOString();
@ -79,6 +69,7 @@ const companiesOptions = ref([]);
const accountingOptions = ref([]);
const amountToReturn = ref();
const dataKey = 'TicketList';
const filterPanelRef = ref(null);
const formInitialData = ref({});
const columns = computed(() => [
@ -260,38 +251,7 @@ const columns = computed(() => [
],
},
]);
const onClientSelected = async (formData) => {
resetAgenciesSelector(formData);
await fetchAddresses(formData);
};
const fetchAddresses = async (formData) => {
if (!formData.clientId) {
addressesOptions.value = [];
formData.defaultAddressFk = null;
formData.addressId = null;
return;
}
const { data } = await getAddresses(formData.clientId);
formInitialData.value = { clientId: formData.clientId };
if (!data) return;
addressesOptions.value = data;
selectedClient.value = data[0].client;
formData.addressId = selectedClient.value.defaultAddressFk;
formInitialData.value.addressId = formData.addressId;
};
watch(
() => route.query.table,
async (newValue) => {
if (newValue) {
const clientId = +JSON.parse(newValue)?.clientFk;
if (clientId) await onClientSelected({ clientId });
if (tableRef.value)
tableRef.value.create.formInitialData = formInitialData.value;
}
},
{ immediate: true },
);
function resetAgenciesSelector(formData) {
agenciesOptions.value = [];
if (formData) formData.agencyModeId = null;
@ -302,6 +262,12 @@ function redirectToLines(id) {
window.open(url, '_blank');
}
const onClientSelected = async (formData) => {
resetAgenciesSelector(formData);
await fetchClient(formData);
await fetchAddresses(formData);
};
const fetchAvailableAgencies = async (formData) => {
resetAgenciesSelector(formData);
const response = await getAgencies(formData, selectedClient.value);
@ -312,6 +278,22 @@ const fetchAvailableAgencies = async (formData) => {
if (agency) formData.agencyModeId = agency.agencyModeFk;
};
const fetchClient = async (formData) => {
const response = await getClient(formData.clientId);
if (!response) return;
const [client] = response.data;
selectedClient.value = client;
};
const fetchAddresses = async (formData) => {
const response = await getAddresses(formData.clientId);
if (!response) return;
addressesOptions.value = response.data;
const { defaultAddress } = selectedClient.value;
formData.addressId = defaultAddress.id;
};
const getColor = (row) => {
if (row.alertLevelCode === 'OK') return 'bg-success';
else if (row.alertLevelCode === 'FREE') return 'bg-notice';
@ -463,6 +445,22 @@ function setReference(data) {
dialogData.value.value.description = newDescription;
}
watch(
() => route.query.table,
(newValue) => {
if (newValue) {
const clientId = +JSON.parse(newValue)?.clientFk;
if (!clientId) return;
formInitialData.value = {
clientId,
};
if (tableRef.value) tableRef.value.create.formInitialData = { clientId };
onClientSelected({ clientId });
}
},
{ immediate: true },
);
</script>
<template>

View File

@ -2,7 +2,6 @@
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';
@ -23,8 +22,6 @@ 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());
@ -146,7 +143,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('extraCommunity.cargoShip'),
label: t('globals.pageTitles.supplier'),
field: 'cargoSupplierNickname',
name: 'cargoSupplierNickname',
align: 'left',
@ -174,7 +171,7 @@ const columns = computed(() => [
? value.reduce((sum, entry) => {
return sum + (entry.invoiceAmount || 0);
}, 0)
: 0,
: 0
),
},
{
@ -203,7 +200,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('extraCommunity.kg'),
label: t('kg'),
field: 'kg',
name: 'kg',
align: 'left',
@ -211,7 +208,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('extraCommunity.physicKg'),
label: t('physicKg'),
field: 'loadedKg',
name: 'loadedKg',
align: 'left',
@ -235,7 +232,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('extraCommunity.shipped'),
label: t('shipped'),
field: 'shipped',
name: 'shipped',
align: 'left',
@ -252,7 +249,7 @@ const columns = computed(() => [
sortable: true,
},
{
label: t('extraCommunity.landed'),
label: t('landed'),
field: 'landed',
name: 'landed',
align: 'left',
@ -261,7 +258,7 @@ const columns = computed(() => [
format: (value) => toDate(value),
},
{
label: t('extraCommunity.notes'),
label: t('notes'),
field: '',
name: 'notes',
align: 'center',
@ -287,7 +284,7 @@ watch(
if (!arrayData.store.data) return;
onStoreDataChange();
},
{ deep: true, immediate: true },
{ deep: true, immediate: true }
);
const openReportPdf = () => {
@ -454,24 +451,13 @@ 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('extraCommunity.searchExtraCommunity')"
:label="t('searchExtraCommunity')"
/>
<RightMenu>
<template #right-panel>
@ -535,7 +521,7 @@ watch(route, () => {
? tableColumnComponents[col.name].event(
rows[props.rowIndex][col.field],
col.field,
props.rowIndex,
props.rowIndex
)
: {}
"
@ -560,7 +546,7 @@ watch(route, () => {
},
{
link: ['id', 'cargoSupplierNickname'].includes(
col.name,
col.name
),
},
]"
@ -578,8 +564,9 @@ watch(route, () => {
</component>
</QTd>
</QTr>
<QTr
v-for="(entry, index) in filteredEntries(props.row.entries)"
v-for="(entry, index) in props.row.entries"
:key="index"
:props="props"
class="bg-vn-secondary-row cursor-pointer"
@ -611,7 +598,7 @@ watch(route, () => {
name="warning"
color="negative"
size="md"
:title="t('extraCommunity.requiresInspection')"
:title="t('requiresInspection')"
>
</QIcon>
</QTd>
@ -722,3 +709,24 @@ watch(route, () => {
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(`extraCommunity.filter.${tag.label}`) }}: </strong>
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
@ -93,7 +93,7 @@ warehouses();
<QItem>
<QItemSection>
<VnInput
:label="t('extraCommunity.filter.reference')"
:label="t('params.reference')"
v-model="params.reference"
is-outlined
/>
@ -104,7 +104,7 @@ warehouses();
<QInput
v-model="params.totalEntries"
type="number"
:label="t('extraCommunity.filter.totalEntries')"
:label="t('params.totalEntries')"
dense
outlined
rounded
@ -134,10 +134,10 @@ warehouses();
<QItem>
<QItemSection>
<VnSelect
:label="t('extraCommunity.filter.agencyModeFk')"
:label="t('params.agencyModeFk')"
v-model="params.agencyModeFk"
:options="agenciesOptions"
option-value="id"
option-value="agencyFk"
option-label="name"
hide-selected
dense
@ -149,7 +149,7 @@ warehouses();
<QItem>
<QItemSection>
<VnInputDate
:label="t('extraCommunity.filter.shippedFrom')"
:label="t('params.shippedFrom')"
v-model="params.shippedFrom"
@update:model-value="searchFn()"
is-outlined
@ -159,7 +159,7 @@ warehouses();
<QItem>
<QItemSection>
<VnInputDate
:label="t('extraCommunity.filter.landedTo')"
:label="t('params.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('extraCommunity.filter.warehouseOutFk')"
:label="t('params.warehouseOutFk')"
v-model="params.warehouseOutFk"
:options="warehousesByContinent[params.continent]"
option-value="id"
@ -184,7 +184,7 @@ warehouses();
<QItem v-else>
<QItemSection>
<VnSelect
:label="t('extraCommunity.filter.warehouseOutFk')"
:label="t('params.warehouseOutFk')"
v-model="params.warehouseOutFk"
:options="warehousesOptions"
option-value="id"
@ -199,7 +199,7 @@ warehouses();
<QItem>
<QItemSection>
<VnSelect
:label="t('extraCommunity.filter.warehouseInFk')"
:label="t('params.warehouseInFk')"
v-model="params.warehouseInFk"
:options="warehousesOptions"
option-value="id"
@ -214,7 +214,6 @@ warehouses();
<QItem>
<QItemSection>
<VnSelectSupplier
:label="t('extraCommunity.cargoShip')"
v-model="params.cargoSupplierFk"
hide-selected
dense
@ -223,21 +222,10 @@ warehouses();
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelectSupplier
v-model="params.entrySupplierFk"
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
:label="t('extraCommunity.filter.continent')"
:label="t('params.continent')"
v-model="params.continent"
:options="continentsOptions"
option-value="code"
@ -253,3 +241,30 @@ 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

@ -1,22 +0,0 @@
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

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

View File

@ -54,8 +54,9 @@ watch(
selected.value = [];
}
},
{ immediate: true, deep: true },
{ immediate: true, deep: true }
);
</script>
<template>
@ -104,7 +105,6 @@ watch(
:options="trainsData"
hide-selected
v-model="row.trainFk"
:required="true"
/>
</VnRow>
<VnRow>
@ -115,14 +115,12 @@ 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>
@ -177,7 +175,6 @@ 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,8 +26,3 @@ const { t } = useI18n();
</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,7 +140,6 @@ function reloadData() {
id="deviceProductionFk"
hide-selected
data-cy="pda-dialog-select"
:required="true"
>
<template #option="scope">
<QItem v-bind="scope.itemProps">

View File

@ -176,7 +176,6 @@ 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

@ -343,29 +343,19 @@ const updateData = async () => {
const getMailStates = async (date) => {
const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
const year = date.getFullYear();
const month = date.getMonth() + 1;
const getMonthStates = async (month, year) => {
return (await axios.get(url, { params: { month, year } })).data;
const prevMonth = month == 1 ? 12 : month - 1;
const params = {
month,
year: date.getFullYear(),
};
const curMonthStates = await getMonthStates(month, year);
const curMonthStates = (await axios.get(url, { params })).data;
const prevMonthStates = (
await axios.get(url, { params: { ...params, month: prevMonth } })
).data;
const prevMonthStates = await getMonthStates(
month === 1 ? 12 : month - 1,
month === 1 ? year - 1 : year,
);
const postMonthStates = await getMonthStates(
month === 12 ? 1 : month + 1,
month === 12 ? year + 1 : year,
);
workerTimeControlMails.value = [
...curMonthStates,
...prevMonthStates,
...postMonthStates,
];
workerTimeControlMails.value = curMonthStates.concat(prevMonthStates);
};
const showWorkerTimeForm = (propValue, formType) => {

View File

@ -279,11 +279,7 @@ async function autofillBic(worker) {
/>
</VnRow>
<VnRow>
<VnInput
v-model="data.fi"
:label="t('worker.create.fi')"
required
/>
<VnInput v-model="data.fi" :label="t('worker.create.fi')" />
<VnInputDate
v-model="data.birth"
:label="t('worker.create.birth')"

View File

@ -9,22 +9,22 @@ import VnInputTime from 'src/components/common/VnInputTime.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
const { t } = useI18n();
const validAddresses = ref([]);
const addresses = ref([]);
const setFilteredAddresses = (data) => {
addresses.value = data.map(({ address }) => address);
const validIds = new Set(validAddresses.value.map((item) => item.addressFk));
addresses.value = data.filter((address) => validIds.has(address.id));
};
</script>
<template>
<FetchData
url="RoadmapAddresses"
:filter="{
include: { relation: 'address' },
}"
auto-load
@on-fetch="setFilteredAddresses"
@on-fetch="(data) => (validAddresses = data)"
/>
<FetchData url="Addresses" auto-load @on-fetch="setFilteredAddresses" />
<FormModel auto-load model="Zone">
<template #form="{ data, validate }">
<VnRow>
@ -120,10 +120,12 @@ const setFilteredAddresses = (data) => {
option-label="nickname"
:options="addresses"
:fields="['id', 'nickname']"
sort-by="nickname ASC"
sort-by="id"
hide-selected
map-options
:rules="validate('data.addressFk')"
:filter-options="['id']"
:where="filterWhere"
/>
</VnRow>
<VnRow>

View File

@ -39,12 +39,7 @@ const agencies = ref([]);
<template #body="{ params, searchFn }">
<QItem>
<QItemSection>
<VnInput
:label="t('list.name')"
v-model="params.name"
is-outlined
data-cy="zoneFilterPanelNameInput"
/>
<VnInput :label="t('list.name')" v-model="params.name" is-outlined />
</QItemSection>
</QItem>
<QItem>
@ -59,7 +54,6 @@ 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="containerShrinked q-pa-md">
<QCard class="full-width q-pa-md">
<div
v-for="(detail, index) in details"
:key="index"

View File

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

View File

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

View File

@ -111,6 +111,15 @@ export default {
shelvingCard,
],
},
{
path: 'create',
name: 'ShelvingCreate',
meta: {
title: 'shelvingCreate',
icon: 'add',
},
component: () => import('src/pages/Shelving/Card/ShelvingForm.vue'),
},
{
path: 'parking',
name: 'ParkingMain',

View File

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

View File

@ -1,149 +0,0 @@
{
"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

@ -1,15 +0,0 @@
#!/bin/bash
find 'test/cypress/integration' \
-mindepth 1 \
-maxdepth 1 \
-type d | \
xargs -P "$1" -I {} sh -c '
echo "🔷 {}" &&
xvfb-run -a cypress run \
--headless \
--spec "{}" \
--quiet \
> /dev/null
'
wait

View File

@ -1,21 +0,0 @@
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 = 1;
const claimId = 2;
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({ force: true });
cy.get('[title="Change destination"]').click();
cy.selectOption(destinationRow, 'Confeccion');
cy.get('.q-card > .q-card__actions > .q-btn--standard').click({ force: true });
cy.get('.q-card > .q-card__actions > .q-btn--standard').click();
});
it('should regularize', () => {

View File

@ -10,6 +10,8 @@ describe('ClaimDevelopment', () => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
cy.intercept('GET', /\/api\/Workers\/search/).as('workers');
cy.waitForElement('tbody');
});
@ -33,7 +35,9 @@ describe('ClaimDevelopment', () => {
cy.saveCard();
});
it('should add and remove new line', () => {
// TODO: #8112
xit('should add and remove new line', () => {
cy.wait(['@workers', '@workers']);
cy.addCard();
cy.waitForElement(thirdRow);

View File

@ -8,11 +8,7 @@ describe('ClaimNotes', () => {
it('should add a new note', () => {
const message = 'This is a new message.';
cy.get('.q-textarea')
.should('be.visible')
.should('not.be.disabled')
.type(message);
cy.get('.q-textarea').type(message);
cy.get(saveBtn).click();
cy.get(firstNote).should('have.text', message);
});

View File

@ -1,7 +1,6 @@
/// <reference types="cypress" />
describe('ClaimPhoto', () => {
const carrouselClose =
'.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon';
// redmine.verdnatura.es/issues/8417
describe.skip('ClaimPhoto', () => {
beforeEach(() => {
const claimId = 1;
cy.login('developer');
@ -13,38 +12,49 @@ describe('ClaimPhoto', () => {
cy.get('label > .q-btn input').selectFile('test/cypress/fixtures/image.jpg', {
force: true,
});
cy.checkNotification('Data saved');
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
it('should add new file with drag and drop', () => {
cy.get('.container').should('be.visible').and('exist');
cy.get('.container').selectFile('test/cypress/fixtures/image.jpg', {
action: 'drag-drop',
});
cy.checkNotification('Data saved');
cy.get('.q-notification__message').should('have.text', 'Data saved');
});
it('should open first image dialog change to second and close', () => {
cy.dataCy('file-1').click();
cy.get(carrouselClose).click();
cy.get(
':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image'
).click();
cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should(
'be.visible'
);
cy.dataCy('file-1').click();
cy.get('.q-carousel__control > button').as('nextButton').click();
cy.get('.q-carousel__slide > .q-ma-none').should('be.visible');
cy.get(carrouselClose).click();
cy.get('.q-carousel__control > .q-btn > .q-btn__content > .q-icon').click();
cy.get(
'.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'
);
});
it('should remove third and fourth file', () => {
cy.dataCy('delete-button-4').click();
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
).click();
cy.checkNotification('Data deleted');
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
).click();
cy.get('.q-notification__message').should('have.text', 'Data deleted');
cy.dataCy('delete-button-3').click();
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block',
'.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon'
).click();
cy.checkNotification('Data deleted');
cy.get(
'.q-card__actions > .q-btn--unelevated > .q-btn__content > .block'
).click();
cy.get('.q-notification__message').should('have.text', 'Data deleted');
});
});

View File

@ -4,6 +4,7 @@ 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').clear().type('123456789');
cy.dataCy('customerPhone').find('input').type('123456789');
cy.get('.q-btn-group > .q-btn--standard').click();
cy.intercept('PATCH', '/api/Clients/1102', (req) => {
const { body } = req;

View File

@ -4,6 +4,7 @@ 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,6 +1,7 @@
/// <reference types="cypress" />
describe('Client list', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/customer/list', {
timeout: 5000,
@ -27,7 +28,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: 'others', type: 'select' },
'Business type': { val: 'Otros', type: 'select' },
};
cy.fillInForm(data);
@ -36,7 +37,6 @@ 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);
@ -58,23 +58,13 @@ describe('Client list', () => {
cy.waitForElement('.q-form');
cy.checkValueForm(1, search);
cy.checkValueForm(2, search);
cy.dataCy('Customer_select').should('have.value', search);
cy.dataCy('Address_select').should('have.value', search);
});
it('Client founded create order', () => {
const search = 'Jessica Jones';
cy.intercept('GET', /\/api\/Clients\/1110\/summary/).as('customer');
cy.dataCy('Name_input').type(`${search}{enter}`);
cy.wait('@customer');
cy.get('.actions > .q-card__actions').should('exist');
cy.searchByLabel('Name', search);
cy.clickButtonWith('icon', 'icon-basketadd');
cy.url().should('include', `/customer/1110/summary`);
cy.waitForElement('#formModel');
cy.waitForElement('.q-form');
cy.checkValueForm(1, search);
cy.dataCy('Client_select').should('have.value', search);
cy.dataCy('Address_select').should('have.value', search);
});
});

View File

@ -12,7 +12,7 @@ describe('Client web-access', () => {
cy.get('.q-btn-group > :nth-child(1)').should('not.be.disabled');
cy.get('.q-checkbox__inner').click();
cy.get('.q-btn-group > .q-btn--standard.q-btn--actionable').should(
'not.be.disabled',
'not.be.disabled'
);
cy.get('.q-btn-group > .q-btn--flat').should('not.be.disabled');
cy.get('.q-btn-group > :nth-child(1)').click();

View File

@ -20,7 +20,7 @@ describe('Entry', () => {
);
});
it.skip('Create entry, modify travel and add buys', () => {
it('Create entry, modify travel and add buys', () => {
createEntryAndBuy();
cy.get('a[data-cy="EntryBasicData-menu-item"]').click();
selectTravel('two');
@ -184,8 +184,9 @@ describe('Entry', () => {
}
function deleteEntry() {
cy.get('[data-cy="descriptor-more-opts"]').should('be.visible').click();
cy.waitForElement('div[data-cy="delete-entry"]').click();
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.url().should('include', 'list');
}

View File

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

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