Merge branch 'test' into warmfix_ticketNegative
gitea/salix-front/pipeline/pr-test There was a failure building this commit
Details
gitea/salix-front/pipeline/pr-test There was a failure building this commit
Details
This commit is contained in:
commit
7d10560493
|
@ -0,0 +1 @@
|
|||
node_modules
|
38
CHANGELOG.md
38
CHANGELOG.md
|
@ -1,3 +1,41 @@
|
|||
# Version 25.08 - 2025-03-04
|
||||
|
||||
### Added 🆕
|
||||
|
||||
- feat: add order for table (origin/8681_ticketAdvance_updates) by:Javier Segarra
|
||||
- feat: detect when is descriptor proxy by:Javier Segarra
|
||||
- feat: refs #7356 update CrudModel by:Javier Segarra
|
||||
- feat: refs #8242 remove teleport by:Javier Segarra
|
||||
- feat: refs #8242 use stateStore by:Javier Segarra
|
||||
- fix: fixed negative bases style by:Jon
|
||||
- fix: fixed style when clicking on icons by:Jon
|
||||
- refactor: refs #6897 remove debug logs and unused style (origin/6897-fixSomeCaus) by:pablone
|
||||
- style: refs #7356 eslint format by:Javier Segarra
|
||||
|
||||
### Changed 📦
|
||||
|
||||
- perf: refs #7356 minor changes (origin/7356_ticketService) by:Javier Segarra
|
||||
- refactor: refs #6897 remove debug logs and unused style (origin/6897-fixSomeCaus) by:pablone
|
||||
- refactor: refs #6897 update component props and attributes for consistency and improved functionality (origin/6897-fixMinorIssues) by:pablone
|
||||
- refactor: refs #6897 update component props and improve UI handling in Entry pages by:pablone
|
||||
- refactor: refs #6897 update VnTable components for improved value handling and UI adjustments (origin/6897-minorFixes) by:pablone
|
||||
- refactor: refs #8697 simplify date handling in ItemDiary component by:pablone
|
||||
|
||||
### Fixed 🛠️
|
||||
|
||||
- fix: add datakey by:Javier Segarra
|
||||
- fix: fixed account descriptor menu and created e2e by:Jon
|
||||
- fix: fixed negative bases style by:Jon
|
||||
- fix: fixed style when clicking on icons by:Jon
|
||||
- fix: refs #6553 workerBusiness (origin/6553-fixWorkerBusinessV2) by:carlossa
|
||||
- fix: refs #6553 workerBusiness v3 by:carlossa
|
||||
- fix: refs #6897 prevent default event behavior in autocompleteExpense function by:pablone
|
||||
- fix: refs #7356 chaining params by:Javier Segarra
|
||||
- fix: refs #7356 ticketService by:Javier Segarra
|
||||
- fix: refs #8242 workerDepartmentTree bug (origin/8242_leftMenu_responsive) by:Javier Segarra
|
||||
- fix: workerBasicData by:carlossa
|
||||
- Revert "revert 1015acefb7e400be2d8b5958dba69b4d98276b34" (origin/fix_revert_revert, fix_revert_revert) by:alexm
|
||||
|
||||
# Version 25.06 - 2025-02-18
|
||||
|
||||
### Added 🆕
|
||||
|
|
|
@ -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)
|
||||
]
|
||||
|
||||
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
||||
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'
|
||||
}
|
||||
steps {
|
||||
sh 'pnpm run test:unit:ci'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
junit(
|
||||
testResults: 'junitresults.xml',
|
||||
allowEmptyResults: true
|
||||
)
|
||||
parallel {
|
||||
stage('Unit') {
|
||||
steps {
|
||||
sh 'pnpm run test:front:ci'
|
||||
}
|
||||
post {
|
||||
always {
|
||||
junit(
|
||||
testResults: 'junit/vitest.xml',
|
||||
allowEmptyResults: true
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
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 {
|
||||
script {
|
||||
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 { PROTECTED_BRANCH }
|
||||
expression { IS_PROTECTED_BRANCH }
|
||||
}
|
||||
environment {
|
||||
CREDENTIALS = credentials('docker-registry')
|
||||
VERSION = readFile 'VERSION.txt'
|
||||
}
|
||||
steps {
|
||||
sh 'quasar build'
|
||||
script {
|
||||
def packageJson = readJSON file: 'package.json'
|
||||
env.VERSION = "${packageJson.version}-build${env.BUILD_ID}"
|
||||
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',
|
||||
|
|
|
@ -23,7 +23,7 @@ quasar dev
|
|||
### Run unit tests
|
||||
|
||||
```bash
|
||||
pnpm run test:unit
|
||||
pnpm run test:front
|
||||
```
|
||||
|
||||
### Run e2e tests
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
main:
|
||||
image: registry.verdnatura.es/salix-frontend:${VERSION:?}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./Dockerfile
|
|
@ -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
|
|
@ -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",
|
||||
|
@ -71,4 +71,4 @@
|
|||
"vite": "^6.0.11",
|
||||
"vitest": "^0.31.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export default [
|
||||
{
|
||||
path: '/api',
|
||||
rule: { target: 'http://0.0.0.0:3000' },
|
||||
rule: { target: 'http://127.0.0.1:3000' },
|
||||
},
|
||||
];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -124,7 +124,7 @@ const selectTravel = ({ id }) => {
|
|||
<FetchData
|
||||
url="AgencyModes"
|
||||
@on-fetch="(data) => (agenciesOptions = data)"
|
||||
:filter="{ fields: ['id', 'name'], order: 'name ASC' }"
|
||||
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -18,14 +18,25 @@ defineProps({ row: { type: Object, required: true } });
|
|||
</QIcon>
|
||||
</router-link>
|
||||
<QIcon
|
||||
v-if="row?.risk"
|
||||
v-if="row?.reserved"
|
||||
color="primary"
|
||||
name="vn:reserva"
|
||||
size="xs"
|
||||
data-cy="ticketSaleReservedIcon"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ t('ticketSale.reserved') }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.hasRisk"
|
||||
name="vn:risk"
|
||||
:color="row.hasHighRisk ? 'negative' : 'primary'"
|
||||
size="xs"
|
||||
>
|
||||
<QTooltip>
|
||||
{{ $t('salesTicketsTable.risk') }}:
|
||||
{{ toCurrency(row.risk - row.credit) }}
|
||||
{{ toCurrency(row.risk - (row.credit ?? 0)) }}
|
||||
</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
|
@ -67,12 +78,7 @@ defineProps({ row: { type: Object, required: true } });
|
|||
>
|
||||
<QTooltip>{{ $t('salesTicketsTable.purchaseRequest') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon
|
||||
v-if="row?.isTaxDataChecked !== 0"
|
||||
name="vn:no036"
|
||||
color="primary"
|
||||
size="xs"
|
||||
>
|
||||
<QIcon v-if="row?.isTaxDataChecked" name="vn:no036" color="primary" size="xs">
|
||||
<QTooltip>{{ $t('salesTicketsTable.noVerifiedData') }}</QTooltip>
|
||||
</QIcon>
|
||||
<QIcon v-if="row?.isFreezed" name="vn:frozen" color="primary" size="xs">
|
||||
|
|
|
@ -51,14 +51,14 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
rightSearchIcon: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
rowClick: {
|
||||
type: [Function, Boolean],
|
||||
default: null,
|
||||
},
|
||||
rowCtrlClick: {
|
||||
type: [Function, Boolean],
|
||||
default: null,
|
||||
},
|
||||
redirect: {
|
||||
type: String,
|
||||
default: null,
|
||||
|
@ -685,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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -302,6 +302,8 @@ defineExpose({ opts: myOptions, vnSelectRef });
|
|||
|
||||
function handleKeyDown(event) {
|
||||
if (event.key === 'Tab' && !event.shiftKey) {
|
||||
event.preventDefault();
|
||||
|
||||
const inputValue = vnSelectRef.value?.inputValue;
|
||||
|
||||
if (inputValue) {
|
||||
|
|
|
@ -18,20 +18,16 @@ import VnInput from 'components/common/VnInput.vue';
|
|||
|
||||
const emit = defineEmits(['onFetch']);
|
||||
|
||||
const originalAttrs = useAttrs();
|
||||
|
||||
const $attrs = computed(() => {
|
||||
const { style, ...rest } = originalAttrs;
|
||||
return rest;
|
||||
});
|
||||
const $attrs = useAttrs();
|
||||
|
||||
const isRequired = computed(() => {
|
||||
return Object.keys($attrs).includes('required')
|
||||
return Object.keys($attrs).includes('required');
|
||||
});
|
||||
|
||||
const $props = defineProps({
|
||||
url: { type: String, default: null },
|
||||
saveUrl: {type: String, default: null},
|
||||
saveUrl: { type: String, default: null },
|
||||
userFilter: { type: Object, default: () => {} },
|
||||
filter: { type: Object, default: () => {} },
|
||||
body: { type: Object, default: () => {} },
|
||||
addNote: { type: Boolean, default: false },
|
||||
|
@ -65,7 +61,7 @@ async function insert() {
|
|||
}
|
||||
|
||||
function confirmAndUpdate() {
|
||||
if(!newNote.text && originalText)
|
||||
if (!newNote.text && originalText)
|
||||
quasar
|
||||
.dialog({
|
||||
component: VnConfirm,
|
||||
|
@ -88,11 +84,17 @@ async function update() {
|
|||
...body,
|
||||
...{ notes: newNote.text },
|
||||
};
|
||||
await axios.patch(`${$props.saveUrl ?? `${$props.url}/${$props.body.workerFk}`}`, newBody);
|
||||
await axios.patch(
|
||||
`${$props.saveUrl ?? `${$props.url}/${$props.body.workerFk}`}`,
|
||||
newBody,
|
||||
);
|
||||
}
|
||||
|
||||
onBeforeRouteLeave((to, from, next) => {
|
||||
if ((newNote.text && !$props.justInput) || (newNote.text !== originalText) && $props.justInput)
|
||||
if (
|
||||
(newNote.text && !$props.justInput) ||
|
||||
(newNote.text !== originalText && $props.justInput)
|
||||
)
|
||||
quasar.dialog({
|
||||
component: VnConfirm,
|
||||
componentProps: {
|
||||
|
@ -104,12 +106,11 @@ onBeforeRouteLeave((to, from, next) => {
|
|||
else next();
|
||||
});
|
||||
|
||||
function fetchData([ data ]) {
|
||||
function fetchData([data]) {
|
||||
newNote.text = data?.notes;
|
||||
originalText = data?.notes;
|
||||
emit('onFetch', data);
|
||||
}
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -126,8 +127,8 @@ function fetchData([ data ]) {
|
|||
@on-fetch="fetchData"
|
||||
auto-load
|
||||
/>
|
||||
<QCard
|
||||
class="q-pa-xs q-mb-lg full-width"
|
||||
<QCard
|
||||
class="q-pa-xs q-mb-lg full-width"
|
||||
:class="{ 'just-input': $props.justInput }"
|
||||
v-if="$props.addNote || $props.justInput"
|
||||
>
|
||||
|
@ -179,7 +180,8 @@ function fetchData([ data ]) {
|
|||
:url="$props.url"
|
||||
order="created DESC"
|
||||
:limit="0"
|
||||
:user-filter="$props.filter"
|
||||
:user-filter="userFilter"
|
||||
:filter="filter"
|
||||
auto-load
|
||||
ref="vnPaginateRef"
|
||||
class="show"
|
||||
|
@ -218,7 +220,7 @@ function fetchData([ data ]) {
|
|||
>
|
||||
{{
|
||||
observationTypes.find(
|
||||
(ot) => ot.id === note.observationTypeFk
|
||||
(ot) => ot.id === note.observationTypeFk,
|
||||
)?.description
|
||||
}}
|
||||
</QBadge>
|
||||
|
|
|
@ -335,3 +335,7 @@ input::-webkit-inner-spin-button {
|
|||
border: 1px solid;
|
||||
box-shadow: 0 4px 6px #00000000;
|
||||
}
|
||||
|
||||
.containerShrinked {
|
||||
width: 80%;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, useAttrs } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useState } from 'src/composables/useState';
|
||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||
|
@ -7,7 +7,6 @@ import VnNotes from 'src/components/ui/VnNotes.vue';
|
|||
const route = useRoute();
|
||||
const state = useState();
|
||||
const user = state.getUser();
|
||||
const $attrs = useAttrs();
|
||||
|
||||
const $props = defineProps({
|
||||
id: { type: [Number, String], default: null },
|
||||
|
@ -15,24 +14,21 @@ const $props = defineProps({
|
|||
});
|
||||
const claimId = computed(() => $props.id || route.params.id);
|
||||
|
||||
const claimFilter = computed(() => {
|
||||
return {
|
||||
where: { claimFk: claimId.value },
|
||||
fields: ['id', 'created', 'workerFk', 'text'],
|
||||
include: {
|
||||
relation: 'worker',
|
||||
scope: {
|
||||
fields: ['id', 'firstName', 'lastName'],
|
||||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'nickname', 'name'],
|
||||
},
|
||||
const claimFilter = {
|
||||
fields: ['id', 'created', 'workerFk', 'text'],
|
||||
include: {
|
||||
relation: 'worker',
|
||||
scope: {
|
||||
fields: ['id', 'firstName', 'lastName'],
|
||||
include: {
|
||||
relation: 'user',
|
||||
scope: {
|
||||
fields: ['id', 'nickname', 'name'],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
const body = {
|
||||
claimFk: claimId.value,
|
||||
|
@ -43,7 +39,8 @@ const body = {
|
|||
<VnNotes
|
||||
url="claimObservations"
|
||||
:add-note="$props.addNote"
|
||||
:filter="claimFilter"
|
||||
:user-filter="claimFilter"
|
||||
:filter="{ where: { claimFk: claimId } }"
|
||||
:body="body"
|
||||
v-bind="$attrs"
|
||||
style="overflow-y: auto"
|
||||
|
|
|
@ -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')" />
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -106,7 +106,6 @@ const props = defineProps({
|
|||
:label="t('claim.zone')"
|
||||
v-model="params.zoneFk"
|
||||
url="Zones"
|
||||
:use-like="false"
|
||||
outlined
|
||||
rounded
|
||||
dense
|
||||
|
|
|
@ -13,7 +13,6 @@ claim:
|
|||
province: Province
|
||||
zone: Zone
|
||||
customerId: client ID
|
||||
assignedTo: Assigned
|
||||
created: Created
|
||||
details: Details
|
||||
item: Item
|
||||
|
|
|
@ -13,7 +13,6 @@ claim:
|
|||
province: Provincia
|
||||
zone: Zona
|
||||
customerId: ID de cliente
|
||||
assignedTo: Asignado a
|
||||
created: Creado
|
||||
details: Detalles
|
||||
item: Artículo
|
||||
|
|
|
@ -1,28 +1,15 @@
|
|||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import VnNotes from 'src/components/ui/VnNotes.vue';
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const noteFilter = computed(() => {
|
||||
return {
|
||||
order: 'created DESC',
|
||||
where: {
|
||||
clientFk: `${route.params.id}`,
|
||||
},
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnNotes
|
||||
url="clientObservations"
|
||||
:add-note="true"
|
||||
:filter="noteFilter"
|
||||
:body="{ clientFk: route.params.id }"
|
||||
:filter="{ where: { clientFk: $route.params.id } }"
|
||||
:body="{ clientFk: $route.params.id }"
|
||||
style="overflow-y: auto"
|
||||
:select-type="true"
|
||||
required
|
||||
order="created DESC"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -17,9 +17,9 @@ describe('getAddresses', () => {
|
|||
expect(axios.get).toHaveBeenCalledWith(`Clients/${clientId}/addresses`, {
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
fields: ['nickname', 'street', 'city', 'id'],
|
||||
fields: ['nickname', 'street', 'city', 'id', 'isActive'],
|
||||
where: { isActive: true },
|
||||
order: 'nickname ASC',
|
||||
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
@ -30,4 +30,4 @@ describe('getAddresses', () => {
|
|||
|
||||
expect(axios.get).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import axios from 'axios';
|
||||
|
||||
export async function getAddresses(clientId, _filter = {}) {
|
||||
export async function getAddresses(clientId, _filter = {}) {
|
||||
if (!clientId) return;
|
||||
const filter = {
|
||||
..._filter,
|
||||
fields: ['nickname', 'street', 'city', 'id'],
|
||||
fields: ['nickname', 'street', 'city', 'id', 'isActive'],
|
||||
where: { isActive: true },
|
||||
order: 'nickname ASC',
|
||||
order: ['isDefaultAddress DESC', 'isActive DESC', 'nickname ASC'],
|
||||
};
|
||||
const params = { filter: JSON.stringify(filter) };
|
||||
return await axios.get(`Clients/${clientId}/addresses`, {
|
||||
params,
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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(',');
|
||||
});
|
||||
|
|
|
@ -145,6 +145,7 @@ const entryFilterPanel = ref();
|
|||
v-model="params.agencyModeId"
|
||||
@update:model-value="searchFn()"
|
||||
url="AgencyModes"
|
||||
sort-by="name ASC"
|
||||
:fields="['id', 'name']"
|
||||
hide-selected
|
||||
dense
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
v-model="params.clientId"
|
||||
:label="t('invoiceOut.negativeBases.clientId')"
|
||||
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>
|
||||
</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>
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -17,6 +17,7 @@ import MonitorTicketFilter from './MonitorTicketFilter.vue';
|
|||
import TicketProblems from 'src/components/TicketProblems.vue';
|
||||
import VnDateBadge from 'src/components/common/VnDateBadge.vue';
|
||||
import { useStateStore } from 'src/stores/useStateStore';
|
||||
import useOpenURL from 'src/composables/useOpenURL';
|
||||
|
||||
const DEFAULT_AUTO_REFRESH = 2 * 60 * 1000;
|
||||
const { t } = useI18n();
|
||||
|
@ -321,8 +322,7 @@ const totalPriceColor = (ticket) => {
|
|||
if (total > 0 && total < 50) return 'warning';
|
||||
};
|
||||
|
||||
const openTab = (id) =>
|
||||
window.open(`#/ticket/${id}/sale`, '_blank', 'noopener, noreferrer');
|
||||
const openTab = (id) => useOpenURL(`#/ticket/${id}/sale`);
|
||||
</script>
|
||||
<template>
|
||||
<FetchData
|
||||
|
@ -397,6 +397,7 @@ const openTab = (id) =>
|
|||
default-mode="table"
|
||||
auto-load
|
||||
:row-click="({ id }) => openTab(id)"
|
||||
:row-ctrl-click="(_, { id }) => openTab(id)"
|
||||
:disable-option="{ card: true }"
|
||||
:user-params="{ from, to, scopeDays: 0 }"
|
||||
>
|
||||
|
|
|
@ -22,7 +22,7 @@ salesTicketsTable:
|
|||
notVisible: Not visible
|
||||
purchaseRequest: Purchase request
|
||||
clientFrozen: Client frozen
|
||||
risk: Risk
|
||||
risk: Excess risk
|
||||
componentLack: Component lack
|
||||
tooLittle: Ticket too little
|
||||
identifier: Identifier
|
||||
|
|
|
@ -22,7 +22,7 @@ salesTicketsTable:
|
|||
notVisible: No visible
|
||||
purchaseRequest: Petición de compra
|
||||
clientFrozen: Cliente congelado
|
||||
risk: Riesgo
|
||||
risk: Exceso de riesgo
|
||||
componentLack: Faltan componentes
|
||||
tooLittle: Ticket demasiado pequeño
|
||||
identifier: Identificador
|
||||
|
|
|
@ -155,11 +155,23 @@ onMounted(() => {
|
|||
});
|
||||
|
||||
async function fetchClientAddress(id, formData = {}) {
|
||||
const { data } = await axios.get(
|
||||
`Clients/${id}/addresses?filter[order]=isActive DESC`
|
||||
);
|
||||
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.addressId = data.defaultAddressFk;
|
||||
formData.addressId = data[0].client.defaultAddressFk;
|
||||
fetchAgencies(formData);
|
||||
}
|
||||
|
||||
|
@ -167,7 +179,13 @@ async function fetchAgencies({ landed, addressId }) {
|
|||
if (!landed || !addressId) return (agencyList.value = []);
|
||||
|
||||
const { data } = await axios.get('Agencies/landsThatDay', {
|
||||
params: { addressFk: addressId, landed },
|
||||
params: {
|
||||
filter: JSON.stringify({
|
||||
order: ['agencyMode DESC', 'agencyModeFk ASC'],
|
||||
}),
|
||||
addressFk: addressId,
|
||||
landed,
|
||||
},
|
||||
});
|
||||
agencyList.value = data;
|
||||
}
|
||||
|
@ -258,6 +276,7 @@ const getDateColor = (date) => {
|
|||
</template>
|
||||
</VnSelect>
|
||||
<VnSelect
|
||||
:disable="!data.clientFk"
|
||||
v-model="data.addressId"
|
||||
:options="addressOptions"
|
||||
:label="t('module.address')"
|
||||
|
@ -284,6 +303,9 @@ const getDateColor = (date) => {
|
|||
{{ scope.opt?.street }},
|
||||
{{ scope.opt?.city }}
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ `#${scope.opt?.id}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
|
|
@ -27,14 +27,17 @@ describe('getAgencies', () => {
|
|||
landed: 'true',
|
||||
};
|
||||
const filter = {
|
||||
fields: ['nickname', 'street', 'city', 'id'],
|
||||
fields: ['name', 'street', 'city', 'id'],
|
||||
where: { isActive: true },
|
||||
order: 'nickname ASC',
|
||||
order: ['name ASC'],
|
||||
};
|
||||
|
||||
await getAgencies(formData, null, filter);
|
||||
|
||||
expect(axios.get).toHaveBeenCalledWith('Agencies/getAgenciesWithWarehouse', generateParams(formData, filter));
|
||||
expect(axios.get).toHaveBeenCalledWith(
|
||||
'Agencies/getAgenciesWithWarehouse',
|
||||
generateParams(formData, filter),
|
||||
);
|
||||
});
|
||||
|
||||
it('should not call API when formData is missing required landed field', async () => {
|
||||
|
@ -64,19 +67,19 @@ describe('getAgencies', () => {
|
|||
it('should return options and agency when default agency is found', async () => {
|
||||
const formData = { warehouseId: '123', addressId: '456', landed: 'true' };
|
||||
const client = { defaultAddress: { agencyModeFk: 'Agency1' } };
|
||||
|
||||
|
||||
const { options, agency } = await getAgencies(formData, client);
|
||||
|
||||
|
||||
expect(options).toEqual(response.data);
|
||||
expect(agency).toEqual(response.data[0]);
|
||||
});
|
||||
});
|
||||
|
||||
it('should return options and agency when client is not provided', async () => {
|
||||
it('should return options and agency when client is not provided', async () => {
|
||||
const formData = { warehouseId: '123', addressId: '456', landed: 'true' };
|
||||
|
||||
|
||||
const { options, agency } = await getAgencies(formData);
|
||||
|
||||
|
||||
expect(options).toEqual(response.data);
|
||||
expect(agency).toBeNull();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import axios from 'axios';
|
||||
import agency from 'src/router/modules/agency';
|
||||
|
||||
export async function getAgencies(formData, client, _filter = {}) {
|
||||
if (!formData.warehouseId || !formData.addressId || !formData.landed) return;
|
||||
|
||||
|
||||
const filter = {
|
||||
..._filter
|
||||
..._filter,
|
||||
order: ['name ASC'],
|
||||
};
|
||||
|
||||
let defaultAgency = null;
|
||||
let agency = null;
|
||||
let params = {
|
||||
filter: JSON.stringify(filter),
|
||||
warehouseFk: formData.warehouseId,
|
||||
|
@ -16,11 +16,15 @@ export async function getAgencies(formData, client, _filter = {}) {
|
|||
landed: formData.landed,
|
||||
};
|
||||
|
||||
const { data } = await axios.get('Agencies/getAgenciesWithWarehouse', { params });
|
||||
const { data: options } = await axios.get('Agencies/getAgenciesWithWarehouse', {
|
||||
params,
|
||||
});
|
||||
|
||||
if(data && client) {
|
||||
defaultAgency = data.find((agency) => agency.agencyModeFk === client.defaultAddress.agencyModeFk );
|
||||
};
|
||||
|
||||
return {options: data, agency: defaultAgency}
|
||||
if (options && client) {
|
||||
agency = options.find(
|
||||
({ agencyModeFk }) => agencyModeFk === client.defaultAddress.agencyModeFk,
|
||||
);
|
||||
}
|
||||
|
||||
return { options, agency };
|
||||
}
|
||||
|
|
|
@ -44,8 +44,7 @@ const exprBuilder = (param, value) => {
|
|||
<template>
|
||||
<FetchData
|
||||
url="AgencyModes"
|
||||
:filter="{ fields: ['id', 'name'] }"
|
||||
sort-by="name ASC"
|
||||
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||
@on-fetch="(data) => (agencyList = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
/>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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` })
|
||||
"
|
||||
>
|
||||
<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>
|
||||
<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>
|
||||
</template>
|
||||
</VnSection>
|
||||
</template>
|
||||
|
|
|
@ -11,6 +11,11 @@ export default {
|
|||
'isSerious',
|
||||
'isTrucker',
|
||||
'account',
|
||||
'workerFk',
|
||||
'note',
|
||||
'isReal',
|
||||
'isPayMethodChecked',
|
||||
'companySize',
|
||||
],
|
||||
include: [
|
||||
{
|
||||
|
|
|
@ -94,9 +94,9 @@ function ticketFilter(ticket) {
|
|||
<VnLv :label="t('globals.warehouse')" :value="entity.warehouse?.name" />
|
||||
<VnLv :label="t('globals.alias')" :value="entity.nickname" />
|
||||
</template>
|
||||
<template #icons>
|
||||
<template #icons="{ entity }">
|
||||
<QCardActions class="q-gutter-x-xs">
|
||||
<TicketProblems :row="problems" />
|
||||
<TicketProblems :row="{ ...entity?.client, ...problems }" />
|
||||
</QCardActions>
|
||||
</template>
|
||||
<template #actions="{ entity }">
|
||||
|
|
|
@ -37,7 +37,6 @@ const expeditionStateTypes = ref([]);
|
|||
|
||||
const expeditionsFilter = computed(() => ({
|
||||
where: { ticketFk: route.params.id },
|
||||
order: ['created DESC'],
|
||||
}));
|
||||
|
||||
const ticketArrayData = useArrayData('Ticket');
|
||||
|
@ -105,6 +104,9 @@ const columns = computed(() => [
|
|||
name: 'created',
|
||||
align: 'left',
|
||||
cardVisible: true,
|
||||
columnFilter: {
|
||||
component: 'date',
|
||||
},
|
||||
format: (row) => toDateTimeFormat(row.created),
|
||||
},
|
||||
{
|
||||
|
@ -201,7 +203,7 @@ const getExpeditionState = async (expedition) => {
|
|||
|
||||
const openGrafana = (expeditionFk) => {
|
||||
useOpenURL(
|
||||
`https://grafana.verdnatura.es/d/de1njb6p5answd/control-de-expediciones?orgId=1&var-expeditionFk=${expeditionFk}`
|
||||
`https://grafana.verdnatura.es/d/de1njb6p5answd/control-de-expediciones?orgId=1&var-expeditionFk=${expeditionFk}`,
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -287,7 +289,7 @@ onMounted(async () => {
|
|||
openConfirmationModal(
|
||||
'',
|
||||
t('expedition.removeExpeditionSubtitle'),
|
||||
deleteExpedition
|
||||
deleteExpedition,
|
||||
)
|
||||
"
|
||||
>
|
||||
|
@ -302,7 +304,6 @@ onMounted(async () => {
|
|||
url="Expeditions/filter"
|
||||
search-url="expeditions"
|
||||
:columns="columns"
|
||||
:filter="expeditionsFilter"
|
||||
v-model:selected="selectedRows"
|
||||
:table="{
|
||||
'row-key': 'id',
|
||||
|
@ -316,11 +317,14 @@ onMounted(async () => {
|
|||
return { id: value };
|
||||
case 'packageItemName':
|
||||
return { packagingItemFk: value };
|
||||
case 'created':
|
||||
return { 'e.created': { gte: value } };
|
||||
}
|
||||
}
|
||||
"
|
||||
:redirect="false"
|
||||
order="created DESC"
|
||||
:filter="expeditionsFilter"
|
||||
>
|
||||
<template #column-freightItemName="{ row }">
|
||||
<span class="link" @click.stop>
|
||||
|
|
|
@ -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 }">
|
||||
|
|
|
@ -42,7 +42,7 @@ const transferRef = ref(null);
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div v-else>
|
||||
<div style="display: flex; flex-direction: row" v-else>
|
||||
<TicketTransfer
|
||||
ref="transferRef"
|
||||
:ticket="$props.ticket"
|
||||
|
|
|
@ -142,7 +142,7 @@ onMounted(() => (stateStore.rightDrawer = true));
|
|||
<template #column-concept="{ row }">
|
||||
<span>{{ row.item.name }}</span>
|
||||
<span class="color-vn-label q-pl-md">{{ row.item.subName }}</span>
|
||||
<FetchedTags :item="row.item" />
|
||||
<FetchedTags :item="row.item" :columns="6" />
|
||||
</template>
|
||||
<template #column-volume="{ rowIndex }">
|
||||
<span>{{ packingTypeVolume?.[rowIndex]?.volume }}</span>
|
||||
|
|
|
@ -46,7 +46,12 @@ const getGroupedStates = (data) => {
|
|||
"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData url="AgencyModes" @on-fetch="(data) => (agencies = data)" auto-load />
|
||||
<FetchData
|
||||
url="AgencyModes"
|
||||
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||
@on-fetch="(data) => (agencies = data)"
|
||||
auto-load
|
||||
/>
|
||||
<FetchData url="Warehouses" @on-fetch="(data) => (warehouses = data)" auto-load />
|
||||
<VnFilterPanel :data-key="props.dataKey" :search-button="true">
|
||||
<template #tags="{ tag, formatFn }">
|
||||
|
@ -74,10 +79,20 @@ const getGroupedStates = (data) => {
|
|||
</QItem>
|
||||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInputDate v-model="params.from" :label="t('From')" is-outlined />
|
||||
<VnInputDate
|
||||
v-model="params.from"
|
||||
:label="t('From')"
|
||||
is-outlined
|
||||
data-cy="From_date"
|
||||
/>
|
||||
</QItemSection>
|
||||
<QItemSection>
|
||||
<VnInputDate v-model="params.to" :label="t('To')" is-outlined />
|
||||
<VnInputDate
|
||||
v-model="params.to"
|
||||
:label="t('To')"
|
||||
is-outlined
|
||||
data-cy="To_date"
|
||||
/>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
<QItem>
|
||||
|
@ -241,8 +256,6 @@ const getGroupedStates = (data) => {
|
|||
v-model="params.agencyModeFk"
|
||||
@update:model-value="searchFn()"
|
||||
:options="agencies"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
use-input
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
import axios from 'axios';
|
||||
import { computed, ref, onBeforeMount } 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';
|
||||
|
@ -69,6 +69,8 @@ const companiesOptions = ref([]);
|
|||
const accountingOptions = ref([]);
|
||||
const amountToReturn = ref();
|
||||
const dataKey = 'TicketList';
|
||||
const filterPanelRef = ref(null);
|
||||
const formInitialData = ref({});
|
||||
|
||||
const columns = computed(() => [
|
||||
{
|
||||
|
@ -119,12 +121,16 @@ const columns = computed(() => [
|
|||
{
|
||||
align: 'left',
|
||||
name: 'shipped',
|
||||
component: 'time',
|
||||
columnFilter: false,
|
||||
label: t('ticketList.hour'),
|
||||
format: (row) => toTimeFormat(row.shipped),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'zoneLanding',
|
||||
component: 'time',
|
||||
columnFilter: false,
|
||||
label: t('ticketList.closure'),
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(toTimeFormat(row.zoneLanding)),
|
||||
},
|
||||
|
@ -144,9 +150,16 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'province',
|
||||
name: 'provinceFk',
|
||||
label: t('ticketList.province'),
|
||||
columnClass: 'expand',
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'Provinces',
|
||||
},
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
format: (row, dashIfEmpty) => dashIfEmpty(row.province),
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -180,9 +193,19 @@ const columns = computed(() => [
|
|||
},
|
||||
{
|
||||
align: 'left',
|
||||
name: 'warehouse',
|
||||
label: t('ticketList.warehouse'),
|
||||
columnClass: 'expand',
|
||||
name: 'warehouseFk',
|
||||
label: t('globals.warehouse'),
|
||||
component: 'select',
|
||||
attrs: {
|
||||
url: 'warehouses',
|
||||
fields: ['id', 'name'],
|
||||
},
|
||||
format: (row) => row.warehouse,
|
||||
columnField: {
|
||||
component: null,
|
||||
},
|
||||
cardVisible: false,
|
||||
create: false,
|
||||
},
|
||||
{
|
||||
align: 'left',
|
||||
|
@ -422,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>
|
||||
|
@ -456,7 +495,7 @@ function setReference(data) {
|
|||
urlCreate: 'Tickets/new',
|
||||
title: t('ticketList.createTicket'),
|
||||
onDataSaved: ({ id }) => tableRef.redirect(id),
|
||||
formInitialData: { clientId: null },
|
||||
formInitialData,
|
||||
}"
|
||||
default-mode="table"
|
||||
:columns="columns"
|
||||
|
@ -538,11 +577,9 @@ function setReference(data) {
|
|||
:label="t('ticketList.client')"
|
||||
v-model="data.clientId"
|
||||
:options="clientsOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
hide-selected
|
||||
required
|
||||
@update:model-value="(client) => onClientSelected(data)"
|
||||
@update:model-value="() => onClientSelected(data)"
|
||||
:sort-by="'id ASC'"
|
||||
>
|
||||
<template #option="scope">
|
||||
|
@ -564,7 +601,6 @@ function setReference(data) {
|
|||
:label="t('basicData.address')"
|
||||
v-model="data.addressId"
|
||||
:options="addressesOptions"
|
||||
option-value="id"
|
||||
option-label="nickname"
|
||||
hide-selected
|
||||
map-options
|
||||
|
@ -610,6 +646,9 @@ function setReference(data) {
|
|||
{{ scope.opt?.city }}
|
||||
</span>
|
||||
</QItemLabel>
|
||||
<QItemLabel caption>
|
||||
{{ `#${scope.opt?.id}` }}
|
||||
</QItemLabel>
|
||||
</QItemSection>
|
||||
</QItem>
|
||||
</template>
|
||||
|
@ -633,8 +672,6 @@ function setReference(data) {
|
|||
:label="t('globals.warehouse')"
|
||||
v-model="data.warehouseId"
|
||||
:options="warehousesOptions"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
hide-selected
|
||||
required
|
||||
@update:model-value="() => fetchAvailableAgencies(data)"
|
||||
|
@ -694,7 +731,6 @@ function setReference(data) {
|
|||
:label="t('ticketList.company')"
|
||||
v-model="dialogData.companyFk"
|
||||
:options="companiesOptions"
|
||||
option-value="id"
|
||||
option-label="code"
|
||||
hide-selected
|
||||
>
|
||||
|
@ -705,7 +741,6 @@ function setReference(data) {
|
|||
:label="t('ticketList.bank')"
|
||||
v-model="dialogData.bankFk"
|
||||
:options="accountingOptions"
|
||||
option-value="id"
|
||||
option-label="bank"
|
||||
hide-selected
|
||||
@update:model-value="setReference"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -73,13 +73,14 @@ warehouses();
|
|||
/>
|
||||
<FetchData
|
||||
url="AgencyModes"
|
||||
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||
@on-fetch="(data) => (agenciesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
<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>
|
||||
|
@ -92,7 +93,7 @@ warehouses();
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnInput
|
||||
:label="t('params.reference')"
|
||||
:label="t('extraCommunity.filter.reference')"
|
||||
v-model="params.reference"
|
||||
is-outlined
|
||||
/>
|
||||
|
@ -103,7 +104,7 @@ warehouses();
|
|||
<QInput
|
||||
v-model="params.totalEntries"
|
||||
type="number"
|
||||
:label="t('params.totalEntries')"
|
||||
:label="t('extraCommunity.filter.totalEntries')"
|
||||
dense
|
||||
outlined
|
||||
rounded
|
||||
|
@ -133,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
|
||||
|
@ -148,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
|
||||
|
@ -158,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
|
||||
|
@ -168,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"
|
||||
|
@ -183,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"
|
||||
|
@ -198,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"
|
||||
|
@ -213,6 +214,7 @@ warehouses();
|
|||
<QItem>
|
||||
<QItemSection>
|
||||
<VnSelectSupplier
|
||||
:label="t('extraCommunity.cargoShip')"
|
||||
v-model="params.cargoSupplierFk"
|
||||
hide-selected
|
||||
dense
|
||||
|
@ -221,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"
|
||||
|
@ -240,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>
|
||||
|
|
|
@ -39,6 +39,7 @@ const redirectToTravelBasicData = (_, { id }) => {
|
|||
<template>
|
||||
<FetchData
|
||||
url="AgencyModes"
|
||||
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||
@on-fetch="(data) => (agenciesOptions = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
|
|
@ -52,9 +52,8 @@ defineExpose({ states });
|
|||
v-model="params.agencyModeFk"
|
||||
@update:model-value="searchFn()"
|
||||
url="agencyModes"
|
||||
sort-by="name ASC"
|
||||
:use-like="false"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
option-filter="name"
|
||||
dense
|
||||
outlined
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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 />
|
||||
|
|
|
@ -5,9 +5,9 @@ import VnNotes from 'src/components/ui/VnNotes.vue';
|
|||
|
||||
const route = useRoute();
|
||||
|
||||
const filter = {
|
||||
const userFilter = {
|
||||
order: 'created DESC',
|
||||
where: { workerFk: route.params.id },
|
||||
|
||||
include: {
|
||||
relation: 'worker',
|
||||
scope: {
|
||||
|
@ -22,11 +22,15 @@ const filter = {
|
|||
},
|
||||
};
|
||||
|
||||
const body = {
|
||||
workerFk: route.params.id,
|
||||
};
|
||||
const body = { workerFk: route.params.id };
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VnNotes :add-note="true" url="WorkerObservations" :filter="filter" :body="body" />
|
||||
<VnNotes
|
||||
:add-note="true"
|
||||
url="WorkerObservations"
|
||||
:user-filter="userFilter"
|
||||
:filter="{ where: { workerFk: $route.params.id } }"
|
||||
:body="body"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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')"
|
||||
|
|
|
@ -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) => {
|
||||
const validIds = new Set(validAddresses.value.map((item) => item.addressFk));
|
||||
addresses.value = data.filter((address) => validIds.has(address.id));
|
||||
addresses.value = data.map(({ address }) => address);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FetchData
|
||||
url="RoadmapAddresses"
|
||||
:filter="{
|
||||
include: { relation: 'address' },
|
||||
}"
|
||||
auto-load
|
||||
@on-fetch="(data) => (validAddresses = data)"
|
||||
@on-fetch="setFilteredAddresses"
|
||||
/>
|
||||
<FetchData url="Addresses" auto-load @on-fetch="setFilteredAddresses" />
|
||||
<FormModel auto-load model="Zone">
|
||||
<template #form="{ data, validate }">
|
||||
<VnRow>
|
||||
|
@ -125,7 +125,6 @@ const setFilteredAddresses = (data) => {
|
|||
map-options
|
||||
:rules="validate('data.addressFk')"
|
||||
:filter-options="['id']"
|
||||
:where="filterWhere"
|
||||
/>
|
||||
</VnRow>
|
||||
<VnRow>
|
||||
|
|
|
@ -5,6 +5,7 @@ import VnInput from 'components/common/VnInput.vue';
|
|||
import FetchData from 'components/FetchData.vue';
|
||||
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
|
||||
import VnSelect from 'components/common/VnSelect.vue';
|
||||
import order from 'src/router/modules/order';
|
||||
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
|
@ -24,7 +25,7 @@ const agencies = ref([]);
|
|||
<template>
|
||||
<FetchData
|
||||
url="AgencyModes"
|
||||
:filter="{ fields: ['id', 'name'] }"
|
||||
:filter="{ fields: ['id', 'name'], order: ['name ASC'] }"
|
||||
@on-fetch="(data) => (agencies = data)"
|
||||
auto-load
|
||||
/>
|
||||
|
@ -38,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>
|
||||
|
@ -53,6 +59,7 @@ const agencies = ref([]);
|
|||
dense
|
||||
outlined
|
||||
rounded
|
||||
data-cy="zoneFilterPanelAgencySelect"
|
||||
>
|
||||
</VnSelect>
|
||||
</QItemSection>
|
||||
|
|
|
@ -199,9 +199,8 @@ function formatRow(row) {
|
|||
<template #more-create-dialog="{ data }">
|
||||
<VnSelect
|
||||
url="AgencyModes"
|
||||
sort-by="name ASC"
|
||||
v-model="data.agencyModeFk"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
:label="t('list.agency')"
|
||||
/>
|
||||
<VnInput
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -44,6 +44,8 @@ summary:
|
|||
filterPanel:
|
||||
name: Name
|
||||
agencyModeFk: Agency
|
||||
id: ID
|
||||
price: Price
|
||||
deliveryPanel:
|
||||
pickup: Pick up
|
||||
delivery: Delivery
|
||||
|
|
|
@ -45,6 +45,8 @@ summary:
|
|||
filterPanel:
|
||||
name: Nombre
|
||||
agencyModeFk: Agencia
|
||||
id: ID
|
||||
price: Precio
|
||||
deliveryPanel:
|
||||
pickup: Recogida
|
||||
delivery: Entrega
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
reports/*
|
||||
videos/*
|
||||
screenshots/*
|
||||
downloads/*
|
||||
downloads/*
|
||||
storage/*
|
||||
reports/*
|
||||
docker/logs/*
|
||||
|
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -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}'
|
|
@ -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();
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
|
@ -18,7 +17,7 @@ describe('Client consignee', () => {
|
|||
const addressName = 'test';
|
||||
cy.dataCy('Consignee_input').type(addressName);
|
||||
cy.dataCy('Location_select').click();
|
||||
cy.get('[role="listbox"] .q-item:nth-child(1)').click();
|
||||
cy.getOption();
|
||||
cy.dataCy('Street address_input').type('TEST ADDRESS');
|
||||
cy.get('.q-btn-group > .q-btn--standard').click();
|
||||
cy.location('href').should('contain', '#/customer/1107/address');
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -8,11 +8,9 @@ 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');
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue