Compare commits

...

13 Commits

Author SHA1 Message Date
Juanjo Breso 79172ef288 Merge branch 'dev' into 6493-refactorizar-procedimientos-vn2008-parte_2
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-04-23 10:16:27 +00:00
Carlos Andrés 2d5daf55c2 Merge pull request 'feat: Varias líneas farming en albaranes refs #7020' (!2349) from 7020-Varias-líneas-farming-en-albaranes into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #2349
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-04-23 10:04:08 +00:00
Javier Segarra 27354e452f Merge pull request '#7190 - RenewTokenMultimedia' (!2335) from 7190_renewTokenMultimedia into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #2335
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-04-23 08:28:08 +00:00
Javier Segarra 83d89d13ad Merge branch 'dev' into 7190_renewTokenMultimedia
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-04-23 08:26:23 +00:00
Alex Moreno 7fd7acbb56 deploy: refs #7253 init version 2420
gitea/salix/pipeline/head This commit looks good Details
2024-04-23 10:06:22 +02:00
Alex Moreno fbf1b6e1af Merge pull request '7253-devToTest_2418' (!2350) from 7253-devToTest_2418 into test
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #2350
Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
2024-04-23 08:02:45 +00:00
Pablo Natek 06e743f5da fix: refs #7253 check booked add new restriction to be tested
gitea/salix/pipeline/pr-test This commit looks good Details
2024-04-23 10:00:11 +02:00
Alex Moreno 60d5b9e4aa test: refs #7173 fix sql, adding alias
gitea/salix/pipeline/pr-test This commit looks good Details
2024-04-23 08:47:52 +02:00
Alex Moreno 85491613b0 test: refs #7173 fix fixtures 2024-04-23 08:47:28 +02:00
Carlos Andrés 8bb331f0ed feat: Varias líneas farming en albaranes refs #7020
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-04-22 19:57:17 +02:00
Javier Segarra 5e8310f5e1 Merge branch 'dev' into 7190_renewTokenMultimedia
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-04-22 06:20:53 +00:00
Javier Segarra 329f875640 feat(salix): refs #7190 Call renewtoken with tokenMultimedia 2024-04-19 11:36:49 +02:00
Javier Segarra d2aba88a34 feat(salix): refs #7190 minor change salix-back 2024-04-19 11:36:34 +02:00
9 changed files with 92 additions and 67 deletions

View File

@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [24.18.01] - 2024-05-02
## [24.20.01] - 2024-05-14
## [24.18.01] - 2024-05-07
## [24.16.01] - 2024-04-18

View File

@ -12,8 +12,8 @@ module.exports = Self => {
http: {
path: `/renewToken`,
verb: 'POST'
}
});
},
accessScopes: ['DEFAULT', 'read:multimedia']});
Self.renewToken = async function(ctx) {
const {accessToken: token} = ctx.req;

View File

@ -2617,7 +2617,7 @@ INSERT INTO `vn`.`invoiceInIntrastat` (`invoiceInFk`, `net`, `intrastatFk`, `amo
UPDATE `vn`.`invoiceIn`
SET isBooked = TRUE
WHERE id IN (2, 5, 7, 8, 9, 10);
WHERE id IN (5, 7, 8, 9, 10);
DELIMITER $$
CREATE PROCEDURE `tmp`.`ticket_recalc`()

View File

@ -0,0 +1,12 @@
CREATE OR REPLACE TABLE `vn`.`farmingDeliveryNote` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`farmingFk` int(10) unsigned NOT NULL,
`deliveryNoteFk` int(11) NOT NULL,
`amount` decimal(10,2) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `farmingDeliveryNoteFk_FK` (`deliveryNoteFk`),
KEY `farmingDeliveryNoteFk_FK_1` (`farmingFk`),
CONSTRAINT `farmingDeliveryNoteFk_FK` FOREIGN KEY (`deliveryNoteFk`) REFERENCES `deliveryNote` (`id`),
CONSTRAINT `farmingDeliveryNoteFk_FK_1` FOREIGN KEY (`farmingFk`) REFERENCES `farming` (`id`)
);

View File

@ -76,6 +76,6 @@ describe('Entry basic data path', () => {
expect(confirmed).toBe('checked');
expect(inventory).toBe('checked');
expect(raid).toBe('checked');
expect(booked).toBe('checked');
expect(booked).toBe('unchecked');
});
});

View File

@ -1,5 +1,6 @@
import ngModule from '../module';
const TOKEN_MULTIMEDIA = 'vnTokenMultimedia';
const TOKEN = 'vnToken';
/**
* Saves and loads the token for the current logged in user.
*
@ -58,8 +59,8 @@ export default class Token {
}
getStorage(storage) {
this.token = storage.getItem('vnToken');
this.tokenMultimedia = storage.getItem('vnTokenMultimedia');
this.token = storage.getItem(TOKEN);
this.tokenMultimedia = storage.getItem(TOKEN_MULTIMEDIA);
if (!this.token) return;
const created = storage.getItem('vnTokenCreated');
this.created = created && new Date(created);
@ -67,15 +68,15 @@ export default class Token {
}
setStorage(storage, token, tokenMultimedia, created, ttl) {
storage.setItem('vnTokenMultimedia', tokenMultimedia);
storage.setItem('vnToken', token);
storage.setItem(TOKEN_MULTIMEDIA, tokenMultimedia);
storage.setItem(TOKEN, token);
storage.setItem('vnTokenCreated', created.toJSON());
storage.setItem('vnTokenTtl', ttl);
}
removeStorage(storage) {
storage.removeItem('vnToken');
storage.removeItem('vnTokenMultimedia');
storage.removeItem(TOKEN);
storage.removeItem(TOKEN_MULTIMEDIA);
storage.removeItem('vnTokenCreated');
storage.removeItem('vnTokenTtl');
}
@ -96,9 +97,9 @@ export default class Token {
this.checking = true;
const renewPeriod = Math.min(this.ttl, this.renewPeriod) * 1000;
const maxDate = this.created.getTime() + renewPeriod;
const now = new Date();
const now = new Date().getTime();
if (now.getTime() <= maxDate) {
if (now <= maxDate) {
this.checking = false;
return;
}
@ -106,7 +107,17 @@ export default class Token {
this.$http.post('VnUsers/renewToken')
.then(res => {
const token = res.data;
this.set(token.id, now, token.ttl, this.remember);
const tokenMultimedia =
localStorage.getItem(TOKEN_MULTIMEDIA)
?? sessionStorage.getItem(TOKEN_MULTIMEDIA);
return this.$http.post('VnUsers/renewToken', null, {
headers: {Authorization: tokenMultimedia}
})
.then(({data}) => {
const tokenMultimedia = data;
this.set(token.id, tokenMultimedia.id, new Date(), token.ttl, this.remember);
});
})
.finally(() => {
this.checking = false;
@ -119,4 +130,4 @@ export default class Token {
}
Token.$inject = ['vnInterceptor', '$http', '$rootScope'];
ngModule.service('vnToken', Token);
ngModule.service(TOKEN, Token);

View File

@ -158,7 +158,7 @@ describe('InvoiceIn filter()', () => {
const result = await models.InvoiceIn.filter(ctx, {}, options);
expect(result.length).toEqual(4);
expect(result.length).toEqual(5);
await tx.rollback();
} catch (e) {
@ -180,7 +180,7 @@ describe('InvoiceIn filter()', () => {
const result = await models.InvoiceIn.filter(ctx, {}, options);
expect(result.length).toEqual(6);
expect(result.length).toEqual(5);
expect(result[0].isBooked).toBeTruthy();
await tx.rollback();

View File

@ -45,7 +45,7 @@ module.exports = Self => {
wh.name warehouseName,
tob.description observationDelivery,
tob2.description observationDropOff,
tob2.id,
tob2.id observationId,
a.street,
a.postalCode,
a.city,

View File

@ -1,6 +1,6 @@
{
"name": "salix-back",
"version": "24.18.0",
"version": "24.20.0",
"author": "Verdnatura Levante SL",
"description": "Salix backend",
"license": "GPL-3.0",