Merge branch '6426-refactorConstants' of https://gitea.verdnatura.es/verdnatura/salix-front into 6426-refactorConstants
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Carlos Satorres 2025-02-05 12:51:06 +01:00
commit 896626a1fd
53 changed files with 2056 additions and 269 deletions

4
.gitignore vendored
View File

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

View File

@ -1,3 +1,157 @@
# Version 25.04 - 2025-01-28
### Added 🆕
- chore: add task comment by:jorgep
- chore: refs #8198 rollback by:jorgep
- chore: refs #8322 unnecessary prop by:alexm
- feat: refs #7055 added new test case by:provira
- feat: refs #7055 created FilterItemForm test by:provira
- feat: refs #7077 created test for VnInputTime by:provira
- feat: refs #7078 created test for VnJsonValue by:provira
- feat: refs #7087 added more test cases by:provira
- feat: refs #7087 added new test by:provira
- feat: refs #7087 created CardSummary test by:provira
- feat: refs #7088 created test for FetchedTags by:provira
- feat: refs #7202 added new field by:Jon
- feat: refs #7882 Added coords to create a address by:guillermo
- feat: refs #7957 add tooltip and i18n support for search link in VnSearchbar component by:jorgep
- feat: refs #7957 enhance search functionality and improve data filtering logic by:jorgep
- feat: refs #7957 open in new tab by:jorgep
- feat: refs #7957 simplify fn to by:jorgep
- feat: refs #7957 update VnSearchbar component with improved search URL handling and styling enhancements by:jorgep
- feat: refs #8117 filters and values added as needed by:jtubau
- feat: refs #8197 useHasContent and use in VnSection and RightMenu by:alexm
- feat: refs #8219 added invoice out e2e tests by:Jon
- feat: refs #8219 global invoicing e2e by:Jon
- feat: refs #8220 added barcodes e2e test by:Jon
- feat: refs #8220 created items e2e by:Jon
- feat: refs #8220 modified create item form and added respective e2e by:Jon
- feat: refs #8225 added account and invoiceOut modules by:Jon
- feat: refs #8225 added entry module and fixed translations by:Jon
- feat: refs #8225 added invoiceIn and travel module by:Jon
- feat: refs #8225 added moreOptions and use it in customer and ticket summary by:Jon
- feat: refs #8225 added route and shelving module by:Jon
- feat: refs #8225 added worker and zone modules by:Jon
- feat: refs #8225 use it in claim, item and order modules by:Jon
- feat: refs #8258 added button to pass to uppercase by:provira
- feat: refs #8258 added uppercase option to VnInput by:provira
- feat: refs #8258 added uppercase validation on supplier create by:provira
- feat: refs #8298 add price optimum input and update translations for bonus and price optimum by:jgallego
- feat: refs #8316 add entryFilter prop to VnTable component in EntryList by:jtubau
- feat: refs #8322 added department changes by:provira
- feat: refs #8372 workerPBX by:robert
- feat: refs #8381 add initial and final temperature fields to entry forms and summaries by:jgallego
- feat: refs #8381 add initial and final temperature labels in English and Spanish locales by:jgallego
- feat: refs #8381 add toCelsius filter and update temperature fields in entry forms and summaries by:jgallego
- feat: skip tests by:jorgep
- style: refs #7957 update VnSearchbar padding for improved layout by:jorgep
### Changed 📦
- perf: refs #8219 #8219 minor change by:Javier Segarra
- perf: refs #8220 on-fetch and added missing translations by:Jon
- perf: refs #8220 on-fetch by:Jon
- perf: refs #8220 translations by:Jon
- perf: refs #8220 use searchbar selector in e2e tests by:Jon
- perf: remove warning default value by:Javier Segarra
- refactor: redirect using params by:Jon
- refactor: refs #7077 removed some comments by:provira
- refactor: refs #7087 removed unused imports by:provira
- refactor: refs #7100 added const mockData by:jtubau
- refactor: refs #7100 delete unnecesary set prop by:jtubau
- refactor: refs #7100 refactorized with methods by:jtubau
- refactor: refs #7957 remove blank by:jorgep
- refactor: refs #8198 simplify data fetching and filtering logic by:jorgep
- refactor: refs #8198 simplify state management and data fetching in ItemDiary component by:jorgep
- refactor: refs #8219 modified e2e tests and fixed some translations by:Jon
- refactor: refs #8219 modified list test, created cypress download folder and added to gitignore by:Jon
- refactor: refs #8219 requested changes by:Jon
- refactor: refs #8219 use checkNotification command by:Jon
- refactor: refs #8220 added data-cy for e2e tests by:Jon
- refactor: refs #8220 requested changes by:Jon
- refactor: refs #8220 skip failling test and modifed tag test by:Jon
- refactor: refs #8225 requested changes by:Jon
- refactor: refs #8247 use new acl for sysadmin by:Jon
- refactor: refs #8316 added claimFilter by:jtubau
- refactor: refs #8316 added entryFilter by:jtubau
- refactor: refs #8316 add new localization keys and update existing ones for entry components by:jtubau
- refactor: refs #8316 moved localizations to local locale by:jtubau
- refactor: refs #8316 move order localization by:jtubau
- refactor: refs #8316 remove unused OrderSearchbar component by:jtubau
- refactor: refs #8316 update EntryCard to use user-filter prop and remove exprBuilder from EntryList by:jtubau
- refactor: refs #8316 used VnSection and VnCardBeta by:jtubau
- refactor: refs #8322 changed translations by:provira
- refactor: refs #8322 changed Worker component to use VnSection/VnCardBeta by:provira
- refactor: refs #8322 set department inside worker by:alexm
- refactor: skip intermitent failing test by:Jon
### Fixed 🛠️
- feat: refs #8225 added entry module and fixed translations by:Jon
- fix: added missing translations in InvoiceIn by:provira
- fix: changed invoiceIn for InvoiceIn by:provira
- fix: changed translations to only use "invoicein" by:provira
- fix: department descriptor link by:Jon
- fix: e2e tests by:Jon
- fix: entry summary view and build warnings by:Jon
- fix: fixed InvoiceIn filter translations by:provira
- fix: modified setData in customerDescriptor to show the icons by:Jon
- fix: redirect to TicketSale from OrderLines (origin/Fix-RedirectToTicketSale) by:Jon
- fix: redirect when confirming lines by:Jon
- fix: refs #7055 #7055 #7055 fixed some tests by:provira
- fix: refs #7077 removed unused imports by:provira
- fix: refs #7078 added missing case with array by:provira
- fix: refs #7087 fixed some tests by:provira
- fix: refs #7088 changed "vm.vm" to "vm" by:provira
- fix: refs #7088 changed wrapper to vm by:provira
- fix: refs #7699 add icons and hint by:carlossa
- fix: refs #7699 add pwd vnInput by:carlossa
- fix: refs #7699 fix component by:carlossa
- fix: refs #7699 fix password visibility by:carlossa
- fix: refs #7699 fix tfront clean code by:carlossa
- fix: refs #7699 fix vnChangePassword, clean VnInput by:carlossa
- fix: refs #7699 fix vnInputPassword by:carlossa
- fix: refs #7957 add missing closing brace by:jorgep
- fix: refs #7957 css by:jorgep
- fix: refs #7957 rollback by:jorgep
- fix: refs #7957 update data-cy by:jorgep
- fix: refs #7957 update visibility handling for clear icon in VnInput component by:jorgep
- fix: refs #7957 vn-searchbar test by:jorgep
- fix: refs #8117 update salesPersonFk filter options and URL for improved data retrieval by:jtubau
- fix: refs #8197 not use yet by:alexm
- fix: refs #8198 update query param by:jorgep
- fix: refs #8219 fixed e2e tests by:Jon
- fix: refs #8219 fixed summary and global tests by:Jon
- fix: refs #8219 forgotten dataCy by:Jon
- fix: refs #8219 global e2e by:Jon
- fix: refs #8219 requested changes by:Jon
- fix: refs #8220 itemTag test by:Javier Segarra
- fix: refs #8225 invoice in translations by:Jon
- fix: refs #8243 fixed SkeletonSummary by:provira
- fix: refs #8247 conflicts by:Jon
- fix: refs #8247 fixed acls and added lost options by:Jon
- fix: refs #8316 ref="claimFilterRef" by:alexm
- fix: refs #8316 userFilter by:alexm
- fix: refs #8316 use rightMenu by:alexm
- fix: refs #8316 use section-searchbar by:alexm
- fix: refs #8317 disable action buttons when no rows are selected in ItemFixedPrice by:jtubau
- fix: refs #8322 unnecessary section by:alexm
- fix: refs #8338 fixed VnTable translations by:provira
- fix: refs #8338 removed chipLocale property/added more translations by:provira
- fix: refs #8448 e2e by:Jon
- fix: refs #8448 not use croppie by:alexm
- fix: remove departmentCode by:Javier Segarra
- fix: removed unused searchbar by:PAU ROVIRA ROSALENY
- fix: skip failling e2e by:Jon
- fix: sort by name in description by:Jon
- fix: translations by:Jon
- fix: use entryFilter by:alexm
- fix(VnCardBeta): add userFilter by:alexm
- refactor: refs #8219 modified e2e tests and fixed some translations by:Jon
- revert: revert header by:alexm
- test: fix expedition e2e by:alexm
# Version 25.00 - 2025-01-14
### Added 🆕

