- {{ $props.label }}
+ {{ $props.label }}
diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue
index 3343ba64c..cc6cd1971 100644
--- a/src/components/ui/VnSearchbar.vue
+++ b/src/components/ui/VnSearchbar.vue
@@ -80,9 +80,9 @@ async function search() {
const module = route.matched[1];
if (rows.length === 1) {
const [firstRow] = rows;
- await router.push({ path: `/${module.name}/${firstRow.id}` });
+ await router.push({ path: `${module.path}/${firstRow.id}` });
} else if (route.matched.length > 3) {
- await router.push({ path: `/${module.name}` });
+ await router.push({ path: `/${module.path}` });
arrayData.updateStateParams();
}
}
diff --git a/src/composables/downloadFile.js b/src/composables/downloadFile.js
new file mode 100644
index 000000000..877d2a254
--- /dev/null
+++ b/src/composables/downloadFile.js
@@ -0,0 +1,11 @@
+import { useSession } from 'src/composables/useSession';
+import { getUrl } from './getUrl';
+
+const session = useSession();
+const token = session.getToken();
+
+export async function downloadFile(dmsId) {
+ let appUrl = await getUrl('', 'lilium');
+ appUrl = appUrl.replace('/#/', '');
+ window.open(`${appUrl}/api/dms/${dmsId}/downloadFile?access_token=${token}`);
+}
diff --git a/src/composables/getUrl.js b/src/composables/getUrl.js
index f2bd9ddb9..1e6aec4c6 100644
--- a/src/composables/getUrl.js
+++ b/src/composables/getUrl.js
@@ -1,11 +1,10 @@
import axios from 'axios';
-export async function getUrl(route, appName = 'salix') {
- const filter = {
- where: { and: [{ appName: appName }, { environment: process.env.NODE_ENV }] },
- };
+export async function getUrl(route, app = 'salix') {
+ let url;
- const { data } = await axios.get('Urls/findOne', { params: { filter } });
- const url = data.url;
- return route ? url + route : url;
+ await axios.get('Urls/getUrl', { params: { app } }).then((res) => {
+ url = res.data + route;
+ });
+ return url;
}
diff --git a/src/composables/useColor.js b/src/composables/useColor.js
new file mode 100644
index 000000000..b325e985f
--- /dev/null
+++ b/src/composables/useColor.js
@@ -0,0 +1,35 @@
+export function djb2a(string) {
+ let hash = 5381;
+ for (let i = 0; i < string.length; i++)
+ hash = ((hash << 5) + hash) ^ string.charCodeAt(i);
+ return hash >>> 0;
+}
+
+export function useColor(value) {
+ return '#' + colors[djb2a(value || '') % colors.length];
+}
+
+const colors = [
+ 'b5b941', // Yellow
+ 'ae9681', // Peach
+ 'd78767', // Salmon
+ 'cc7000', // Orange bright
+ 'e2553d', // Coral
+ '8B0000', // Red dark
+ 'de4362', // Red crimson
+ 'FF1493', // Ping intense
+ 'be39a2', // Pink light
+ 'b754cf', // Purple middle
+ 'a87ba8', // Pink
+ '8a69cd', // Blue lavender
+ 'ab20ab', // Purple dark
+ '00b5b8', // Turquoise
+ '1fa8a1', // Green ocean
+ '5681cf', // Blue steel
+ '3399fe', // Blue sky
+ '6d9c3e', // Green chartreuse
+ '51bb51', // Green lime
+ '518b8b', // Gray board
+ '7e7e7e', // Gray
+ '5d5d5d', // Gray dark
+];
diff --git a/src/composables/useValidator.js b/src/composables/useValidator.js
index bc48332a2..3f9f00367 100644
--- a/src/composables/useValidator.js
+++ b/src/composables/useValidator.js
@@ -1,19 +1,12 @@
-import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
-import axios from 'axios';
import validator from 'validator';
-
-const models = ref(null);
+import { useValidationsStore } from 'src/stores/useValidationsStore';
export function useValidator() {
- if (!models.value) fetch();
-
- function fetch() {
- axios.get('Schemas/ModelInfo').then((response) => (models.value = response.data));
- }
+ const models = useValidationsStore().validations;
function validate(propertyRule) {
- const modelInfo = models.value;
+ const modelInfo = models;
if (!modelInfo || !propertyRule) return;
const rule = propertyRule.split('.');
@@ -75,5 +68,6 @@ export function useValidator() {
return {
validate,
+ models,
};
}
diff --git a/src/css/app.scss b/src/css/app.scss
index 2b2abec86..02d4f8946 100644
--- a/src/css/app.scss
+++ b/src/css/app.scss
@@ -33,6 +33,7 @@ body.body--light {
--vn-gray: #f5f5f5;
--vn-label: #5f5f5f;
--vn-dark: white;
+ --vn-light-gray: #e7e3e3;
}
body.body--dark {
@@ -40,6 +41,7 @@ body.body--dark {
--vn-gray: #313131;
--vn-label: #a8a8a8;
--vn-dark: #292929;
+ --vn-light-gray: #424242;
}
.bg-vn-dark {
@@ -51,7 +53,3 @@ body.body--dark {
color: var(--vn-text);
border-radius: 8px;
}
-
-.vn-secondary-button {
- background-color: var(--vn-dark);
-}
diff --git a/src/filters/index.js b/src/filters/index.js
index 158ce1009..b0c441641 100644
--- a/src/filters/index.js
+++ b/src/filters/index.js
@@ -2,6 +2,7 @@ import toLowerCase from './toLowerCase';
import toDate from './toDate';
import toDateString from './toDateString';
import toDateHour from './toDateHour';
+import toRelativeDate from './toRelativeDate';
import toCurrency from './toCurrency';
import toPercentage from './toPercentage';
import toLowerCamel from './toLowerCamel';
@@ -13,6 +14,7 @@ export {
toDate,
toDateString,
toDateHour,
+ toRelativeDate,
toCurrency,
toPercentage,
dashIfEmpty,
diff --git a/src/filters/toRelativeDate.js b/src/filters/toRelativeDate.js
new file mode 100644
index 000000000..76e67dbea
--- /dev/null
+++ b/src/filters/toRelativeDate.js
@@ -0,0 +1,32 @@
+import { useI18n } from 'vue-i18n';
+
+export default function formatDate(dateVal) {
+ const { t } = useI18n();
+ const today = new Date();
+ if (dateVal == null) return '';
+
+ const date = new Date(dateVal);
+ const dateZeroTime = new Date(dateVal);
+ dateZeroTime.setHours(0, 0, 0, 0);
+ const diff = Math.trunc(
+ (today.getTime() - dateZeroTime.getTime()) / (1000 * 3600 * 24)
+ );
+ let format;
+ if (diff === 0) format = t('globals.today');
+ else if (diff === 1) format = t('globals.yesterday');
+ else if (diff > 1 && diff < 7) {
+ const options = { weekday: 'short' };
+ format = date.toLocaleDateString(t('globals.dateFormat'), options);
+ } else if (today.getFullYear() === date.getFullYear()) {
+ const options = { day: 'numeric', month: 'short' };
+ format = date.toLocaleDateString(t('globals.dateFormat'), options);
+ } else {
+ const options = { year: 'numeric', month: '2-digit', day: '2-digit' };
+ format = date.toLocaleDateString(t('globals.dateFormat'), options);
+ }
+
+ // Formatear la hora en HH:mm
+ const hours = date.getHours().toString().padStart(2, '0');
+ const minutes = date.getMinutes().toString().padStart(2, '0');
+ return `${format} ${hours}:${minutes}`;
+}
diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js
index fb603deca..5e7e116c5 100644
--- a/src/i18n/en/index.js
+++ b/src/i18n/en/index.js
@@ -5,6 +5,9 @@ export default {
en: 'English',
},
language: 'Language',
+ entity: 'Entity',
+ user: 'User',
+ details: 'Details',
collapseMenu: 'Collapse left menu',
backToDashboard: 'Return to dashboard',
notifications: 'Notifications',
@@ -13,8 +16,11 @@ export default {
pinnedModules: 'Pinned modules',
darkMode: 'Dark mode',
logOut: 'Log out',
+ date: 'Date',
dataSaved: 'Data saved',
dataDeleted: 'Data deleted',
+ search: 'Search',
+ changes: 'Changes',
dataCreated: 'Data created',
add: 'Add',
create: 'Create',
@@ -37,6 +43,10 @@ export default {
summary: {
basicData: 'Basic data',
},
+ today: 'Today',
+ yesterday: 'Yesterday',
+ dateFormat: 'en-GB',
+ microsip: 'Open in MicroSIP',
noSelectedRows: `You don't have any line selected`,
downloadCSVSuccess: 'CSV downloaded successfully',
// labels compartidos entre vistas
@@ -362,7 +372,7 @@ export default {
},
invoiceOut: {
pageTitles: {
- invoiceOuts: 'Invoices Out',
+ invoiceOuts: 'Invoice out',
list: 'List',
negativeBases: 'Negative Bases',
globalInvoicing: 'Global invoicing',
@@ -457,7 +467,7 @@ export default {
list: {
parking: 'Parking',
priority: 'Priority',
- newShelving: 'New Shelving'
+ newShelving: 'New Shelving',
},
summary: {
code: 'Code',
@@ -473,6 +483,71 @@ export default {
recyclable: 'Recyclable',
},
},
+ invoiceIn: {
+ pageTitles: {
+ invoiceIns: 'Invoices In',
+ list: 'List',
+ createInvoiceIn: 'Create invoice in',
+ summary: 'Summary',
+ basicData: 'Basic data',
+ vat: 'VAT',
+ dueDay: 'Due day',
+ intrastat: 'Intrastat',
+ log: 'Logs',
+ },
+ list: {
+ ref: 'Reference',
+ supplier: 'Supplier',
+ supplierRef: 'Supplier ref.',
+ serialNumber: 'Serial number',
+ serial: 'Serial',
+ file: 'File',
+ issued: 'Issued',
+ isBooked: 'Is booked',
+ awb: 'AWB',
+ amount: 'Amount',
+ },
+ card: {
+ issued: 'Issued',
+ amount: 'Amount',
+ client: 'Client',
+ company: 'Company',
+ customerCard: 'Customer card',
+ ticketList: 'Ticket List',
+ vat: 'Vat',
+ dueDay: 'Due day',
+ intrastat: 'Intrastat',
+ },
+ summary: {
+ supplier: 'Supplier',
+ supplierRef: 'Supplier ref.',
+ currency: 'Currency',
+ docNumber: 'Doc number',
+ issued: 'Expedition date',
+ operated: 'Operation date',
+ bookEntried: 'Entry date',
+ bookedDate: 'Booked date',
+ sage: 'Sage withholding',
+ vat: 'Undeductible VAT',
+ company: 'Company',
+ booked: 'Booked',
+ expense: 'Expense',
+ taxableBase: 'Taxable base',
+ rate: 'Rate',
+ sageVat: 'Sage vat',
+ sageTransaction: 'Sage transaction',
+ dueDay: 'Date',
+ bank: 'Bank',
+ amount: 'Amount',
+ foreignValue: 'Foreign value',
+ dueTotal: 'Due day',
+ noMatch: 'Do not match',
+ code: 'Code',
+ net: 'Net',
+ stems: 'Stems',
+ country: 'Country',
+ },
+ },
worker: {
pageTitles: {
workers: 'Workers',
@@ -531,6 +606,7 @@ export default {
typesList: 'Types List',
typeCreate: 'Create type',
typeEdit: 'Edit type',
+ wagonCounter: 'Trolley counter',
},
type: {
name: 'Name',
@@ -669,6 +745,7 @@ export default {
logOut: 'Log Out',
},
smartCard: {
+ downloadFile: 'Download file',
clone: 'Clone',
openCard: 'View',
openSummary: 'Summary',
diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js
index 75ee011c3..79f1114b5 100644
--- a/src/i18n/es/index.js
+++ b/src/i18n/es/index.js
@@ -5,6 +5,9 @@ export default {
en: 'Inglés',
},
language: 'Idioma',
+ entity: 'Entidad',
+ user: 'Usuario',
+ details: 'Detalles',
collapseMenu: 'Contraer menú lateral',
backToDashboard: 'Volver al tablón',
notifications: 'Notificaciones',
@@ -13,8 +16,11 @@ export default {
pinnedModules: 'Módulos fijados',
darkMode: 'Modo oscuro',
logOut: 'Cerrar sesión',
+ date: 'Fecha',
dataSaved: 'Datos guardados',
dataDeleted: 'Datos eliminados',
+ search: 'Buscar',
+ changes: 'Cambios',
dataCreated: 'Datos creados',
add: 'Añadir',
create: 'Crear',
@@ -37,9 +43,13 @@ export default {
summary: {
basicData: 'Datos básicos',
},
+ today: 'Hoy',
+ yesterday: 'Ayer',
+ dateFormat: 'es-ES',
noSelectedRows: `No tienes ninguna línea seleccionada`,
- downloadCSVSuccess: 'Descarga de CSV exitosa',
+ microsip: 'Abrir en MicroSIP',
// labels compartidos entre vistas
+ downloadCSVSuccess: 'Descarga de CSV exitosa',
reference: 'Referencia',
agency: 'Agencia',
wareHouseOut: 'Alm. salida',
@@ -459,7 +469,7 @@ export default {
list: {
parking: 'Parking',
priority: 'Prioridad',
- newShelving: 'Nuevo Carro'
+ newShelving: 'Nuevo Carro',
},
summary: {
code: 'Código',
@@ -475,6 +485,69 @@ export default {
recyclable: 'Reciclable',
},
},
+ invoiceIn: {
+ pageTitles: {
+ invoiceIns: 'Fact. recibidas',
+ list: 'Listado',
+ createInvoiceIn: 'Crear fact. recibida',
+ summary: 'Resumen',
+ basicData: 'Datos básicos',
+ vat: 'IVA',
+ dueDay: 'Vencimiento',
+ intrastat: 'Intrastat',
+ log: 'Registros de auditoría',
+ },
+ list: {
+ ref: 'Referencia',
+ supplier: 'Proveedor',
+ supplierRef: 'Ref. proveedor',
+ serialNumber: 'Num. serie',
+ shortIssued: 'F. emisión',
+ serial: 'Serie',
+ file: 'Fichero',
+ issued: 'Fecha emisión',
+ isBooked: 'Conciliada',
+ awb: 'AWB',
+ amount: 'Importe',
+ },
+ card: {
+ issued: 'Fecha emisión',
+ amount: 'Importe',
+ client: 'Cliente',
+ company: 'Empresa',
+ customerCard: 'Ficha del cliente',
+ ticketList: 'Listado de tickets',
+ vat: 'Iva',
+ dueDay: 'Fecha de vencimiento',
+ },
+ summary: {
+ supplier: 'Proveedor',
+ supplierRef: 'Ref. proveedor',
+ currency: 'Divisa',
+ docNumber: 'Número documento',
+ issued: 'Fecha de expedición',
+ operated: 'Fecha operación',
+ bookEntried: 'Fecha asiento',
+ bookedDate: 'Fecha contable',
+ sage: 'Retención sage',
+ vat: 'Iva no deducible',
+ company: 'Empresa',
+ booked: 'Contabilizada',
+ expense: 'Gasto',
+ taxableBase: 'Base imp.',
+ rate: 'Tasa',
+ sageTransaction: 'Sage transación',
+ dueDay: 'Fecha',
+ bank: 'Caja',
+ amount: 'Importe',
+ foreignValue: 'Divisa',
+ dueTotal: 'Vencimiento',
+ code: 'Código',
+ net: 'Neto',
+ stems: 'Tallos',
+ country: 'País',
+ },
+ },
worker: {
pageTitles: {
workers: 'Trabajadores',
@@ -533,6 +606,7 @@ export default {
typesList: 'Listado tipos',
typeCreate: 'Crear tipo',
typeEdit: 'Editar tipo',
+ wagonCounter: 'Contador de carros',
},
type: {
name: 'Nombre',
@@ -671,6 +745,7 @@ export default {
logOut: 'Cerrar sesión',
},
smartCard: {
+ downloadFile: 'Descargar archivo',
clone: 'Clonar',
openCard: 'Ficha',
openSummary: 'Detalles',
diff --git a/src/pages/Claim/Card/ClaimBasicData.vue b/src/pages/Claim/Card/ClaimBasicData.vue
index 57b6515db..35f93c736 100644
--- a/src/pages/Claim/Card/ClaimBasicData.vue
+++ b/src/pages/Claim/Card/ClaimBasicData.vue
@@ -7,6 +7,7 @@ import FetchData from 'components/FetchData.vue';
import FormModel from 'components/FormModel.vue';
import VnRow from 'components/ui/VnRow.vue';
import VnInput from 'src/components/common/VnInput.vue';
+import VnInputDate from 'components/common/VnInputDate.vue';
import { useSession } from 'src/composables/useSession';
@@ -110,33 +111,10 @@ const statesFilter = {
/>
-
-
-
-
-
-
-
-
-
-
-
-
-
+ :label="t('claim.basicData.created')"
+ />
diff --git a/src/pages/Claim/Card/ClaimDescriptor.vue b/src/pages/Claim/Card/ClaimDescriptor.vue
index 9dd8aa1f6..85ae9f7e1 100644
--- a/src/pages/Claim/Card/ClaimDescriptor.vue
+++ b/src/pages/Claim/Card/ClaimDescriptor.vue
@@ -7,6 +7,7 @@ import { useState } from 'src/composables/useState';
import TicketDescriptorProxy from 'pages/Ticket/Card/TicketDescriptorProxy.vue';
import WorkerDescriptorProxy from 'src/pages/Worker/Card/WorkerDescriptorProxy.vue';
+import CustomerDescriptorProxy from 'src/pages/Customer/Card/CustomerDescriptorProxy.vue';
import ClaimDescriptorMenu from 'pages/Claim/Card/ClaimDescriptorMenu.vue';
import CardDescriptor from 'components/ui/CardDescriptor.vue';
import VnLv from 'src/components/ui/VnLv.vue';
@@ -119,7 +120,7 @@ const setData = (entity) => {
{{ entity.worker.user.name }}
-
+
diff --git a/src/pages/Claim/Card/ClaimDescriptorMenu.vue b/src/pages/Claim/Card/ClaimDescriptorMenu.vue
index 5688613d6..d88c3d120 100644
--- a/src/pages/Claim/Card/ClaimDescriptorMenu.vue
+++ b/src/pages/Claim/Card/ClaimDescriptorMenu.vue
@@ -37,7 +37,7 @@ function confirmPickupOrder() {
data: {
address: customer.email,
},
- send: sendPickupOrder,
+ promise: sendPickupOrder,
},
});
}
diff --git a/src/pages/Claim/Card/ClaimLines.vue b/src/pages/Claim/Card/ClaimLines.vue
index c03291b85..fa7fb123f 100644
--- a/src/pages/Claim/Card/ClaimLines.vue
+++ b/src/pages/Claim/Card/ClaimLines.vue
@@ -46,7 +46,7 @@ async function onFetchClaim(data) {
const amount = ref(0);
const amountClaimed = ref(0);
async function onFetch(rows) {
- if (!rows || rows.length) return;
+ if (!rows || !rows.length) return;
amount.value = rows.reduce(
(acumulator, { sale }) => acumulator + sale.price * sale.quantity,
0
@@ -155,7 +155,7 @@ function showImportDialog() {
-
+
{{ t('Amount') }}
diff --git a/src/pages/Claim/Card/ClaimPhoto.vue b/src/pages/Claim/Card/ClaimPhoto.vue
index 483dbffc1..6ac116ce0 100644
--- a/src/pages/Claim/Card/ClaimPhoto.vue
+++ b/src/pages/Claim/Card/ClaimPhoto.vue
@@ -26,6 +26,7 @@ const client = ref({});
const inputFile = ref();
const files = ref({});
+const spinnerRef = ref();
const claimDmsRef = ref();
const dmsType = ref({});
const config = ref({});
@@ -118,11 +119,11 @@ async function create() {
clientId: client.value.id,
}).toUpperCase(),
};
-
+ spinnerRef.value.show();
await axios.post(query, formData, {
params: dms,
});
-
+ spinnerRef.value.hide();
quasar.notify({
message: t('globals.dataSaved'),
type: 'positive',
@@ -234,7 +235,9 @@ function onDrag() {
-
+