Merge branch 'dev' into 6921_addFromDelivery
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Sergio De la torre 2024-04-22 08:11:37 +00:00
commit 23fa74a5ad
34 changed files with 264 additions and 257 deletions

1
Jenkinsfile vendored
View File

@ -71,6 +71,7 @@ pipeline {
stage('Back') { stage('Back') {
steps { steps {
sh 'pnpm install --prefer-offline' sh 'pnpm install --prefer-offline'
sh 'node node_modules/puppeteer/install.mjs'
} }
} }
stage('Print') { stage('Print') {

View File

@ -30,7 +30,7 @@ module.exports = Self => {
path: `/:id/downloadFile`, path: `/:id/downloadFile`,
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.downloadFile = async function(ctx, id) { Self.downloadFile = async function(ctx, id) {

View File

@ -43,7 +43,7 @@ module.exports = Self => {
path: `/:id/download`, path: `/:id/download`,
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.download = async function(id, fileCabinet, filter) { Self.download = async function(id, fileCabinet, filter) {

View File

@ -48,7 +48,7 @@ module.exports = Self => {
path: `/:collection/:size/:id/download`, path: `/:collection/:size/:id/download`,
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.download = async function(ctx, collection, size, id) { Self.download = async function(ctx, collection, size, id) {

View File

@ -28,6 +28,9 @@ describe('Renew Token', () => {
}); });
it('should renew token', async() => { it('should renew token', async() => {
const {courtesyTime} = await models.AccessTokenConfig.findOne({
fields: ['courtesyTime']
});
const mockDate = new Date(startingTime + 26600000); const mockDate = new Date(startingTime + 26600000);
jasmine.clock().mockDate(mockDate); jasmine.clock().mockDate(mockDate);
const {id} = await models.VnUser.renewToken(ctx); const {id} = await models.VnUser.renewToken(ctx);
@ -35,7 +38,7 @@ describe('Renew Token', () => {
expect(id).not.toEqual(ctx.req.accessToken.id); expect(id).not.toEqual(ctx.req.accessToken.id);
await models.VnUser.logout(ctx.req.accessToken.id); await models.VnUser.logout(ctx.req.accessToken.id);
jasmine.clock().tick(70 * 1000); jasmine.clock().tick((courtesyTime + 10) * 1000);
let tokenNotExists; let tokenNotExists;
try { try {
tokenNotExists = await models.AccessToken.findById(ctx.req.accessToken.id); tokenNotExists = await models.AccessToken.findById(ctx.req.accessToken.id);

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_assign`(
vUserFk INT, vUserFk INT,
OUT vCollectionFk INT OUT vCollectionFk INT
) )
proc:BEGIN BEGIN
/** /**
* Comprueba si existen colecciones libres que se ajustan * Comprueba si existen colecciones libres que se ajustan
* al perfil del usuario y le asigna la más antigua. * al perfil del usuario y le asigna la más antigua.
@ -16,7 +16,7 @@ proc:BEGIN
DECLARE vItemPackingTypeFk VARCHAR(1); DECLARE vItemPackingTypeFk VARCHAR(1);
DECLARE vWarehouseFk INT; DECLARE vWarehouseFk INT;
DECLARE vLockName VARCHAR(215); DECLARE vLockName VARCHAR(215);
DECLARE vLockTime INT DEFAULT 15; DECLARE vLockTime INT DEFAULT 30;
DECLARE EXIT HANDLER FOR SQLEXCEPTION DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN BEGIN
@ -39,7 +39,6 @@ proc:BEGIN
IF vHasTooMuchCollections THEN IF vHasTooMuchCollections THEN
CALL util.throw('Hay colecciones pendientes'); CALL util.throw('Hay colecciones pendientes');
LEAVE proc;
END IF; END IF;
SELECT warehouseFk, itemPackingTypeFk SELECT warehouseFk, itemPackingTypeFk
@ -54,7 +53,7 @@ proc:BEGIN
); );
IF NOT GET_LOCK(vLockName, vLockTime) THEN IF NOT GET_LOCK(vLockName, vLockTime) THEN
LEAVE proc; CALL util.throw(CONCAT('Cannot get lock: ', vLockName));
END IF; END IF;
-- Se eliminan las colecciones sin asignar que estan obsoletas -- Se eliminan las colecciones sin asignar que estan obsoletas

View File

@ -1,6 +1,6 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_new`(vUserFk INT, OUT vCollectionFk INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`collection_new`(vUserFk INT, OUT vCollectionFk INT)
proc:BEGIN BEGIN
/** /**
* Genera colecciones de tickets sin asignar trabajador. * Genera colecciones de tickets sin asignar trabajador.
* *
@ -26,7 +26,7 @@ proc:BEGIN
DECLARE vHasUniqueCollectionTime BOOL; DECLARE vHasUniqueCollectionTime BOOL;
DECLARE vDone INT DEFAULT FALSE; DECLARE vDone INT DEFAULT FALSE;
DECLARE vLockName VARCHAR(215); DECLARE vLockName VARCHAR(215);
DECLARE vLockTime INT DEFAULT 15; DECLARE vLockTime INT DEFAULT 30;
DECLARE vFreeWagonFk INT; DECLARE vFreeWagonFk INT;
DECLARE c1 CURSOR FOR DECLARE c1 CURSOR FOR
@ -86,7 +86,7 @@ proc:BEGIN
); );
IF NOT GET_LOCK(vLockName, vLockTime) THEN IF NOT GET_LOCK(vLockName, vLockTime) THEN
LEAVE proc; CALL util.throw(CONCAT('Cannot get lock: ', vLockName));
END IF; END IF;
-- Se prepara el tren, con tantos vagones como sea necesario. -- Se prepara el tren, con tantos vagones como sea necesario.

View File

@ -188,7 +188,7 @@ BEGIN
FROM tPendingDuedates vp FROM tPendingDuedates vp
LEFT JOIN supplier s ON s.id = vp.supplierFk LEFT JOIN supplier s ON s.id = vp.supplierFk
LEFT JOIN client c ON c.fi = s.nif LEFT JOIN client c ON c.fi = s.nif
JOIN clientRisk cr ON cr.clientFk = c.id LEFT JOIN clientRisk cr ON cr.clientFk = c.id
AND cr.companyFk = vp.companyFk AND cr.companyFk = vp.companyFk
LEFT JOIN supplierAccount sa ON sa.supplierFk = s.id LEFT JOIN supplierAccount sa ON sa.supplierFk = s.id
LEFT JOIN bankEntity be ON be.id = sa.bankEntityFk LEFT JOIN bankEntity be ON be.id = sa.bankEntityFk

View File

@ -1,6 +1,9 @@
CREATE OR REPLACE DEFINER=`root`@`localhost` CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER SQL SECURITY DEFINER
VIEW `vn2008`.`payroll_employee` VIEW `vn2008`.`payroll_employee` AS
AS SELECT `pw`.`workerFkA3` AS `CodTrabajador`, SELECT
`pw`.`companyFkA3` AS `codempresa` `pw`.`workerFkA3` AS `CodTrabajador`,
FROM `vn`.`payrollWorker` `pw` `pw`.`companyFkA3` AS `codempresa`,
`pw`.`workerFk` AS `workerFk`
FROM
`vn`.`payrollWorker` `pw`;

View File

@ -1,5 +1,5 @@
import ngModule from '../../module'; import ngModule from '../../module';
const UserError = require('vn-loopback/util/user-error'); import UserError from 'core/lib/user-error';
export default class Controller { export default class Controller {
constructor($scope, $element, $http, vnApp, $translate, $state, $location) { constructor($scope, $element, $http, vnApp, $translate, $state, $location) {

View File

@ -1,5 +1,5 @@
import ngModule from '../../module'; import ngModule from '../../module';
const UserError = require('vn-loopback/util/user-error'); import UserError from 'core/lib/user-error';
export default class Controller { export default class Controller {
constructor($scope, $element, $http, vnApp, $translate, $state, $location) { constructor($scope, $element, $http, vnApp, $translate, $state, $location) {

View File

@ -224,5 +224,6 @@
"There are not picking tickets": "There are not picking tickets", "There are not picking tickets": "There are not picking tickets",
"ticketCommercial": "The ticket {{ ticket }} for the salesperson {{ salesMan }} is in preparation. (automatically generated message)", "ticketCommercial": "The ticket {{ ticket }} for the salesperson {{ salesMan }} is in preparation. (automatically generated message)",
"This password can only be changed by the user themselves": "This password can only be changed by the user themselves", "This password can only be changed by the user themselves": "This password can only be changed by the user themselves",
"They're not your subordinate": "They're not your subordinate" "They're not your subordinate": "They're not your subordinate",
"InvoiceIn is already booked": "InvoiceIn is already booked"
} }

View File

@ -35,7 +35,7 @@ module.exports = Self => {
path: '/:id/claim-pickup-pdf', path: '/:id/claim-pickup-pdf',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.claimPickupPdf = (ctx, id) => Self.printReport(ctx, id, 'claim-pickup-order'); Self.claimPickupPdf = (ctx, id) => Self.printReport(ctx, id, 'claim-pickup-order');

View File

@ -33,7 +33,7 @@ module.exports = Self => {
path: `/:id/downloadFile`, path: `/:id/downloadFile`,
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.downloadFile = async function(ctx, id) { Self.downloadFile = async function(ctx, id) {

View File

@ -46,7 +46,7 @@ module.exports = Self => {
path: '/:id/campaign-metrics-pdf', path: '/:id/campaign-metrics-pdf',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.campaignMetricsPdf = (ctx, id) => Self.printReport(ctx, id, 'campaign-metrics'); Self.campaignMetricsPdf = (ctx, id) => Self.printReport(ctx, id, 'campaign-metrics');

View File

@ -34,7 +34,7 @@ module.exports = Self => {
path: '/:id/entry-order-pdf', path: '/:id/entry-order-pdf',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.entryOrderPdf = (ctx, id) => Self.printReport(ctx, id, 'entry-order'); Self.entryOrderPdf = (ctx, id) => Self.printReport(ctx, id, 'entry-order');

View File

@ -32,7 +32,7 @@ module.exports = Self => {
path: '/:id/download', path: '/:id/download',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.download = async function(ctx, id, options) { Self.download = async function(ctx, id, options) {

View File

@ -32,7 +32,7 @@ module.exports = Self => {
path: '/downloadZip', path: '/downloadZip',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.downloadZip = async function(ctx, ids, options) { Self.downloadZip = async function(ctx, ids, options) {

View File

@ -35,7 +35,7 @@ module.exports = Self => {
path: '/:reference/exportation-pdf', path: '/:reference/exportation-pdf',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.exportationPdf = (ctx, reference) => Self.printReport(ctx, reference, 'exportation'); Self.exportationPdf = (ctx, reference) => Self.printReport(ctx, reference, 'exportation');

View File

@ -38,7 +38,7 @@ module.exports = Self => {
path: '/:reference/invoice-csv', path: '/:reference/invoice-csv',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.invoiceCsv = async reference => { Self.invoiceCsv = async reference => {

View File

@ -40,7 +40,7 @@ module.exports = Self => {
path: '/negativeBasesCsv', path: '/negativeBasesCsv',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.negativeBasesCsv = async(ctx, options) => { Self.negativeBasesCsv = async(ctx, options) => {

View File

@ -11,7 +11,7 @@ module.exports = Self => {
path: `/download`, path: `/download`,
verb: 'POST', verb: 'POST',
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.download = async() => { Self.download = async() => {

View File

@ -30,7 +30,7 @@ module.exports = Self => {
path: '/:id/cmr', path: '/:id/cmr',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.cmr = (ctx, id) => Self.printReport(ctx, id, 'cmr'); Self.cmr = (ctx, id) => Self.printReport(ctx, id, 'cmr');

View File

@ -30,7 +30,7 @@ module.exports = Self => {
path: '/downloadCmrsZip', path: '/downloadCmrsZip',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.downloadCmrsZip = async function(ctx, ids, options) { Self.downloadCmrsZip = async function(ctx, ids, options) {

View File

@ -30,7 +30,7 @@ module.exports = Self => {
path: '/downloadZip', path: '/downloadZip',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.downloadZip = async function(ctx, id, options) { Self.downloadZip = async function(ctx, id, options) {

View File

@ -35,7 +35,7 @@ module.exports = Self => {
path: '/:id/driver-route-pdf', path: '/:id/driver-route-pdf',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });

View File

@ -45,7 +45,7 @@ module.exports = Self => {
path: '/:id/campaign-metrics-pdf', path: '/:id/campaign-metrics-pdf',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.campaignMetricsPdf = (ctx, id) => Self.printReport(ctx, id, 'supplier-campaign-metrics'); Self.campaignMetricsPdf = (ctx, id) => Self.printReport(ctx, id, 'supplier-campaign-metrics');

View File

@ -38,7 +38,7 @@ module.exports = Self => {
path: '/:id/delivery-note-csv', path: '/:id/delivery-note-csv',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.deliveryNoteCsv = async id => { Self.deliveryNoteCsv = async id => {

View File

@ -42,7 +42,7 @@ module.exports = Self => {
path: '/:id/delivery-note-pdf', path: '/:id/delivery-note-pdf',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.deliveryNotePdf = (ctx, id) => Self.printReport(ctx, id, 'delivery-note'); Self.deliveryNotePdf = (ctx, id) => Self.printReport(ctx, id, 'delivery-note');

View File

@ -1,6 +1,6 @@
import ngModule from '../module'; import ngModule from '../module';
import ModuleMain from 'salix/components/module-main'; import ModuleMain from 'salix/components/module-main';
const UserError = require('vn-loopback/util/user-error'); import UserError from 'core/lib/user-error';
export default class Ticket extends ModuleMain { export default class Ticket extends ModuleMain {
fetchParams($params) { fetchParams($params) {

View File

@ -79,7 +79,7 @@ module.exports = Self => {
path: '/extra-community-pdf', path: '/extra-community-pdf',
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.extraCommunityPdf = ctx => Self.printReport(ctx, null, 'extra-community'); Self.extraCommunityPdf = ctx => Self.printReport(ctx, null, 'extra-community');

View File

@ -30,7 +30,7 @@ module.exports = Self => {
path: `/:id/downloadFile`, path: `/:id/downloadFile`,
verb: 'GET' verb: 'GET'
}, },
accessScopes: ['read:multimedia'] accessScopes: ['DEFAULT', 'read:multimedia']
}); });
Self.downloadFile = async function(ctx, id) { Self.downloadFile = async function(ctx, id) {

View File

@ -99,7 +99,7 @@
{ {
"relation": "user", "relation": "user",
"scope": { "scope": {
"fields": ["email", "name", "nickname", "roleFk"], "fields": ["email", "name", "nickname", "roleFk", "emailVerified"],
"include": [ "include": [
{ {
"relation": "role", "relation": "role",

View File

@ -1,6 +1,6 @@
import ngModule from '../module'; import ngModule from '../module';
import Descriptor from 'salix/components/descriptor'; import Descriptor from 'salix/components/descriptor';
const UserError = require('vn-loopback/util/user-error'); import UserError from 'core/lib/user-error';
class Controller extends Descriptor { class Controller extends Descriptor {
constructor($element, $, $rootScope) { constructor($element, $, $rootScope) {
super($element, $); super($element, $);