View File

@ -30,9 +30,11 @@ export default defineConfig({
testFiles: '**/*.spec.js',
supportFile: 'test/cypress/support/unit.js',
},
setupNodeEvents(on, config) {
import('cypress-mochawesome-reporter/plugin').then((plugin) => plugin.default(on));
// implement node event listeners here
setupNodeEvents: async (on, config) => {
const plugin = await import('cypress-mochawesome-reporter/plugin');
plugin.default(on);
return config;
},
viewportWidth: 1280,
viewportHeight: 720,

38
docs/.vitepress/config.js Normal file
View File

@ -0,0 +1,38 @@
import { defineConfig } from 'vitepress';
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Lilium',
description: 'Lilium docs',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'Components', link: '/components/vnInput' },
{ text: 'Composables', link: '/composables/useArrayData' },
],
sidebar: [
{
items: [
{
text: 'Components',
collapsible: true,
collapsed: true,
items: [{ text: 'VnInput', link: '/components/vnInput' }],
},
{
text: 'Composables',
collapsible: true,
collapsed: true,
items: [
{ text: 'useArrayData', link: '/composables/useArrayData' },
],
},
],
},
],
socialLinks: [{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }],
},
});

136
docs/components/vnInput.md Normal file
View File

@ -0,0 +1,136 @@
# VnInput
`VnInput` is a custom input component that provides various useful features such as validation, input clearing, and more.
## Props
### `modelValue`
- **Type:** `String | Number`
- **Default:** `null`
- **Description:** The value of the model bound to the component.
### `isOutlined`
- **Type:** `Boolean`
- **Default:** `false`
- **Description:** If `true`, the component is rendered with an outlined style.
### `info`
- **Type:** `String`
- **Default:** `''`
- **Description:** Additional information displayed alongside the component.
### `clearable`
- **Type:** `Boolean`
- **Default:** `true`
- **Description:** If `true`, the component shows a button to clear the input.
### `emptyToNull`
- **Type:** `Boolean`
- **Default:** `true`
- **Description:** If `true`, converts empty inputs to `null`.
### `insertable`
- **Type:** `Boolean`
- **Default:** `false`
- **Description:** If `true`, allows the insertion of new values.
### `maxlength`
- **Type:** `Number`
- **Default:** `null`
- **Description:** The maximum number of characters allowed in the input.
### `uppercase`
- **Type:** `Boolean`
- **Default:** `false`
- **Description:** If `true`, converts the input text to uppercase.
## Emits
### `update:modelValue`
- **Description:** Emits the updated model value.
- **Behavior:** This event is emitted whenever the input value changes. It is used to update the model value bound to the component.
### `update:options`
- **Description:** Emits the updated options.
- **Behavior:** This event is emitted when the component's options change. It is useful for components with dynamic options.
### `keyup.enter`
- **Description:** Emits an event when the Enter key is pressed.
- **Behavior:** This event is emitted whenever the Enter key is pressed while the input is focused. It can be used to handle specific actions when the input is confirmed.
### `remove`
- **Description:** Emits an event to remove the current value.
- **Behavior:** This event is emitted when the clear button (close icon) is clicked. It is used to handle the removal of the current input value.
## Functions
### `focus`
- **Description:** Focuses the input.
- **Behavior:** This function is exposed so it can be called from outside the component. It uses `vnInputRef.value.focus()` to focus the input.
### `handleKeydown`
- **Description:** Handles the `keydown` event of the input.
- **Behavior:** This function is called whenever a key is pressed while the input is focused. If the pressed key is `Backspace`, it does nothing. If `insertable` is `true` and the pressed key is a number, it calls `handleInsertMode`.
### `handleInsertMode`
- **Description:** Handles the insertion mode of values.
- **Behavior:** This function is called when `insertable` is `true` and a numeric key is pressed. It inserts the value at the cursor position and updates the input value. Then, it moves the cursor to the correct position.
### `handleUppercase`
- **Description:** Converts the input value to uppercase.
- **Behavior:** This function is called when the uppercase icon is clicked. It converts the current input value to uppercase.
## Usage
```vue
<template>
<VnInput
v-model="inputValue"
:isOutlined="true"
info="Additional information"
:clearable="true"
:emptyToNull="true"
:insertable="false"
:maxlength="50"
:uppercase="true"
@update:modelValue="handleUpdate"
@keyup.enter="handleEnter"
@remove="handleRemove"
/>
</template>
<script setup>
import { ref } from 'vue';
import VnInput from 'src/components/common/VnInput.vue';
const inputValue = ref('');
const handleUpdate = (value) => {
console.log('Updated value:', value);
};
const handleEnter = () => {
console.log('Enter pressed');
};
const handleRemove = () => {
console.log('Value removed');
};
</script>
```

View File

@ -0,0 +1,215 @@
# useArrayData
`useArrayData` is a composable function that provides a set of utilities for managing array data in a Vue component. It leverages Pinia for state management and provides various methods for fetching, filtering, and manipulating data.
## Usage
```javascript
import { useArrayData } from 'src/composables/useArrayData';
const {
fetch,
applyFilter,
addFilter,
getCurrentFilter,
setCurrentFilter,
addFilterWhere,
addOrder,
deleteOrder,
refresh,
destroy,
loadMore,
store,
totalRows,
updateStateParams,
isLoading,
deleteOption,
reset,
resetPagination,
} = useArrayData('myKey', userOptions);
```
## Parameters
### `key`
- **Type:** `String`
- **Description:** A unique key to identify the data store.
### `userOptions`
- **Type:** `Object`
- **Description:** An object containing user-defined options for configuring the data store.
## Methods
### `fetch`
Fetches data from the server.
#### Parameters
- **`options`** : An object with the following properties:
- `append` (Boolean): Whether to append the fetched data to the existing data.
- `updateRouter` (Boolean): Whether to update the router with the current filter.
#### Returns
- **`Promise`** : A promise that resolves with the fetched data.
### `applyFilter`
Applies a filter to the data.
#### Parameters
- **`filter`** : An object containing the filter criteria.
- **`params`** : Additional parameters for the filter.
- **`fetchOptions`** : Options for the fetch method.
#### Returns
- **`Promise`** : A promise that resolves with the filtered data.
### `addFilter`
Adds a filter to the existing filters.
#### Parameters
- **`filter`** : An object containing the filter criteria.
- **`params`** : Additional parameters for the filter.
#### Returns
- **`Promise`** : A promise that resolves with the updated filter and parameters.
### `getCurrentFilter`
Gets the current filter applied to the data.
#### Returns
- **`Object`** : The current filter and parameters.
### `setCurrentFilter`
Sets the current filter for the data.
#### Returns
- **`Object`** : The current filter and parameters.
### `addFilterWhere`
Adds a `where` clause to the existing filters.
#### Parameters
- **`where`** : An object containing the `where` clause.
#### Returns
- **`Promise`** : A promise that resolves when the filter is applied.
### `addOrder`
Adds an order to the existing orders.
#### Parameters
- **`field`** : The field to order by.
- **`direction`** : The direction of the order (`ASC` or `DESC`).
#### Returns
- **`Promise`** : A promise that resolves with the updated order.
### `deleteOrder`
Deletes an order from the existing orders.
#### Parameters
- **`field`** : The field to delete the order for.
#### Returns
- **`Promise`** : A promise that resolves when the order is deleted.
### `refresh`
Refreshes the data by re-fetching it from the server.
#### Returns
- **`Promise`** : A promise that resolves with the refreshed data.
### `destroy`
Destroys the data store for the given key.
### `loadMore`
Loads more data by incrementing the pagination.
#### Returns
- **`Promise`** : A promise that resolves with the additional data.
### `updateStateParams`
Updates the state parameters with the given data.
#### Parameters
- **`data`** : The data to update the state parameters with.
### `deleteOption`
Deletes an option from the store.
#### Parameters
- **`option`** : The option to delete.
### `reset`
Resets the store to its default state.
#### Parameters
- **`opts`** : An array of options to reset.
### `resetPagination`
Resets the pagination for the store.
## Computed Properties
### `totalRows`
- **Description:** The total number of rows in the data.
- **Type:** `Number`
### `isLoading`
- **Description:** Whether the data is currently being loaded.
- **Type:** `Boolean`
```vue
<script setup>
import { useArrayData } from 'src/composables/useArrayData';
const userOptions = {
url: '/api/data',
limit: 10,
};
const arrayData = useArrayData('myKey', userOptions);
</script>
```
```
```

