Compare commits
33 Commits
2a93dcf5b8
...
9894591aa9
Author | SHA1 | Date |
---|---|---|
Robert Ferrús | 9894591aa9 | |
Javier Segarra | 24c7271dd8 | |
Javier Segarra | 10247c744f | |
Guillermo Bonet | a36f22a414 | |
Guillermo Bonet | 95a8646d07 | |
Guillermo Bonet | 09ad31a92d | |
Sergio De la torre | f774297321 | |
Sergio De la torre | 64ecf2e229 | |
Javier Segarra | b86c73777f | |
Carlos Satorres | f5ef6c66a4 | |
Carlos Satorres | 3abbae7612 | |
Javi Gallego | be5df940bf | |
Javi Gallego | 58ba1c10d0 | |
Carlos Satorres | 3c9c221220 | |
Carlos Satorres | c75ee22345 | |
Carlos Satorres | c7d960229d | |
Carlos Satorres | acfa0fd857 | |
Javi Gallego | 7ff8ec93ff | |
Carlos Satorres | f55e85a189 | |
Carlos Satorres | af07a531ed | |
Alex Moreno | 6699f5d5a6 | |
Pablo Natek | 72283005b8 | |
Pablo Natek | c457b5c4d2 | |
Pablo Natek | 3f22f48df7 | |
Guillermo Bonet | 1373d7071b | |
Guillermo Bonet | 6527cae72a | |
Guillermo Bonet | b53e454b8b | |
Sergio De la torre | 426b3aa4de | |
Sergio De la torre | d0def8abcc | |
Sergio De la torre | 60ffc21d5a | |
Sergio De la torre | fa08ebf416 | |
Guillermo Bonet | 175f53c0c5 | |
Guillermo Bonet | 04008110f1 |
|
@ -5,6 +5,12 @@ 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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [2352.01] - 2023-12-28
|
||||||
|
|
||||||
|
### Added
|
||||||
|
### Changed
|
||||||
|
### Fixed
|
||||||
|
|
||||||
## [2350.01] - 2023-12-14
|
## [2350.01] - 2023-12-14
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -7,6 +7,10 @@ process.on('warning', warning => {
|
||||||
console.log(warning.stack);
|
console.log(warning.stack);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.on('SIGUSR2', async() => {
|
||||||
|
if (container) await container.rm();
|
||||||
|
});
|
||||||
|
|
||||||
process.on('exit', async function() {
|
process.on('exit', async function() {
|
||||||
if (container) await container.rm();
|
if (container) await container.rm();
|
||||||
});
|
});
|
||||||
|
|
|
@ -2351,9 +2351,11 @@ INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `weekDays`)
|
||||||
(8, 'indefinitely', 'mon,tue,wed,thu,fri,sat,sun'),
|
(8, 'indefinitely', 'mon,tue,wed,thu,fri,sat,sun'),
|
||||||
(10, 'indefinitely', 'mon,tue,wed,thu,fri,sat,sun');
|
(10, 'indefinitely', 'mon,tue,wed,thu,fri,sat,sun');
|
||||||
|
|
||||||
INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `started`, `ended`)
|
INSERT INTO `vn`.`zoneEvent`(`zoneFk`, `type`, `started`, `ended`, `weekDays`)
|
||||||
VALUES
|
VALUES
|
||||||
(9, 'range', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 YEAR));
|
(9, 'range', DATE_ADD(util.VN_CURDATE(), INTERVAL -1 YEAR), DATE_ADD(util.VN_CURDATE(), INTERVAL +1 YEAR), 'mon'),
|
||||||
|
(9, 'range', util.VN_CURDATE(), NULL, 'tue'),
|
||||||
|
(9, 'range', NULL, util.VN_CURDATE(), 'wed');
|
||||||
|
|
||||||
INSERT INTO `vn`.`workerTimeControl`(`userFk`, `timed`, `manual`, `direction`, `isSendMail`)
|
INSERT INTO `vn`.`workerTimeControl`(`userFk`, `timed`, `manual`, `direction`, `isSendMail`)
|
||||||
VALUES
|
VALUES
|
||||||
|
|
|
@ -18,6 +18,7 @@ Show summary: Mostrar vista previa
|
||||||
What is new: Novedades de la versión
|
What is new: Novedades de la versión
|
||||||
Settings: Ajustes
|
Settings: Ajustes
|
||||||
There is a new version, click here to reload: Hay una nueva versión, pulse aquí para recargar
|
There is a new version, click here to reload: Hay una nueva versión, pulse aquí para recargar
|
||||||
|
This ticket is locked.: Este ticket está bloqueado
|
||||||
|
|
||||||
# Actions
|
# Actions
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ function $exceptionHandler(vnApp, $window, $state, $injector) {
|
||||||
messageT = 'Invalid login';
|
messageT = 'Invalid login';
|
||||||
break;
|
break;
|
||||||
case 403:
|
case 403:
|
||||||
messageT = 'Access denied';
|
messageT = exception.data?.error?.message || 'Access denied';
|
||||||
break;
|
break;
|
||||||
case 502:
|
case 502:
|
||||||
messageT = 'It seems that the server has fall down';
|
messageT = 'It seems that the server has fall down';
|
||||||
|
|
|
@ -80,13 +80,15 @@ module.exports = Self => {
|
||||||
};
|
};
|
||||||
const conn = Self.dataSource.connector;
|
const conn = Self.dataSource.connector;
|
||||||
|
|
||||||
let where = buildFilter(params, (param, value) => {return {[param]: value}});
|
let where = buildFilter(params, (param, value) => {
|
||||||
|
return {[param]: value};
|
||||||
|
});
|
||||||
filter = mergeFilters(filter, {where});
|
filter = mergeFilters(filter, {where});
|
||||||
|
|
||||||
if (!filter.where) {
|
if (!filter.where) {
|
||||||
const yesterday = new Date();
|
const yesterday = new Date();
|
||||||
yesterday.setDate(yesterday.getDate() - 1);
|
yesterday.setDate(yesterday.getDate() - 1);
|
||||||
filter.where = {'shipped': yesterday.toISOString().split('T')[0]}
|
filter.where = {'shipped': yesterday.toISOString().split('T')[0]};
|
||||||
}
|
}
|
||||||
|
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
|
|
|
@ -63,7 +63,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
const isAvailable = itemStock.available > 0;
|
const isAvailable = itemStock.available > 0;
|
||||||
|
|
||||||
if (!isAvailable)
|
if (!isAvailable || !ctx.args.quantity)
|
||||||
throw new UserError(`This item is not available`);
|
throw new UserError(`This item is not available`);
|
||||||
|
|
||||||
if (request.saleFk)
|
if (request.saleFk)
|
||||||
|
|
|
@ -141,7 +141,6 @@ describe('ticket filter()', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return the tickets that are not pending', async() => {
|
it('should return the tickets that are not pending', async() => {
|
||||||
pending('#6010 test intermitente');
|
|
||||||
const tx = await models.Ticket.beginTransaction({});
|
const tx = await models.Ticket.beginTransaction({});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -35,25 +35,17 @@ module.exports = Self => {
|
||||||
if (typeof options == 'object')
|
if (typeof options == 'object')
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
|
ended = simpleDate(ended);
|
||||||
|
started = simpleDate(started);
|
||||||
|
|
||||||
query = `
|
query = `
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM vn.zoneEvent
|
FROM vn.zoneEvent
|
||||||
WHERE zoneFk = ?
|
WHERE zoneFk = ?
|
||||||
AND ((type = 'indefinitely')
|
AND (IFNULL(started, ?) <= ? AND IFNULL(ended,?) >= ?)
|
||||||
OR (type = 'day' AND dated BETWEEN ? AND ?)
|
|
||||||
OR (type = 'range'
|
|
||||||
AND (
|
|
||||||
(started BETWEEN ? AND ?)
|
|
||||||
OR
|
|
||||||
(ended BETWEEN ? AND ?)
|
|
||||||
OR
|
|
||||||
(started <= ? AND ended >= ?)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
ORDER BY type='indefinitely' DESC, type='range' DESC, type='day' DESC;`;
|
ORDER BY type='indefinitely' DESC, type='range' DESC, type='day' DESC;`;
|
||||||
const events = await Self.rawSql(query,
|
const events = await Self.rawSql(query,
|
||||||
[zoneFk, started, ended, started, ended, started, ended, started, ended], myOptions);
|
[zoneFk, started, ended, ended, started], myOptions);
|
||||||
|
|
||||||
query = `
|
query = `
|
||||||
SELECT e.*
|
SELECT e.*
|
||||||
|
@ -75,4 +67,7 @@ module.exports = Self => {
|
||||||
|
|
||||||
return {events, exclusions, geoExclusions};
|
return {events, exclusions, geoExclusions};
|
||||||
};
|
};
|
||||||
|
function simpleDate(date) {
|
||||||
|
return date.toISOString().split('T')[0];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,7 +30,7 @@ describe('zone getEventsFiltered()', () => {
|
||||||
|
|
||||||
const result = await models.Zone.getEventsFiltered(9, today, today, options);
|
const result = await models.Zone.getEventsFiltered(9, today, today, options);
|
||||||
|
|
||||||
expect(result.events.length).toEqual(1);
|
expect(result.events.length).toEqual(3);
|
||||||
expect(result.exclusions.length).toEqual(0);
|
expect(result.exclusions.length).toEqual(0);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
@ -47,11 +47,12 @@ describe('zone getEventsFiltered()', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
const date = Date.vnNew();
|
const date = Date.vnNew();
|
||||||
date.setFullYear(date.getFullYear() - 2);
|
date.setFullYear(date.getFullYear() - 2);
|
||||||
const dateTomorrow = new Date(date.setDate(date.getDate() + 1));
|
const dateTomorrow = new Date(date);
|
||||||
|
dateTomorrow.setDate(dateTomorrow.getDate() + 1);
|
||||||
|
|
||||||
const result = await models.Zone.getEventsFiltered(9, date, dateTomorrow, options);
|
const result = await models.Zone.getEventsFiltered(9, date, dateTomorrow, options);
|
||||||
|
|
||||||
expect(result.events.length).toEqual(0);
|
expect(result.events.length).toEqual(1);
|
||||||
expect(result.exclusions.length).toEqual(0);
|
expect(result.exclusions.length).toEqual(0);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-back",
|
"name": "salix-back",
|
||||||
"version": "23.50.01",
|
"version": "23.52.01",
|
||||||
"author": "Verdnatura Levante SL",
|
"author": "Verdnatura Levante SL",
|
||||||
"description": "Salix backend",
|
"description": "Salix backend",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|
|
@ -20,7 +20,7 @@ SELECT
|
||||||
u.nickName salesPersonName,
|
u.nickName salesPersonName,
|
||||||
ipkg.itemPackingTypes
|
ipkg.itemPackingTypes
|
||||||
FROM route r
|
FROM route r
|
||||||
LEFT JOIN ticket t ON t.routeFk = r.id
|
JOIN ticket t ON t.routeFk = r.id
|
||||||
LEFT JOIN address a ON a.id = t.addressFk
|
LEFT JOIN address a ON a.id = t.addressFk
|
||||||
LEFT JOIN client c ON c.id = t.clientFk
|
LEFT JOIN client c ON c.id = t.clientFk
|
||||||
LEFT JOIN worker w ON w.id = client_getSalesPerson(t.clientFk, CURDATE())
|
LEFT JOIN worker w ON w.id = client_getSalesPerson(t.clientFk, CURDATE())
|
||||||
|
|
Loading…
Reference in New Issue