13
docs/index.md Normal file
View File

@ -0,0 +1,13 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home
hero:
name: 'Lilium'
text: 'Lilium docs'
tagline: Powered by Verdnatura
actions:
- theme: brand
text: Docs
link: /components/vnInput
---

View File

@ -1,70 +1,74 @@
{
"name": "salix-front",
"version": "25.06.0",
"description": "Salix frontend",
"productName": "Salix",
"author": "Verdnatura",
"private": true,
"packageManager": "pnpm@8.15.1",
"type": "module",
"scripts": {
"resetDatabase": "cd ../salix && gulp docker",
"lint": "eslint --ext .js,.vue ./",
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
"test:e2e": "cypress open",
"test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run",
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
"test:unit": "vitest",
"test:unit:ci": "vitest run",
"commitlint": "commitlint --edit",
"prepare": "npx husky install",
"addReferenceTag": "node .husky/addReferenceTag.js"
},
"dependencies": {
"@quasar/cli": "^2.4.1",
"@quasar/extras": "^1.16.16",
"axios": "^1.4.0",
"chromium": "^3.0.3",
"croppie": "^2.6.5",
"moment": "^2.30.1",
"pinia": "^2.1.3",
"quasar": "^2.17.7",
"validator": "^13.9.0",
"vue": "^3.5.13",
"vue-i18n": "^9.3.0",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@intlify/unplugin-vue-i18n": "^0.8.2",
"@pinia/testing": "^0.1.2",
"@quasar/app-vite": "^2.0.8",
"@quasar/quasar-app-extension-qcalendar": "^4.0.2",
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
"@vue/test-utils": "^2.4.4",
"autoprefixer": "^10.4.14",
"cypress": "^13.6.6",
"cypress-mochawesome-reporter": "^3.8.2",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-vue": "^9.32.0",
"husky": "^8.0.0",
"postcss": "^8.4.23",
"prettier": "^3.4.2",
"sass": "^1.83.4",
"vitest": "^0.34.0"
},
"engines": {
"node": "^20 || ^18 || ^16",
"npm": ">= 8.1.2",
"yarn": ">= 1.21.1",
"bun": ">= 1.0.25"
},
"overrides": {
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.0.11",
"vitest": "^0.31.1"
}
}
"name": "salix-front",
"version": "25.06.0",
"description": "Salix frontend",
"productName": "Salix",
"author": "Verdnatura",
"private": true,
"packageManager": "pnpm@8.15.1",
"type": "module",
"scripts": {
"resetDatabase": "cd ../salix && gulp docker",
"lint": "eslint --ext .js,.vue ./",
"format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore",
"test:e2e": "cypress open",
"test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run",
"test": "echo \"See package.json => scripts for available tests.\" && exit 0",
"test:unit": "vitest",
"test:unit:ci": "vitest run",
"commitlint": "commitlint --edit",
"prepare": "npx husky install",
"addReferenceTag": "node .husky/addReferenceTag.js",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
},
"dependencies": {
"@quasar/cli": "^2.4.1",
"@quasar/extras": "^1.16.16",
"axios": "^1.4.0",
"chromium": "^3.0.3",
"croppie": "^2.6.5",
"moment": "^2.30.1",
"pinia": "^2.1.3",
"quasar": "^2.17.7",
"validator": "^13.9.0",
"vue": "^3.5.13",
"vue-i18n": "^9.3.0",
"vue-router": "^4.2.5"
},
"devDependencies": {
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@intlify/unplugin-vue-i18n": "^0.8.2",
"@pinia/testing": "^0.1.2",
"@quasar/app-vite": "^2.0.8",
"@quasar/quasar-app-extension-qcalendar": "^4.0.2",
"@quasar/quasar-app-extension-testing-unit-vitest": "^0.4.0",
"@vue/test-utils": "^2.4.4",
"autoprefixer": "^10.4.14",
"cypress": "^13.6.6",
"cypress-mochawesome-reporter": "^3.8.2",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-cypress": "^4.1.0",
"eslint-plugin-vue": "^9.32.0",
"husky": "^8.0.0",
"postcss": "^8.4.23",
"prettier": "^3.4.2",
"sass": "^1.83.4",
"vitepress": "^1.6.3",
"vitest": "^0.34.0"
},
"engines": {
"node": "^20 || ^18 || ^16",
"npm": ">= 8.1.2",
"yarn": ">= 1.21.1",
"bun": ">= 1.0.25"
},
"overrides": {
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.0.11",
"vitest": "^0.31.1"
}
}

File diff suppressed because it is too large Load Diff

6
proxy-serve.js Normal file
View File

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

View File

@ -179,7 +179,6 @@ export default configure(function (/* ctx */) {
'render', // keep this as last one
],
},
// https://v2.quasar.dev/quasar-cli/developing-pwa/configuring-pwa
pwa: {
workboxMode: 'generateSW', // or 'injectManifest'

View File

@ -149,7 +149,7 @@ function filter(value, update, filterOptions) {
(ref) => {
ref.setOptionIndex(-1);
ref.moveOptionSelection(1, true);
}
},
);
}
@ -215,7 +215,7 @@ async function remove(data) {
if (preRemove.length) {
newData = newData.filter(
(form) => !preRemove.some((index) => index == form.$index)
(form) => !preRemove.some((index) => index == form.$index),
);
const changes = getChanges();
if (!changes.creates?.length && !changes.updates?.length)

View File

@ -349,4 +349,11 @@ es:
floramondo: Floramondo
salesPersonFk: Comprador
categoryFk: Categoría
Plant: Planta natural
Flower: Flor fresca
Handmade: Hecho a mano
Artificial: Artificial
Green: Verdes frescos
Accessories: Complementos florales
Fruit: Fruta
</i18n>

View File

@ -20,6 +20,7 @@ const appName = 'Lilium';
const pinnedModulesRef = ref();
onMounted(() => stateStore.setMounted());
const refresh = () => window.location.reload();
</script>
<template>
<QHeader color="white" elevated>
@ -64,6 +65,13 @@ onMounted(() => stateStore.setMounted());
<QSpace />
<div class="q-pl-sm q-gutter-sm row items-center no-wrap">
<div id="actions-prepend"></div>
<QIcon
name="refresh"
size="md"
color="red"
v-if="state.get('error')"
@click="refresh"
/>
<QBtn
:class="{ 'q-pa-none': quasar.platform.is.mobile }"
id="pinnedModules"

View File

@ -0,0 +1,12 @@
export default function (initialFooter, data) {
const footer = data.reduce(
(acc, row) => {
Object.entries(initialFooter).forEach(([key, initialValue]) => {
acc[key] += row?.[key] !== undefined ? row[key] : initialValue;
});
return acc;
},
{ ...initialFooter }
);
return footer;
}

View File

@ -26,6 +26,7 @@ onMounted(() => {
round
dense
icon="dock_to_left"
data-cy="toggle-right-drawer"
>
<QTooltip bottom anchor="bottom right">
{{ t('globals.collapseMenu') }}

View File

@ -175,7 +175,11 @@ const handleUppercase = () => {
v-if="!$attrs.disabled && !($attrs.readonly) && $props.uppercase"
@click="handleUppercase"
class="uppercase-icon"
/>
>
<QTooltip>
{{ t('Convert to uppercase') }}
</QTooltip>
</QIcon>
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
<QIcon v-if="info" name="info">
@ -188,13 +192,26 @@ const handleUppercase = () => {
</div>
</template>
<style>
.uppercase-icon {
transition: color 0.3s, transform 0.2s;
cursor: pointer;
}
.uppercase-icon:hover {
color: #ed9937;
transform: scale(1.2);
}
</style>
<i18n>
en:
inputMin: Must be more than {value}
maxLength: The value exceeds {value} characters
inputMax: Must be less than {value}
es:
inputMin: Debe ser mayor a {value}
maxLength: El valor excede los {value} carácteres
inputMax: Debe ser menor a {value}
Convert to uppercase: Convertir a mayúsculas
</i18n>

View File

@ -98,8 +98,8 @@ function checkIsMain() {
/>
<div :id="searchbarId"></div>
</slot>
<RightAdvancedMenu :is-main-section="isMainSection && rightFilter">
<template #advanced-menu v-if="$slots[advancedMenuSlot]">
<RightAdvancedMenu :is-main-section="isMainSection">
<template #advanced-menu v-if="$slots[advancedMenuSlot] || rightFilter">
<slot :name="advancedMenuSlot">
<VnTableFilter
v-if="rightFilter && columns"

View File

@ -170,7 +170,7 @@ function emitStoreData() {
async function paginate() {
const { page, rowsPerPage, sortBy, descending } = pagination.value;
if (!props.url) return;
if (!arrayData.store.url) return;
isLoading.value = true;
await arrayData.loadMore();

View File

@ -1,7 +1,7 @@
globals:
lang:
es: Spanish
en: English
en: English
language: Language
quantity: Quantity
entity: Entity
@ -453,6 +453,7 @@ ticket:
service: Service
attender: Attender
ok: Ok
consigneeStreet: Street
create:
address: Address
invoiceOut:
@ -721,6 +722,7 @@ travel:
destination: Destination
thermograph: Thermograph
travelFileDescription: 'Travel id { travelId }'
carrier: Carrier
components:
topbar: {}
itemsFilterPanel:

View File

@ -448,6 +448,7 @@ ticket:
purchaseRequest: Petición de compra
service: Servicio
attender: Consignatario
consigneeStreet: Dirección
create:
address: Dirección
order:
@ -691,6 +692,7 @@ travel:
destination: Destino
thermograph: Termógrafo
travelFileDescription: 'Id envío { travelId }'
carrier: Transportista
components:
topbar: {}
itemsFilterPanel:

View File

@ -1,3 +1,4 @@
<script setup>
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
@ -169,9 +170,16 @@ en:
fi: FI
salesPersonFk: Salesperson
provinceFk: Province
isActive: Is active
city: City
phone: Phone
email: Email
isToBeMailed: Mailed
isEqualizated: Equailized
businessTypeFk: Business type
sageTaxTypeFk: Sage Tax Type
sageTransactionTypeFk: Sage Tax Type
payMethodFk: Billing data
zoneFk: Zone
socialName : Social name
name: Name
@ -180,6 +188,13 @@ es:
params:
search: Contiene
fi: NIF
isActive: Activo
isToBeMailed: A enviar
isEqualizated: Recargo de equivalencia
businessTypeFk: Tipo de negocio
sageTaxTypeFk: Tipo de impuesto Sage
sageTransactionTypeFk: Tipo de impuesto Sage
payMethodFk: Forma de pago
salesPersonFk: Comercial
provinceFk: Provincia
city: Ciudad

View File

@ -38,8 +38,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('globals.name'),
name: 'name',
label: t('globals.name'),
isTitle: true,
create: true,
columnClass: 'expand',
@ -51,25 +51,30 @@ const columns = computed(() => [
isTitle: true,
create: true,
columnClass: 'expand',
attrs: {
uppercase: true,
},
columnFilter: {
component: 'select',
attrs: {
url: 'Clients',
fields: ['socialName'],
optionLabel: 'socialName',
optionValue: 'socialName',
uppercase: false,
},
},
attrs: {
uppercase: true,
},
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.fi'),
name: 'fi',
label: t('customer.extendedList.tableVisibleColumns.fi'),
create: true,
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
name: 'salesPersonFk',
label: t('customer.extendedList.tableVisibleColumns.salesPersonFk'),
component: 'select',
attrs: {
url: 'Workers/activeWithInheritedRole',
@ -85,8 +90,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.summary.credit'),
name: 'credit',
label: t('customer.summary.credit'),
columnFilter: {
component: 'number',
inWhere: true,
@ -94,8 +99,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.creditInsurance'),
name: 'creditInsurance',
label: t('customer.extendedList.tableVisibleColumns.creditInsurance'),
columnFilter: {
component: 'number',
inWhere: true,
@ -103,8 +108,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.phone'),
name: 'phone',
label: t('customer.extendedList.tableVisibleColumns.phone'),
cardVisible: true,
columnFilter: {
component: 'number',
@ -123,8 +128,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.summary.mobile'),
name: 'mobile',
label: t('customer.summary.mobile'),
cardVisible: true,
columnFilter: {
component: 'number',
@ -133,8 +138,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.street'),
name: 'street',
label: t('customer.extendedList.tableVisibleColumns.street'),
create: true,
columnFilter: {
inWhere: true,
@ -143,8 +148,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.countryFk'),
name: 'countryFk',
label: t('customer.extendedList.tableVisibleColumns.countryFk'),
columnFilter: {
component: 'select',
inWhere: true,
@ -157,8 +162,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.provinceFk'),
name: 'provinceFk',
label: t('customer.extendedList.tableVisibleColumns.provinceFk'),
component: 'select',
attrs: {
url: 'Provinces',
@ -170,24 +175,24 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.summary.city'),
name: 'city',
label: t('customer.summary.city'),
},
{
align: 'left',
label: t('customer.summary.postcode'),
name: 'postcode',
label: t('customer.summary.postcode'),
},
{
align: 'left',
label: t('globals.params.email'),
name: 'email',
label: t('globals.params.email'),
cardVisible: true,
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.created'),
name: 'created',
label: t('customer.extendedList.tableVisibleColumns.created'),
format: ({ created }) => toDate(created),
columnFilter: {
component: 'date',
@ -197,10 +202,13 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.businessTypeFk'),
name: 'businessTypeFk',
label: t('customer.extendedList.tableVisibleColumns.businessTypeFk'),
create: true,
component: 'select',
columnFilter: {
inWhere: true,
},
attrs: {
url: 'BusinessTypes',
fields: ['code', 'description'],
@ -215,8 +223,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.summary.payMethodFk'),
name: 'payMethodFk',
label: t('customer.summary.payMethodFk'),
columnFilter: {
component: 'select',
attrs: {
@ -236,8 +244,6 @@ const columns = computed(() => [
optionLabel: 'vat',
url: 'SageTaxTypes',
},
alias: 'sti',
inWhere: true,
},
format: (row, dashIfEmpty) => dashIfEmpty(row.sageTaxType),
},
@ -251,15 +257,13 @@ const columns = computed(() => [
optionLabel: 'transaction',
url: 'SageTransactionTypes',
},
alias: 'stt',
inWhere: true,
},
format: (row, dashIfEmpty) => dashIfEmpty(row.sageTransactionType),
},
{
align: 'left',
label: t('customer.summary.isActive'),
name: 'isActive',
label: t('customer.summary.isActive'),
chip: {
color: null,
condition: (value) => !value,
@ -271,24 +275,24 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('globals.isVies'),
name: 'isVies',
label: t('globals.isVies'),
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.isTaxDataChecked'),
name: 'isTaxDataChecked',
label: t('customer.extendedList.tableVisibleColumns.isTaxDataChecked'),
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
label: t('customer.summary.isEqualizated'),
name: 'isEqualizated',
label: t('customer.summary.isEqualizated'),
create: true,
columnFilter: {
inWhere: true,
@ -296,8 +300,8 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.isFreezed'),
name: 'isFreezed',
label: t('customer.extendedList.tableVisibleColumns.isFreezed'),
chip: {
color: null,
condition: (value) => value,
@ -309,48 +313,48 @@ const columns = computed(() => [
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.hasToInvoice'),
name: 'hasToInvoice',
label: t('customer.extendedList.tableVisibleColumns.hasToInvoice'),
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.hasToInvoiceByAddress'),
name: 'hasToInvoiceByAddress',
label: t('customer.extendedList.tableVisibleColumns.hasToInvoiceByAddress'),
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.isToBeMailed'),
name: 'isToBeMailed',
label: t('customer.extendedList.tableVisibleColumns.isToBeMailed'),
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
label: t('customer.summary.hasLcr'),
name: 'hasLcr',
label: t('customer.summary.hasLcr'),
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
label: t('customer.summary.hasCoreVnl'),
name: 'hasCoreVnl',
label: t('customer.summary.hasCoreVnl'),
columnFilter: {
inWhere: true,
},
},
{
align: 'left',
label: t('customer.extendedList.tableVisibleColumns.hasSepaVnl'),
name: 'hasSepaVnl',
label: t('customer.extendedList.tableVisibleColumns.hasSepaVnl'),
columnFilter: {
inWhere: true,
},

View File

@ -114,7 +114,7 @@ const columns = computed(() => [
action: ({ id }) =>
window.open(
router.resolve({ params: { id }, name: 'TicketSale' }).href,
'_blank'
'_blank',
),
isPrimary: true,
},
@ -122,7 +122,7 @@ const columns = computed(() => [
title: t('components.smartCard.viewSummary'),
icon: 'preview',
isPrimary: true,
action: (row) => viewSummary(row.id, TicketSummary),
action: (row) => viewSummary(row.id, TicketSummary, 'lg-width'),
},
],
},

View File

@ -10,4 +10,4 @@ import DepartmentDescriptor from 'pages/Department/Card/DepartmentDescriptor.vue
base-url="Departments"
:descriptor="DepartmentDescriptor"
/>
</template>
</template>

View File

@ -44,7 +44,7 @@ const transferEntry = async () => {
<template>
<QItem v-ripple clickable @click="showEntryReport">
<QItemSection>{{ $t('entryList.list.showEntryReport') }}</QItemSection>
<QItemSection>{{ $t('entry.descriptorMenu.showEntryReport') }}</QItemSection>
</QItem>
<QItem v-ripple clickable @click="openDialog">
<QItemSection>{{ t('transferEntry') }}</QItemSection>

View File

@ -76,6 +76,8 @@ entry:
warehouseInFk: Warehouse in
search: Search entries
searchInfo: You can search by entry reference
descriptorMenu:
showEntryReport: Show entry report
entryFilter:
params:
invoiceNumber: Invoice number

View File

@ -75,6 +75,8 @@ entry:
warehouseInFk: Alm. entrada
daysOnward: Días adelante
daysAgo: Días atras
descriptorMenu:
showEntryReport: Ver informe del pedido
search: Buscar entradas
searchInfo: Puedes buscar por referencia de entrada
entryFilter:

View File

@ -368,7 +368,7 @@ watchEffect(selectedRows);
<VnSelect
url="InvoiceOutSerials"
v-model="data.serial"
:label="t('invoicein.serial')"
:label="t('invoiceOutModule.serial')"
:options="invoiceOutSerialsOptions"
option-label="description"
option-value="code"

View File

@ -60,6 +60,7 @@ invoiceOutModule:
amount: Amount
company: Company
address: Address
serial: Serial
invoiceOutList:
tableVisibleColumns:
id: ID
@ -70,4 +71,4 @@ invoiceOutList:
invoiceOutSerial: Serial
ticket: Ticket
taxArea: Tax area
customsAgent: Custom Agent
customsAgent: Custom Agent

View File

@ -11,7 +11,7 @@ invoiceOut:
isActive: Activo
hasToInvoice: Debe facturar
hasVerifiedData: Datos verificados
workerName: Comercial
workerName: Comercial
card:
issued: Fecha emisión
customerCard: Ficha del cliente
@ -54,12 +54,13 @@ invoiceOut:
verifiedData: Datos comprobados
comercial: Comercial
errors:
downloadCsvFailed: Error al descargar CSV
downloadCsvFailed: Error al descargar CSV
invoiceOutModule:
customer: Cliente
amount: Importe
company: Empresa
address: Consignatario
serial: Serie
invoiceOutList:
tableVisibleColumns:
id: ID
@ -70,4 +71,4 @@ invoiceOutList:
invoiceOutSerial: Serial
ticket: Ticket
taxArea: Area
customsAgent: Agente de aduanas
customsAgent: Agente de aduanas

View File

@ -13,10 +13,9 @@ import axios from 'axios';
const route = useRoute();
const { t } = useI18n();
const itemTagsRef = ref(null);
const itemTagsRef = ref();
const tagOptions = ref([]);
const valueOptionsMap = ref(new Map());
const getSelectedTagValues = async (tag) => {
if (!tag.tagFk && tag.tag.isFree) return;
const filter = {
@ -59,10 +58,6 @@ const insertTag = (rows) => {
itemTagsRef.value.formData[itemTagsRef.value.formData.length - 1].priority =
getHighestPriority(rows);
};
const submitTags = async (data) => {
itemTagsRef.value.onSubmit(data);
};
</script>
<template>
@ -149,7 +144,7 @@ const submitTags = async (data) => {
v-model="row.value"
:label="t('itemTags.value')"
:is-clearable="false"
@keyup.enter.stop="submitTags(row)"
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
/>
<VnInput
:label="t('itemBasicData.relevancy')"
@ -157,7 +152,7 @@ const submitTags = async (data) => {
v-model="row.priority"
:required="true"
:rules="validate('itemTag.priority')"
@keyup.enter.stop="submitTags(row)"
@keyup.enter.stop="(data) => itemTagsRef.onSubmit(data)"
/>
<div class="row justify-center" style="flex: 0">
<QIcon
@ -197,4 +192,5 @@ const submitTags = async (data) => {
<i18n>
es:
Tags can not be repeated: Las etiquetas no pueden repetirse
The value must be a number or a range of numbers: El valor debe ser un número o un rango de números
</i18n>

View File

@ -422,6 +422,7 @@ function handleOnDataSave({ CrudModelRef }) {
onDataSaved: handleOnDataSave,
}"
:disable-option="{ card: true }"
:has-sub-toolbar="false"
>
<template #header-selection="scope">
<QCheckbox v-model="scope.selected" />

View File

@ -48,14 +48,14 @@ const itemPackingTypesOptions = ref([]);
>
<template #form="{ data }">
<VnRow>
<VnInput v-model="data.code" :label="t('shared.code')" />
<VnInput v-model="data.name" :label="t('shared.name')" />
<VnInput v-model="data.code" :label="t('itemType.shared.code')" />
<VnInput v-model="data.name" :label="t('itemType.shared.name')" />
</VnRow>
<VnRow>
<VnSelect
url="Workers/search"
v-model="data.workerFk"
:label="t('shared.worker')"
:label="t('itemType.shared.worker')"
sort-by="nickname ASC"
:fields="['id', 'nickname']"
option-label="nickname"
@ -83,7 +83,7 @@ const itemPackingTypesOptions = ref([]);
>
<VnSelect
v-model="data.categoryFk"
:label="t('shared.category')"
:label="t('itemType.shared.category')"
:options="categoriesOptions"
option-value="id"
option-label="name"
@ -93,27 +93,30 @@ const itemPackingTypesOptions = ref([]);
<VnRow>
<VnSelect
v-model="data.temperatureFk"
:label="t('shared.temperature')"
:label="t('itemType.shared.temperature')"
:options="temperaturesOptions"
option-value="code"
option-label="name"
hide-selected
/>
<VnInput v-model="data.life" :label="t('shared.life')" />
<VnInput v-model="data.life" :label="t('itemType.summary.life')" />
</VnRow>
<VnRow>
<VnSelect
v-model="data.itemPackingTypeFk"
:label="t('shared.itemPackingType')"
:label="t('itemType.shared.itemPackingType')"
:options="itemPackingTypesOptions"
option-value="code"
option-label="description"
hide-selected
/>
<VnInput v-model="data.maxRefs" :label="t('shared.maxRefs')" />
<VnInput v-model="data.maxRefs" :label="t('itemType.shared.maxRefs')" />
</VnRow>
<VnRow>
<QCheckbox v-model="data.isFragile" :label="t('shared.fragile')" />
<QCheckbox
v-model="data.isFragile"
:label="t('itemType.shared.fragile')"
/>
</VnRow>
</template>
</FormModel>

View File

@ -50,15 +50,15 @@ const setData = (entity) => (data.value = useCardDescription(entity.code, entity
@on-fetch="setData"
>
<template #body="{ entity }">
<VnLv :label="t('shared.code')" :value="entity.code" />
<VnLv :label="t('shared.name')" :value="entity.name" />
<VnLv :label="t('shared.worker')">
<VnLv :label="t('itemType.shared.code')" :value="entity.code" />
<VnLv :label="t('itemType.shared.name')" :value="entity.name" />
<VnLv :label="t('itemType.shared.worker')">
<template #value>
<span class="link">{{ entity.worker?.firstName }}</span>
<WorkerDescriptorProxy :id="entity.worker?.id" />
</template>
</VnLv>
<VnLv :label="t('shared.category')" :value="entity.category?.name" />
<VnLv :label="t('itemType.shared.category')" :value="entity.category?.name" />
</template>
</CardDescriptor>
</template>

View File

@ -76,13 +76,6 @@ itemTags:
searchbar:
label: Search item
info: Search by item id
itemType:
shared:
code: Code
name: Name
worker: Worker
category: Category
temperature: Temperature
item:
params:
daysOnward: Days onward

View File

@ -80,6 +80,9 @@ itemType:
worker: Trabajador
category: Reino
temperature: Temperatura
searchbar:
label: Buscar artículo
info: Buscar por id de artículo
params:
state: asfsdf
item:
@ -216,6 +219,6 @@ item:
item: 'Artículo'
achieved: 'Conseguido'
concept: 'Concepto'
state: 'Estado'
state: 'Estado'
search: 'Buscar artículo'
searchInfo: 'Puedes buscar por id'
searchInfo: 'Puedes buscar por id'

View File

@ -1,8 +1,12 @@
<script setup>
import RouteDescriptor from 'pages/Route/Card/RouteDescriptor.vue';
import VnCardBeta from 'src/components/common/VnCardBeta.vue';
</script>
<template>
<VnCardBeta data-key="Route" base-url="Routes" :descriptor="RouteDescriptor" />
<VnCardBeta
data-key="Route"
base-url="Routes"
custom-url="Routes/filter"
:descriptor="RouteDescriptor"
/>
</template>

View File

@ -0,0 +1,191 @@
<script setup>
import { computed, onBeforeMount, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute } from 'vue-router';
import tableFooter from 'src/components/VnTable/filters/tableFooter';
import { dashIfEmpty, toCurrency, toDateHourMin } from 'src/filters';
import { useState } from 'src/composables/useState';
import { useStateStore } from 'src/stores/useStateStore';
import VnTable from 'src/components/VnTable/VnTable.vue';
import InvoiceInDescriptorProxy from 'src/pages/InvoiceIn/Card/InvoiceInDescriptorProxy.vue';
import SupplierBalanceFilter from './SupplierBalanceFilter.vue';
import { onMounted } from 'vue';
import FetchData from 'src/components/FetchData.vue';
const { t } = useI18n();
const route = useRoute();
const state = useState();
const stateStore = useStateStore();
const user = state.getUser();
const tableRef = ref();
const companyId = ref();
const companyUser = ref(user.value.companyFk);
const balances = ref([]);
const userParams = ref({
supplierId: route.params.id,
companyId: companyId.value ?? companyUser.value,
isBooked: false,
});
const columns = computed(() => [
{
align: 'left',
name: 'dated',
label: t('Creation date'),
format: ({ dated }) => toDateHourMin(dated),
cardVisible: true,
},
{
align: 'left',
name: 'sref',
label: t('Reference'),
isTitle: true,
class: 'extend',
format: ({ sref }) => dashIfEmpty(sref),
},
{
align: 'left',
name: 'bank',
label: t('Bank'),
cardVisible: true,
},
{
align: 'left',
name: 'invoiceEuros',
label: t('Debit'),
format: ({ invoiceEuros }) => toCurrency(invoiceEuros),
isId: true,
},
{
align: 'left',
name: 'paymentEuros',
label: t('Havings'),
format: ({ paymentEuros }) => toCurrency(paymentEuros),
cardVisible: true,
},
{
align: 'left',
name: 'euroBalance',
label: t('Balance'),
format: ({ euroBalance }) => toCurrency(euroBalance),
cardVisible: true,
},
{
align: 'left',
name: 'isBooked',
label: t('Conciliated'),
cardVisible: true,
},
]);
onBeforeMount(() => {
stateStore.rightDrawer = true;
companyId.value = companyUser.value;
});
onMounted(async () => {
Object.assign(userParams, {
supplierId: route.params.id,
companyId: companyId.value ?? companyUser.value,
isConciliated: false,
});
});
function setFooter(data) {
const initialFooter = {
invoiceEuros: 0,
paymentEuros: 0,
euroBalance: 0,
};
tableRef.value.footer = tableFooter(initialFooter, data);
}
async function onFetch(data) {
setFooter(data);
return;
}
function round(value) {
return Math.round(value * 100) / 100;
}
const onFetchCurrencies = ([currency]) => {
userParams.value.currencyFk = currency?.id;
};
</script>
<template>
<QDrawer side="right" :width="265" v-model="stateStore.rightDrawer">
<SupplierBalanceFilter data-key="SupplierBalance" />
</QDrawer>
<FetchData
url="Currencies"
:filter="{ fields: ['id', 'code'], where: { code: 'EUR' } }"
sort-by="code"
@on-fetch="onFetchCurrencies"
auto-load
/>
<VnTable
v-if="userParams.currencyFk"
ref="tableRef"
data-key="SupplierBalance"
url="Suppliers/receipts"
search-url="balance"
:user-params="userParams"
:columns="columns"
:right-search="false"
:is-editable="false"
:column-search="false"
@on-fetch="onFetch"
:disable-option="{ card: true }"
:footer="true"
:order="['dated ASC']"
data-cy="supplierBalanceTable"
auto-load
:map-key="false"
>
<template #column-balance="{ rowIndex }">
{{ toCurrency(balances[rowIndex]?.balance) }}
</template>
<template #column-sref="{ row }">
<span class="link" v-if="row.statementType === 'invoiceIn'">
{{ dashIfEmpty(row.sref) }}
<InvoiceInDescriptorProxy :id="row.id" />
</span>
<span v-else> {{ dashIfEmpty(row.sref) }}</span>
</template>
<template #column-footer-invoiceEuros>
<span>
{{ toCurrency(round(tableRef.footer.invoiceEuros)) }}
</span>
</template>
<template #column-footer-paymentEuros>
<span>
{{ toCurrency(round(tableRef.footer.paymentEuros)) }}
</span>
</template>
<template #column-footer-euroBalance>
<span>
{{ toCurrency(round(tableRef.footer.euroBalance)) }}
</span>
</template>
</VnTable>
</template>
<i18n>
es:
Company: Empresa
Total by company: Total por empresa
Date: Fecha
Creation date: Fecha de creación
Reference: Referencia
Bank: Caja
Debit: Debe
Havings: Haber
Balance: Balance
Conciliated: Conciliado
</i18n>

View File

@ -0,0 +1,121 @@
<script setup>
import { useI18n } from 'vue-i18n';
import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInputDate from 'src/components/common/VnInputDate.vue';
const { t } = useI18n();
defineProps({
dataKey: {
type: String,
required: true,
},
});
</script>
<template>
<VnFilterPanel
:data-key="dataKey"
:search-button="true"
:redirect="false"
:unremovable-params="['supplierId', 'companyId']"
>
<template #tags="{ tag, formatFn }">
<div class="q-gutter-x-xs">
<strong>{{ t(`params.${tag.label}`) }}: </strong>
<span>{{ formatFn(tag.value) }}</span>
</div>
</template>
<template #body="{ params, searchFn }">
<QItem>
<QItemSection>
<VnInputDate
:label="t('params.from')"
v-model="params.from"
@update:model-value="searchFn()"
is-outlined
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
:label="t('params.bankFk')"
v-model="params.bankFk"
url="Accountings"
option-label="bank"
:include="{ relation: 'accountingType' }"
sort-by="id"
dense
outlined
rounded
>
<template #option="scope">
<QItem v-bind="scope.itemProps">
<QItemSection>
<QItemLabel>
{{ scope.opt.id }} {{ scope.opt.bank }}
</QItemLabel>
</QItemSection>
</QItem>
</template>
</VnSelect>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<VnSelect
:label="t('params.currencyFk')"
url="Currencies"
:filter="{ fields: ['id', 'name'] }"
order="code"
v-model="params.currencyFk"
option-value="id"
option-label="name"
hide-selected
dense
outlined
rounded
/>
</QItemSection>
</QItem>
<QItem>
<QItemSection>
<QCheckbox
v-model="params.isConciliated"
:label="t('params.isConciliated')"
/></QItemSection>
</QItem>
</template>
</VnFilterPanel>
</template>
<i18n>
en:
params:
search: General search
supplierId: Supplier
categoryId: Category
from: From
to: To
isConciliated: Is conciliated
currencyFk: Currency
bankFk: Bank
companyId: Comapany
isBooked: Is booked
es:
params:
supplierId: Proveedor
isConciliated: Conciliado
currencyFk: Moneda
New payment: Añadir pago
Date: Fecha
from: Desde
to: Hasta
companyId: Empresa
isBooked: Contabilizado
bankFk: Caja
Amount: Importe
Reference: Referencia
Cash: Efectivo
</i18n>

View File

@ -46,16 +46,6 @@ onMounted(async () => {
ticketUrl.value = (await getUrl('ticket/')) + entityId.value + '/';
});
function formattedAddress() {
if (!ticket.value) return '';
const address = ticket.value.address;
const postcode = address.postalCode;
const province = address.province ? `(${address.province.name})` : '';
return `${address.street} - ${postcode} - ${address.city} ${province}`;
}
function isEditable() {
try {
return !ticket.value.ticketState?.state?.alertLevel;
@ -243,7 +233,11 @@ onMounted(async () => {
</VnLv>
<VnLv
:label="t('ticket.summary.consignee')"
:value="formattedAddress()"
:value="`${entity.address?.nickname} #${entity.address?.id}`"
/>
<VnLv
:label="t('ticket.summary.consigneeStreet')"
:value="entity.address?.street"
/>
</QCard>
<QCard class="vn-one" v-if="entity.notes.length">

View File

@ -11,6 +11,7 @@ import { useStateStore } from 'stores/useStateStore';
import { dashIfEmpty } from 'src/filters';
import axios from 'axios';
import VnTable from 'src/components/VnTable/VnTable.vue';
import RightMenu from 'src/components/common/RightMenu.vue';
const route = useRoute();
const stateStore = useStateStore();
@ -23,7 +24,7 @@ watch(
async () => {
await nextTick();
salesRef.value?.fetch();
}
},
);
const salesFilter = computed(() => ({
@ -100,29 +101,28 @@ onMounted(() => (stateStore.rightDrawer = true));
@on-fetch="(data) => applyVolumes(data)"
auto-load
/>
<Teleport
to="#right-panel"
v-if="stateStore.isHeaderMounted() && packingTypeVolume.length"
>
<QCard
v-for="(packingType, index) in packingTypeVolume"
:key="index"
class="q-pa-md q-mb-md q-ma-md color-vn-text"
bordered
flat
style="border-color: black"
>
<QCardSection class="column items-center" horizontal>
<span>
{{ t('volume.type') }}:
{{ dashIfEmpty(packingType.description) }}
</span>
</QCardSection>
<QCardSection class="column items-center" horizontal>
<span> {{ t('volume.volume') }}: {{ packingType.volume }} </span>
</QCardSection>
</QCard>
</Teleport>
<RightMenu>
<template #right-panel>
<QCard
v-for="(packingType, index) in packingTypeVolume"
:key="index"
class="q-pa-md q-mb-md q-ma-md color-vn-text"
bordered
flat
style="border-color: black"
>
<QCardSection class="column items-center" horizontal>
<span>
{{ t('volume.type') }}:
{{ dashIfEmpty(packingType.description) }}
</span>
</QCardSection>
<QCardSection class="column items-center" horizontal>
<span> {{ t('volume.volume') }}: {{ packingType.volume }} </span>
</QCardSection>
</QCard>
</template>
</RightMenu>
<VnTable
ref="tableRef"
data-key="TicketVolume"

View File

@ -136,6 +136,12 @@ const thermographsTableColumns = computed(() => {
name: 'temperatureFk',
align: 'left',
},
{
label: t('travel.thermographs.carrier'),
field: (row) => row.agencyMode?.name,
name: 'agencyModeFk',
align: 'left',
},
{
label: t('globals.maxTemperature'),
field: 'maxTemperature',
@ -179,33 +185,31 @@ const entriesTableRows = computed(() => {
return entries.value;
});
const entriesTotalHb = computed(() =>
entriesTableRows.value.reduce((acc, { hb }) => acc + hb, 0)
);
const entriesTotals = computed(() => {
const totals = {
hb: 0,
freightValue: 0,
packageValue: 0,
cc: 0,
pallet: 0,
m3: 0,
};
const entriesTotalFreight = computed(() =>
toCurrency(
entriesTableRows.value.reduce((acc, { freightValue }) => acc + freightValue, 0)
)
);
entriesTableRows.value.forEach((row) => {
for (const key in totals) {
totals[key] += row[key] || 0;
}
});
const entriesTotalPackageValue = computed(() =>
toCurrency(
entriesTableRows.value.reduce((acc, { packageValue }) => acc + packageValue, 0)
)
);
const entriesTotalCc = computed(() =>
entriesTableRows.value.reduce((acc, { cc }) => acc + cc, 0)
);
const entriesTotalPallet = computed(() =>
entriesTableRows.value.reduce((acc, { pallet }) => acc + pallet, 0)
);
const entriesTotalM3 = computed(() =>
entriesTableRows.value.reduce((acc, { m3 }) => acc + m3, 0)
);
return {
hb: totals.hb.toFixed(2),
freight: toCurrency(totals.freightValue),
packageValue: toCurrency(totals.packageValue),
cc: totals.cc.toFixed(2),
pallet: totals.pallet.toFixed(2),
m3: totals.m3.toFixed(2),
};
});
const getTravelEntries = async (id) => {
const { data } = await axios.get(`Travels/${id}/getEntries`);
@ -214,17 +218,25 @@ const getTravelEntries = async (id) => {
const getTravelThermographs = async (id) => {
const filter = {
include: {
relation: 'warehouse',
scope: {
fields: ['id', 'name'],
include: [
{
relation: 'agencyMode',
scope: {
fields: ['id', 'name'],
},
},
},
{
relation: 'warehouse',
scope: {
fields: ['id', 'name'],
},
},
],
where: { travelFk: id },
};
const { data } = await axios.get('TravelThermographs', {
params: { filter: JSON.parse(JSON.stringify(filter)) },
params: { filter },
});
thermographs.value = data;
};
@ -368,12 +380,12 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`;
<QTd></QTd>
<QTd></QTd>
<QTd></QTd>
<QTd class="text-bold">{{ entriesTotalHb }}</QTd>
<QTd class="text-bold">{{ entriesTotalFreight }}</QTd>
<QTd class="text-bold">{{ entriesTotalPackageValue }}</QTd>
<QTd class="text-bold">{{ entriesTotalCc }}</QTd>
<QTd class="text-bold">{{ entriesTotalPallet }}</QTd>
<QTd class="text-bold">{{ entriesTotalM3 }}</QTd>
<QTd class="text-bold">{{ entriesTotals.hb }}</QTd>
<QTd class="text-bold">{{ entriesTotals.freight }}</QTd>
<QTd class="text-bold">{{ entriesTotals.packageValue }}</QTd>
<QTd class="text-bold">{{ entriesTotals.cc }}</QTd>
<QTd class="text-bold">{{ entriesTotals.pallet }}</QTd>
<QTd class="text-bold">{{ entriesTotals.m3 }}</QTd>
</template>
</QTable>
</QCard>

View File

@ -12,6 +12,7 @@ import axios from 'axios';
import useNotify from 'src/composables/useNotify.js';
import { toDate, toCelsius } from 'src/filters';
import { downloadFile } from 'src/composables/downloadFile';
import { useArrayData } from 'src/composables/useArrayData';
const route = useRoute();
const quasar = useQuasar();
@ -19,16 +20,25 @@ const router = useRouter();
const { t } = useI18n();
const { notify } = useNotify();
const travel = computed(() => useArrayData('Travel').store.data);
const thermographPaginateRef = ref();
const warehouses = ref([]);
const thermographFilter = {
include: {
relation: 'warehouse',
scope: {
fields: ['id', 'name'],
include: [
{
relation: 'agencyMode',
scope: {
fields: ['id', 'name'],
},
},
},
{
relation: 'warehouse',
scope: {
fields: ['id', 'name'],
},
},
],
where: { travelFk: route.params.id },
order: ['created'],
};
@ -47,6 +57,12 @@ const TableColumns = computed(() => {
name: 'temperatureFk',
align: 'left',
},
{
label: t('travel.thermographs.carrier'),
field: (row) => row.agencyMode?.name,
name: 'agencyModeFk',
align: 'left',
},
{
label: t('globals.maxTemperature'),
field: 'maxTemperature',
@ -116,7 +132,9 @@ const redirectToThermographForm = (action, id) => {
};
if (action === 'edit' && id) {
routeDetails.query = { travelThermographFk: id };
routeDetails.query = { id };
} else if (action === 'create') {
routeDetails.query = { agencyModeFk: travel.value?.agencyModeFk };
}
router.push(routeDetails);
};

View File

@ -39,6 +39,7 @@ const warehousesOptions = ref([]);
const temperaturesOptions = ref([]);
const thermographForm = ref({});
const inputFileRef = ref(null);
const agencyModeOptions = ref([]);
onBeforeMount(async () => {
if (props.viewAction === 'create') {
@ -49,8 +50,8 @@ onBeforeMount(async () => {
if (route.query.thermographData) {
const thermographData = JSON.parse(route.query.thermographData);
for (let key in thermographForm) {
thermographForm[key] = thermographData[key];
for (let key in thermographForm.value) {
thermographForm.value[key] = thermographData[key];
}
}
});
@ -72,6 +73,7 @@ const setCreateDefaultParams = async () => {
thermographForm.value.reference = route.params.id;
thermographForm.value.dmsTypeId = dataResponse.id;
thermographForm.value.state = 'Ok';
thermographForm.value.agencyModeFk = +route.query.agencyModeFk;
thermographForm.value.description = t('travel.thermographs.travelFileDescription', {
travelId: route.params.id,
}).toUpperCase();
@ -81,7 +83,7 @@ const setEditDefaultParams = async () => {
const filterObj = { include: { relation: 'dms' } };
const filter = encodeURIComponent(JSON.stringify(filterObj));
const { data } = await axios.get(
`TravelThermographs/${route.query.travelThermographFk}?filter=${filter}`
`TravelThermographs/${route.query.id}?filter=${filter}`,
);
if (data) {
@ -98,6 +100,7 @@ const setEditDefaultParams = async () => {
thermographForm.value.minTemperature = data.minTemperature;
thermographForm.value.temperatureFk = data.temperatureFk;
thermographForm.value.travelThermographFk = data.id;
thermographForm.value.agencyModeFk = data.agencyModeFk;
}
};
@ -159,9 +162,14 @@ const onThermographCreated = async (data) => {
auto-load
url="Temperatures"
/>
<FetchData
@on-fetch="(data) => (agencyModeOptions = data)"
auto-load
url="AgencyModeIncomings"
/>
<QPage class="column items-center full-width">
<QForm
model="travel"
:form-initial-data="thermographForm"
:observe-form-changes="viewAction === 'create'"
:default-actions="true"
@ -201,10 +209,11 @@ const onThermographCreated = async (data) => {
}"
sort-by="thermographFk ASC"
option-label="thermographFk"
option-filter-value="thermographFk"
option-filter-value="id"
:disable="viewAction === 'edit'"
:tooltip="t('New thermograph')"
:roles-allowed-to-create="['logistic']"
data-key="travelThermographSelect"
>
<template #form>
<CreateThermographForm
@ -218,10 +227,20 @@ const onThermographCreated = async (data) => {
/>
</VnRow>
<VnRow>
<VnSelect
:label="t('travel.thermographs.carrier')"
v-model="thermographForm.agencyModeFk"
:options="agencyModeOptions"
option-value="id"
option-label="name"
/>
<VnInput
v-model="thermographForm.reference"
:label="t('globals.reference')"
/>
</VnRow>
<VnRow>
<VnSelect
:label="t('globals.type')"
v-model="thermographForm.dmsTypeId"
@ -229,8 +248,6 @@ const onThermographCreated = async (data) => {
option-value="id"
option-label="name"
/>
</VnRow>
<VnRow>
<VnSelect
:label="t('globals.company')"
v-model="thermographForm.companyId"
@ -238,6 +255,8 @@ const onThermographCreated = async (data) => {
option-value="id"
option-label="code"
/>
</VnRow>
<VnRow>
<VnSelect
:label="t('globals.warehouse')"
v-model="thermographForm.warehouseId"
@ -245,8 +264,6 @@ const onThermographCreated = async (data) => {
option-value="id"
option-label="name"
/>
</VnRow>
<VnRow>
<VnSelect
:label="t('travel.thermographs.temperature')"
:options="temperaturesOptions"
@ -256,6 +273,8 @@ const onThermographCreated = async (data) => {
v-model="thermographForm.temperatureFk"
:required="true"
/>
</VnRow>
<VnRow>
<VnInputNumber
v-model="thermographForm.maxTemperature"
:label="t('globals.maxTemperature')"

View File

@ -21,8 +21,8 @@ const { t, te } = i18n.global;
const createHistory = process.env.SERVER
? createMemoryHistory
: process.env.VUE_ROUTER_MODE === 'history'
? createWebHistory
: createWebHashHistory;
? createWebHistory
: createWebHashHistory;
const Router = createRouter({
scrollBehavior: () => ({ left: 0, top: 0 }),
@ -99,9 +99,15 @@ export default defineRouter(function (/* { store, ssrContext } */) {
title += builtTitle;
}
document.title = title;
});
Router.onError(({ message }) => {
const errorMessages = [
'Failed to fetch dynamically imported module',
'Importing a module script failed',
];
state.set('error', errorMessages.some(message.includes));
});
return Router;
});

View File

@ -21,6 +21,7 @@ export default {
'SupplierAccounts',
'SupplierContacts',
'SupplierAddresses',
'SupplierBalance',
'SupplierConsumption',
'SupplierAgencyTerm',
'SupplierDms',
@ -144,6 +145,16 @@ export default {
component: () =>
import('src/pages/Supplier/Card/SupplierAddressesCreate.vue'),
},
{
path: 'balance',
name: 'SupplierBalance',
meta: {
title: 'balance',
icon: 'balance',
},
component: () =>
import('src/pages/Supplier/Card/SupplierBalance.vue'),
},
{
path: 'consumption',
name: 'SupplierConsumption',

View File

@ -0,0 +1,11 @@
describe('Supplier Balance', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
cy.visit(`/#/supplier/1/balance`);
});
it('Should load layout', () => {
cy.get('.q-page').should('be.visible');
});
});

View File

@ -3,9 +3,7 @@ describe('Client balance', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('#/customer/1101/balance', {
timeout: 5000,
});
cy.visit('#/customer/1101/balance');
});
it('Should load layout', () => {
cy.get('.q-page').should('be.visible');

View File

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

View File

@ -1,13 +1,6 @@
/// <reference types="cypress" />
describe('InvoiceOut list', () => {
const invoice = {
Ticket: { val: '8' },
Serial: { val: 'Española rapida', type: 'select' },
};
const invoiceError = {
Ticket: { val: '1' },
Serial: { val: 'Española rapida', type: 'select' },
};
const serial = 'Española rapida';
beforeEach(() => {
cy.viewport(1920, 1080);
@ -32,14 +25,16 @@ describe('InvoiceOut list', () => {
it('should give an error when manual invoicing a ticket that is already invoiced', () => {
cy.dataCy('vnTableCreateBtn').click();
cy.fillInForm(invoiceError);
cy.dataCy('InvoiceOutCreateTicketinput').type(1);
cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial);
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('This ticket is already invoiced');
});
it('should create a manual invoice and enter to its summary', () => {
cy.dataCy('vnTableCreateBtn').click();
cy.fillInForm(invoice);
cy.dataCy('InvoiceOutCreateTicketinput').type(8);
cy.selectOption('[data-cy="InvoiceOutCreateSerialSelect"]', serial);
cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created');
});

View File

@ -10,14 +10,14 @@ describe('VnLog', () => {
cy.openRightMenu();
});
it.skip('should filter by insert actions', () => {
it('should filter by insert actions', () => {
cy.checkOption(':nth-child(7) > .q-checkbox');
cy.get('.q-page').click();
cy.validateContent(chips[0], 'Document');
cy.validateContent(chips[1], 'Beginning');
});
it.skip('should filter by entity', () => {
it('should filter by entity', () => {
cy.selectOption('.q-drawer--right .q-item > .q-select', 'Claim');
cy.get('.q-page').click();
cy.validateContent(chips[0], 'Claim');

View File

@ -71,7 +71,7 @@ Cypress.Commands.add('getValue', (selector) => {
return cy
.get(
selector +
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input'
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input',
)
.invoke('val');
}
@ -264,7 +264,7 @@ Cypress.Commands.add('openListSummary', (row) => {
Cypress.Commands.add('openRightMenu', (element) => {
if (element) cy.waitForElement(element);
cy.get('#actions-append').click();
cy.get('[data-cy="toggle-right-drawer"]').click();
});
Cypress.Commands.add('openLeftMenu', (element) => {
@ -330,7 +330,7 @@ Cypress.Commands.add('clickButtonsDescriptor', (id) => {
Cypress.Commands.add('openUserPanel', () => {
cy.get(
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image'
'.column > .q-avatar > .q-avatar__content > .q-img > .q-img__container > .q-img__image',
).click();
});
@ -356,7 +356,7 @@ Cypress.Commands.add('checkValueForm', (id, search) => {
Cypress.Commands.add('checkValueSelectForm', (id, search) => {
cy.get(
`.grid-create > :nth-child(${id}) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input`
`.grid-create > :nth-child(${id}) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input`,
).should('have.value', search);
});