From b45b0ff8260ee221da6902cd7cff4e557fd33533 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 20 Apr 2023 08:23:46 +0200 Subject: [PATCH 01/53] refs #5066 copy project from the other --- db/changes/231601/00-ACLgetVehiclesSorted.sql | 3 ++ .../back/methods/vehicle/getVehiclesSorted.js | 28 +++++++++++++++++++ modules/route/back/models/vehicle.js | 3 ++ modules/route/front/basic-data/index.html | 5 +++- modules/route/front/basic-data/index.js | 13 +++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 db/changes/231601/00-ACLgetVehiclesSorted.sql create mode 100644 modules/route/back/methods/vehicle/getVehiclesSorted.js create mode 100644 modules/route/back/models/vehicle.js diff --git a/db/changes/231601/00-ACLgetVehiclesSorted.sql b/db/changes/231601/00-ACLgetVehiclesSorted.sql new file mode 100644 index 000000000..5d3ec454d --- /dev/null +++ b/db/changes/231601/00-ACLgetVehiclesSorted.sql @@ -0,0 +1,3 @@ +INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalId`) + VALUES + ('Vehicle','getVehiclesSorted','WRITE','ALLOW','employee'); \ No newline at end of file diff --git a/modules/route/back/methods/vehicle/getVehiclesSorted.js b/modules/route/back/methods/vehicle/getVehiclesSorted.js new file mode 100644 index 000000000..b785e5dc8 --- /dev/null +++ b/modules/route/back/methods/vehicle/getVehiclesSorted.js @@ -0,0 +1,28 @@ +module.exports = Self => { + Self.remoteMethod('getVehiclesSorted', { + description: 'Sort the vehicles by a warehouse', + accessType: 'WRITE', + accepts: [{ + arg: 'warehouseFk', + type: 'number' + }], + returns: { + type: ['object'], + root: true + }, + http: { + path: `/getVehiclesSorted`, + verb: `POST` + } + }); + + Self.getVehiclesSorted = async warehouseFk => { + const vehicles = await Self.rawSql(` + SELECT v.id, v.numberPlate, w.name + FROM vehicle v + JOIN warehouse w ON w.id = v.warehouseFk + ORDER BY v.warehouseFk = ? DESC, v.numberPlate ASC`, [warehouseFk]); + + return vehicles; + }; +}; diff --git a/modules/route/back/models/vehicle.js b/modules/route/back/models/vehicle.js new file mode 100644 index 000000000..459afe1c2 --- /dev/null +++ b/modules/route/back/models/vehicle.js @@ -0,0 +1,3 @@ +module.exports = Self => { + require('../methods/vehicle/getVehiclesSorted')(Self); +}; diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html index 831599ae8..9888a6859 100644 --- a/modules/route/front/basic-data/index.html +++ b/modules/route/front/basic-data/index.html @@ -24,10 +24,13 @@ + + {{numberPlate}} - {{name}} + diff --git a/modules/route/front/basic-data/index.js b/modules/route/front/basic-data/index.js index b8602ed12..80626e97e 100644 --- a/modules/route/front/basic-data/index.js +++ b/modules/route/front/basic-data/index.js @@ -7,6 +7,19 @@ class Controller extends Section { this.card.reload() ); } + constructor($element, $) { + super($element, $); + this.$http.get(`UserConfigs/getUserConfig`) + .then(res => { + if (res && res.data) { + this.$http.post(`Vehicles/getVehiclesSorted`, {warehouseFk: res.data.warehouseFk}) + .then(res => { + if (res && res.data) + this.vehicles = res.data; + }); + } + }); + } } ngModule.vnComponent('vnRouteBasicData', { From 16fdfa00fda86e5fe2cba3f57ec581f36d18152b Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 20 Apr 2023 09:09:48 +0200 Subject: [PATCH 02/53] refs #5066 e2e solve --- e2e/paths/08-route/02_basic_data.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/paths/08-route/02_basic_data.spec.js b/e2e/paths/08-route/02_basic_data.spec.js index ff8361499..6132d5e23 100644 --- a/e2e/paths/08-route/02_basic_data.spec.js +++ b/e2e/paths/08-route/02_basic_data.spec.js @@ -46,7 +46,7 @@ describe('Route basic Data path', () => { it('should confirm the vehicle was edited', async() => { const vehicle = await page.waitToGetProperty(selectors.routeBasicData.vehicle, 'value'); - expect(vehicle).toEqual('1111-IMK'); + expect(vehicle).toEqual('1111-IMK - Warehouse One'); }); it('should confirm the km start was edited', async() => { From 237c83c6f551d7b8d188a0045c9be108eee3b2fa Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 20 Apr 2023 10:20:15 +0200 Subject: [PATCH 03/53] refs #5066 getVehicleSorted small mod --- modules/route/back/methods/vehicle/getVehiclesSorted.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/route/back/methods/vehicle/getVehiclesSorted.js b/modules/route/back/methods/vehicle/getVehiclesSorted.js index b785e5dc8..9dad8b80a 100644 --- a/modules/route/back/methods/vehicle/getVehiclesSorted.js +++ b/modules/route/back/methods/vehicle/getVehiclesSorted.js @@ -1,6 +1,6 @@ module.exports = Self => { Self.remoteMethod('getVehiclesSorted', { - description: 'Sort the vehicles by a warehouse', + description: 'Sort the vehicles by warehouse', accessType: 'WRITE', accepts: [{ arg: 'warehouseFk', From c1ea1acc8c5147fbbc161cb6726b730e4607b4a0 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 26 Apr 2023 13:49:08 +0200 Subject: [PATCH 04/53] refs #4614 fear(ticket): add 'set weight' funcionality --- db/changes/231601/00-ticketWeight.sql | 7 ++ db/dump/fixtures.sql | 66 +++++++++---------- modules/ticket/back/models/ticket.json | 3 + .../ticket/front/descriptor-menu/index.html | 23 +++++++ modules/ticket/front/descriptor-menu/index.js | 9 +++ modules/ticket/front/summary/index.html | 5 ++ .../invoice-incoterms/sql/incoterms.sql | 53 +++++++-------- 7 files changed, 104 insertions(+), 62 deletions(-) create mode 100644 db/changes/231601/00-ticketWeight.sql diff --git a/db/changes/231601/00-ticketWeight.sql b/db/changes/231601/00-ticketWeight.sql new file mode 100644 index 000000000..188804348 --- /dev/null +++ b/db/changes/231601/00-ticketWeight.sql @@ -0,0 +1,7 @@ +UPDATE vn.ticket t + JOIN vn.ticketObservation o ON o.ticketFk = t.id + SET t.weight = cast(REPLACE(o.description, ',', '.') as decimal(10,2)) + WHERE o.observationTypeFk = 6; + +DELETE FROM vn.ticketObservation WHERE observationTypeFk = 6; +DELETE FROM vn.observationType WHERE id = 6; diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 15ccece35..dc109e4c4 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -688,40 +688,40 @@ INSERT INTO `vn`.`route`(`id`, `time`, `workerFk`, `created`, `vehicleFk`, `agen (6, NULL, 57, util.VN_CURDATE(), 5, 7, 'sixth route', 1.7, 60, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 3), (7, NULL, 57, util.VN_CURDATE(), 6, 8, 'seventh route', 0, 70, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 5); -INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`) +INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `zoneFk`, `zonePrice`, `zoneBonus`, `created`, `weight`) VALUES - (1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, 'T1111111', 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), - (2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T1111111', 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), - (3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T2222222', 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)), - (4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T3333333', 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)), - (5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T4444444', 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)), - (6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, 'A1111111', 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)), - (7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE()), - (8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE()), - (9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE()), - (10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE()), - (11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE()), - (12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()), - (13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE()), - (14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE()), - (15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE()), - (16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE()), - (17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE()), - (18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, util.VN_CURDATE()), - (19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE()), - (20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), - (21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), - (22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)), - (23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE()), - (24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE()), - (25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()), - (26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()), - (27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE()), - (28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()), - (29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()), - (30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()), - (31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()), - (32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE()); + (1 , 3, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Bat cave', 121, 'T1111111', 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1), + (2 , 1, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T1111111', 0, 1, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2), + (3 , 1, 7, 1, 6, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -2 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T2222222', 0, 3, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), NULL), + (4 , 3, 2, 1, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -3 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T3333333', 0, 9, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH), NULL), + (5 , 3, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -4 MONTH), INTERVAL +1 DAY), 1104, 'Stark tower', 124, 'T4444444', 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH), NULL), + (6 , 1, 3, 3, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL -1 MONTH), INTERVAL +1 DAY), 1101, 'Mountain Drive Gotham', 1, 'A1111111', 0, 10, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), NULL), + (7 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Mountain Drive Gotham', 1, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), + (8 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'Bat cave', 121, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), + (9 , NULL, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1104, 'Stark tower', 124, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), + (10, 1, 1, 5, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'Ingram Street', 2, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL), + (11, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1102, 'NY roofs', 122, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), + (12, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL), + (13, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), + (14, 1, 2, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1104, 'Malibu Point', 4, NULL, 0, 9, 5, 1, util.VN_CURDATE(), NULL), + (15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), + (16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), + (17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), + (18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, util.VN_CURDATE(), NULL), + (19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE(), NULL), + (20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL), + (21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL), + (22, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Japan', 103, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL), + (23, NULL, 8, 1, 7, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1101, 'address 21', 121, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL), + (24 ,NULL, 8, 1, 7, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 5, 5, 1, util.VN_CURDATE(), NULL), + (25 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Bruce Wayne', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL), + (26 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'An incredibly long alias for testing purposes', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL), + (27 ,NULL, 8, 1, NULL, util.VN_CURDATE(), util.VN_CURDATE(), 1101, 'Wolverine', 1, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL), + (28, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL), + (29, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL), + (30, 1, 8, 1, 1, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL), + (31, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL), + (32, 1, 8, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL + 2 DAY), 1103, 'Phone Box', 123, NULL, 0, 1, 5, 1, util.VN_CURDATE(), NULL); INSERT INTO `vn`.`ticketObservation`(`id`, `ticketFk`, `observationTypeFk`, `description`) VALUES diff --git a/modules/ticket/back/models/ticket.json b/modules/ticket/back/models/ticket.json index b2e87362f..ec4193bed 100644 --- a/modules/ticket/back/models/ticket.json +++ b/modules/ticket/back/models/ticket.json @@ -60,6 +60,9 @@ }, "totalWithoutVat": { "type": "number" + }, + "weight": { + "type": "number" } }, "relations": { diff --git a/modules/ticket/front/descriptor-menu/index.html b/modules/ticket/front/descriptor-menu/index.html index c2ebc3e3a..64204feb7 100644 --- a/modules/ticket/front/descriptor-menu/index.html +++ b/modules/ticket/front/descriptor-menu/index.html @@ -148,6 +148,12 @@ translate> Refund all + + Set ticket weight + @@ -341,3 +347,20 @@ question="Are you sure you want to replace this delivery note?" message="Already exist signed delivery note"> + + + + + + + + + + + diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index 1a88b00d5..c9cad9bd2 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -335,6 +335,15 @@ class Controller extends Section { this.vnApp.showSuccess(this.$t('PDF sent!')); }); } + + setTicketWeight(weight) { + return this.$http.patch(`Tickets/${this.ticket.id}`, {weight}) + .then(() => { + this.$.setTicketWeight.hide(); + this.vnApp.showSuccess(this.$t('Data saved!')); + this.reload(); + }); + } } Controller.$inject = ['$element', '$scope', 'vnReport', 'vnEmail']; diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 97055208b..dd0e94f42 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -65,6 +65,11 @@ {{$ctrl.summary.refFk | dashIfEmpty}} + + + {{$ctrl.summary.weight | dashIfEmpty}} + + Date: Mon, 29 May 2023 10:24:37 +0200 Subject: [PATCH 05/53] refs #5066 move sql --- db/changes/232401/00-ACLgetVehiclesSorted.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 db/changes/232401/00-ACLgetVehiclesSorted.sql diff --git a/db/changes/232401/00-ACLgetVehiclesSorted.sql b/db/changes/232401/00-ACLgetVehiclesSorted.sql new file mode 100644 index 000000000..5d3ec454d --- /dev/null +++ b/db/changes/232401/00-ACLgetVehiclesSorted.sql @@ -0,0 +1,3 @@ +INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalId`) + VALUES + ('Vehicle','getVehiclesSorted','WRITE','ALLOW','employee'); \ No newline at end of file From d8e7c2700a110bde087ae5bee817fe6fc997acfb Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 29 May 2023 12:42:27 +0200 Subject: [PATCH 06/53] refs #5066 fix autocomplete --- e2e/paths/08-route/02_basic_data.spec.js | 2 +- front/core/components/autocomplete/index.js | 14 +++++++++++++- .../back/methods/vehicle/getVehiclesSorted.js | 10 ++++++---- modules/route/front/basic-data/index.html | 8 +++----- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/e2e/paths/08-route/02_basic_data.spec.js b/e2e/paths/08-route/02_basic_data.spec.js index 6008b0482..7ab7dda42 100644 --- a/e2e/paths/08-route/02_basic_data.spec.js +++ b/e2e/paths/08-route/02_basic_data.spec.js @@ -24,7 +24,7 @@ describe('Route basic Data path', () => { const form = 'vn-route-basic-data form'; const values = { worker: 'adminBossNick', - vehicle: '1111-IMK - Warehouse One', + vehicle: '1111-IMK', created: nextMonth, kmStart: 1, kmEnd: 2, diff --git a/front/core/components/autocomplete/index.js b/front/core/components/autocomplete/index.js index 2539c4ef4..52491f7e0 100755 --- a/front/core/components/autocomplete/index.js +++ b/front/core/components/autocomplete/index.js @@ -174,6 +174,7 @@ export default class Autocomplete extends Field { refreshDisplayed() { let display = ''; + let hasTemplate = this.$transclude && this.$transclude.isSlotFilled('tplItem'); if (this._selection && this.showField) { if (this.multiple && Array.isArray(this._selection)) { @@ -181,8 +182,19 @@ export default class Autocomplete extends Field { if (display.length > 0) display += ', '; display += item[this.showField]; } - } else + } else { display = this._selection[this.showField]; + if (hasTemplate) { + let template = this.$transclude(() => {}, null, 'tplItem'); + const element = template[0]; + const description = element.querySelector('.text-secondary'); + if (description) description.remove(); + + const displayElement = angular.element(element); + const displayText = displayElement.text(); + display = this.$interpolate(displayText)(this._selection); + } + } } this.input.value = display; diff --git a/modules/route/back/methods/vehicle/getVehiclesSorted.js b/modules/route/back/methods/vehicle/getVehiclesSorted.js index 9dad8b80a..384d89391 100644 --- a/modules/route/back/methods/vehicle/getVehiclesSorted.js +++ b/modules/route/back/methods/vehicle/getVehiclesSorted.js @@ -18,11 +18,13 @@ module.exports = Self => { Self.getVehiclesSorted = async warehouseFk => { const vehicles = await Self.rawSql(` - SELECT v.id, v.numberPlate, w.name + SELECT ROW_NUMBER() OVER (ORDER BY v.warehouseFk = ? DESC, w.id, v.numberPlate) AS 'order', + v.id, + v.warehouseFk, + CONCAT(v.numberPlate, ' - ', w.name) as description FROM vehicle v - JOIN warehouse w ON w.id = v.warehouseFk - ORDER BY v.warehouseFk = ? DESC, v.numberPlate ASC`, [warehouseFk]); - + JOIN warehouse w ON w.id = v.warehouseFk + ORDER BY v.warehouseFk = ? DESC, w.id, v.numberPlate ASC`, [warehouseFk, warehouseFk]); return vehicles; }; }; diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html index 0f62dc107..1ba84583f 100644 --- a/modules/route/front/basic-data/index.html +++ b/modules/route/front/basic-data/index.html @@ -25,19 +25,17 @@ - - {{numberPlate}} - {{name}} - + vn-name="created"> Date: Mon, 29 May 2023 13:49:32 +0200 Subject: [PATCH 07/53] refs #5066 e2e fixs, change name sorted --- db/changes/232401/00-ACLgetVehiclesSorted.sql | 2 +- e2e/paths/08-route/02_basic_data.spec.js | 2 +- front/core/components/autocomplete/index.js | 14 +------------- .../vehicle/{getVehiclesSorted.js => sorted.js} | 6 +++--- modules/route/back/models/vehicle.js | 2 +- modules/route/front/basic-data/index.html | 3 ++- modules/route/front/basic-data/index.js | 2 +- 7 files changed, 10 insertions(+), 21 deletions(-) rename modules/route/back/methods/vehicle/{getVehiclesSorted.js => sorted.js} (85%) diff --git a/db/changes/232401/00-ACLgetVehiclesSorted.sql b/db/changes/232401/00-ACLgetVehiclesSorted.sql index 5d3ec454d..6625f0d5c 100644 --- a/db/changes/232401/00-ACLgetVehiclesSorted.sql +++ b/db/changes/232401/00-ACLgetVehiclesSorted.sql @@ -1,3 +1,3 @@ INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalId`) VALUES - ('Vehicle','getVehiclesSorted','WRITE','ALLOW','employee'); \ No newline at end of file + ('Vehicle','sorted','WRITE','ALLOW','employee'); \ No newline at end of file diff --git a/e2e/paths/08-route/02_basic_data.spec.js b/e2e/paths/08-route/02_basic_data.spec.js index 7ab7dda42..6008b0482 100644 --- a/e2e/paths/08-route/02_basic_data.spec.js +++ b/e2e/paths/08-route/02_basic_data.spec.js @@ -24,7 +24,7 @@ describe('Route basic Data path', () => { const form = 'vn-route-basic-data form'; const values = { worker: 'adminBossNick', - vehicle: '1111-IMK', + vehicle: '1111-IMK - Warehouse One', created: nextMonth, kmStart: 1, kmEnd: 2, diff --git a/front/core/components/autocomplete/index.js b/front/core/components/autocomplete/index.js index 52491f7e0..2539c4ef4 100755 --- a/front/core/components/autocomplete/index.js +++ b/front/core/components/autocomplete/index.js @@ -174,7 +174,6 @@ export default class Autocomplete extends Field { refreshDisplayed() { let display = ''; - let hasTemplate = this.$transclude && this.$transclude.isSlotFilled('tplItem'); if (this._selection && this.showField) { if (this.multiple && Array.isArray(this._selection)) { @@ -182,19 +181,8 @@ export default class Autocomplete extends Field { if (display.length > 0) display += ', '; display += item[this.showField]; } - } else { + } else display = this._selection[this.showField]; - if (hasTemplate) { - let template = this.$transclude(() => {}, null, 'tplItem'); - const element = template[0]; - const description = element.querySelector('.text-secondary'); - if (description) description.remove(); - - const displayElement = angular.element(element); - const displayText = displayElement.text(); - display = this.$interpolate(displayText)(this._selection); - } - } } this.input.value = display; diff --git a/modules/route/back/methods/vehicle/getVehiclesSorted.js b/modules/route/back/methods/vehicle/sorted.js similarity index 85% rename from modules/route/back/methods/vehicle/getVehiclesSorted.js rename to modules/route/back/methods/vehicle/sorted.js index 384d89391..4231b77cb 100644 --- a/modules/route/back/methods/vehicle/getVehiclesSorted.js +++ b/modules/route/back/methods/vehicle/sorted.js @@ -1,5 +1,5 @@ module.exports = Self => { - Self.remoteMethod('getVehiclesSorted', { + Self.remoteMethod('sorted', { description: 'Sort the vehicles by warehouse', accessType: 'WRITE', accepts: [{ @@ -11,12 +11,12 @@ module.exports = Self => { root: true }, http: { - path: `/getVehiclesSorted`, + path: `/sorted`, verb: `POST` } }); - Self.getVehiclesSorted = async warehouseFk => { + Self.sorted = async warehouseFk => { const vehicles = await Self.rawSql(` SELECT ROW_NUMBER() OVER (ORDER BY v.warehouseFk = ? DESC, w.id, v.numberPlate) AS 'order', v.id, diff --git a/modules/route/back/models/vehicle.js b/modules/route/back/models/vehicle.js index 459afe1c2..73e321443 100644 --- a/modules/route/back/models/vehicle.js +++ b/modules/route/back/models/vehicle.js @@ -1,3 +1,3 @@ module.exports = Self => { - require('../methods/vehicle/getVehiclesSorted')(Self); + require('../methods/vehicle/sorted')(Self); }; diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html index 1ba84583f..1d6e260a9 100644 --- a/modules/route/front/basic-data/index.html +++ b/modules/route/front/basic-data/index.html @@ -28,7 +28,8 @@ show-field="description" order="order" value-field="id" - label="Vehicle"> + label="Vehicle" + vn-name="vehicle"> diff --git a/modules/route/front/basic-data/index.js b/modules/route/front/basic-data/index.js index 80626e97e..a147a451c 100644 --- a/modules/route/front/basic-data/index.js +++ b/modules/route/front/basic-data/index.js @@ -12,7 +12,7 @@ class Controller extends Section { this.$http.get(`UserConfigs/getUserConfig`) .then(res => { if (res && res.data) { - this.$http.post(`Vehicles/getVehiclesSorted`, {warehouseFk: res.data.warehouseFk}) + this.$http.post(`Vehicles/sorted`, {warehouseFk: res.data.warehouseFk}) .then(res => { if (res && res.data) this.vehicles = res.data; From 0661bf8fa98cead2a07a4ee16b499520e771be0c Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 30 May 2023 12:21:44 +0200 Subject: [PATCH 08/53] refs #5066 remake sql without ROW_ORDER --- modules/route/back/methods/vehicle/sorted.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/route/back/methods/vehicle/sorted.js b/modules/route/back/methods/vehicle/sorted.js index 4231b77cb..5c4c305cc 100644 --- a/modules/route/back/methods/vehicle/sorted.js +++ b/modules/route/back/methods/vehicle/sorted.js @@ -17,14 +17,11 @@ module.exports = Self => { }); Self.sorted = async warehouseFk => { - const vehicles = await Self.rawSql(` - SELECT ROW_NUMBER() OVER (ORDER BY v.warehouseFk = ? DESC, w.id, v.numberPlate) AS 'order', - v.id, - v.warehouseFk, - CONCAT(v.numberPlate, ' - ', w.name) as description - FROM vehicle v - JOIN warehouse w ON w.id = v.warehouseFk - ORDER BY v.warehouseFk = ? DESC, w.id, v.numberPlate ASC`, [warehouseFk, warehouseFk]); - return vehicles; + return Self.rawSql(` + SELECT v.id, v.warehouseFk, CONCAT(v.numberPlate, ' - ', w.name) as description + FROM vehicle v + JOIN warehouse w ON w.id = v.warehouseFk + ORDER BY v.warehouseFk = ? DESC, w.id, v.numberPlate ASC; + `, [warehouseFk]); }; }; From dfebb3b307d781a80756594a18b8c9dba1c7f2e6 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 31 May 2023 10:04:34 +0200 Subject: [PATCH 09/53] refs #5066 sorted without CONCAT, order=false --- modules/route/back/methods/vehicle/sorted.js | 2 +- modules/route/front/basic-data/index.html | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/route/back/methods/vehicle/sorted.js b/modules/route/back/methods/vehicle/sorted.js index 5c4c305cc..b379743bc 100644 --- a/modules/route/back/methods/vehicle/sorted.js +++ b/modules/route/back/methods/vehicle/sorted.js @@ -18,7 +18,7 @@ module.exports = Self => { Self.sorted = async warehouseFk => { return Self.rawSql(` - SELECT v.id, v.warehouseFk, CONCAT(v.numberPlate, ' - ', w.name) as description + SELECT v.id, v.warehouseFk, v.numberPlate, w.name FROM vehicle v JOIN warehouse w ON w.id = v.warehouseFk ORDER BY v.warehouseFk = ? DESC, w.id, v.numberPlate ASC; diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html index 1d6e260a9..bf7bf672c 100644 --- a/modules/route/front/basic-data/index.html +++ b/modules/route/front/basic-data/index.html @@ -22,14 +22,14 @@
{{::name}}
- + order="false"> + {{::numberPlate}} - {{::name}}
From d18137bce0c97552ab8628d4458d5f346678ce9e Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 31 May 2023 10:20:13 +0200 Subject: [PATCH 10/53] refs #5066 not dense --- modules/route/front/basic-data/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html index bf7bf672c..514c535a2 100644 --- a/modules/route/front/basic-data/index.html +++ b/modules/route/front/basic-data/index.html @@ -22,7 +22,7 @@
{{::name}}
- Date: Wed, 7 Jun 2023 08:30:37 +0200 Subject: [PATCH 11/53] refs #5066 fix vehicle res.data --- modules/route/front/basic-data/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/route/front/basic-data/index.js b/modules/route/front/basic-data/index.js index a147a451c..d7f178985 100644 --- a/modules/route/front/basic-data/index.js +++ b/modules/route/front/basic-data/index.js @@ -11,10 +11,10 @@ class Controller extends Section { super($element, $); this.$http.get(`UserConfigs/getUserConfig`) .then(res => { - if (res && res.data) { + if (res.data) { this.$http.post(`Vehicles/sorted`, {warehouseFk: res.data.warehouseFk}) .then(res => { - if (res && res.data) + if (res.data) this.vehicles = res.data; }); } From dcbe8c5f7a36c29ed985705c07f0a80a4c17556a Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 26 Jun 2023 06:28:35 +0200 Subject: [PATCH 12/53] refs #5066 quit if --- modules/route/front/basic-data/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/route/front/basic-data/index.js b/modules/route/front/basic-data/index.js index d7f178985..e6be796ce 100644 --- a/modules/route/front/basic-data/index.js +++ b/modules/route/front/basic-data/index.js @@ -14,8 +14,7 @@ class Controller extends Section { if (res.data) { this.$http.post(`Vehicles/sorted`, {warehouseFk: res.data.warehouseFk}) .then(res => { - if (res.data) - this.vehicles = res.data; + this.vehicles = res.data; }); } }); From eff46c1cec81cf0d12a6e775e4749098481025fc Mon Sep 17 00:00:00 2001 From: carlossa Date: Mon, 26 Jun 2023 07:43:36 +0200 Subject: [PATCH 13/53] refs #5066 e2e fix, vnConfig --- e2e/paths/08-route/02_basic_data.spec.js | 2 +- modules/route/front/basic-data/index.html | 3 ++- modules/route/front/basic-data/index.js | 19 +++++++------------ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/e2e/paths/08-route/02_basic_data.spec.js b/e2e/paths/08-route/02_basic_data.spec.js index 6008b0482..7ab7dda42 100644 --- a/e2e/paths/08-route/02_basic_data.spec.js +++ b/e2e/paths/08-route/02_basic_data.spec.js @@ -24,7 +24,7 @@ describe('Route basic Data path', () => { const form = 'vn-route-basic-data form'; const values = { worker: 'adminBossNick', - vehicle: '1111-IMK - Warehouse One', + vehicle: '1111-IMK', created: nextMonth, kmStart: 1, kmEnd: 2, diff --git a/modules/route/front/basic-data/index.html b/modules/route/front/basic-data/index.html index 514c535a2..ade9230e8 100644 --- a/modules/route/front/basic-data/index.html +++ b/modules/route/front/basic-data/index.html @@ -28,7 +28,8 @@ data="$ctrl.vehicles" show-field="numberPlate" value-field="id" - order="false"> + order="false" + vn-name="vehicle"> {{::numberPlate}} - {{::name}}
diff --git a/modules/route/front/basic-data/index.js b/modules/route/front/basic-data/index.js index e6be796ce..f051e23c5 100644 --- a/modules/route/front/basic-data/index.js +++ b/modules/route/front/basic-data/index.js @@ -2,23 +2,18 @@ import ngModule from '../module'; import Section from 'salix/components/section'; class Controller extends Section { + $onInit() { + this.$http.post(`Vehicles/sorted`, {warehouseFk: this.vnConfig.warehouseFk}) + .then(res => { + this.vehicles = res.data; + }); + } + onSubmit() { this.$.watcher.submit().then(() => this.card.reload() ); } - constructor($element, $) { - super($element, $); - this.$http.get(`UserConfigs/getUserConfig`) - .then(res => { - if (res.data) { - this.$http.post(`Vehicles/sorted`, {warehouseFk: res.data.warehouseFk}) - .then(res => { - this.vehicles = res.data; - }); - } - }); - } } ngModule.vnComponent('vnRouteBasicData', { From e58d4e5db3451316308d2e2bb196676d0da5ce7e Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 4 Jul 2023 14:42:51 +0200 Subject: [PATCH 14/53] =?UTF-8?q?refs=20#4770=20feat:=20a=C3=B1adida=20sec?= =?UTF-8?q?ci=C3=B3n=20'Troncales'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/changes/232801/00-roadmap.sql | 10 + db/changes/232801/00-roadmapACL.sql | 4 + db/dump/fixtures.sql | 15 +- front/core/styles/icons/salixfont.css | 805 +++++++++--------- front/core/styles/icons/salixfont.eot | Bin 46420 -> 49176 bytes front/core/styles/icons/salixfont.svg | 7 +- front/core/styles/icons/salixfont.ttf | Bin 46248 -> 49004 bytes front/core/styles/icons/salixfont.woff | Bin 46324 -> 49080 bytes modules/client/front/summary/style.scss | 4 +- modules/entry/front/buy/index/style.scss | 9 +- modules/route/back/methods/roadmap/clone.js | 81 ++ modules/route/back/model-config.json | 14 +- .../route/back/models/expedition-truck.json | 43 + modules/route/back/models/roadmap.js | 3 + modules/route/back/models/roadmap.json | 63 ++ modules/route/front/index.js | 1 + .../route/front/roadmap/basic-data/index.html | 98 +++ .../route/front/roadmap/basic-data/index.js | 16 + modules/route/front/roadmap/card/index.html | 5 + modules/route/front/roadmap/card/index.js | 19 + modules/route/front/roadmap/create/index.html | 37 + modules/route/front/roadmap/create/index.js | 23 + modules/route/front/roadmap/create/style.scss | 6 + .../route/front/roadmap/descriptor/index.html | 39 + .../route/front/roadmap/descriptor/index.js | 26 + .../front/roadmap/descriptor/locale/es.yml | 3 + modules/route/front/roadmap/index.js | 9 + modules/route/front/roadmap/index/index.html | 112 +++ modules/route/front/roadmap/index/index.js | 62 ++ .../route/front/roadmap/index/locale/es.yml | 3 + modules/route/front/roadmap/locale/es.yml | 14 + modules/route/front/roadmap/main/index.html | 20 + modules/route/front/roadmap/main/index.js | 61 ++ .../route/front/roadmap/main/locale/es.yml | 1 + .../front/roadmap/search-panel/index.html | 74 ++ .../route/front/roadmap/search-panel/index.js | 7 + modules/route/front/roadmap/stops/index.html | 71 ++ modules/route/front/roadmap/stops/index.js | 39 + .../route/front/roadmap/stops/locale/es.yml | 4 + .../route/front/roadmap/summary/index.html | 113 +++ modules/route/front/roadmap/summary/index.js | 68 ++ .../route/front/roadmap/summary/locale/es.yml | 3 + .../route/front/roadmap/summary/style.scss | 11 + modules/route/front/routes.json | 47 +- modules/shelving/front/descriptor/index.html | 8 +- .../shelving/front/descriptor/locale/es.yml | 3 + modules/worker/front/create/index.html | 2 +- modules/worker/front/create/locale/es.yml | 2 +- 48 files changed, 1643 insertions(+), 422 deletions(-) create mode 100644 db/changes/232801/00-roadmap.sql create mode 100644 db/changes/232801/00-roadmapACL.sql create mode 100644 modules/route/back/methods/roadmap/clone.js create mode 100644 modules/route/back/models/expedition-truck.json create mode 100644 modules/route/back/models/roadmap.js create mode 100644 modules/route/back/models/roadmap.json create mode 100644 modules/route/front/roadmap/basic-data/index.html create mode 100644 modules/route/front/roadmap/basic-data/index.js create mode 100644 modules/route/front/roadmap/card/index.html create mode 100644 modules/route/front/roadmap/card/index.js create mode 100644 modules/route/front/roadmap/create/index.html create mode 100644 modules/route/front/roadmap/create/index.js create mode 100644 modules/route/front/roadmap/create/style.scss create mode 100644 modules/route/front/roadmap/descriptor/index.html create mode 100644 modules/route/front/roadmap/descriptor/index.js create mode 100644 modules/route/front/roadmap/descriptor/locale/es.yml create mode 100644 modules/route/front/roadmap/index.js create mode 100644 modules/route/front/roadmap/index/index.html create mode 100644 modules/route/front/roadmap/index/index.js create mode 100644 modules/route/front/roadmap/index/locale/es.yml create mode 100644 modules/route/front/roadmap/locale/es.yml create mode 100644 modules/route/front/roadmap/main/index.html create mode 100644 modules/route/front/roadmap/main/index.js create mode 100644 modules/route/front/roadmap/main/locale/es.yml create mode 100644 modules/route/front/roadmap/search-panel/index.html create mode 100644 modules/route/front/roadmap/search-panel/index.js create mode 100644 modules/route/front/roadmap/stops/index.html create mode 100644 modules/route/front/roadmap/stops/index.js create mode 100644 modules/route/front/roadmap/stops/locale/es.yml create mode 100644 modules/route/front/roadmap/summary/index.html create mode 100644 modules/route/front/roadmap/summary/index.js create mode 100644 modules/route/front/roadmap/summary/locale/es.yml create mode 100644 modules/route/front/roadmap/summary/style.scss create mode 100644 modules/shelving/front/descriptor/locale/es.yml diff --git a/db/changes/232801/00-roadmap.sql b/db/changes/232801/00-roadmap.sql new file mode 100644 index 000000000..a2835160f --- /dev/null +++ b/db/changes/232801/00-roadmap.sql @@ -0,0 +1,10 @@ +ALTER TABLE `vn`.`roadmap` COMMENT='Troncales diarios que se contratan'; +ALTER TABLE `vn`.`roadmap` ADD price decimal(10,2) NULL; +ALTER TABLE `vn`.`roadmap` ADD driverName varchar(45) NULL; +ALTER TABLE `vn`.`roadmap` ADD name varchar(45) NOT NULL; +ALTER TABLE `vn`.`roadmap` CHANGE name name varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL AFTER id; +ALTER TABLE `vn`.`roadmap` MODIFY COLUMN etd datetime NOT NULL; + +ALTER TABLE `vn`.`expeditionTruck` COMMENT='Distintas paradas que hacen los trocales'; +ALTER TABLE `vn`.`expeditionTruck` DROP FOREIGN KEY expeditionTruck_FK_2; +ALTER TABLE `vn`.`expeditionTruck` ADD CONSTRAINT expeditionTruck_FK_2 FOREIGN KEY (roadmapFk) REFERENCES vn.roadmap(id) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/db/changes/232801/00-roadmapACL.sql b/db/changes/232801/00-roadmapACL.sql new file mode 100644 index 000000000..8954ecb27 --- /dev/null +++ b/db/changes/232801/00-roadmapACL.sql @@ -0,0 +1,4 @@ +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) + VALUES + ('Roadmap', '*', '*', 'ALLOW', 'ROLE', 'employee'), + ('ExpeditionTruck', '*', '*', 'ALLOW', 'ROLE', 'employee'); diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 208eb2c21..a5cc2ddbe 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2593,7 +2593,7 @@ UPDATE `vn`.`ticket` UPDATE `vn`.`ticket` SET refFk = 'A1111111' - WHERE id = 6; + WHERE id = 6; INSERT INTO `vn`.`zoneAgencyMode`(`id`, `agencyModeFk`, `zoneFk`) VALUES @@ -2602,9 +2602,18 @@ INSERT INTO `vn`.`zoneAgencyMode`(`id`, `agencyModeFk`, `zoneFk`) (3, 6, 5), (4, 7, 1); -INSERT INTO `vn`.`expeditionTruck` (`id`, `eta`, `description`) +INSERT INTO `vn`.`roadmap` (`id`, `name`, `tractorPlate`, `trailerPlate`, `phone`, `supplierFk`, `etd`, `observations`, `userFk`, `price`, `driverName`) VALUES - (1, CONCAT(YEAR(DATE_ADD(util.VN_CURDATE(), INTERVAL +3 YEAR))), 'Best truck in fleet'); + (1, 'val-algemesi', 'RE-001', 'PO-001', '111111111', 1, util.VN_NOW(), 'this is test observation', 1, 15, 'Batman'), + (2, 'alg-valencia', 'RE-002', 'PO-002', '111111111', 1, util.VN_NOW(), 'test observation', 1, 20, 'Robin'), + (3, 'alz-algemesi', 'RE-003', 'PO-003', '222222222', 2, DATE_ADD(util.VN_NOW(), INTERVAL 2 DAY), 'observations...', 2, 25, 'Driverman'); + +INSERT INTO `vn`.`expeditionTruck` (`id`, `roadmapFk`, `warehouseFk`, `eta`, `description`, `userFk`) + VALUES + (1, 1, 1, DATE_ADD(util.VN_NOW(), INTERVAL 1 DAY), 'Best truck in fleet', 1), + (2, 1, 2, DATE_ADD(util.VN_NOW(), INTERVAL '1 2' DAY_HOUR), 'Second truck in fleet', 1), + (3, 1, 3, DATE_ADD(util.VN_NOW(), INTERVAL '1 4' DAY_HOUR), 'Third truck in fleet', 1), + (4, 2, 1, DATE_ADD(util.VN_NOW(), INTERVAL 3 DAY), 'Truck red', 1); INSERT INTO `vn`.`expeditionPallet` (`id`, `truckFk`, `built`, `position`, `isPrint`) VALUES diff --git a/front/core/styles/icons/salixfont.css b/front/core/styles/icons/salixfont.css index 6f9b1fe15..37f489fe2 100644 --- a/front/core/styles/icons/salixfont.css +++ b/front/core/styles/icons/salixfont.css @@ -1,402 +1,411 @@ @font-face { - font-family: 'salixfont'; - src: - url('./salixfont.ttf?wtrl3') format('truetype'), - url('./salixfont.woff?wtrl3') format('woff'), - url('./salixfont.svg?wtrl3#salixfont') format('svg'); - font-weight: normal; - font-style: normal; -} + font-family: 'salixfont'; + src: + url('./salixfont.ttf?wtrl3') format('truetype'), + url('./salixfont.woff?wtrl3') format('woff'), + url('./salixfont.svg?wtrl3#salixfont') format('svg'); + font-weight: normal; + font-style: normal; + } -[class^="icon-"], [class*=" icon-"] { - /* use !important to prevent issues with browser extensions that change fonts */ - font-family: 'salixfont' !important; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; + [class^="icon-"], [class*=" icon-"] { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'salixfont' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } -.icon-agency-term:before { - content: "\e950"; -} -.icon-defaulter:before { - content: "\e94b"; -} -.icon-100:before { - content: "\e95a"; -} -.icon-clientUnpaid:before { - content: "\e95b"; -} -.icon-history:before { - content: "\e968"; -} -.icon-Person:before { - content: "\e901"; -} -.icon-accessory:before { - content: "\e90a"; -} -.icon-account:before { - content: "\e92a"; -} -.icon-actions:before { - content: "\e960"; -} -.icon-addperson:before { - content: "\e90e"; -} -.icon-agency:before { - content: "\e938"; -} -.icon-albaran:before { - content: "\e94d"; -} -.icon-anonymous:before { - content: "\e930"; -} -.icon-apps:before { - content: "\e951"; -} -.icon-artificial:before { - content: "\e90b"; -} -.icon-attach:before { - content: "\e92e"; -} -.icon-barcode:before { - content: "\e971"; -} -.icon-basket:before { - content: "\e914"; -} -.icon-basketadd:before { - content: "\e913"; -} -.icon-bin:before { - content: "\e96f"; -} -.icon-botanical:before { - content: "\e972"; -} -.icon-bucket:before { - content: "\e97a"; -} -.icon-buscaman:before { - content: "\e93b"; -} -.icon-buyrequest:before { - content: "\e932"; -} -.icon-calc_volum .path1:before { - content: "\e915"; -} -.icon-calc_volum .path2:before { - content: "\e916"; - margin-left: -1em; -} -.icon-calc_volum .path3:before { - content: "\e917"; - margin-left: -1em; -} -.icon-calc_volum .path4:before { - content: "\e918"; - margin-left: -1em; -} -.icon-calc_volum .path5:before { - content: "\e919"; - margin-left: -1em; -} -.icon-calc_volum .path6:before { - content: "\e91a"; - margin-left: -1em; -} -.icon-calendar:before { - content: "\e93d"; -} -.icon-catalog:before { - content: "\e937"; -} -.icon-claims:before { - content: "\e963"; -} -.icon-client:before { - content: "\e928"; -} -.icon-clone:before { - content: "\e973"; -} -.icon-columnadd:before { - content: "\e954"; -} -.icon-columndelete:before { - content: "\e953"; -} -.icon-components:before { - content: "\e946"; -} -.icon-consignatarios:before { - content: "\e93f"; -} -.icon-control:before { - content: "\e949"; -} -.icon-credit:before { - content: "\e927"; -} -.icon-deletedTicket:before { - content: "\e935"; -} -.icon-deleteline:before { - content: "\e955"; -} -.icon-delivery:before { - content: "\e939"; -} -.icon-deliveryprices:before { - content: "\e91c"; -} -.icon-details:before { - content: "\e961"; -} -.icon-dfiscales:before { - content: "\e984"; -} -.icon-disabled:before { - content: "\e921"; -} -.icon-doc:before { - content: "\e977"; -} -.icon-entry:before { - content: "\e934"; -} -.icon-exit:before { - content: "\e92f"; -} -.icon-eye:before { - content: "\e976"; -} -.icon-fixedPrice:before { - content: "\e90d"; -} -.icon-flower:before { - content: "\e90c"; -} -.icon-frozen:before { - content: "\e900"; -} -.icon-fruit:before { - content: "\e903"; -} -.icon-funeral:before { - content: "\e904"; -} -.icon-greenery:before { - content: "\e907"; -} -.icon-greuge:before { - content: "\e944"; -} -.icon-grid:before { - content: "\e980"; -} -.icon-handmade:before { - content: "\e909"; -} -.icon-handmadeArtificial:before { - content: "\e902"; -} -.icon-headercol:before { - content: "\e958"; -} -.icon-info:before { - content: "\e952"; -} -.icon-inventory:before { - content: "\e92b"; -} -.icon-invoice:before { - content: "\e923"; -} -.icon-invoice-in:before { - content: "\e911"; -} -.icon-invoice-in-create:before { - content: "\e912"; -} -.icon-invoice-out:before { - content: "\e910"; -} -.icon-isTooLittle:before { - content: "\e91b"; -} -.icon-item:before { - content: "\e956"; -} -.icon-languaje:before { - content: "\e926"; -} -.icon-lines:before { - content: "\e942"; -} -.icon-linesprepaired:before { - content: "\e948"; -} -.icon-logout:before { - content: "\e936"; -} -.icon-mana:before { - content: "\e96a"; -} -.icon-mandatory:before { - content: "\e97b"; -} -.icon-net:before { - content: "\e931"; -} -.icon-niche:before { - content: "\e96c"; -} -.icon-no036:before { - content: "\e920"; -} -.icon-noPayMethod:before { - content: "\e905"; -} -.icon-notes:before { - content: "\e941"; -} -.icon-noweb:before { - content: "\e91f"; -} -.icon-onlinepayment:before { - content: "\e91d"; -} -.icon-package:before { - content: "\e978"; -} -.icon-payment:before { - content: "\e97e"; -} -.icon-pbx:before { - content: "\e93c"; -} -.icon-pets:before { - content: "\e947"; -} -.icon-photo:before { - content: "\e924"; -} -.icon-plant:before { - content: "\e908"; -} -.icon-polizon:before { - content: "\e95e"; -} -.icon-preserved:before { - content: "\e906"; -} -.icon-recovery:before { - content: "\e97c"; -} -.icon-regentry:before { - content: "\e964"; -} -.icon-reserva:before { - content: "\e959"; -} -.icon-revision:before { - content: "\e94a"; -} -.icon-risk:before { - content: "\e91e"; -} -.icon-services:before { - content: "\e94c"; -} -.icon-settings:before { - content: "\e979"; -} -.icon-shipment-01:before { - content: "\e929"; -} -.icon-sign:before { - content: "\e95d"; -} -.icon-sms:before { - content: "\e975"; -} -.icon-solclaim:before { - content: "\e95f"; -} -.icon-solunion:before { - content: "\e94e"; -} -.icon-stowaway:before { - content: "\e94f"; -} -.icon-splitline:before { - content: "\e93e"; -} -.icon-splur:before { - content: "\e970"; -} -.icon-supplier:before { - content: "\e925"; -} -.icon-supplierfalse:before { - content: "\e90f"; -} -.icon-tags:before { - content: "\e96d"; -} -.icon-tax:before { - content: "\e940"; -} -.icon-thermometer:before { - content: "\e933"; -} -.icon-ticket:before { - content: "\e96b"; -} -.icon-ticketAdd:before { - content: "\e945"; -} -.icon-traceability:before { - content: "\e962"; -} -.icon-transaction:before { - content: "\e966"; -} -.icon-treatments:before { - content: "\e922"; -} -.icon-unavailable:before { - content: "\e92c"; -} -.icon-volume:before { - content: "\e96e"; -} -.icon-wand:before { - content: "\e93a"; -} -.icon-web:before { - content: "\e982"; -} -.icon-wiki:before { - content: "\e92d"; -} -.icon-worker:before { - content: "\e957"; -} -.icon-zone:before { - content: "\e943"; -} + .icon-trailer:before { + content: "\e967"; + } + .icon-grafana:before { + content: "\e965"; + } + .icon-trolley:before { + content: "\e95c"; + } + .icon-agency-term:before { + content: "\e950"; + } + .icon-defaulter:before { + content: "\e94b"; + } + .icon-100:before { + content: "\e95a"; + } + .icon-clientUnpaid:before { + content: "\e95b"; + } + .icon-history:before { + content: "\e968"; + } + .icon-Person:before { + content: "\e901"; + } + .icon-accessory:before { + content: "\e90a"; + } + .icon-account:before { + content: "\e92a"; + } + .icon-actions:before { + content: "\e960"; + } + .icon-addperson:before { + content: "\e90e"; + } + .icon-agency:before { + content: "\e938"; + } + .icon-albaran:before { + content: "\e94d"; + } + .icon-anonymous:before { + content: "\e930"; + } + .icon-apps:before { + content: "\e951"; + } + .icon-artificial:before { + content: "\e90b"; + } + .icon-attach:before { + content: "\e92e"; + } + .icon-barcode:before { + content: "\e971"; + } + .icon-basket:before { + content: "\e914"; + } + .icon-basketadd:before { + content: "\e913"; + } + .icon-bin:before { + content: "\e96f"; + } + .icon-botanical:before { + content: "\e972"; + } + .icon-bucket:before { + content: "\e97a"; + } + .icon-buscaman:before { + content: "\e93b"; + } + .icon-buyrequest:before { + content: "\e932"; + } + .icon-calc_volum .path1:before { + content: "\e915"; + } + .icon-calc_volum .path2:before { + content: "\e916"; + margin-left: -1em; + } + .icon-calc_volum .path3:before { + content: "\e917"; + margin-left: -1em; + } + .icon-calc_volum .path4:before { + content: "\e918"; + margin-left: -1em; + } + .icon-calc_volum .path5:before { + content: "\e919"; + margin-left: -1em; + } + .icon-calc_volum .path6:before { + content: "\e91a"; + margin-left: -1em; + } + .icon-calendar:before { + content: "\e93d"; + } + .icon-catalog:before { + content: "\e937"; + } + .icon-claims:before { + content: "\e963"; + } + .icon-client:before { + content: "\e928"; + } + .icon-clone:before { + content: "\e973"; + } + .icon-columnadd:before { + content: "\e954"; + } + .icon-columndelete:before { + content: "\e953"; + } + .icon-components:before { + content: "\e946"; + } + .icon-consignatarios:before { + content: "\e93f"; + } + .icon-control:before { + content: "\e949"; + } + .icon-credit:before { + content: "\e927"; + } + .icon-deletedTicket:before { + content: "\e935"; + } + .icon-deleteline:before { + content: "\e955"; + } + .icon-delivery:before { + content: "\e939"; + } + .icon-deliveryprices:before { + content: "\e91c"; + } + .icon-details:before { + content: "\e961"; + } + .icon-dfiscales:before { + content: "\e984"; + } + .icon-disabled:before { + content: "\e921"; + } + .icon-doc:before { + content: "\e977"; + } + .icon-entry:before { + content: "\e934"; + } + .icon-exit:before { + content: "\e92f"; + } + .icon-eye:before { + content: "\e976"; + } + .icon-fixedPrice:before { + content: "\e90d"; + } + .icon-flower:before { + content: "\e90c"; + } + .icon-frozen:before { + content: "\e900"; + } + .icon-fruit:before { + content: "\e903"; + } + .icon-funeral:before { + content: "\e904"; + } + .icon-greenery:before { + content: "\e907"; + } + .icon-greuge:before { + content: "\e944"; + } + .icon-grid:before { + content: "\e980"; + } + .icon-handmade:before { + content: "\e909"; + } + .icon-handmadeArtificial:before { + content: "\e902"; + } + .icon-headercol:before { + content: "\e958"; + } + .icon-info:before { + content: "\e952"; + } + .icon-inventory:before { + content: "\e92b"; + } + .icon-invoice:before { + content: "\e923"; + } + .icon-invoice-in:before { + content: "\e911"; + } + .icon-invoice-in-create:before { + content: "\e912"; + } + .icon-invoice-out:before { + content: "\e910"; + } + .icon-isTooLittle:before { + content: "\e91b"; + } + .icon-item:before { + content: "\e956"; + } + .icon-languaje:before { + content: "\e926"; + } + .icon-lines:before { + content: "\e942"; + } + .icon-linesprepaired:before { + content: "\e948"; + } + .icon-logout:before { + content: "\e936"; + } + .icon-mana:before { + content: "\e96a"; + } + .icon-mandatory:before { + content: "\e97b"; + } + .icon-net:before { + content: "\e931"; + } + .icon-niche:before { + content: "\e96c"; + } + .icon-no036:before { + content: "\e920"; + } + .icon-noPayMethod:before { + content: "\e905"; + } + .icon-notes:before { + content: "\e941"; + } + .icon-noweb:before { + content: "\e91f"; + } + .icon-onlinepayment:before { + content: "\e91d"; + } + .icon-package:before { + content: "\e978"; + } + .icon-payment:before { + content: "\e97e"; + } + .icon-pbx:before { + content: "\e93c"; + } + .icon-pets:before { + content: "\e947"; + } + .icon-photo:before { + content: "\e924"; + } + .icon-plant:before { + content: "\e908"; + } + .icon-polizon:before { + content: "\e95e"; + } + .icon-preserved:before { + content: "\e906"; + } + .icon-recovery:before { + content: "\e97c"; + } + .icon-regentry:before { + content: "\e964"; + } + .icon-reserva:before { + content: "\e959"; + } + .icon-revision:before { + content: "\e94a"; + } + .icon-risk:before { + content: "\e91e"; + } + .icon-services:before { + content: "\e94c"; + } + .icon-settings:before { + content: "\e979"; + } + .icon-shipment-01:before { + content: "\e929"; + } + .icon-sign:before { + content: "\e95d"; + } + .icon-sms:before { + content: "\e975"; + } + .icon-solclaim:before { + content: "\e95f"; + } + .icon-solunion:before { + content: "\e94e"; + } + .icon-stowaway:before { + content: "\e94f"; + } + .icon-splitline:before { + content: "\e93e"; + } + .icon-splur:before { + content: "\e970"; + } + .icon-supplier:before { + content: "\e925"; + } + .icon-supplierfalse:before { + content: "\e90f"; + } + .icon-tags:before { + content: "\e96d"; + } + .icon-tax:before { + content: "\e940"; + } + .icon-thermometer:before { + content: "\e933"; + } + .icon-ticket:before { + content: "\e96b"; + } + .icon-ticketAdd:before { + content: "\e945"; + } + .icon-traceability:before { + content: "\e962"; + } + .icon-transaction:before { + content: "\e966"; + } + .icon-treatments:before { + content: "\e922"; + } + .icon-unavailable:before { + content: "\e92c"; + } + .icon-volume:before { + content: "\e96e"; + } + .icon-wand:before { + content: "\e93a"; + } + .icon-web:before { + content: "\e982"; + } + .icon-wiki:before { + content: "\e92d"; + } + .icon-worker:before { + content: "\e957"; + } + .icon-zone:before { + content: "\e943"; + } diff --git a/front/core/styles/icons/salixfont.eot b/front/core/styles/icons/salixfont.eot index 61a3be8b7a499b5ad3f597168c821e1139893db8..6a158c806f3d7e215af3cca22ba80fed7ad300b4 100644 GIT binary patch delta 3142 zcmZuzU2Ggz6~5>G&Hv2qdUn@d|L?BXPMo+q`{%?>q6oE3D3%&GaSUn;7*djlgoZY% z(gDnF_a^r?Ly4~QooP(>r8A|B$xcW3OxL9EWq z+_`h^Io~<=-0$qWf9K!-iqM1C7(4ss72T80=EetC4nNa>@7^mjjL`^V?CI01Pn^dy zhxe;^+NaMx^@Zo2eR%`#uQ2wD3uhi(Jyrkmk6vPI!|3eWMU$Bg~zY1pvOtzJCOe!!n(?AOmgf8vX)=Y}5r^va))VB%FM zymgR8eSXalM)lOw#4K0&++0n`rd!8i4Vm! zR%H#ghq0-AtvK1Oy;7Mf=f&ZC zd8$&WmkOBOvqv1h`Tm0V`U@}Iykt$pm8q#pJYhM`?J@t|N53a~Ve>4tK6;0(KmM&@ zr%!AKc&>|U{5WE2#&B%yltwja=tP&w*<`Gtkc?5X&)mxpT}n#5`E0yEcN4xHqHfac zBnN0eH9OryG@nVSm(0<0(yS)c=6>o_q0sI3ItS?hB?qa~=pLYhG!2zIWtOmFma4i| z)ptM}q2dUQ5+0fN?R$HH+Rc`^r-P*3>|rzyY4zF}lvWRz;K%BRRLdfR{oR!8CftoQ zt8HAhYNNIjO``*l-MEuD&0nX z3;UR<%>S8(ab)6-o$57EDb`NxY4Q@(3;j`Qp=>1`sfv!Bvx$yf(ruf|K39&Q`+J8j zxJ6&Nx;%W(ierUVakiv96;7_qHx)A;oAX-9c_U?xT`>*tS*<;ElJ>BEnRIg2aOn(iv^?%(ei zhol25tmXlh&orCZNR*4K@JVWH5{xU2;)tj7h4COL+LmiljIX}ql>J~Nibf;k(99rI zE7IYR>*Xz|38R>zk{AhWvsnk5S*)@zg{xKQ*aZh0Xgry0DG@hd5Ea0)OqwN*_UmPD z&_^l5D&p0q;w*{uLy#SR$Sc*&R>O#v(zC)w*&7Oi;V>Kx3otCnicIA|!eO)5%I+)R z#&T39RuNa`o?$Zs{J4;j>y`uK(ZrXEF%*u3>GyOJ1_W8YcCaUsP|O847|Z2r1BK}V z+|3>qC9}bZ3;{uv7CQAMw5#=RKevziHrq=~yvM)FX4nbVXK%2#Kwt-H4J{!fDBZ}; zx?!MZ3k<(SLSPo~glPryAondQO?%f)!f2yIq)WPU1eu-|}^Pej5Pz zIGfzb=1IHTM&r1X_Dq;}!E6%^EU6Vs{j|x9845L$Amp~n;3l=Ew$LM?xE-Z|fM%Jt z_^ou99L23R^xCav=DyuaeIg3eywZ+|DETi<`S?yW7Fiw+35tbl99~H{7N8yF$spiw zJF($VI{=G80Y4lEEu@ygkcXPLaiD~2Z$6JoO4p$jxZ|Yd26NDsU@#DktGtkl!O{xK z8}$}VL|E;(P)rL5XESx$$C>d_k-&!Aclm3k9ygcFoA@Cd!Hzj@lG}p=SQ3^ToE>~E z?uv1Oys_9VI68G3mICKOyn&z4H=${&noHYY;8Kj&azrhtp?*^YeIV6EuEgd` zIMDCP4t+{m<9dMkae0b z!R4{5X;LVBE0HxExRPl~Vq=J`)mMn2fsbUqUu_>g(h{4HjGeX8@l?dRIQ z*XQZ-`uW!{6M1Vl-l#blQ$lE@}ajL SwjW-=A8*DkuU}ffPX7fLBU>&2 delta 408 zcmbQyz22kEC11P|u$Fc^ReZG3%;fng(%&&ZUUSW&<*i>Zu(VbckqdWF2iT*=h9@SE;Hffqmp z^9u5dOBk4eQVd%GNMGC&70Gw?7lGAO)^ewp$z?PbQx;+Hiq>s~gzY25MxS%y>Y2vcLhh&Av=Rots~Gi*auLI?IA_ zbLE0?DH*$|9QpD5HeVUIS-^%o;A}bwVu0w$Z+4k8Hf&be-OM<7^&SOA=FM03$T51j z*0~k9Gr1?ZZ}5=vSm7z)xyFmno5v@_XOgd#?;XDozY4z<{u=%b{^tTL0x|-60!0E# c0#5{Yg$abkge?lY0yLcwh#NNB?YqSY0AsU==>Px# diff --git a/front/core/styles/icons/salixfont.svg b/front/core/styles/icons/salixfont.svg index d6bfd5d74..da5404842 100644 --- a/front/core/styles/icons/salixfont.svg +++ b/front/core/styles/icons/salixfont.svg @@ -98,7 +98,8 @@ - + + @@ -107,7 +108,9 @@ + + @@ -131,4 +134,4 @@ - + \ No newline at end of file diff --git a/front/core/styles/icons/salixfont.ttf b/front/core/styles/icons/salixfont.ttf index 89d3bd57d3429a743fb9421dd39b7ae8a38b38e7..b484f2a6022b2897ea5e4eff21768a430dce4a00 100644 GIT binary patch delta 3124 zcmZ8jU2I%O6`nIQcjo@z-SypFd;Pz=UORE(?%h8(&W|FLl29Twe@;McfrysmA)zUa zsw6_XLMcd86|^#~)Cbytgp`M(D43r%0ufcEsu1LfK9C30CnTf@5K<8jN#L7%ZO6en zJ9mE0ob#PCXTI^(zwtZw`Kwdu$B(@>#~6(<#$Gyg@`ZEw7BIeouYKyw#jpL~)gRx$ z_$p)Xo5q{QZc=eD@Xk0PXY499x2 zwCYJqC8|=*Cu0SLWP*}MOUjt=KUqwNm$!M{iNMXcF_)M_xgKiF_+39S)kdZ zT~F%m9n`Bsp`Q+VyJ;6CyQ$ae@1or_3zdgup0Hz{>Z(y!4?!EF@)(U1KDqbxw!1{# zcE_|?C+W5a=q*AzgKiF`GXN&|(P>DHJTlndO37A2YouN8;@7CR8k^CydH~svdr80D z>-Gi@V$02DE_YI=Zqi_qlS^DFR{=GFl##$(a<2>dCu`@iF)_Y3d(8X&N0AzMUU}_e zIb9E7BNlW_AJOHqIOweP0BF%Vy6um9T6}I?^gTcEKh(bV+q>F1h6hdVH|wyj%7yS5-&%op5xh%kve> zv%={Ub46$u#(d(mu%x$Gl>c$E3a(d+qUmBOZI;}UtuRG`q$^AHD5`mGQCXTuaOvB2 z$#pBPS9Un(>-%94tAvjL2wMsp1Ck_!7G_cjp(Ga^{d|vU^PetgJJiaTmNM2-5f@Bg zjs?idvxJpff;HtUuj*AAp0YC|*?uXkz%I_${LxT_Ixt?fjK;%oET}D%+=9}sl+suR z5a4%}KQ$!Xb?ZtXCb5v;MkWr3MMg~; zOI``N%EHV1S|qVz2?4WGT7lz?L^{yk_?Di_1tEGnvUR~mKR%f5Xo$}vv9JgTl5^Jr zW}2K`KIK@R8k&od%;vfM6NSl0d1~*|VnK6@l%hwfTOW6fLsEeb>qTJYbL}?H5!K>a zSdz*l0Zxz;z7u^^cM&+J5z5pKo#p$m+FjP9+wg7X(|lna5%@UQ-puAnx8KFX@h}gX zxF3PtHXg8~QLbcf%mg7NMiQi;Yvu5hMq6n-ks6uX^v z?!G(7d?F0mU#faJcsh zOjgd4Pz<8Uf^y*{M*Io{PNk_R3eC-TK>`Xtq8)(XL`stbelX@C4ibovjYr`ON82=r zl3SsT96{hh06c<3j&0a*%08~Q9V!aZ$h(yDNIk_yeAo2*TYK{c>mpT2(q!-QPw~;IYisEoaBEamR!+8Ng3#Env1YmT% zGEP&%rf>ZMsdX%Q#I@YA2a7sT&eKOStO$|l8K35URQS|B~7 z@ca)b;Ub(hNmsdZycA3aq z*>}C+%t1-uw|({W^$9w-@Ar>=@Y!GPKd}Gm{(m3%%7MRs?)bq&2k$&ldgA<{ZydgH z_&-Ok9R1AE8%O_gEIjtTV}D)lEx)yVYx!TtFCD*qV&Mz_eDcL7-+#(}Y6<^$Gj@6P J*3WL!{{Z7KRgeGx delta 379 zcmaF!k7>nArU?r56LThIGcYj9FfcI8Nlz>;0MY_L{th6`k)BhTb~uOa6_9^`fnn{6 zjMT&w<++|;85q`Q0OidxfC3zPENg)L1wg(^Ms7*Pw?c_Z}XLbn+0Sx!voHygD`rs!!C2ihRqebni(hm z->tyNyjf$99Al7com+uBlY5f;1`jEZ6`lf~YrOcpd3-{ACizFyx(_b_RgKn?Dx#<>?WIR=g!wA+av^OlUM^unrx!9RYO~oABl}N z)HVo%qzYQlgl&rjZ9}2p4<&}J8iS>wR4Jmx9~NqUh`$6O_(d!Ik+eSVy}QXq9L{^^ zopaB7&U4Ot-sfdL_#3aua3g;lh1q!x(_Vt${91BKmY306OSKz%(AYYfKA_w#@B!H$_Xf;yNKTn zGwgYB>BOlsPeb>%Wij6j_LbpZoP6R@*!}7c@QD~?U)yKdfCU0ZLSozzQP-E=!`qgJ=KlNNGG`sqB)q^(+7Yi*-$4F92TY~_WFqVytfslLFBH%{r_cMZb;JP2~92w{r2h%02fSE7Fz9kR-gfO zZo|Z+o!miv8~eEF%>U8DIVy42PW7AU6ulmMR=gDbLcbG=OIr#@$g*P>Y@!2aRmWyx zz@)?Jf&R`jZrPWvs*K!s)X||X&n426;ndODBFqb;J~5hK)Egz`A4am^detbJDwY~0 zw`415h?8(dsTM_5&n+sci8vF!ZI@g(alNv`7+YHoe|Sp+d~?C1Ex6605yZLXMyWVg zf^mjvGOFBxg$7JzVa$wQumad`N)R&J8@y3}9g_G1vKw34BB@E|#dUm;}RI2$4zXm4y|*JYfL zy&c)QU}GNd+g9hFL1Ez$5Cmhc1Z0|+Svu}WPYun+sAc2yp7Fv&q&&6j5k9Y(B&Fz{ z%BH~sjtNLA&|$3zuxz%~!bYN9T!~jgVUyroDl|ttQ!GscLD|->DKXyqj#Kf2(I^^= zP(!0Zsyb5P2G=WUm~ms6p%R#JY_nMhpLwogAh@e!=-4F(8)zb#YDpe9;Se3b@=BT| zj`AB7Z`emG!z=PtrsK3g`5~x|zrjlyW~<>u3E}CmS@AXm!AKa6g(Wx^q$ATgkZ{E8 zwX_EkxUn3aiB-g;dFI&61RuslL^SzjVjP8|VfH>#!T~4kD+hZb2+dq_gYiPK zK2(}1A>7<9o|p|rW=II8wAgJN#C5f@<@v2Nu&pg*@%Pv_tXb=@HLxyQZ-Kye&@!%s zoS;-QKkJ5pT5T}=DhYvEz!T;wSOB@NQfYQ~ttX5QZisA2Z=N7C)3s(DT(QP|9i8#Z z9U4#CYwnvf+FTltW-YfjTm(X0K7Y16$lmm3rrLdTf7GXHYK(A+PUDU;JX%`?jpesv z-O;ZB03YYd^=zJYdL3LGchjCp^B%Zu;Q~wR)3ATd%0Vb_zd+cMygKIvjKb<|=1JC9V!93~AphKmDA+mzOc18gI}!G+nlRYMhlMa`A~{t}})@l7oUoB*RZ zoRJ1VJD4z5K+;^Pp#T{eW3PE)sI0RnP9OWT}>xNJsXUr`k65NwyE04bLx$5XYuHJIK5N-d^@&vfWvi|Z+ z_rCb4pVH#Y`G1|Zn-g@GGPuV7%Dyl}tRL>>A1IY5Cq6LThIrzaK{FfcH& z0QnqHERdd4nFbW&VPIIh0)!9eu)WGiO-x~6Sic3R#tej&=X!q4015)d-T?V3Ak3l1 zvL++9q=JEAg8)!JP>6})TcJdFPJS{_-6o(IBT$f$Nou3f>sz^r6+nwOivU$AfblG* zvb@CHRG^p%P|-XPjtjr(UXWj00`$X`iGR9H8-NOB7z7xY8F+wRQ+OHuGUa93%Z!)B zFKb@by=-{d^s?pu-~a!Cs(^;RWOx}1lAXMPQHe|Juh<{4-$0F^5D=fdVL#jEw~Rua zo4dQkI5$t7Wx=>vazVJ1jNMd@{CIwwuMFIv0AXNwz}a*VMo;e9WzN{J`N*zj#>w7$ z6d0K|m+X;a^l+_nD{yCWPjcVjA?2~cQ^0eL7oRtePl(SXUn}1`ej$Dpek=Sn{2Tnw m1y}@R1oQ-o1eOGz2<{3K2#X0@6m|t@JR=Y{Y`(Ym79#)x`HcDi diff --git a/modules/client/front/summary/style.scss b/modules/client/front/summary/style.scss index 77fc020ef..7dc1cc928 100644 --- a/modules/client/front/summary/style.scss +++ b/modules/client/front/summary/style.scss @@ -8,7 +8,7 @@ vn-client-summary .summary { } vn-horizontal h4 .grafana:after { - content: 'contact_support'; - font-size: 17px; + font-family: 'salixfont' !important; + content: "\e965"; } } diff --git a/modules/entry/front/buy/index/style.scss b/modules/entry/front/buy/index/style.scss index 04c8d130a..3fad252df 100644 --- a/modules/entry/front/buy/index/style.scss +++ b/modules/entry/front/buy/index/style.scss @@ -3,14 +3,13 @@ vn-entry-buy-index vn-card { max-width: $width-xl; - + .dark-row { background-color: lighten($color-marginal, 10%); } thead tr { - border-left: 1px solid white; - border-right: 1px solid white; + border: 1px solid white;; } tbody tr:nth-child(1), @@ -22,7 +21,7 @@ vn-entry-buy-index vn-card { tbody tr:nth-child(2) { border-bottom: 1px solid $color-spacer; } - + tbody{ border-bottom: 1px solid $color-spacer; } @@ -40,4 +39,4 @@ vn-entry-buy-index vn-card { } } -$color-font-link-medium: lighten($color-font-link, 20%) \ No newline at end of file +$color-font-link-medium: lighten($color-font-link, 20%) diff --git a/modules/route/back/methods/roadmap/clone.js b/modules/route/back/methods/roadmap/clone.js new file mode 100644 index 000000000..456ed823d --- /dev/null +++ b/modules/route/back/methods/roadmap/clone.js @@ -0,0 +1,81 @@ +const UserError = require('vn-loopback/util/user-error'); +module.exports = Self => { + Self.remoteMethod('clone', { + description: 'Clones the selected routes', + accessType: 'WRITE', + accepts: [ + { + arg: 'ids', + type: ['number'], + required: true, + description: 'The routes ids to clone' + }, + { + arg: 'etd', + type: 'date', + required: true, + description: 'The estimated time of departure for all roadmaps' + } + ], + returns: { + type: ['Object'], + root: true + }, + http: { + path: `/clone`, + verb: 'POST' + } + }); + + Self.clone = async(ids, etd) => { + const tx = await Self.beginTransaction({}); + try { + const models = Self.app.models; + const options = {transaction: tx}; + const originalRoadmaps = await models.Roadmap.find({ + where: {id: {inq: ids}}, + fields: [ + 'id', + 'name', + 'tractorPlate', + 'trailerPlate', + 'phone', + 'supplierFk', + 'etd', + 'observations', + 'price'], + include: [{ + relation: 'expeditionTruck', + scope: { + fields: ['roadmapFk', 'warehouseFk', 'eta', 'description'] + } + }] + + }, options); + + if (ids.length != originalRoadmaps.length) + throw new UserError(`The amount of roadmaps found don't match`); + + for (const roadmap of originalRoadmaps) { + roadmap.id = undefined; + roadmap.etd = etd; + + const clone = await models.Roadmap.create(roadmap, options); + + const expeditionTrucks = roadmap.expeditionTruck(); + expeditionTrucks.map(expeditionTruck => { + expeditionTruck.roadmapFk = clone.id; + return expeditionTruck; + }); + await models.ExpeditionTruck.create(expeditionTrucks, options); + } + + await tx.commit(); + + return true; + } catch (e) { + await tx.rollback(); + throw e; + } + }; +}; diff --git a/modules/route/back/model-config.json b/modules/route/back/model-config.json index 31aaad9f5..6688a243a 100644 --- a/modules/route/back/model-config.json +++ b/modules/route/back/model-config.json @@ -5,18 +5,22 @@ "AgencyTermConfig": { "dataSource": "vn" }, - "Route": { + "DeliveryPoint": { "dataSource": "vn" }, - "Vehicle": { + "ExpeditionTruck": { + "dataSource": "vn" + }, + "Roadmap": { + "dataSource": "vn" + }, + "Route": { "dataSource": "vn" }, "RouteLog": { "dataSource": "vn" }, - "DeliveryPoint": { + "Vehicle": { "dataSource": "vn" } } - - diff --git a/modules/route/back/models/expedition-truck.json b/modules/route/back/models/expedition-truck.json new file mode 100644 index 000000000..8edc7347f --- /dev/null +++ b/modules/route/back/models/expedition-truck.json @@ -0,0 +1,43 @@ +{ + "name": "ExpeditionTruck", + "base": "VnModel", + "options": { + "mysql": { + "table": "expeditionTruck" + } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "roadmapFk": { + "type": "number" + }, + "warehouseFk": { + "type": "number" + }, + "eta": { + "type": "date" + }, + "description": { + "type": "string" + }, + "userFk": { + "type": "number" + } + }, + "relations": { + "roadmap": { + "type": "belongsTo", + "model": "Roadmap", + "foreignKey": "roadmapFk" + }, + "warehouse": { + "type": "belongsTo", + "model": "Warehouse", + "foreignKey": "warehouseFk" + } + } +} diff --git a/modules/route/back/models/roadmap.js b/modules/route/back/models/roadmap.js new file mode 100644 index 000000000..4a2a02022 --- /dev/null +++ b/modules/route/back/models/roadmap.js @@ -0,0 +1,3 @@ +module.exports = Self => { + require('../methods/roadmap/clone')(Self); +}; diff --git a/modules/route/back/models/roadmap.json b/modules/route/back/models/roadmap.json new file mode 100644 index 000000000..7ca8fe0f6 --- /dev/null +++ b/modules/route/back/models/roadmap.json @@ -0,0 +1,63 @@ +{ + "name": "Roadmap", + "base": "VnModel", + "options": { + "mysql": { + "table": "roadmap" + } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "name": { + "type": "string" + }, + "tractorPlate": { + "type": "string" + }, + "trailerPlate": { + "type": "string" + }, + "phone": { + "type": "string" + }, + "supplierFk": { + "type": "number" + }, + "etd": { + "type": "date" + }, + "observations": { + "type": "string" + }, + "userFk": { + "type": "number" + }, + "price": { + "type": "number" + }, + "driverName": { + "type": "string" + } + }, + "relations": { + "worker": { + "type": "belongsTo", + "model": "Worker", + "foreignKey": "userFk" + }, + "supplier": { + "type": "belongsTo", + "model": "Supplier", + "foreignKey": "supplierFk" + }, + "expeditionTruck": { + "type": "hasMany", + "model": "ExpeditionTruck", + "foreignKey": "roadmapFk" + } + } +} diff --git a/modules/route/front/index.js b/modules/route/front/index.js index c43048df5..803fc1045 100644 --- a/modules/route/front/index.js +++ b/modules/route/front/index.js @@ -16,3 +16,4 @@ import './agency-term/createInvoiceIn'; import './agency-term-search-panel'; import './ticket-popup'; import './sms'; +import './roadmap'; diff --git a/modules/route/front/roadmap/basic-data/index.html b/modules/route/front/roadmap/basic-data/index.html new file mode 100644 index 000000000..28c67eb47 --- /dev/null +++ b/modules/route/front/roadmap/basic-data/index.html @@ -0,0 +1,98 @@ + + + +
+ + + + + + + + + + + + + + + + + + + {{::id}} - {{::nickname}} + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/modules/route/front/roadmap/basic-data/index.js b/modules/route/front/roadmap/basic-data/index.js new file mode 100644 index 000000000..d5b39b76e --- /dev/null +++ b/modules/route/front/roadmap/basic-data/index.js @@ -0,0 +1,16 @@ +import ngModule from '../../module'; +import Section from 'salix/components/section'; + +export default class Controller extends Section { + onSubmit() { + this.$.watcher.submit(); + } +} + +ngModule.component('vnRoadmapBasicData', { + template: require('./index.html'), + controller: Controller, + bindings: { + roadmap: '<' + } +}); diff --git a/modules/route/front/roadmap/card/index.html b/modules/route/front/roadmap/card/index.html new file mode 100644 index 000000000..97ca40f95 --- /dev/null +++ b/modules/route/front/roadmap/card/index.html @@ -0,0 +1,5 @@ + + + + + diff --git a/modules/route/front/roadmap/card/index.js b/modules/route/front/roadmap/card/index.js new file mode 100644 index 000000000..ff2d13616 --- /dev/null +++ b/modules/route/front/roadmap/card/index.js @@ -0,0 +1,19 @@ +import ngModule from '../../module'; +import ModuleCard from 'salix/components/module-card'; + +class Controller extends ModuleCard { + reload() { + const filter = { + include: [ + {relation: 'supplier'} + ] + }; + this.$http.get(`Roadmaps/${this.$params.id}`, {filter}) + .then(res => this.roadmap = res.data); + } +} + +ngModule.vnComponent('vnRoadmapCard', { + template: require('./index.html'), + controller: Controller +}); diff --git a/modules/route/front/roadmap/create/index.html b/modules/route/front/roadmap/create/index.html new file mode 100644 index 000000000..f5a26566e --- /dev/null +++ b/modules/route/front/roadmap/create/index.html @@ -0,0 +1,37 @@ + + +
+ + + + + + + + + + + + + + + + +
diff --git a/modules/route/front/roadmap/create/index.js b/modules/route/front/roadmap/create/index.js new file mode 100644 index 000000000..7e638da94 --- /dev/null +++ b/modules/route/front/roadmap/create/index.js @@ -0,0 +1,23 @@ +import ngModule from '../../module'; +import Section from 'salix/components/section'; +import './style.scss'; + +class Controller extends Section { + constructor($element, $, $transclude, vnReport, vnEmail) { + super($element, $, $transclude); + this.roadmap = {etd: Date.vnNew()}; + } + + onSubmit() { + this.$.watcher.submit().then( + res => this.$state.go('route.roadmap.card.summary', {id: res.data.id}) + ); + } +} + +Controller.$inject = ['$element', '$scope']; + +ngModule.vnComponent('vnRoadmapCreate', { + template: require('./index.html'), + controller: Controller +}); diff --git a/modules/route/front/roadmap/create/style.scss b/modules/route/front/roadmap/create/style.scss new file mode 100644 index 000000000..8ee7ecb09 --- /dev/null +++ b/modules/route/front/roadmap/create/style.scss @@ -0,0 +1,6 @@ +vn-ticket-request { + .vn-textfield { + margin: 0!important; + max-width: 100px; + } +} diff --git a/modules/route/front/roadmap/descriptor/index.html b/modules/route/front/roadmap/descriptor/index.html new file mode 100644 index 000000000..92ae8eab1 --- /dev/null +++ b/modules/route/front/roadmap/descriptor/index.html @@ -0,0 +1,39 @@ + + + + Delete roadmap + + + +
+ + + + + + + {{$ctrl.roadmap.supplier.nickname}} + + +
+
+
+ + + + diff --git a/modules/route/front/roadmap/descriptor/index.js b/modules/route/front/roadmap/descriptor/index.js new file mode 100644 index 000000000..2846b073a --- /dev/null +++ b/modules/route/front/roadmap/descriptor/index.js @@ -0,0 +1,26 @@ +import ngModule from '../../module'; +import Descriptor from 'salix/components/descriptor'; + +class Controller extends Descriptor { + get roadmap() { + return this.entity; + } + + set roadmap(value) { + this.entity = value; + } + + onDelete() { + return this.$http.delete(`Roadmaps/${this.roadmap.id}`) + .then(() => this.$state.go('route.roadmap')) + .then(() => this.vnApp.showSuccess(this.$t('Roadmap removed'))); + } +} + +ngModule.component('vnRoadmapDescriptor', { + template: require('./index.html'), + controller: Controller, + bindings: { + roadmap: '<' + } +}); diff --git a/modules/route/front/roadmap/descriptor/locale/es.yml b/modules/route/front/roadmap/descriptor/locale/es.yml new file mode 100644 index 000000000..376209694 --- /dev/null +++ b/modules/route/front/roadmap/descriptor/locale/es.yml @@ -0,0 +1,3 @@ +Delete roadmap: Eliminar troncal +The roadmap will be removed: La troncal será eliminada +Roadmap removed: Troncal eliminada diff --git a/modules/route/front/roadmap/index.js b/modules/route/front/roadmap/index.js new file mode 100644 index 000000000..91b782a9b --- /dev/null +++ b/modules/route/front/roadmap/index.js @@ -0,0 +1,9 @@ +import './main'; +import './index/'; +import './summary'; +import './card'; +import './descriptor'; +import './create'; +import './basic-data'; +import './search-panel'; +import './stops'; diff --git a/modules/route/front/roadmap/index/index.html b/modules/route/front/roadmap/index/index.html new file mode 100644 index 000000000..6f8cbecc4 --- /dev/null +++ b/modules/route/front/roadmap/index/index.html @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + Roadmap + ETD + Carrier + Plate + Price + Observations + + + + + + + + + + {{::roadmap.name}} + {{::roadmap.etd | date:'dd/MM/yyyy HH:mm'}} + + + {{::roadmap.supplier.nickname}} + + + {{::roadmap.tractorPlate | dashIfEmpty}} + {{::roadmap.price | currency: 'EUR':2 | dashIfEmpty}} + {{::roadmap.observations | dashIfEmpty}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/route/front/roadmap/index/index.js b/modules/route/front/roadmap/index/index.js new file mode 100644 index 000000000..3ffc5b4b1 --- /dev/null +++ b/modules/route/front/roadmap/index/index.js @@ -0,0 +1,62 @@ +import ngModule from '../../module'; +import Section from 'salix/components/section'; + +class Controller extends Section { + get checked() { + const roadmaps = this.$.model.data || []; + const checkedRoadmap = []; + for (let roadmap of roadmaps) { + if (roadmap.checked) + checkedRoadmap.push(roadmap); + } + + return checkedRoadmap; + } + + get totalChecked() { + return this.checked.length; + } + + preview(roadmap) { + this.roadmapSelected = roadmap; + this.$.summary.show(); + } + + openClonationDialog() { + this.$.clonationDialog.show(); + this.etd = Date.vnNew(); + } + + cloneSelectedRoadmaps() { + try { + if (!this.etd) + throw new Error(`The date can't be empty`); + + const roadmapsIds = []; + for (let roadmap of this.checked) + roadmapsIds.push(roadmap.id); + + return this.$http.post('Roadmaps/clone', {ids: roadmapsIds, etd: this.etd}).then(() => { + this.$.model.refresh(); + this.vnApp.showSuccess(this.$t('Data saved!')); + }); + } catch (e) { + this.vnApp.showError(this.$t(e.message)); + } + } + + deleteRoadmaps() { + console.log(this.checked); + + for (const roadmap of this.checked) { + this.$http.delete(`Roadmaps/${roadmap.id}`) + .then(() => this.$.model.refresh()) + .then(() => this.vnApp.showSuccess(this.$t('Roadmaps removed'))); + } + } +} + +ngModule.vnComponent('vnRoadmapIndex', { + template: require('./index.html'), + controller: Controller +}); diff --git a/modules/route/front/roadmap/index/locale/es.yml b/modules/route/front/roadmap/index/locale/es.yml new file mode 100644 index 000000000..dd93eac6e --- /dev/null +++ b/modules/route/front/roadmap/index/locale/es.yml @@ -0,0 +1,3 @@ +Delete roadmap(s): Eliminar troncal(es) +Selected roadmaps will be removed: Los troncales seleccionados serán eliminados +Roadmaps removed: Troncales eliminados diff --git a/modules/route/front/roadmap/locale/es.yml b/modules/route/front/roadmap/locale/es.yml new file mode 100644 index 000000000..e136eca31 --- /dev/null +++ b/modules/route/front/roadmap/locale/es.yml @@ -0,0 +1,14 @@ +Roadmaps: Troncales +Roadmap: Troncal +Driver name: Nombre conductor +Plate: Matrícula +Price: Precio +Observations: Observaciones +Clone selected roadmaps: Clonar troncales seleccionadas +Select the estimated time of departure (ETD): Seleccione la hora estimada de salida (ETD) +Create roadmap: Crear troncal +Tractor plate: Matrícula tractor +Trailer plate: Matrícula trailer +Carrier: Transportista +ETD date: Fecha ETD +ETD hour: Hora ETD diff --git a/modules/route/front/roadmap/main/index.html b/modules/route/front/roadmap/main/index.html new file mode 100644 index 000000000..3a8eb2599 --- /dev/null +++ b/modules/route/front/roadmap/main/index.html @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/modules/route/front/roadmap/main/index.js b/modules/route/front/roadmap/main/index.js new file mode 100644 index 000000000..e7b3366f2 --- /dev/null +++ b/modules/route/front/roadmap/main/index.js @@ -0,0 +1,61 @@ +import ngModule from '../../module'; +import ModuleMain from 'salix/components/module-main'; + +export default class Roadmap extends ModuleMain { + constructor($element, $) { + super($element, $); + + this.include = { + relation: 'supplier', + scope: { + fields: ['nickname'] + } + }; + } + + $postLink() { + const from = Date.vnNew(); + from.setHours(0, 0, 0, 0); + + const to = Date.vnNew(); + to.setHours(23, 59, 59, 999); + + this.filterParams = { + from: from, + to: to + }; + + this.$.model.addFilter({where: { + and: [ + {etd: {gte: from}}, + {etd: {lte: to}} + ] + }}); + } + + exprBuilder(param, value) { + switch (param) { + case 'search': + return /^\d+$/.test(value) + ? {id: value} + : {name: {like: `%${value}%`}}; + case 'from': + return {etd: {gte: value}}; + case 'to': + return {etd: {lte: value}}; + case 'supplierFk': + case 'price': + return {[param]: value}; + case 'tractorPlate': + case 'trailerPlate': + case 'phone': + case 'driverName': + return {[param]: {like: `%${value}%`}}; + } + } +} + +ngModule.vnComponent('vnRoadmap', { + controller: Roadmap, + template: require('./index.html') +}); diff --git a/modules/route/front/roadmap/main/locale/es.yml b/modules/route/front/roadmap/main/locale/es.yml new file mode 100644 index 000000000..78342bce8 --- /dev/null +++ b/modules/route/front/roadmap/main/locale/es.yml @@ -0,0 +1 @@ +Search roadmap by id or trunk: Buscar troncales por id o troncal diff --git a/modules/route/front/roadmap/search-panel/index.html b/modules/route/front/roadmap/search-panel/index.html new file mode 100644 index 000000000..53fd37344 --- /dev/null +++ b/modules/route/front/roadmap/search-panel/index.html @@ -0,0 +1,74 @@ +
+
+ + + + +
+ + + + + + +
+ + + + + + + + + + {{::id}} - {{::nickname}} + + + + + + + + + + + + + + +
+
diff --git a/modules/route/front/roadmap/search-panel/index.js b/modules/route/front/roadmap/search-panel/index.js new file mode 100644 index 000000000..499027d14 --- /dev/null +++ b/modules/route/front/roadmap/search-panel/index.js @@ -0,0 +1,7 @@ +import ngModule from '../../module'; +import SearchPanel from 'core/components/searchbar/search-panel'; + +ngModule.component('vnRoadmapSearchPanel', { + template: require('./index.html'), + controller: SearchPanel +}); diff --git a/modules/route/front/roadmap/stops/index.html b/modules/route/front/roadmap/stops/index.html new file mode 100644 index 000000000..b69492a21 --- /dev/null +++ b/modules/route/front/roadmap/stops/index.html @@ -0,0 +1,71 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/modules/route/front/roadmap/stops/index.js b/modules/route/front/roadmap/stops/index.js new file mode 100644 index 000000000..075a1c8a4 --- /dev/null +++ b/modules/route/front/roadmap/stops/index.js @@ -0,0 +1,39 @@ +import ngModule from '../../module'; +import Section from 'salix/components/section'; + +export default class Controller extends Section { + add() { + const filter = { + fields: ['etd'] + }; + this.$http.get(`Roadmaps/${this.$params.id}`, {filter}) + .then(res => { + this.roadmap = res.data; + + const eta = new Date(this.roadmap.etd); + eta.setDate(eta.getDate() + 1); + + this.$.model.insert({ + roadmapFk: this.$params.id, + eta: eta + }); + }); + } + + onSubmit() { + this.$.watcher.check(); + this.$.model.save().then(() => { + this.$.watcher.notifySaved(); + this.$.watcher.updateOriginalData(); + this.$.model.refresh(); + }); + } +} + +ngModule.component('vnRoadmapStops', { + template: require('./index.html'), + controller: Controller, + bindings: { + roadmap: '<' + } +}); diff --git a/modules/route/front/roadmap/stops/locale/es.yml b/modules/route/front/roadmap/stops/locale/es.yml new file mode 100644 index 000000000..1db275949 --- /dev/null +++ b/modules/route/front/roadmap/stops/locale/es.yml @@ -0,0 +1,4 @@ +Remove stop: Eliminar parada +Add stop: Añadir parada +ETA date: Fecha ETA +ETA hour: Hora ETA diff --git a/modules/route/front/roadmap/summary/index.html b/modules/route/front/roadmap/summary/index.html new file mode 100644 index 000000000..e6b50601e --- /dev/null +++ b/modules/route/front/roadmap/summary/index.html @@ -0,0 +1,113 @@ + +
+ {{summary.id}} - {{summary.name}} +
+ + + + + {{summary.supplier.nickname}} + + + + + + + + + + + + + + + + + + +

+ + Stops + + + +

+ + + + Wharehouse + ETA + + + + + {{expeditionTruck.warehouse.name}} + {{expeditionTruck.eta | date:'dd/MM/yyyy HH:mm'}} + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/route/front/roadmap/summary/index.js b/modules/route/front/roadmap/summary/index.js new file mode 100644 index 000000000..041b43ce3 --- /dev/null +++ b/modules/route/front/roadmap/summary/index.js @@ -0,0 +1,68 @@ +import ngModule from '../../module'; +import Component from 'core/lib/component'; +import './style.scss'; + +class Controller extends Component { + set roadmap(value) { + this._roadmap = value; + this.$.summary = null; + if (!value) return; + + this.loadData(); + } + + get roadmap() { + return this._roadmap; + } + + loadData() { + const filter = { + include: [ + {relation: 'supplier'}, + {relation: 'worker'}, + {relation: 'expeditionTruck', + scope: { + include: [ + {relation: 'warehouse'} + ] + }} + ] + }; + this.$http.get(`Roadmaps/${this.roadmap.id}`, {filter}) + .then(res => this.$.summary = res.data); + } + + getETD() { + const eta = new Date(this.roadmap.etd); + eta.setDate(eta.getDate() + 1); + + this.expeditionTruck = {eta: eta}; + } + + onAddAccept() { + try { + const data = { + roadmapFk: this.roadmap.id, + warehouseFk: this.expeditionTruck.warehouseFk, + eta: this.expeditionTruck.eta, + description: this.expeditionTruck.description + }; + + this.$http.post(`ExpeditionTrucks`, data) + .then(() => { + this.loadData(); + this.vnApp.showSuccess(this.$t('Data saved!')); + }); + } catch (e) { + this.vnApp.showError(this.$t(e.message)); + } + } +} + +ngModule.component('vnRoadmapSummary', { + template: require('./index.html'), + controller: Controller, + bindings: { + roadmap: '<' + } +}); diff --git a/modules/route/front/roadmap/summary/locale/es.yml b/modules/route/front/roadmap/summary/locale/es.yml new file mode 100644 index 000000000..f2d82438a --- /dev/null +++ b/modules/route/front/roadmap/summary/locale/es.yml @@ -0,0 +1,3 @@ +Stops: Paradas +Wharehouse: Almacén +You must fill all the fields: Debes rellenar todos los campos diff --git a/modules/route/front/roadmap/summary/style.scss b/modules/route/front/roadmap/summary/style.scss new file mode 100644 index 000000000..8e75d3e0b --- /dev/null +++ b/modules/route/front/roadmap/summary/style.scss @@ -0,0 +1,11 @@ +@import "variables"; + + +vn-roadmap-summary .summary { + a { + display: flex; + align-items: center; + height: 18.328px; + } + +} diff --git a/modules/route/front/routes.json b/modules/route/front/routes.json index 75e1fdc57..3b866581d 100644 --- a/modules/route/front/routes.json +++ b/modules/route/front/routes.json @@ -7,12 +7,17 @@ "menus": { "main": [ {"state": "route.index", "icon": "icon-delivery"}, - {"state": "route.agencyTerm.index", "icon": "icon-agency-term"} + {"state": "route.agencyTerm.index", "icon": "icon-agency-term"}, + {"state": "route.roadmap", "icon": "icon-trailer"} ], "card": [ {"state": "route.card.basicData", "icon": "settings"}, {"state": "route.card.tickets", "icon": "icon-ticket"}, {"state": "route.card.log", "icon": "history"} + ], + "roadmap": [ + {"state": "route.roadmap.card.basicData", "icon": "settings"}, + {"state": "route.roadmap.card.stops", "icon": "icon-lines"} ] }, "routes": [ @@ -90,6 +95,46 @@ "route": "$ctrl.route" }, "acl": ["delivery"] + }, { + "url": "/roadmap?q", + "state": "route.roadmap", + "component": "vn-roadmap", + "description": "Roadmaps" + }, { + "url": "/create", + "state": "route.roadmap.create", + "component": "vn-roadmap-create", + "description": "Create roadmap" + },{ + "url": "/:id", + "state": "route.roadmap.card", + "component": "vn-roadmap-card", + "abstract": true, + "description": "Detail" + },{ + "url": "/summary", + "state": "route.roadmap.card.summary", + "component": "vn-roadmap-summary", + "description": "Summary", + "params": { + "roadmap": "$ctrl.roadmap" + } + },{ + "url": "/basic-data", + "state": "route.roadmap.card.basicData", + "component": "vn-roadmap-basic-data", + "description": "Basic data", + "params": { + "roadmap": "$ctrl.roadmap" + } + }, { + "url": "/stops", + "state": "route.roadmap.card.stops", + "component": "vn-roadmap-stops", + "description": "Stops", + "params": { + "route": "$ctrl.roadmap" + } } ] } diff --git a/modules/shelving/front/descriptor/index.html b/modules/shelving/front/descriptor/index.html index 1344bb52a..53dd37258 100644 --- a/modules/shelving/front/descriptor/index.html +++ b/modules/shelving/front/descriptor/index.html @@ -7,7 +7,7 @@ ng-click="deleteShelving.show()" name="deleteShelving" translate> - Delete + Delete shelving @@ -32,7 +32,7 @@ @@ -40,6 +40,6 @@ - - \ No newline at end of file + diff --git a/modules/shelving/front/descriptor/locale/es.yml b/modules/shelving/front/descriptor/locale/es.yml new file mode 100644 index 000000000..e7fafc320 --- /dev/null +++ b/modules/shelving/front/descriptor/locale/es.yml @@ -0,0 +1,3 @@ +Delete shelving: Eliminar carro +Shelving will be removed: El carro será eliminado +Shelving removed: Carro eliminado diff --git a/modules/worker/front/create/index.html b/modules/worker/front/create/index.html index eb45704a7..481746761 100644 --- a/modules/worker/front/create/index.html +++ b/modules/worker/front/create/index.html @@ -38,7 +38,7 @@ Date: Tue, 4 Jul 2023 15:04:32 +0200 Subject: [PATCH 15/53] refs #4770 feat: add test --- .../back/methods/roadmap/specs/clone.spec.js | 109 ++++++++++++++++++ .../route/front/roadmap/card/index.spec.js | 27 +++++ .../route/front/roadmap/create/index.spec.js | 107 +++++++++++++++++ .../route/front/roadmap/index/index.spec.js | 94 +++++++++++++++ .../route/front/roadmap/main/index.spec.js | 31 +++++ 5 files changed, 368 insertions(+) create mode 100644 modules/route/back/methods/roadmap/specs/clone.spec.js create mode 100644 modules/route/front/roadmap/card/index.spec.js create mode 100644 modules/route/front/roadmap/create/index.spec.js create mode 100644 modules/route/front/roadmap/index/index.spec.js create mode 100644 modules/route/front/roadmap/main/index.spec.js diff --git a/modules/route/back/methods/roadmap/specs/clone.spec.js b/modules/route/back/methods/roadmap/specs/clone.spec.js new file mode 100644 index 000000000..41e696157 --- /dev/null +++ b/modules/route/back/methods/roadmap/specs/clone.spec.js @@ -0,0 +1,109 @@ +const app = require('vn-loopback/server/server'); +const models = require('vn-loopback/server/server').models; + +describe('AgencyTerm filter()', () => { + const authUserId = 9; + const today = Date.vnNew(); + today.setHours(2, 0, 0, 0); + + it('should return all results matching the filter', async() => { + const tx = await models.AgencyTerm.beginTransaction({}); + + try { + const options = {transaction: tx}; + const filter = {}; + const ctx = {req: {accessToken: {userId: authUserId}}}; + + const agencyTerms = await models.AgencyTerm.filter(ctx, filter, options); + const firstAgencyTerm = agencyTerms[0]; + + expect(firstAgencyTerm.routeFk).toEqual(1); + expect(agencyTerms.length).toEqual(5); + + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } + }); + + it('should return results matching "search" searching by integer', async() => { + let ctx = { + args: { + search: 1, + } + }; + + let result = await app.models.AgencyTerm.filter(ctx); + + expect(result.length).toEqual(1); + expect(result[0].routeFk).toEqual(1); + }); + + it('should return results matching "search" searching by string', async() => { + let ctx = { + args: { + search: 'Plants SL', + } + }; + + let result = await app.models.AgencyTerm.filter(ctx); + + expect(result.length).toEqual(2); + }); + + it('should return results matching "from" and "to"', async() => { + const tx = await models.Buy.beginTransaction({}); + const options = {transaction: tx}; + + try { + const from = Date.vnNew(); + from.setHours(0, 0, 0, 0); + + const to = Date.vnNew(); + to.setHours(23, 59, 59, 999); + + const ctx = { + args: { + from: from, + to: to + } + }; + + const results = await models.AgencyTerm.filter(ctx, options); + + expect(results.length).toBe(5); + + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } + }); + + it('should return results matching "agencyModeFk"', async() => { + let ctx = { + args: { + agencyModeFk: 1, + } + }; + + let result = await app.models.AgencyTerm.filter(ctx); + + expect(result.length).toEqual(1); + expect(result[0].routeFk).toEqual(1); + }); + + it('should return results matching "agencyFk"', async() => { + let ctx = { + args: { + agencyFk: 2, + } + }; + + let result = await app.models.AgencyTerm.filter(ctx); + + expect(result.length).toEqual(1); + expect(result[0].routeFk).toEqual(2); + }); +}); diff --git a/modules/route/front/roadmap/card/index.spec.js b/modules/route/front/roadmap/card/index.spec.js new file mode 100644 index 000000000..ab2314bb9 --- /dev/null +++ b/modules/route/front/roadmap/card/index.spec.js @@ -0,0 +1,27 @@ +import './index'; + +describe('component vnItemTypeCard', () => { + let controller; + let $httpBackend; + + beforeEach(ngModule('item')); + + beforeEach(inject(($componentController, _$httpBackend_) => { + $httpBackend = _$httpBackend_; + controller = $componentController('vnItemTypeCard', {$element: null}); + })); + + describe('reload()', () => { + it('should reload the controller data', () => { + controller.$params.id = 1; + + const itemType = {id: 1}; + + $httpBackend.expectGET('ItemTypes/1').respond(itemType); + controller.reload(); + $httpBackend.flush(); + + expect(controller.itemType).toEqual(itemType); + }); + }); +}); diff --git a/modules/route/front/roadmap/create/index.spec.js b/modules/route/front/roadmap/create/index.spec.js new file mode 100644 index 000000000..d6d9883a7 --- /dev/null +++ b/modules/route/front/roadmap/create/index.spec.js @@ -0,0 +1,107 @@ +import './index'; +import watcher from 'core/mocks/watcher.js'; + +describe('AgencyTerm', () => { + describe('Component vnAgencyTermCreateInvoiceIn', () => { + let controller; + let $scope; + let $httpBackend; + let $httpParamSerializer; + + beforeEach(ngModule('route')); + + beforeEach(inject(($componentController, $rootScope, _$httpBackend_, _$httpParamSerializer_) => { + $scope = $rootScope.$new(); + $httpBackend = _$httpBackend_; + $httpParamSerializer = _$httpParamSerializer_; + const $element = angular.element(''); + controller = $componentController('vnAgencyTermCreateInvoiceIn', {$element}); + controller._route = { + id: 1 + }; + })); + + describe('$onChanges()', () => { + it('should update the params data when $params.q is defined', () => { + controller.$params = {q: '{"supplierName": "Plants SL","rows": null}'}; + + const params = {q: '{"supplierName": "Plants SL", "rows": null}'}; + const json = JSON.parse(params.q); + + controller.$onChanges(); + + expect(controller.params).toEqual(json); + }); + }); + + describe('route() setter', () => { + it('should set the ticket data and then call setDefaultParams() and getAllowedContentTypes()', () => { + jest.spyOn(controller, 'setDefaultParams'); + jest.spyOn(controller, 'getAllowedContentTypes'); + controller.route = { + id: 1 + }; + + expect(controller.route).toBeDefined(); + expect(controller.setDefaultParams).toHaveBeenCalledWith(); + expect(controller.getAllowedContentTypes).toHaveBeenCalledWith(); + }); + }); + + describe('getAllowedContentTypes()', () => { + it('should make an HTTP GET request to get the allowed content types', () => { + const expectedResponse = ['image/png', 'image/jpg']; + $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse); + controller.getAllowedContentTypes(); + $httpBackend.flush(); + + expect(controller.allowedContentTypes).toBeDefined(); + expect(controller.allowedContentTypes).toEqual('image/png, image/jpg'); + }); + }); + + describe('setDefaultParams()', () => { + it('should perform a GET query and define the dms property on controller', () => { + const params = {filter: { + where: {code: 'invoiceIn'} + }}; + const serializedParams = $httpParamSerializer(params); + $httpBackend.expect('GET', `DmsTypes/findOne?${serializedParams}`).respond({id: 1, code: 'invoiceIn'}); + controller.params = {supplierName: 'Plants SL'}; + controller.setDefaultParams(); + $httpBackend.flush(); + + expect(controller.dms).toBeDefined(); + expect(controller.dms.dmsTypeId).toEqual(1); + }); + }); + + describe('onSubmit()', () => { + it('should make an HTTP POST request to save the form data', () => { + controller.$.watcher = watcher; + + jest.spyOn(controller.$.watcher, 'updateOriginalData'); + const files = [{id: 1, name: 'MyFile'}]; + controller.dms = {files}; + const serializedParams = $httpParamSerializer(controller.dms); + const query = `dms/uploadFile?${serializedParams}`; + controller.params = {rows: null}; + + $httpBackend.expect('POST', query).respond({}); + $httpBackend.expect('POST', 'AgencyTerms/createInvoiceIn').respond({}); + controller.onSubmit(); + $httpBackend.flush(); + }); + }); + + describe('onFileChange()', () => { + it('should set dms hasFileAttached property to true if has any files', () => { + const files = [{id: 1, name: 'MyFile'}]; + controller.onFileChange(files); + $scope.$apply(); + + expect(controller.dms.hasFileAttached).toBeTruthy(); + }); + }); + }); +}); diff --git a/modules/route/front/roadmap/index/index.spec.js b/modules/route/front/roadmap/index/index.spec.js new file mode 100644 index 000000000..55c40daa5 --- /dev/null +++ b/modules/route/front/roadmap/index/index.spec.js @@ -0,0 +1,94 @@ +import './index.js'; +import crudModel from 'core/mocks/crud-model'; + +describe('AgencyTerm', () => { + describe('Component vnAgencyTermIndex', () => { + let controller; + let $window; + + beforeEach(ngModule('route')); + + beforeEach(inject(($componentController, _$window_) => { + $window = _$window_; + const $element = angular.element(''); + controller = $componentController('vnAgencyTermIndex', {$element}); + controller.$.model = crudModel; + controller.$.model.data = [ + {supplierFk: 1, totalPrice: null}, + {supplierFk: 1}, + {supplierFk: 2} + ]; + })); + + describe('checked() getter', () => { + it('should return the checked lines', () => { + const data = controller.$.model.data; + data[0].checked = true; + + const checkedRows = controller.checked; + + const firstCheckedRow = checkedRows[0]; + + expect(firstCheckedRow.supplierFk).toEqual(1); + }); + }); + + describe('totalCheked() getter', () => { + it('should return the total checked lines', () => { + const data = controller.$.model.data; + data[0].checked = true; + + const checkedRows = controller.totalChecked; + + expect(checkedRows).toEqual(1); + }); + }); + + describe('preview()', () => { + it('should show the summary dialog', () => { + controller.$.summary = {show: () => {}}; + jest.spyOn(controller.$.summary, 'show'); + + let event = new MouseEvent('click', { + view: $window, + bubbles: true, + cancelable: true + }); + const route = {id: 1}; + + controller.preview(event, route); + + expect(controller.$.summary.show).toHaveBeenCalledWith(); + }); + }); + + describe('createInvoiceIn()', () => { + it('should throw an error if more than one autonomous are checked', () => { + jest.spyOn(controller.vnApp, 'showError'); + const data = controller.$.model.data; + data[0].checked = true; + data[2].checked = true; + + controller.createInvoiceIn(); + + expect(controller.vnApp.showError).toHaveBeenCalled(); + }); + + it('should call the function go() on $state to go to the file management', () => { + jest.spyOn(controller.$state, 'go'); + const data = controller.$.model.data; + data[0].checked = true; + + controller.createInvoiceIn(); + + delete data[0].checked; + const params = JSON.stringify({ + supplierName: data[0].supplierName, + rows: [data[0]] + }); + + expect(controller.$state.go).toHaveBeenCalledWith('route.agencyTerm.createInvoiceIn', {q: params}); + }); + }); + }); +}); diff --git a/modules/route/front/roadmap/main/index.spec.js b/modules/route/front/roadmap/main/index.spec.js new file mode 100644 index 000000000..dcb14ec0e --- /dev/null +++ b/modules/route/front/roadmap/main/index.spec.js @@ -0,0 +1,31 @@ +import './index'; + +describe('Item', () => { + describe('Component vnItemType', () => { + let controller; + + beforeEach(ngModule('item')); + + beforeEach(inject($componentController => { + const $element = angular.element(''); + controller = $componentController('vnItemType', {$element}); + })); + + describe('exprBuilder()', () => { + it('should return a filter based on a search by id', () => { + const filter = controller.exprBuilder('search', '123'); + + expect(filter).toEqual({id: '123'}); + }); + + it('should return a filter based on a search by name or code', () => { + const filter = controller.exprBuilder('search', 'Alstroemeria'); + + expect(filter).toEqual({or: [ + {name: {like: '%Alstroemeria%'}}, + {code: {like: '%Alstroemeria%'}}, + ]}); + }); + }); + }); +}); From 6530e87508b0ea3040fe551346db1667a8dc2776 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 5 Jul 2023 15:20:51 +0200 Subject: [PATCH 16/53] refs #4614 feat(ticket): prevent invoice without weight --- db/changes/232801/00-ticketWeight.sql | 8 +-- .../ticket/front/descriptor-menu/index.html | 51 ++++++++++++------- modules/ticket/front/descriptor-menu/index.js | 14 ++--- .../front/descriptor-menu/locale/es.yml | 8 ++- modules/ticket/front/descriptor/locale/es.yml | 2 - 5 files changed, 50 insertions(+), 33 deletions(-) diff --git a/db/changes/232801/00-ticketWeight.sql b/db/changes/232801/00-ticketWeight.sql index 188804348..0b727b434 100644 --- a/db/changes/232801/00-ticketWeight.sql +++ b/db/changes/232801/00-ticketWeight.sql @@ -1,7 +1,7 @@ -UPDATE vn.ticket t - JOIN vn.ticketObservation o ON o.ticketFk = t.id +UPDATE `vn`.`ticket` t + JOIN `vn`.`ticketObservation` o ON o.ticketFk = t.id SET t.weight = cast(REPLACE(o.description, ',', '.') as decimal(10,2)) WHERE o.observationTypeFk = 6; -DELETE FROM vn.ticketObservation WHERE observationTypeFk = 6; -DELETE FROM vn.observationType WHERE id = 6; +DELETE FROM `vn`.`ticketObservation` WHERE observationTypeFk = 6; +DELETE FROM `vn`.`observationType` WHERE id = 6; diff --git a/modules/ticket/front/descriptor-menu/index.html b/modules/ticket/front/descriptor-menu/index.html index 6b4f967ac..5c76df97a 100644 --- a/modules/ticket/front/descriptor-menu/index.html +++ b/modules/ticket/front/descriptor-menu/index.html @@ -101,23 +101,32 @@ translate> Change shipped hour - - SMS Pending payment - - - SMS Minimum import - - - SMS Notify changes + Send SMS... + + + + Pending payment + + + Minimum import + + + Notify changes + + + Set ticket weight @@ -371,3 +380,11 @@ + + + + diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index 71a0c782f..c849b59eb 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -249,16 +249,11 @@ class Controller extends Section { this.$.sms.open(); } - makeInvoice() { - const params = {ticketsIds: [this.id]}; - /* - This should call the notification sistem to insert a new notification - in te queue, yet to check how to handle user permissions, - as of 08-11-2022 every employee can insert a new notification in the queue + makeInvoice(force) { + if (this.ticket.address.incotermsFk && !this.ticket.weight && !force) + return this.$.withoutWeightConfirmation.show(); - */ const client = this.ticket.client; - if (client.hasElectronicInvoice) { this.$http.post(`NotificationQueues`, { notificationFk: 'invoice-electronic', @@ -275,7 +270,8 @@ class Controller extends Section { }); } - return this.$http.post(`Tickets/makeInvoice`, params) + return this.$http.post(`Tickets/makeInvoice`, {ticketsIds: [this.id]}) + .then(() => this.reload()) .then(() => this.reload()) .then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced'))); } diff --git a/modules/ticket/front/descriptor-menu/locale/es.yml b/modules/ticket/front/descriptor-menu/locale/es.yml index 3830523cf..3181a753c 100644 --- a/modules/ticket/front/descriptor-menu/locale/es.yml +++ b/modules/ticket/front/descriptor-menu/locale/es.yml @@ -16,8 +16,14 @@ without warehouse: sin almacén Invoice sent: Factura enviada The following refund ticket have been created: "Se ha creado siguiente ticket de abono: {{ticketId}}" Transfer client: Transferir cliente -SMS Notify changes: SMS Notificar cambios +Send SMS...: Enviar SMS... +Notify changes: Notificar cambios +Minimum import: Importe mínimo +Pending payment: Pago pendiente PDF sent!: ¡PDF enviado! Already exist signed delivery note: Ya existe albarán de entrega firmado Are you sure you want to replace this delivery note?: ¿Seguro que quieres reemplazar este albarán de entrega? Create a single ticket with all the content of the current ticket: Crea un ticket único con todo el contenido del ticket actual +Set ticket weight: Establecer peso al ticket +Ticket weight: Peso del ticket +This address has incoterms, you should set the weight before invoice it: Este consigatario tiene incoterms, deberías establecer el peso antes de facturar diff --git a/modules/ticket/front/descriptor/locale/es.yml b/modules/ticket/front/descriptor/locale/es.yml index 3da013467..86b1a6b57 100644 --- a/modules/ticket/front/descriptor/locale/es.yml +++ b/modules/ticket/front/descriptor/locale/es.yml @@ -17,8 +17,6 @@ Shipped hour updated: Hora de envio modificada Deleted ticket: Ticket eliminado Recalculate components: Recalcular componentes Are you sure you want to recalculate the components?: ¿Seguro que quieres recalcular los componentes? -SMS Minimum import: 'SMS Importe minimo' -SMS Pending payment: 'SMS Pago pendiente' Restore ticket: Restaurar ticket You are going to restore this ticket: Vas a restaurar este ticket Are you sure you want to restore this ticket?: ¿Seguro que quieres restaurar el ticket? From d9d4441d59d2e12505dff4d0573f89688d1ebb5a Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 6 Jul 2023 13:38:59 +0200 Subject: [PATCH 17/53] refs #5970 deploy: 233001 init --- CHANGELOG.md | 9 +++++++++ db/changes/233001/.gitkeep | 0 package-lock.json | 2 +- package.json | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 db/changes/233001/.gitkeep diff --git a/CHANGELOG.md b/CHANGELOG.md index d0d172a3f..76527ac83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ 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). +## [2330.01] - 2023-07-27 + +### Added + +### Changed + +### Fixed + + ## [2328.01] - 2023-07-13 ### Added diff --git a/db/changes/233001/.gitkeep b/db/changes/233001/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/package-lock.json b/package-lock.json index 97a326669..ee6d4e0fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "salix-back", - "version": "23.28.01", + "version": "23.30.01", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 64c374841..66e341ad5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-back", - "version": "23.28.01", + "version": "23.30.01", "author": "Verdnatura Levante SL", "description": "Salix backend", "license": "GPL-3.0", From 8fe9b387ce5b00d287b0a3f08e31d41e2969dbe3 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 6 Jul 2023 15:16:52 +0200 Subject: [PATCH 18/53] refs #4614 test: front and correct folder --- db/changes/{232801 => 233001}/00-ticketWeight.sql | 0 modules/ticket/front/descriptor-menu/index.spec.js | 11 +++++++++++ 2 files changed, 11 insertions(+) rename db/changes/{232801 => 233001}/00-ticketWeight.sql (100%) diff --git a/db/changes/232801/00-ticketWeight.sql b/db/changes/233001/00-ticketWeight.sql similarity index 100% rename from db/changes/232801/00-ticketWeight.sql rename to db/changes/233001/00-ticketWeight.sql diff --git a/modules/ticket/front/descriptor-menu/index.spec.js b/modules/ticket/front/descriptor-menu/index.spec.js index 0aef956db..953de3962 100644 --- a/modules/ticket/front/descriptor-menu/index.spec.js +++ b/modules/ticket/front/descriptor-menu/index.spec.js @@ -198,6 +198,17 @@ describe('Ticket Component vnTicketDescriptorMenu', () => { expect(controller.reload).toHaveBeenCalledWith(); expect(controller.vnApp.showSuccess).toHaveBeenCalled(); }); + + it('should show withoutWeightConfirmation', () => { + controller.$.withoutWeightConfirmation = {show: () => {}}; + jest.spyOn(controller.$.withoutWeightConfirmation, 'show'); + controller.ticket.address.incotermsFk = true; + + controller.makeInvoice(); + controller.ticket.address.incotermsFk = false; + + expect(controller.$.withoutWeightConfirmation.show).toHaveBeenCalled(); + }); }); describe('createPdfInvoice()', () => { From d9a5868ce422c083be4872ec7f26c62dcd927c4c Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 7 Jul 2023 10:55:45 +0200 Subject: [PATCH 19/53] refs #5930 fix(claim_updateClaim) options --- modules/claim/back/methods/claim/updateClaim.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/claim/back/methods/claim/updateClaim.js b/modules/claim/back/methods/claim/updateClaim.js index cc7392e39..5486b8eff 100644 --- a/modules/claim/back/methods/claim/updateClaim.js +++ b/modules/claim/back/methods/claim/updateClaim.js @@ -95,7 +95,7 @@ module.exports = Self => { // When claimState has been changed if (args.claimStateFk) { - const newState = await models.ClaimState.findById(args.claimStateFk, null, options); + const newState = await models.ClaimState.findById(args.claimStateFk, null, myOptions); if (newState.hasToNotify) { if (newState.code == 'incomplete') notifyStateChange(ctx, salesPerson.id, claim, newState.code); From 8922d27f20cfcc3106a3914d5345b5aba0cdca20 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 7 Jul 2023 12:25:02 +0200 Subject: [PATCH 20/53] refs #4614 fix e2e --- db/dump/fixtures.sql | 2 +- e2e/helpers/selectors.js | 1 + e2e/paths/05-ticket/12_descriptor.spec.js | 4 ++-- modules/ticket/front/descriptor-menu/index.html | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 5b4b64437..7649e3594 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -729,7 +729,7 @@ INSERT INTO `vn`.`ticket`(`id`, `priority`, `agencyModeFk`,`warehouseFk`,`routeF (15, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1105, 'An incredibly long alias for testing purposes', 125, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), (16, 1, 7, 1, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), (17, 1, 7, 2, 6, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1106, 'Many Places', 126, NULL, 0, 3, 5, 1, util.VN_CURDATE(), NULL), - (18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, util.VN_CURDATE(), NULL), + (18, 1, 4, 4, 4, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1108, 'Cerebro', 128, NULL, 0, 12, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +12 HOUR), NULL), (19, 1, 5, 5, NULL, util.VN_CURDATE(), DATE_ADD(util.VN_CURDATE(), INTERVAL + 1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 1, NULL, 5, 1, util.VN_CURDATE(), NULL), (20, 1, 5, 5, 3, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Thailand', 129, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL), (21, NULL, 5, 5, 5, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), DATE_ADD(DATE_ADD(util.VN_CURDATE(),INTERVAL +1 MONTH), INTERVAL +1 DAY), 1109, 'Somewhere in Holland', 102, NULL, 0, 13, 5, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH), NULL), diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js index b10813488..977c8a837 100644 --- a/e2e/helpers/selectors.js +++ b/e2e/helpers/selectors.js @@ -547,6 +547,7 @@ export default { moreMenuMakeInvoice: '.vn-menu [name="makeInvoice"]', moreMenuRegenerateInvoice: '.vn-menu [name="regenerateInvoice"]', moreMenuChangeShippedHour: '.vn-menu [name="changeShipped"]', + moreMenuSMSOptions: '.vn-menu [name="smsOptions"]', moreMenuPaymentSMS: '.vn-menu [name="sendPaymentSms"]', moreMenuSendImportSms: '.vn-menu [name="sendImportSms"]', SMStext: 'textarea[name="message"]', diff --git a/e2e/paths/05-ticket/12_descriptor.spec.js b/e2e/paths/05-ticket/12_descriptor.spec.js index ca6fb8290..95a114c45 100644 --- a/e2e/paths/05-ticket/12_descriptor.spec.js +++ b/e2e/paths/05-ticket/12_descriptor.spec.js @@ -124,6 +124,7 @@ describe('Ticket descriptor path', () => { describe('SMS', () => { it('should send the payment SMS using the descriptor menu', async() => { await page.waitToClick(selectors.ticketDescriptor.moreMenu); + await page.waitToClick(selectors.ticketDescriptor.moreMenuSMSOptions); await page.waitToClick(selectors.ticketDescriptor.moreMenuPaymentSMS); await page.waitForSelector(selectors.ticketDescriptor.SMStext); await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 128); @@ -134,8 +135,7 @@ describe('Ticket descriptor path', () => { }); it('should send the import SMS using the descriptor menu', async() => { - await page.waitToClick(selectors.ticketDescriptor.moreMenu); - await page.waitForContentLoaded(); + await page.waitToClick(selectors.ticketDescriptor.moreMenuSMSOptions); await page.waitToClick(selectors.ticketDescriptor.moreMenuSendImportSms); await page.waitForSelector(selectors.ticketDescriptor.SMStext); await page.waitPropertyLength(selectors.ticketDescriptor.SMStext, 'value', 144); diff --git a/modules/ticket/front/descriptor-menu/index.html b/modules/ticket/front/descriptor-menu/index.html index 5c76df97a..d55b8a462 100644 --- a/modules/ticket/front/descriptor-menu/index.html +++ b/modules/ticket/front/descriptor-menu/index.html @@ -103,6 +103,7 @@ Send SMS... From d1c8f0ff11ef80c2769dec1f6e6ca8d6a7c620f0 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 11 Jul 2023 07:37:51 +0200 Subject: [PATCH 21/53] refs #5949 itemRecycle --- db/changes/233001/00-itemRecycle.sql | 2 + modules/item/back/methods/item/filter.js | 4 +- modules/item/back/models/item.json | 6 ++ modules/item/front/basic-data/index.html | 78 ++++++++++++++---------- modules/item/front/summary/index.html | 12 ++++ 5 files changed, 70 insertions(+), 32 deletions(-) create mode 100644 db/changes/233001/00-itemRecycle.sql diff --git a/db/changes/233001/00-itemRecycle.sql b/db/changes/233001/00-itemRecycle.sql new file mode 100644 index 000000000..c191e5d1c --- /dev/null +++ b/db/changes/233001/00-itemRecycle.sql @@ -0,0 +1,2 @@ +ALTER TABLE `vn`.`item` ADD recycledPlastic INT NULL; +ALTER TABLE `vn`.`item` ADD nonRecycledPlastic INT NULL; diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index c0b1cc0d9..d5de6a954 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -145,7 +145,7 @@ module.exports = Self => { const stmts = []; const stmt = new ParameterizedSQL( - `SELECT + `SELECT i.id, i.image, i.name, @@ -164,6 +164,8 @@ module.exports = Self => { i.stemMultiplier, i.typeFk, i.isFloramondo, + i.recycledPlastic, + i.nonRecycledPlastic, pr.name AS producer, it.name AS typeName, it.workerFk AS buyerFk, diff --git a/modules/item/back/models/item.json b/modules/item/back/models/item.json index 4a7e04002..e99dcd996 100644 --- a/modules/item/back/models/item.json +++ b/modules/item/back/models/item.json @@ -125,6 +125,12 @@ "minPrice": { "type": "number" }, + "recycledPlastic": { + "type": "number" + }, + "nonRecycledPlastic": { + "type": "number" + }, "packingOut": { "type": "number" }, diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index a7e603bd1..61456f154 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -82,6 +82,8 @@ vn-name="expence" initial-data="$ctrl.item.expense"> + + - - - - - - + + + + + + - - - - - - + + + + + + + + + + + + + + + + + +

From ba109dccc5fec9f636fbd76178d42ffbc5d38e06 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 11 Jul 2023 07:58:18 +0200 Subject: [PATCH 22/53] refs #5949 trad --- modules/item/front/basic-data/index.html | 6 +++--- modules/item/front/basic-data/locale/es.yml | 10 ++++++---- modules/item/front/summary/index.html | 8 ++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index 61456f154..285ad11f9 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -170,14 +170,14 @@ diff --git a/modules/item/front/basic-data/locale/es.yml b/modules/item/front/basic-data/locale/es.yml index 747dfe792..b6f3c9f75 100644 --- a/modules/item/front/basic-data/locale/es.yml +++ b/modules/item/front/basic-data/locale/es.yml @@ -1,7 +1,7 @@ Reference: Referencia -Full name calculates based on tags 1-3. Is not recommended to change it manually: >- - El nombre completo se calcula - basado en los tags 1-3. +Full name calculates based on tags 1-3. Is not recommended to change it manually: >- + El nombre completo se calcula + basado en los tags 1-3. No se recomienda cambiarlo manualmente Is active: Activo Expense: Gasto @@ -13,4 +13,6 @@ Is shown at website, app that this item cannot travel (wreath, palms, ...): Se m Multiplier: Multiplicador Generic: Genérico This item does need a photo: Este artículo necesita una foto -Do photo: Hacer foto \ No newline at end of file +Do photo: Hacer foto +Recyled Plastic: Plástico reciclado +No recycled plastic: Plástico no reciclado diff --git a/modules/item/front/summary/index.html b/modules/item/front/summary/index.html index 78b7af355..af8752b5f 100644 --- a/modules/item/front/summary/index.html +++ b/modules/item/front/summary/index.html @@ -113,19 +113,19 @@ - - - - From 7291b793ae6cdf80b7d5ab394564711eb7629284 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 11 Jul 2023 08:41:43 +0200 Subject: [PATCH 23/53] refs #5949 fix traduct --- modules/item/front/basic-data/index.html | 4 ++-- modules/item/front/basic-data/locale/es.yml | 4 ++-- modules/item/front/summary/index.html | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/item/front/basic-data/index.html b/modules/item/front/basic-data/index.html index 285ad11f9..fba4d679c 100644 --- a/modules/item/front/basic-data/index.html +++ b/modules/item/front/basic-data/index.html @@ -170,14 +170,14 @@ diff --git a/modules/item/front/basic-data/locale/es.yml b/modules/item/front/basic-data/locale/es.yml index b6f3c9f75..8f459c417 100644 --- a/modules/item/front/basic-data/locale/es.yml +++ b/modules/item/front/basic-data/locale/es.yml @@ -14,5 +14,5 @@ Multiplier: Multiplicador Generic: Genérico This item does need a photo: Este artículo necesita una foto Do photo: Hacer foto -Recyled Plastic: Plástico reciclado -No recycled plastic: Plástico no reciclado +Recycled Plastic: Plástico reciclado +Non recycled plastic: Plástico no reciclado diff --git a/modules/item/front/summary/index.html b/modules/item/front/summary/index.html index af8752b5f..fcc267b4d 100644 --- a/modules/item/front/summary/index.html +++ b/modules/item/front/summary/index.html @@ -122,10 +122,10 @@ - - From 6655807d8042cb99de271d40330ebfd6eb652e3f Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 11 Jul 2023 13:50:38 +0200 Subject: [PATCH 24/53] refs #4770 refactor: change acl --- db/changes/232801/00-roadmapACL.sql | 6 ++++-- modules/route/front/roadmap/summary/style.scss | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/db/changes/232801/00-roadmapACL.sql b/db/changes/232801/00-roadmapACL.sql index 8954ecb27..4fc116f86 100644 --- a/db/changes/232801/00-roadmapACL.sql +++ b/db/changes/232801/00-roadmapACL.sql @@ -1,4 +1,6 @@ INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES - ('Roadmap', '*', '*', 'ALLOW', 'ROLE', 'employee'), - ('ExpeditionTruck', '*', '*', 'ALLOW', 'ROLE', 'employee'); + ('Roadmap', '*', '*', 'ALLOW', 'ROLE', 'palletizerBoss'), + ('Roadmap', '*', '*', 'ALLOW', 'ROLE', 'productionBoss'), + ('ExpeditionTruck', '*', '*', 'ALLOW', 'ROLE', 'palletizerBoss'), + ('ExpeditionTruck', '*', '*', 'ALLOW', 'ROLE', 'productionBoss'); diff --git a/modules/route/front/roadmap/summary/style.scss b/modules/route/front/roadmap/summary/style.scss index 8e75d3e0b..63b3f625a 100644 --- a/modules/route/front/roadmap/summary/style.scss +++ b/modules/route/front/roadmap/summary/style.scss @@ -1,6 +1,5 @@ @import "variables"; - vn-roadmap-summary .summary { a { display: flex; From 392dc5060a7707c4fa288c7b1b85b67e503903de Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 13 Jul 2023 10:19:12 +0200 Subject: [PATCH 25/53] refs #4770 delete test --- .../route/front/roadmap/card/index.spec.js | 27 ----- .../route/front/roadmap/create/index.spec.js | 107 ------------------ .../route/front/roadmap/index/index.spec.js | 94 --------------- .../route/front/roadmap/main/index.spec.js | 31 ----- modules/ticket/front/descriptor-menu/index.js | 2 +- 5 files changed, 1 insertion(+), 260 deletions(-) delete mode 100644 modules/route/front/roadmap/card/index.spec.js delete mode 100644 modules/route/front/roadmap/create/index.spec.js delete mode 100644 modules/route/front/roadmap/index/index.spec.js delete mode 100644 modules/route/front/roadmap/main/index.spec.js diff --git a/modules/route/front/roadmap/card/index.spec.js b/modules/route/front/roadmap/card/index.spec.js deleted file mode 100644 index ab2314bb9..000000000 --- a/modules/route/front/roadmap/card/index.spec.js +++ /dev/null @@ -1,27 +0,0 @@ -import './index'; - -describe('component vnItemTypeCard', () => { - let controller; - let $httpBackend; - - beforeEach(ngModule('item')); - - beforeEach(inject(($componentController, _$httpBackend_) => { - $httpBackend = _$httpBackend_; - controller = $componentController('vnItemTypeCard', {$element: null}); - })); - - describe('reload()', () => { - it('should reload the controller data', () => { - controller.$params.id = 1; - - const itemType = {id: 1}; - - $httpBackend.expectGET('ItemTypes/1').respond(itemType); - controller.reload(); - $httpBackend.flush(); - - expect(controller.itemType).toEqual(itemType); - }); - }); -}); diff --git a/modules/route/front/roadmap/create/index.spec.js b/modules/route/front/roadmap/create/index.spec.js deleted file mode 100644 index d6d9883a7..000000000 --- a/modules/route/front/roadmap/create/index.spec.js +++ /dev/null @@ -1,107 +0,0 @@ -import './index'; -import watcher from 'core/mocks/watcher.js'; - -describe('AgencyTerm', () => { - describe('Component vnAgencyTermCreateInvoiceIn', () => { - let controller; - let $scope; - let $httpBackend; - let $httpParamSerializer; - - beforeEach(ngModule('route')); - - beforeEach(inject(($componentController, $rootScope, _$httpBackend_, _$httpParamSerializer_) => { - $scope = $rootScope.$new(); - $httpBackend = _$httpBackend_; - $httpParamSerializer = _$httpParamSerializer_; - const $element = angular.element(''); - controller = $componentController('vnAgencyTermCreateInvoiceIn', {$element}); - controller._route = { - id: 1 - }; - })); - - describe('$onChanges()', () => { - it('should update the params data when $params.q is defined', () => { - controller.$params = {q: '{"supplierName": "Plants SL","rows": null}'}; - - const params = {q: '{"supplierName": "Plants SL", "rows": null}'}; - const json = JSON.parse(params.q); - - controller.$onChanges(); - - expect(controller.params).toEqual(json); - }); - }); - - describe('route() setter', () => { - it('should set the ticket data and then call setDefaultParams() and getAllowedContentTypes()', () => { - jest.spyOn(controller, 'setDefaultParams'); - jest.spyOn(controller, 'getAllowedContentTypes'); - controller.route = { - id: 1 - }; - - expect(controller.route).toBeDefined(); - expect(controller.setDefaultParams).toHaveBeenCalledWith(); - expect(controller.getAllowedContentTypes).toHaveBeenCalledWith(); - }); - }); - - describe('getAllowedContentTypes()', () => { - it('should make an HTTP GET request to get the allowed content types', () => { - const expectedResponse = ['image/png', 'image/jpg']; - $httpBackend.expect('GET', `DmsContainers/allowedContentTypes`).respond(expectedResponse); - controller.getAllowedContentTypes(); - $httpBackend.flush(); - - expect(controller.allowedContentTypes).toBeDefined(); - expect(controller.allowedContentTypes).toEqual('image/png, image/jpg'); - }); - }); - - describe('setDefaultParams()', () => { - it('should perform a GET query and define the dms property on controller', () => { - const params = {filter: { - where: {code: 'invoiceIn'} - }}; - const serializedParams = $httpParamSerializer(params); - $httpBackend.expect('GET', `DmsTypes/findOne?${serializedParams}`).respond({id: 1, code: 'invoiceIn'}); - controller.params = {supplierName: 'Plants SL'}; - controller.setDefaultParams(); - $httpBackend.flush(); - - expect(controller.dms).toBeDefined(); - expect(controller.dms.dmsTypeId).toEqual(1); - }); - }); - - describe('onSubmit()', () => { - it('should make an HTTP POST request to save the form data', () => { - controller.$.watcher = watcher; - - jest.spyOn(controller.$.watcher, 'updateOriginalData'); - const files = [{id: 1, name: 'MyFile'}]; - controller.dms = {files}; - const serializedParams = $httpParamSerializer(controller.dms); - const query = `dms/uploadFile?${serializedParams}`; - controller.params = {rows: null}; - - $httpBackend.expect('POST', query).respond({}); - $httpBackend.expect('POST', 'AgencyTerms/createInvoiceIn').respond({}); - controller.onSubmit(); - $httpBackend.flush(); - }); - }); - - describe('onFileChange()', () => { - it('should set dms hasFileAttached property to true if has any files', () => { - const files = [{id: 1, name: 'MyFile'}]; - controller.onFileChange(files); - $scope.$apply(); - - expect(controller.dms.hasFileAttached).toBeTruthy(); - }); - }); - }); -}); diff --git a/modules/route/front/roadmap/index/index.spec.js b/modules/route/front/roadmap/index/index.spec.js deleted file mode 100644 index 55c40daa5..000000000 --- a/modules/route/front/roadmap/index/index.spec.js +++ /dev/null @@ -1,94 +0,0 @@ -import './index.js'; -import crudModel from 'core/mocks/crud-model'; - -describe('AgencyTerm', () => { - describe('Component vnAgencyTermIndex', () => { - let controller; - let $window; - - beforeEach(ngModule('route')); - - beforeEach(inject(($componentController, _$window_) => { - $window = _$window_; - const $element = angular.element(''); - controller = $componentController('vnAgencyTermIndex', {$element}); - controller.$.model = crudModel; - controller.$.model.data = [ - {supplierFk: 1, totalPrice: null}, - {supplierFk: 1}, - {supplierFk: 2} - ]; - })); - - describe('checked() getter', () => { - it('should return the checked lines', () => { - const data = controller.$.model.data; - data[0].checked = true; - - const checkedRows = controller.checked; - - const firstCheckedRow = checkedRows[0]; - - expect(firstCheckedRow.supplierFk).toEqual(1); - }); - }); - - describe('totalCheked() getter', () => { - it('should return the total checked lines', () => { - const data = controller.$.model.data; - data[0].checked = true; - - const checkedRows = controller.totalChecked; - - expect(checkedRows).toEqual(1); - }); - }); - - describe('preview()', () => { - it('should show the summary dialog', () => { - controller.$.summary = {show: () => {}}; - jest.spyOn(controller.$.summary, 'show'); - - let event = new MouseEvent('click', { - view: $window, - bubbles: true, - cancelable: true - }); - const route = {id: 1}; - - controller.preview(event, route); - - expect(controller.$.summary.show).toHaveBeenCalledWith(); - }); - }); - - describe('createInvoiceIn()', () => { - it('should throw an error if more than one autonomous are checked', () => { - jest.spyOn(controller.vnApp, 'showError'); - const data = controller.$.model.data; - data[0].checked = true; - data[2].checked = true; - - controller.createInvoiceIn(); - - expect(controller.vnApp.showError).toHaveBeenCalled(); - }); - - it('should call the function go() on $state to go to the file management', () => { - jest.spyOn(controller.$state, 'go'); - const data = controller.$.model.data; - data[0].checked = true; - - controller.createInvoiceIn(); - - delete data[0].checked; - const params = JSON.stringify({ - supplierName: data[0].supplierName, - rows: [data[0]] - }); - - expect(controller.$state.go).toHaveBeenCalledWith('route.agencyTerm.createInvoiceIn', {q: params}); - }); - }); - }); -}); diff --git a/modules/route/front/roadmap/main/index.spec.js b/modules/route/front/roadmap/main/index.spec.js deleted file mode 100644 index dcb14ec0e..000000000 --- a/modules/route/front/roadmap/main/index.spec.js +++ /dev/null @@ -1,31 +0,0 @@ -import './index'; - -describe('Item', () => { - describe('Component vnItemType', () => { - let controller; - - beforeEach(ngModule('item')); - - beforeEach(inject($componentController => { - const $element = angular.element(''); - controller = $componentController('vnItemType', {$element}); - })); - - describe('exprBuilder()', () => { - it('should return a filter based on a search by id', () => { - const filter = controller.exprBuilder('search', '123'); - - expect(filter).toEqual({id: '123'}); - }); - - it('should return a filter based on a search by name or code', () => { - const filter = controller.exprBuilder('search', 'Alstroemeria'); - - expect(filter).toEqual({or: [ - {name: {like: '%Alstroemeria%'}}, - {code: {like: '%Alstroemeria%'}}, - ]}); - }); - }); - }); -}); diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js index 0b47102ac..0fc8488ca 100644 --- a/modules/ticket/front/descriptor-menu/index.js +++ b/modules/ticket/front/descriptor-menu/index.js @@ -270,7 +270,7 @@ class Controller extends Section { }); } - return this.$http.post(`Tickets/invoiceTickets`, params) + return this.$http.post(`Tickets/invoiceTickets`, {ticketsIds: [this.id]}) .then(() => this.reload()) .then(() => this.vnApp.showSuccess(this.$t('Ticket invoiced'))); } From c91db1b42922acaccfe7dd562f2b006997b7b8a0 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 13 Jul 2023 10:19:57 +0200 Subject: [PATCH 26/53] a --- back/methods/vn-user/specs/addAlias.spec.js | 68 --------------------- 1 file changed, 68 deletions(-) delete mode 100644 back/methods/vn-user/specs/addAlias.spec.js diff --git a/back/methods/vn-user/specs/addAlias.spec.js b/back/methods/vn-user/specs/addAlias.spec.js deleted file mode 100644 index ef657a3a8..000000000 --- a/back/methods/vn-user/specs/addAlias.spec.js +++ /dev/null @@ -1,68 +0,0 @@ -const {models} = require('vn-loopback/server/server'); - -describe('VnUser addAlias()', () => { - const employeeId = 1; - const sysadminId = 66; - const developerId = 9; - const customerId = 2; - const mailAlias = 1; - it('should throw an error when user not has privileges', async() => { - const ctx = {req: {accessToken: {userId: employeeId}}}; - const tx = await models.VnUser.beginTransaction({}); - - let error; - try { - const options = {transaction: tx}; - - await models.VnUser.addAlias(ctx, employeeId, mailAlias, options); - - await tx.rollback(); - } catch (e) { - error = e; - await tx.rollback(); - } - - expect(error.message).toContain(`You don't have grant privilege`); - }); - - it('should throw an error when user has privileges but not has the role from user', async() => { - const ctx = {req: {accessToken: {userId: sysadminId}}}; - const tx = await models.VnUser.beginTransaction({}); - - let error; - try { - const options = {transaction: tx}; - - await models.VnUser.addAlias(ctx, employeeId, mailAlias, options); - - await tx.rollback(); - } catch (e) { - error = e; - await tx.rollback(); - } - - expect(error.message).toContain(`You cannot assign an alias that you are not assigned to`); - }); - - it('should add an alias', async() => { - const ctx = {req: {accessToken: {userId: developerId}}}; - const tx = await models.VnUser.beginTransaction({}); - - let result; - try { - const options = {transaction: tx}; - - const user = await models.VnUser.findById(developerId, null, options); - await user.updateAttribute('hasGrant', true, options); - - result = await models.VnUser.addAlias(ctx, customerId, mailAlias, options); - - await tx.rollback(); - } catch (e) { - await tx.rollback(); - } - - expect(result.mailAlias).toBe(mailAlias); - expect(result.account).toBe(customerId); - }); -}); From 765a84e2eb9ec325fc892994d18361796f6dfd7e Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 14 Jul 2023 07:27:04 +0200 Subject: [PATCH 27/53] refs #5819 Added param to call zone_getLeaves --- modules/zone/back/methods/zone/getLeaves.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/zone/back/methods/zone/getLeaves.js b/modules/zone/back/methods/zone/getLeaves.js index a6db3b711..aeed9f3a2 100644 --- a/modules/zone/back/methods/zone/getLeaves.js +++ b/modules/zone/back/methods/zone/getLeaves.js @@ -38,7 +38,7 @@ module.exports = Self => { Object.assign(myOptions, options); const [res] = await Self.rawSql( - `CALL zone_getLeaves(?, ?, ?)`, + `CALL zone_getLeaves(?, ?, ?, FALSE)`, [id, parentId, search], myOptions ); From 6d8b3e346dc99043d23af1c771d3483b80aef386 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 14 Jul 2023 09:40:16 +0200 Subject: [PATCH 28/53] refs #5837 fix filter existingClient France --- modules/client/back/models/client.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index ca279ef71..dc48f9d3d 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -50,9 +50,14 @@ module.exports = Self => { ] } }; - const client = await Self.app.models.Client.findOne(filter); - if (client) - err(); + + const existingClient = await Self.app.models.Client.findOne(filter); + + if (existingClient) { + if (this.countryFk !== 19 && this.socialName === existingClient.socialName) + err(); + } + done(); } From 765c22df969a5ebd8c73907cd30f503a7934ca5e Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 14 Jul 2023 11:30:13 +0200 Subject: [PATCH 29/53] refs #5837 new table --- back/models/country.json | 5 ++++- db/changes/233001/00-noUniqueSocialName.sql | 2 ++ modules/client/back/models/client.js | 3 ++- modules/client/back/models/client.json | 5 +++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 db/changes/233001/00-noUniqueSocialName.sql diff --git a/back/models/country.json b/back/models/country.json index 8fa25b88e..fd540d819 100644 --- a/back/models/country.json +++ b/back/models/country.json @@ -22,6 +22,9 @@ }, "isUeeMember": { "type": "boolean" + }, + "isSocialNameUnique": { + "type": "boolean" } }, "relations": { @@ -39,4 +42,4 @@ "permission": "ALLOW" } ] -} \ No newline at end of file +} diff --git a/db/changes/233001/00-noUniqueSocialName.sql b/db/changes/233001/00-noUniqueSocialName.sql new file mode 100644 index 000000000..0dc4c832f --- /dev/null +++ b/db/changes/233001/00-noUniqueSocialName.sql @@ -0,0 +1,2 @@ +ALTER TABLE `vn`.`country` +ADD COLUMN `isSocialNameUnique` tinyint(1) NOT NULL DEFAULT 1; diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index dc48f9d3d..089500149 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -54,7 +54,8 @@ module.exports = Self => { const existingClient = await Self.app.models.Client.findOne(filter); if (existingClient) { - if (this.countryFk !== 19 && this.socialName === existingClient.socialName) + console.log(this.isSocialNameUnique); + if (!this.isSocialNameUnique && this.socialName === existingClient.socialName) err(); } diff --git a/modules/client/back/models/client.json b/modules/client/back/models/client.json index 5f56a1ed2..66a67ec2e 100644 --- a/modules/client/back/models/client.json +++ b/modules/client/back/models/client.json @@ -181,6 +181,11 @@ "model": "Country", "foreignKey": "countryFk" }, + "isSocialNameUnique": { + "type": "belongsTo", + "model": "Country", + "foreignKey": "countryFk" + }, "contactChannel": { "type": "belongsTo", "model": "ContactChannel", From 93387cae62aed6a12f860fe3207bf656b84d73ac Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 14 Jul 2023 13:07:40 +0200 Subject: [PATCH 30/53] refs #5837 if isSocialNameUnique --- modules/client/back/models/client.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index 089500149..163d51fc5 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -42,6 +42,14 @@ module.exports = Self => { async function socialNameIsUnique(err, done) { const filter = { + include: { + relation: 'country', + scope: { + fields: { + isSocialNameUnique: true, + }, + }, + }, where: { and: [ {socialName: this.socialName}, @@ -54,8 +62,8 @@ module.exports = Self => { const existingClient = await Self.app.models.Client.findOne(filter); if (existingClient) { - console.log(this.isSocialNameUnique); - if (!this.isSocialNameUnique && this.socialName === existingClient.socialName) + // eslint-disable-next-line max-len + if (existingClient.country().isSocialNameUnique && this.socialName === existingClient.socialName) err(); } From 3c013110d35a96aadb7f78b226f3de590bf4957a Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 18 Jul 2023 07:32:45 +0200 Subject: [PATCH 31/53] refs #5819 Changed structure sql --- db/dump/structure.sql | 121 ++++++++++++++++++++++++++---------------- 1 file changed, 74 insertions(+), 47 deletions(-) diff --git a/db/dump/structure.sql b/db/dump/structure.sql index ee5fb40a1..4e7127310 100644 --- a/db/dump/structure.sql +++ b/db/dump/structure.sql @@ -77831,7 +77831,7 @@ BEGIN LEAVE cur1Loop; END IF; - CALL zone_getLeaves2(vZoneFk, NULL, NULL); + CALL zone_getLeaves(vZoneFk, NULL, NULL, TRUE); myLoop: LOOP SET vGeoFk = NULL; @@ -77844,7 +77844,7 @@ BEGIN LEAVE myLoop; END IF; - CALL zone_getLeaves2(vZoneFk, vGeoFk, NULL); + CALL zone_getLeaves(vZoneFk, vGeoFk, NULL, TRUE); UPDATE tmp.zoneNodes SET isChecked = TRUE WHERE geoFk = vGeoFk; @@ -78130,55 +78130,58 @@ DELIMITER ; /*!50003 SET @saved_sql_mode = @@sql_mode */ ; /*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ; DELIMITER ;; -CREATE DEFINER=`root`@`localhost` PROCEDURE `zone_getLeaves`(vSelf INT, vParentFk INT, vSearch VARCHAR(255)) -BEGIN +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`zone_getLeaves`( + vSelf INT, + vParentFk INT, + vSearch VARCHAR(255), + vHasInsert BOOL +) +BEGIN /** * Devuelve las ubicaciones incluidas en la ruta y que sean hijos de parentFk. * @param vSelf Id de la zona * @param vParentFk Id del geo a calcular - * @param vSearch cadena a buscar + * @param vSearch Cadena a buscar + * @param vHasInsert Indica si inserta en tmp.zoneNodes + * Optional @table tmp.zoneNodes(geoFk, name, parentFk, sons, isChecked, zoneFk) */ DECLARE vIsNumber BOOL; - DECLARE vIsSearch BOOL DEFAULT vSearch IS NOT NULL AND vSearch != ''; + DECLARE vIsSearch BOOL DEFAULT vSearch IS NOT NULL AND vSearch <> ''; - DROP TEMPORARY TABLE IF EXISTS tNodes; - CREATE TEMPORARY TABLE tNodes + CREATE OR REPLACE TEMPORARY TABLE tNodes (UNIQUE (id)) ENGINE = MEMORY - SELECT id - FROM zoneGeo + SELECT id + FROM zoneGeo LIMIT 0; IF vIsSearch THEN SET vIsNumber = vSearch REGEXP '^[0-9]+$'; - + INSERT INTO tNodes - SELECT id + SELECT id FROM zoneGeo WHERE (vIsNumber AND `name` = vSearch) OR (!vIsNumber AND `name` LIKE CONCAT('%', vSearch, '%')) LIMIT 1000; - + ELSEIF vParentFk IS NULL THEN INSERT INTO tNodes - SELECT geoFk + SELECT geoFk FROM zoneIncluded WHERE zoneFk = vSelf; END IF; IF vParentFk IS NULL THEN - DROP TEMPORARY TABLE IF EXISTS tChilds; - CREATE TEMPORARY TABLE tChilds + CREATE OR REPLACE TEMPORARY TABLE tChilds + (INDEX(id)) ENGINE = MEMORY - SELECT id - FROM tNodes; + SELECT id FROM tNodes; - DROP TEMPORARY TABLE IF EXISTS tParents; - CREATE TEMPORARY TABLE tParents + CREATE OR REPLACE TEMPORARY TABLE tParents + (INDEX(id)) ENGINE = MEMORY - SELECT id - FROM zoneGeo - LIMIT 0; + SELECT id FROM zoneGeo LIMIT 0; myLoop: LOOP DELETE FROM tParents; @@ -78186,43 +78189,67 @@ BEGIN SELECT parentFk id FROM zoneGeo g JOIN tChilds c ON c.id = g.id - WHERE g.parentFk IS NOT NULL; - + WHERE g.parentFk IS NOT NULL; + INSERT IGNORE INTO tNodes - SELECT id - FROM tParents; - - IF ROW_COUNT() = 0 THEN + SELECT id FROM tParents; + + IF NOT ROW_COUNT() THEN LEAVE myLoop; END IF; - + DELETE FROM tChilds; INSERT INTO tChilds - SELECT id - FROM tParents; + SELECT id FROM tParents; END LOOP; - + DROP TEMPORARY TABLE tChilds, tParents; END IF; - IF !vIsSearch THEN + IF NOT vIsSearch THEN INSERT IGNORE INTO tNodes - SELECT id + SELECT id FROM zoneGeo WHERE parentFk <=> vParentFk; END IF; - SELECT g.id, - g.name, - g.parentFk, - g.sons, - isIncluded selected - FROM zoneGeo g - JOIN tNodes n ON n.id = g.id - LEFT JOIN zoneIncluded i ON i.geoFk = g.id AND i.zoneFk = vSelf - ORDER BY `depth`, selected DESC, name; + CREATE OR REPLACE TEMPORARY TABLE tZones + SELECT g.id, + g.name, + g.parentFk, + g.sons, + NOT g.sons OR `type` = 'country' isChecked, + i.isIncluded selected, + g.`depth`, + vSelf + FROM zoneGeo g + JOIN tNodes n ON n.id = g.id + LEFT JOIN zoneIncluded i ON i.geoFk = g.id + AND i.zoneFk = vSelf + ORDER BY g.`depth`, selected DESC, g.name; - DROP TEMPORARY TABLE tNodes; + IF vHasInsert THEN + INSERT IGNORE INTO tmp.zoneNodes(geoFk, name, parentFk, sons, isChecked, zoneFk) + SELECT id, + name, + parentFk, + sons, + isChecked, + vSelf + FROM tZones + WHERE selected + OR (selected IS NULL AND vParentFk IS NOT NULL); + ELSE + SELECT id, + name, + parentFk, + sons, + selected + FROM tZones + ORDER BY `depth`, selected DESC, name; + END IF; + + DROP TEMPORARY TABLE tNodes, tZones; END ;; DELIMITER ; /*!50003 SET sql_mode = @saved_sql_mode */ ; @@ -78540,7 +78567,7 @@ BEGIN INDEX(geoFk)) ENGINE = MEMORY; - CALL zone_getLeaves2(vSelf, NULL , NULL); + CALL zone_getLeaves(vSelf, NULL , NULL, TRUE); UPDATE tmp.zoneNodes zn SET isChecked = 0 @@ -78553,7 +78580,7 @@ BEGIN WHERE NOT isChecked LIMIT 1; - CALL zone_getLeaves2(vSelf, vGeoFk, NULL); + CALL zone_getLeaves(vSelf, vGeoFk, NULL, TRUE); UPDATE tmp.zoneNodes SET isChecked = TRUE WHERE geoFk = vGeoFk; From 93da12923959e0b829871d30e08b1e157f3b6e7c Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 18 Jul 2023 08:54:45 +0200 Subject: [PATCH 32/53] refs #5983 feat(itemShelving): add getInventory --- .../233001/00-itemShelving_inventory.sql | 52 +++++++++++++++++++ .../methods/item-shelving/getInventory.js | 37 +++++++++++++ .../item-shelving/specs/getInventory.spec.js | 19 +++++++ modules/item/back/models/item-shelving.js | 1 + 4 files changed, 109 insertions(+) create mode 100644 db/changes/233001/00-itemShelving_inventory.sql create mode 100644 modules/item/back/methods/item-shelving/getInventory.js create mode 100644 modules/item/back/methods/item-shelving/specs/getInventory.spec.js diff --git a/db/changes/233001/00-itemShelving_inventory.sql b/db/changes/233001/00-itemShelving_inventory.sql new file mode 100644 index 000000000..b2a2ff321 --- /dev/null +++ b/db/changes/233001/00-itemShelving_inventory.sql @@ -0,0 +1,52 @@ + +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_inventory`(vParkingFromFk INT, vParkingToFk INT) +/** + * Devuelve un listado de ubicaciones a revisar + * + * @param vParkingFromFk Parking de partida, identificador de vn.parking + * @param vParkingToFk Parking de llegada, identificador de vn.parking +*/ + + DECLARE vSectorFk INT; + DECLARE vPickingOrderFrom INT; + DECLARE vPickingOrderTo INT; + + SELECT ish.id, + p.pickingOrder, + p.code parking, + ish.shelvingFk, + ish.itemFk, + i.longName, + ish.visible, + p.sectorFk, + it.workerFk buyer, + CONCAT('http:',ic.url, '/catalog/1600x900/',i.image) urlImage, + ish.isChecked, + CASE + WHEN s.notPrepared > sm.parked THEN 0 + WHEN sm.visible > sm.parked THEN 1 + ELSE 2 + END + FROM vn.itemShelving ish + JOIN vn.item i ON i.id = ish.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN tmp.stockMisfit sm ON sm.itemFk = ish.itemFk + JOIN vn.shelving sh ON sh.code = ish.shelvingFk + JOIN vn.parking p ON p.id = sh.parkingFk + JOIN (SELECT s.itemFk, sum(s.quantity) notPrepared + FROM vn.sale s + JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.warehouse w ON w.id = t.warehouseFk + WHERE t.shipped BETWEEN CURDATE() + AND CURDATE() + INTERVAL 23 HOUR + AND s.isPicked = FALSE + AND w.name = 'Algemesi' + GROUP BY s.itemFk) s ON s.itemFk = i.id + JOIN hedera.imageConfig ic + WHERE p.pickingOrder BETWEEN vParkingFrom AND vPickingOrderTo + AND p.sectorFk = vSectorFk + ORDER BY p.pickingOrder; + +END ;; +DELIMITER ; diff --git a/modules/item/back/methods/item-shelving/getInventory.js b/modules/item/back/methods/item-shelving/getInventory.js new file mode 100644 index 000000000..144bd83e7 --- /dev/null +++ b/modules/item/back/methods/item-shelving/getInventory.js @@ -0,0 +1,37 @@ +module.exports = Self => { + Self.remoteMethod('getInventory', { + description: 'Get list of itemShelving to review between two parking code', + accessType: 'WRITE', + accepts: [{ + arg: 'parkingFrom', + type: 'string', + required: true, + description: 'Parking code from' + }, + { + arg: 'parkingTo', + type: 'string', + required: true, + description: 'Parking code to' + }], + returns: { + type: ['object'], + root: true + }, + http: { + path: `/getInventory`, + verb: 'POST' + } + }); + + Self.getInventory = async(parkingFrom, parkingTo, options) => { + const myOptions = {}; + + if (typeof options == 'object') + Object.assign(myOptions, options); + + const [result] = await Self.rawSql(`CALL vn.itemShelving_inventory(?, ?)`, [parkingFrom, parkingTo], myOptions); + + return result; + }; +}; diff --git a/modules/item/back/methods/item-shelving/specs/getInventory.spec.js b/modules/item/back/methods/item-shelving/specs/getInventory.spec.js new file mode 100644 index 000000000..76cc39073 --- /dev/null +++ b/modules/item/back/methods/item-shelving/specs/getInventory.spec.js @@ -0,0 +1,19 @@ +const models = require('vn-loopback/server/server').models; + +describe('itemShelving getInventory()', () => { + it('should return a list of itemShelvings', async() => { + const tx = await models.ItemShelving.beginTransaction({}); + + let response; + try { + const options = {transaction: tx}; + response = await models.ItemShelving.getInventory(1, 2, options); + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } + + expect(response.length).toEqual(2); + }); +}); diff --git a/modules/item/back/models/item-shelving.js b/modules/item/back/models/item-shelving.js index 5f372a3be..98ff18931 100644 --- a/modules/item/back/models/item-shelving.js +++ b/modules/item/back/models/item-shelving.js @@ -1,3 +1,4 @@ module.exports = Self => { require('../methods/item-shelving/deleteItemShelvings')(Self); + require('../methods/item-shelving/getInventory')(Self); }; From b3a7a170f0522ff693be1684d3201b8914a8ca7e Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 18 Jul 2023 11:54:43 +0200 Subject: [PATCH 33/53] =?UTF-8?q?refs=20#5934=20feat:=20a=C3=B1adido=20cli?= =?UTF-8?q?entSms=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/changes/233001/00-clientSms.sql | 15 +++++++ modules/client/back/methods/client/sendSms.js | 8 +++- modules/client/back/model-config.json | 3 ++ modules/client/back/models/client-sms.json | 29 +++++++++++++ modules/client/back/models/sms.json | 2 +- modules/client/front/index.js | 1 + modules/client/front/routes.json | 7 ++++ modules/client/front/sms/index.html | 42 +++++++++++++++++++ modules/client/front/sms/index.js | 39 +++++++++++++++++ modules/client/front/sms/locale/es.yml | 2 + 10 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 db/changes/233001/00-clientSms.sql create mode 100644 modules/client/back/models/client-sms.json create mode 100644 modules/client/front/sms/index.html create mode 100644 modules/client/front/sms/index.js create mode 100644 modules/client/front/sms/locale/es.yml diff --git a/db/changes/233001/00-clientSms.sql b/db/changes/233001/00-clientSms.sql new file mode 100644 index 000000000..353041ad9 --- /dev/null +++ b/db/changes/233001/00-clientSms.sql @@ -0,0 +1,15 @@ +CREATE TABLE `vn`.`clientSms` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `clientFk` int(11) NOT NULL, + `smsFk` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`id`), + KEY `clientSms_FK` (`clientFk`), + KEY `clientSms_FK_1` (`smsFk`), + CONSTRAINT `clientSms_FK` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON UPDATE CASCADE, + CONSTRAINT `clientSms_FK_1` FOREIGN KEY (`smsFk`) REFERENCES `sms` (`id`) ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; + +INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) + VALUES + ('ClientSms', '*', 'READ', 'ALLOW', 'ROLE', 'employee'), + ('ClientSms', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'); diff --git a/modules/client/back/methods/client/sendSms.js b/modules/client/back/methods/client/sendSms.js index 83b7c8d6e..270d7e5b5 100644 --- a/modules/client/back/methods/client/sendSms.js +++ b/modules/client/back/methods/client/sendSms.js @@ -7,7 +7,7 @@ module.exports = Self => { arg: 'id', type: 'number', required: true, - description: 'The ticket id', + description: 'The client id', http: {source: 'path'} }, { @@ -33,6 +33,12 @@ module.exports = Self => { Self.sendSms = async(ctx, id, destination, message) => { const models = Self.app.models; const sms = await models.Sms.send(ctx, destination, message); + + await models.ClientSms.create({ + clientFk: id, + smsFk: sms.id + }); + return sms; }; }; diff --git a/modules/client/back/model-config.json b/modules/client/back/model-config.json index 1e06ea1c0..bc48ec360 100644 --- a/modules/client/back/model-config.json +++ b/modules/client/back/model-config.json @@ -95,6 +95,9 @@ "ClientSample": { "dataSource": "vn" }, + "ClientSms": { + "dataSource": "vn" + }, "Sms": { "dataSource": "vn" }, diff --git a/modules/client/back/models/client-sms.json b/modules/client/back/models/client-sms.json new file mode 100644 index 000000000..18d7ad051 --- /dev/null +++ b/modules/client/back/models/client-sms.json @@ -0,0 +1,29 @@ +{ + "name": "ClientSms", + "base": "VnModel", + "options": { + "mysql": { + "table": "clientSms" + } + }, + "properties": { + "id": { + "type": "number", + "id": true, + "description": "Identifier" + }, + "clientFk": { + "type": "number" + }, + "smsFk": { + "type": "number" + } + }, + "relations": { + "sms": { + "type": "belongsTo", + "model": "Sms", + "foreignKey": "smsFk" + } + } +} diff --git a/modules/client/back/models/sms.json b/modules/client/back/models/sms.json index 4639131ef..8f349b073 100644 --- a/modules/client/back/models/sms.json +++ b/modules/client/back/models/sms.json @@ -36,7 +36,7 @@ } }, "relations": { - "sender": { + "user": { "type": "belongsTo", "model": "VnUser", "foreignKey": "senderFk" diff --git a/modules/client/front/index.js b/modules/client/front/index.js index c7e39ea5d..62076459b 100644 --- a/modules/client/front/index.js +++ b/modules/client/front/index.js @@ -48,4 +48,5 @@ import './notification'; import './unpaid'; import './extended-list'; import './credit-management'; +import './sms'; diff --git a/modules/client/front/routes.json b/modules/client/front/routes.json index 01d1b53bf..773b7b22a 100644 --- a/modules/client/front/routes.json +++ b/modules/client/front/routes.json @@ -23,6 +23,7 @@ {"state": "client.card.recovery.index", "icon": "icon-recovery"}, {"state": "client.card.webAccess", "icon": "cloud"}, {"state": "client.card.log", "icon": "history"}, + {"state": "client.card.sms", "icon": "contact_support"}, { "description": "Credit management", "icon": "monetization_on", @@ -373,6 +374,12 @@ "component": "vn-client-log", "description": "Log" }, + { + "url" : "/sms", + "state": "client.card.sms", + "component": "vn-client-sms", + "description": "Sms" + }, { "url": "/dms", "state": "client.card.dms", diff --git a/modules/client/front/sms/index.html b/modules/client/front/sms/index.html new file mode 100644 index 000000000..db944e3b0 --- /dev/null +++ b/modules/client/front/sms/index.html @@ -0,0 +1,42 @@ + + + + + + + + Sender + Number sender + Destination + Message + Status + Created + + + + + + + {{::clientSms.sms.user.name}} + + + {{::clientSms.sms.sender}} + {{::clientSms.sms.destination}} + {{::clientSms.sms.message}} + {{::clientSms.sms.status}} + {{::clientSms.sms.created | date:'dd/MM/yyyy HH:mm'}} + + + + + + + diff --git a/modules/client/front/sms/index.js b/modules/client/front/sms/index.js new file mode 100644 index 000000000..1478b78e9 --- /dev/null +++ b/modules/client/front/sms/index.js @@ -0,0 +1,39 @@ +import ngModule from '../module'; +import Section from 'salix/components/section'; + +export default class Controller extends Section { + constructor($element, $) { + super($element, $); + + this.filter = { + fields: ['id', 'smsFk'], + include: { + relation: 'sms', + scope: { + fields: [ + 'senderFk', + 'sender', + 'destination', + 'message', + 'statusCode', + 'status', + 'created'], + include: { + relation: 'user', + scope: { + fields: ['name'] + } + } + } + } + }; + } +} + +ngModule.vnComponent('vnClientSms', { + template: require('./index.html'), + controller: Controller, + bindings: { + client: '<' + } +}); diff --git a/modules/client/front/sms/locale/es.yml b/modules/client/front/sms/locale/es.yml new file mode 100644 index 000000000..6d1e9e147 --- /dev/null +++ b/modules/client/front/sms/locale/es.yml @@ -0,0 +1,2 @@ +Sender: Remitente +Number sender: Número remitente From 3e8775149a4dc286ebedeeb4cd9b95a4157d2596 Mon Sep 17 00:00:00 2001 From: vicent Date: Tue, 18 Jul 2023 13:02:42 +0200 Subject: [PATCH 34/53] refs #5934 feat: change icon --- modules/client/back/models/sms.json | 2 +- modules/client/front/routes.json | 2 +- modules/client/front/sms/index.html | 4 +--- modules/client/front/sms/index.js | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/client/back/models/sms.json b/modules/client/back/models/sms.json index 8f349b073..4639131ef 100644 --- a/modules/client/back/models/sms.json +++ b/modules/client/back/models/sms.json @@ -36,7 +36,7 @@ } }, "relations": { - "user": { + "sender": { "type": "belongsTo", "model": "VnUser", "foreignKey": "senderFk" diff --git a/modules/client/front/routes.json b/modules/client/front/routes.json index 773b7b22a..63d6709e5 100644 --- a/modules/client/front/routes.json +++ b/modules/client/front/routes.json @@ -23,7 +23,7 @@ {"state": "client.card.recovery.index", "icon": "icon-recovery"}, {"state": "client.card.webAccess", "icon": "cloud"}, {"state": "client.card.log", "icon": "history"}, - {"state": "client.card.sms", "icon": "contact_support"}, + {"state": "client.card.sms", "icon": "sms"}, { "description": "Credit management", "icon": "monetization_on", diff --git a/modules/client/front/sms/index.html b/modules/client/front/sms/index.html index db944e3b0..3331f217b 100644 --- a/modules/client/front/sms/index.html +++ b/modules/client/front/sms/index.html @@ -13,7 +13,6 @@ Sender - Number sender Destination Message Status @@ -24,10 +23,9 @@ - {{::clientSms.sms.user.name}} + {{::clientSms.sms.sender.name}} - {{::clientSms.sms.sender}} {{::clientSms.sms.destination}} {{::clientSms.sms.message}} {{::clientSms.sms.status}} diff --git a/modules/client/front/sms/index.js b/modules/client/front/sms/index.js index 1478b78e9..6ad64282e 100644 --- a/modules/client/front/sms/index.js +++ b/modules/client/front/sms/index.js @@ -19,7 +19,7 @@ export default class Controller extends Section { 'status', 'created'], include: { - relation: 'user', + relation: 'sender', scope: { fields: ['name'] } From 9076553070b5ff5e7399eeb5df7d28904a86ba79 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 18 Jul 2023 14:11:50 +0200 Subject: [PATCH 35/53] refs #5983 test(itemShelving): add getInventory --- .../233001/00-itemShelving_inventory.sql | 94 +++++++++++-------- db/dump/fixtures.sql | 12 ++- .../item-shelving/specs/getInventory.spec.js | 7 +- 3 files changed, 70 insertions(+), 43 deletions(-) diff --git a/db/changes/233001/00-itemShelving_inventory.sql b/db/changes/233001/00-itemShelving_inventory.sql index b2a2ff321..c66ad69e9 100644 --- a/db/changes/233001/00-itemShelving_inventory.sql +++ b/db/changes/233001/00-itemShelving_inventory.sql @@ -1,52 +1,64 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_inventory`(vParkingFromFk INT, vParkingToFk INT) +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelving_inventory`(vParkingFromFk VARCHAR(8), vParkingToFk VARCHAR(8)) +BEGIN /** * Devuelve un listado de ubicaciones a revisar * - * @param vParkingFromFk Parking de partida, identificador de vn.parking - * @param vParkingToFk Parking de llegada, identificador de vn.parking + * @param vParkingFromFk Parking de partida, identificador de parking + * @param vParkingToFk Parking de llegada, identificador de parking */ DECLARE vSectorFk INT; DECLARE vPickingOrderFrom INT; - DECLARE vPickingOrderTo INT; - - SELECT ish.id, - p.pickingOrder, - p.code parking, - ish.shelvingFk, - ish.itemFk, - i.longName, - ish.visible, - p.sectorFk, - it.workerFk buyer, - CONCAT('http:',ic.url, '/catalog/1600x900/',i.image) urlImage, - ish.isChecked, - CASE - WHEN s.notPrepared > sm.parked THEN 0 - WHEN sm.visible > sm.parked THEN 1 - ELSE 2 - END - FROM vn.itemShelving ish - JOIN vn.item i ON i.id = ish.itemFk - JOIN vn.itemType it ON it.id = i.typeFk - JOIN tmp.stockMisfit sm ON sm.itemFk = ish.itemFk - JOIN vn.shelving sh ON sh.code = ish.shelvingFk - JOIN vn.parking p ON p.id = sh.parkingFk - JOIN (SELECT s.itemFk, sum(s.quantity) notPrepared - FROM vn.sale s - JOIN vn.ticket t ON t.id = s.ticketFk - JOIN vn.warehouse w ON w.id = t.warehouseFk - WHERE t.shipped BETWEEN CURDATE() - AND CURDATE() + INTERVAL 23 HOUR - AND s.isPicked = FALSE - AND w.name = 'Algemesi' - GROUP BY s.itemFk) s ON s.itemFk = i.id - JOIN hedera.imageConfig ic - WHERE p.pickingOrder BETWEEN vParkingFrom AND vPickingOrderTo - AND p.sectorFk = vSectorFk - ORDER BY p.pickingOrder; + DECLARE vPickingOrderTo INT; -END ;; + SELECT p.sectorFk, p.pickingOrder INTO vSectorFk, vPickingOrderFrom + FROM vn.parking p + WHERE p.code = vParkingFromFk COLLATE 'utf8mb3_general_ci'; + + SELECT p.pickingOrder INTO vPickingOrderTo + FROM vn.parking p + WHERE p.code = vParkingToFk COLLATE 'utf8mb3_general_ci'; + + CALL vn.visible_getMisfit(vSectorFk); + + SELECT ish.id, + p.pickingOrder, + p.code parking, + ish.shelvingFk, + ish.itemFk, + i.longName, + ish.visible, + p.sectorFk, + it.workerFk buyer, + CONCAT('http:',ic.url, '/catalog/1600x900/',i.image) urlImage, + ish.isChecked, + CASE + WHEN s.notPrepared > sm.parked THEN 0 + WHEN sm.visible > sm.parked THEN 1 + ELSE 2 + END priority + FROM vn.itemShelving ish + JOIN vn.item i ON i.id = ish.itemFk + JOIN vn.itemType it ON it.id = i.typeFk + JOIN tmp.stockMisfit sm ON sm.itemFk = ish.itemFk + JOIN vn.shelving sh ON sh.code = ish.shelvingFk + JOIN vn.parking p ON p.id = sh.parkingFk + JOIN (SELECT s.itemFk, sum(s.quantity) notPrepared + FROM vn.sale s + JOIN vn.ticket t ON t.id = s.ticketFk + JOIN vn.warehouse w ON w.id = t.warehouseFk + JOIN vn.config c ON c.mainWarehouseFk = w.id + WHERE t.shipped BETWEEN util.VN_CURDATE() + AND util.VN_CURDATE() + INTERVAL 23 HOUR + AND s.isPicked = FALSE + GROUP BY s.itemFk) s ON s.itemFk = i.id + JOIN hedera.imageConfig ic + WHERE p.pickingOrder BETWEEN vPickingOrderFrom AND vPickingOrderTo + AND p.sectorFk = vSectorFk + ORDER BY p.pickingOrder; + +END$$ DELIMITER ; + diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index fe11d5b64..670a45778 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -37,7 +37,7 @@ ALTER TABLE `vn`.`ticket` AUTO_INCREMENT = 1; INSERT INTO `salix`.`AccessToken` (`id`, `ttl`, `created`, `userId`) VALUES - ('DEFAULT_TOKEN', '1209600', util.VN_CURDATE(), 66); + ('DEFAULT_TOKEN', '1209600', CURDATE(), 66); INSERT INTO `salix`.`printConfig` (`id`, `itRecipient`, `incidencesEmail`) VALUES @@ -2953,3 +2953,13 @@ INSERT INTO `vn`.`invoiceInSerial` (`code`, `description`, `cplusTerIdNifFk`, `t ('E', 'Midgard', 1, 'CEE'), ('R', 'Jotunheim', 1, 'NATIONAL'), ('W', 'Vanaheim', 1, 'WORLD'); + + +INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`) + VALUES + (1, 0, 0, 'marvel.com'); + +/* DELETE ME */ +UPDATE vn.config + SET mainWarehouseFk=1 + WHERE id=1; \ No newline at end of file diff --git a/modules/item/back/methods/item-shelving/specs/getInventory.spec.js b/modules/item/back/methods/item-shelving/specs/getInventory.spec.js index 76cc39073..6a8c9804c 100644 --- a/modules/item/back/methods/item-shelving/specs/getInventory.spec.js +++ b/modules/item/back/methods/item-shelving/specs/getInventory.spec.js @@ -7,7 +7,12 @@ describe('itemShelving getInventory()', () => { let response; try { const options = {transaction: tx}; - response = await models.ItemShelving.getInventory(1, 2, options); + await models.ItemShelving.rawSql(` + UPDATE vn.config + SET mainWarehouseFk=1 + WHERE id=1 + `, null, options); + response = await models.ItemShelving.getInventory('100-01', 'LR-02-3', options); await tx.rollback(); } catch (e) { await tx.rollback(); From bd723bb7ba540771f786ecd3bc9972781d92e0ca Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 18 Jul 2023 15:01:58 +0200 Subject: [PATCH 36/53] refs #5824 mod ng --- modules/item/front/fixed-price/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/item/front/fixed-price/index.html b/modules/item/front/fixed-price/index.html index d9a955fe1..f1f6e1419 100644 --- a/modules/item/front/fixed-price/index.html +++ b/modules/item/front/fixed-price/index.html @@ -85,7 +85,7 @@ show-field="id" value-field="id" search-function="$ctrl.itemSearchFunc($search)" - on-change="$ctrl.upsertPrice(price, true)" + ng-change="$ctrl.upsertPrice(price, true)" order="id DESC" tabindex="1"> From 49c656928ed8049f00f333c4e7cb482d836cefd1 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 18 Jul 2023 15:43:11 +0200 Subject: [PATCH 37/53] refs #5983 feat(itemShelving): add visible --- modules/item/back/models/item-shelving.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/item/back/models/item-shelving.json b/modules/item/back/models/item-shelving.json index 49bebcb6b..be379adca 100644 --- a/modules/item/back/models/item-shelving.json +++ b/modules/item/back/models/item-shelving.json @@ -23,6 +23,9 @@ }, "isChecked": { "type": "boolean" + }, + "visible": { + "type": "number" } }, "relations": { From 85c017431ce9c199bfa0f7f5a1e394cd43b8931f Mon Sep 17 00:00:00 2001 From: sergiodt Date: Wed, 19 Jul 2023 07:01:43 +0200 Subject: [PATCH 38/53] refs #5983 fix(itemShelving): fixtures --- db/dump/fixtures.sql | 5 ----- 1 file changed, 5 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 670a45778..eaa00a3de 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2958,8 +2958,3 @@ INSERT INTO `vn`.`invoiceInSerial` (`code`, `description`, `cplusTerIdNifFk`, `t INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`) VALUES (1, 0, 0, 'marvel.com'); - -/* DELETE ME */ -UPDATE vn.config - SET mainWarehouseFk=1 - WHERE id=1; \ No newline at end of file From b17de86fb1f7f94e6f892f0662ec09d8d5d467f8 Mon Sep 17 00:00:00 2001 From: jorgep Date: Wed, 19 Jul 2023 12:15:52 +0200 Subject: [PATCH 39/53] refs #6043 add ACL --- db/changes/233001/00-fixACLVehicle.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 db/changes/233001/00-fixACLVehicle.sql diff --git a/db/changes/233001/00-fixACLVehicle.sql b/db/changes/233001/00-fixACLVehicle.sql new file mode 100644 index 000000000..6625f0d5c --- /dev/null +++ b/db/changes/233001/00-fixACLVehicle.sql @@ -0,0 +1,3 @@ +INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalId`) + VALUES + ('Vehicle','sorted','WRITE','ALLOW','employee'); \ No newline at end of file From 7cff0149887a1eb09d586a51212798caa97d570a Mon Sep 17 00:00:00 2001 From: sergiodt Date: Wed, 19 Jul 2023 13:27:31 +0200 Subject: [PATCH 40/53] refs #5983 fix(itemShelving): vn --- .../233001/00-itemShelving_inventory.sql | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/db/changes/233001/00-itemShelving_inventory.sql b/db/changes/233001/00-itemShelving_inventory.sql index c66ad69e9..b0b080ef3 100644 --- a/db/changes/233001/00-itemShelving_inventory.sql +++ b/db/changes/233001/00-itemShelving_inventory.sql @@ -14,14 +14,14 @@ BEGIN DECLARE vPickingOrderTo INT; SELECT p.sectorFk, p.pickingOrder INTO vSectorFk, vPickingOrderFrom - FROM vn.parking p + FROM parking p WHERE p.code = vParkingFromFk COLLATE 'utf8mb3_general_ci'; SELECT p.pickingOrder INTO vPickingOrderTo - FROM vn.parking p + FROM parking p WHERE p.code = vParkingToFk COLLATE 'utf8mb3_general_ci'; - CALL vn.visible_getMisfit(vSectorFk); + CALL visible_getMisfit(vSectorFk); SELECT ish.id, p.pickingOrder, @@ -39,19 +39,19 @@ BEGIN WHEN sm.visible > sm.parked THEN 1 ELSE 2 END priority - FROM vn.itemShelving ish - JOIN vn.item i ON i.id = ish.itemFk - JOIN vn.itemType it ON it.id = i.typeFk + FROM itemShelving ish + JOIN item i ON i.id = ish.itemFk + JOIN itemType it ON it.id = i.typeFk JOIN tmp.stockMisfit sm ON sm.itemFk = ish.itemFk - JOIN vn.shelving sh ON sh.code = ish.shelvingFk - JOIN vn.parking p ON p.id = sh.parkingFk + JOIN shelving sh ON sh.code = ish.shelvingFk + JOIN parking p ON p.id = sh.parkingFk JOIN (SELECT s.itemFk, sum(s.quantity) notPrepared - FROM vn.sale s - JOIN vn.ticket t ON t.id = s.ticketFk - JOIN vn.warehouse w ON w.id = t.warehouseFk - JOIN vn.config c ON c.mainWarehouseFk = w.id + FROM sale s + JOIN ticket t ON t.id = s.ticketFk + JOIN warehouse w ON w.id = t.warehouseFk + JOIN config c ON c.mainWarehouseFk = w.id WHERE t.shipped BETWEEN util.VN_CURDATE() - AND util.VN_CURDATE() + INTERVAL 23 HOUR + AND util.dayEnd(util.VN_CURDATE()) AND s.isPicked = FALSE GROUP BY s.itemFk) s ON s.itemFk = i.id JOIN hedera.imageConfig ic From ab95ef74a945c4c232f2cb6a9a73c9c51f767147 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 20 Jul 2023 07:17:35 +0200 Subject: [PATCH 41/53] refs #5934 refactor: nombres variables --- db/changes/233001/00-clientSms.sql | 6 +++--- modules/client/back/models/client-sms.json | 3 --- modules/client/front/sms/index.html | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/db/changes/233001/00-clientSms.sql b/db/changes/233001/00-clientSms.sql index 353041ad9..e1e34f6b2 100644 --- a/db/changes/233001/00-clientSms.sql +++ b/db/changes/233001/00-clientSms.sql @@ -7,9 +7,9 @@ CREATE TABLE `vn`.`clientSms` ( KEY `clientSms_FK_1` (`smsFk`), CONSTRAINT `clientSms_FK` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON UPDATE CASCADE, CONSTRAINT `clientSms_FK_1` FOREIGN KEY (`smsFk`) REFERENCES `sms` (`id`) ON UPDATE CASCADE -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES - ('ClientSms', '*', 'READ', 'ALLOW', 'ROLE', 'employee'), - ('ClientSms', '*', 'WRITE', 'ALLOW', 'ROLE', 'employee'); + ('ClientSms', 'find', 'READ', 'ALLOW', 'ROLE', 'employee'), + ('ClientSms', 'create', 'WRITE', 'ALLOW', 'ROLE', 'employee'); diff --git a/modules/client/back/models/client-sms.json b/modules/client/back/models/client-sms.json index 18d7ad051..b2244ebbb 100644 --- a/modules/client/back/models/client-sms.json +++ b/modules/client/back/models/client-sms.json @@ -14,9 +14,6 @@ }, "clientFk": { "type": "number" - }, - "smsFk": { - "type": "number" } }, "relations": { diff --git a/modules/client/front/sms/index.html b/modules/client/front/sms/index.html index 3331f217b..9abadd312 100644 --- a/modules/client/front/sms/index.html +++ b/modules/client/front/sms/index.html @@ -3,7 +3,7 @@ url="ClientSms" link="{clientFk: $ctrl.$params.id}" filter="::$ctrl.filter" - data="clientSmss" + data="clientSmsList" limit="20" auto-load="true"> @@ -20,7 +20,7 @@ - + {{::clientSms.sms.sender.name}} From 60e75d7825cfdc9c5222700ac0f36cf3d92101e0 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 20 Jul 2023 08:23:43 +0200 Subject: [PATCH 42/53] refs #5837 fix client condition --- modules/client/back/models/client.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js index 163d51fc5..8369fa906 100644 --- a/modules/client/back/models/client.js +++ b/modules/client/back/models/client.js @@ -41,6 +41,9 @@ module.exports = Self => { }); async function socialNameIsUnique(err, done) { + if (!this.countryFk) + return done(); + const filter = { include: { relation: 'country', @@ -59,13 +62,11 @@ module.exports = Self => { } }; - const existingClient = await Self.app.models.Client.findOne(filter); + const client = await Self.app.models.Country.findById(this.countryFk, {fields: ['isSocialNameUnique']}); + const existingClient = await Self.findOne(filter); - if (existingClient) { - // eslint-disable-next-line max-len - if (existingClient.country().isSocialNameUnique && this.socialName === existingClient.socialName) - err(); - } + if (existingClient && (existingClient.country().isSocialNameUnique || client.isSocialNameUnique)) + err(); done(); } From 0585080303f72750987698c299e4d716ca13890f Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 20 Jul 2023 09:26:40 +0200 Subject: [PATCH 43/53] refs #6011 deploy 2330 version --- CHANGELOG.md | 5 +++++ db/changes/232401/00-ACLgetVehiclesSorted.sql | 3 --- db/changes/{232801 => 233001}/00-roadmap.sql | 2 -- db/changes/{232801 => 233001}/00-roadmapACL.sql | 0 4 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 db/changes/232401/00-ACLgetVehiclesSorted.sql rename db/changes/{232801 => 233001}/00-roadmap.sql (69%) rename db/changes/{232801 => 233001}/00-roadmapACL.sql (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76527ac83..847275825 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2330.01] - 2023-07-27 ### Added +- (Artículos -> Vista Previa) Añadido campo "Plástico reciclado" +- (Rutas -> Troncales) Nueva sección +- (Tickets -> Opciones) Opción establecer peso ### Changed +- (General -> Iconos) Añadidos nuevos iconos + ### Fixed diff --git a/db/changes/232401/00-ACLgetVehiclesSorted.sql b/db/changes/232401/00-ACLgetVehiclesSorted.sql deleted file mode 100644 index 6625f0d5c..000000000 --- a/db/changes/232401/00-ACLgetVehiclesSorted.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalId`) - VALUES - ('Vehicle','sorted','WRITE','ALLOW','employee'); \ No newline at end of file diff --git a/db/changes/232801/00-roadmap.sql b/db/changes/233001/00-roadmap.sql similarity index 69% rename from db/changes/232801/00-roadmap.sql rename to db/changes/233001/00-roadmap.sql index a2835160f..9b5db54eb 100644 --- a/db/changes/232801/00-roadmap.sql +++ b/db/changes/233001/00-roadmap.sql @@ -6,5 +6,3 @@ ALTER TABLE `vn`.`roadmap` CHANGE name name varchar(45) CHARACTER SET utf8mb3 CO ALTER TABLE `vn`.`roadmap` MODIFY COLUMN etd datetime NOT NULL; ALTER TABLE `vn`.`expeditionTruck` COMMENT='Distintas paradas que hacen los trocales'; -ALTER TABLE `vn`.`expeditionTruck` DROP FOREIGN KEY expeditionTruck_FK_2; -ALTER TABLE `vn`.`expeditionTruck` ADD CONSTRAINT expeditionTruck_FK_2 FOREIGN KEY (roadmapFk) REFERENCES vn.roadmap(id) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/db/changes/232801/00-roadmapACL.sql b/db/changes/233001/00-roadmapACL.sql similarity index 100% rename from db/changes/232801/00-roadmapACL.sql rename to db/changes/233001/00-roadmapACL.sql From 071a891d30079e13792765a7578b5aae03da6ee2 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 20 Jul 2023 09:30:18 +0200 Subject: [PATCH 44/53] refs #6011 add changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 847275825..d5928e9c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,9 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - (Artículos -> Vista Previa) Añadido campo "Plástico reciclado" - (Rutas -> Troncales) Nueva sección - (Tickets -> Opciones) Opción establecer peso +- (Clientes -> SMS) Nueva sección ### Changed - (General -> Iconos) Añadidos nuevos iconos +- (Clientes -> Razón social) Nuevas restricciones por pais ### Fixed From 44ceeac9c4195ed2808fa9a8be20bd53bd9ed5f1 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 25 Jul 2023 10:21:54 +0200 Subject: [PATCH 45/53] refs #5983 feat(itemShelving): add userFk field --- modules/item/back/models/item-shelving.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/item/back/models/item-shelving.json b/modules/item/back/models/item-shelving.json index be379adca..8628bfeee 100644 --- a/modules/item/back/models/item-shelving.json +++ b/modules/item/back/models/item-shelving.json @@ -25,6 +25,9 @@ "type": "boolean" }, "visible": { + "type": "number" + }, + "userFk": { "type": "number" } }, From 2a0c363dc5443091d71df034da772032b56191e3 Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 26 Jul 2023 13:28:40 +0200 Subject: [PATCH 46/53] hotfix change model --- .../assets/files/{model.ezp => model.ezpx} | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename print/templates/email/printer-setup/assets/files/{model.ezp => model.ezpx} (95%) diff --git a/print/templates/email/printer-setup/assets/files/model.ezp b/print/templates/email/printer-setup/assets/files/model.ezpx similarity index 95% rename from print/templates/email/printer-setup/assets/files/model.ezp rename to print/templates/email/printer-setup/assets/files/model.ezpx index dba98e0ee..739593447 100644 --- a/print/templates/email/printer-setup/assets/files/model.ezp +++ b/print/templates/email/printer-setup/assets/files/model.ezpx @@ -539,9 +539,9 @@ 2 4 - + false - false + true 4294967295 5 W5 @@ -571,15 +571,15 @@ 2896 - 187 - 24 + 138 + 32 426 2896 - 187 - 24 + 138 + 32 426 2896 @@ -621,14 +621,14 @@ New label -Lang:(es-ES) OS:Microsoft Windows NT 10.0.22000.0(Win32NT) +Lang:(es-ES) OS:Microsoft Windows NT 10.0.19045.0(Win32NT) Mm 203 EZPL - GODEX G300#132207AB - None + 00000000 + COM1 USB 2886794855 9100 From 1277af1399ff877069a7f33840e1174f374ba11c Mon Sep 17 00:00:00 2001 From: carlossa Date: Wed, 26 Jul 2023 13:53:15 +0200 Subject: [PATCH 47/53] hotfix mod path --- print/templates/email/printer-setup/attachments.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/print/templates/email/printer-setup/attachments.json b/print/templates/email/printer-setup/attachments.json index 1e1f710c3..969fdd23a 100644 --- a/print/templates/email/printer-setup/attachments.json +++ b/print/templates/email/printer-setup/attachments.json @@ -1,9 +1,9 @@ [ { - "filename": "model.ezp", + "filename": "model.ezpx", "component": "printer-setup", - "path": "/assets/files/model.ezp", - "cid": "model.ezp" + "path": "/assets/files/model.ezpx", + "cid": "model.ezpx" }, { "filename": "port.png", @@ -11,4 +11,4 @@ "path": "/assets/files/port.png", "cid": "port.png" } -] \ No newline at end of file +] From 29baa2f0c7d7998864863761adca7eb30b6608bc Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 27 Jul 2023 08:27:09 +0200 Subject: [PATCH 48/53] refs #6015 modify changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5928e9c4..8440e0f2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - (General -> Iconos) Añadidos nuevos iconos -- (Clientes -> Razón social) Nuevas restricciones por pais +- (Clientes -> Razón social) Permite crear clientes con la misma razón social según el país ### Fixed From 3bc3ffe1153644fc568d24176e6ca3590d36f491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Thu, 27 Jul 2023 13:40:39 +0200 Subject: [PATCH 49/53] refs #6077 Log-InvoiceInDueday-incorrecto --- .../invoiceIn/back/locale/invoiceIn/en.yml | 20 +++++++++++++++++++ .../invoiceIn/back/locale/invoiceIn/es.yml | 20 +++++++++++++++++++ .../back/locale/invoiceInDueDay/en.yml | 9 +++++++++ .../back/locale/invoiceInDueDay/es.yml | 9 +++++++++ .../invoiceIn/back/locale/invoiceInTax/en.yml | 12 +++++++++++ .../invoiceIn/back/locale/invoiceInTax/es.yml | 12 +++++++++++ 6 files changed, 82 insertions(+) create mode 100644 modules/invoiceIn/back/locale/invoiceIn/en.yml create mode 100644 modules/invoiceIn/back/locale/invoiceIn/es.yml create mode 100644 modules/invoiceIn/back/locale/invoiceInDueDay/en.yml create mode 100644 modules/invoiceIn/back/locale/invoiceInDueDay/es.yml create mode 100644 modules/invoiceIn/back/locale/invoiceInTax/en.yml create mode 100644 modules/invoiceIn/back/locale/invoiceInTax/es.yml diff --git a/modules/invoiceIn/back/locale/invoiceIn/en.yml b/modules/invoiceIn/back/locale/invoiceIn/en.yml new file mode 100644 index 000000000..4110dcdbc --- /dev/null +++ b/modules/invoiceIn/back/locale/invoiceIn/en.yml @@ -0,0 +1,20 @@ +name: invoice in +columns: + id: id + serialNumber: serial number + serial: serial + supplierFk: supplier + issued: issued + supplierRef: supplierRef + isBooked: is booked + currencyFk: currency + created: created + companyFk: company + docFk: document + booked: booked + operated: operated + bookEntried: book entried + isVatDeductible: is VAT deductible + withholdingSageFk: withholding + expenceFkDeductible: expence deductible + editorFk: editor \ No newline at end of file diff --git a/modules/invoiceIn/back/locale/invoiceIn/es.yml b/modules/invoiceIn/back/locale/invoiceIn/es.yml new file mode 100644 index 000000000..432b27cb3 --- /dev/null +++ b/modules/invoiceIn/back/locale/invoiceIn/es.yml @@ -0,0 +1,20 @@ +name: factura recibida +columns: + id: id + serialNumber: número de serie + serial: serie + supplierFk: proveedor + issued: fecha emisión + supplierRef: referéncia proveedor + isBooked: facturado + currencyFk: moneda + created: creado + companyFk: empresa + docFk: documento + booked: fecha contabilización + operated: fecha entrega + bookEntried: fecha asiento + isVatDeductible: impuesto deducible + withholdingSageFk: código de retención + expenceFkDeductible: gasto deducible + editorFk: editor \ No newline at end of file diff --git a/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml b/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml new file mode 100644 index 000000000..5e42dfc66 --- /dev/null +++ b/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml @@ -0,0 +1,9 @@ +name: invoice in due day +columns: + id: id + invoiceInFk: invoice in + dueDated: due date + bankFk: bank + amount: amount + foreignValue : foreign amount + created: created diff --git a/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml b/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml new file mode 100644 index 000000000..168db9803 --- /dev/null +++ b/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml @@ -0,0 +1,9 @@ +name: vencimientos factura recibida +columns: + id: id + invoiceInFk: factura + dueDated: fecha vto. + bankFk: banco + amount: importe + foreignValue : importe divisa + created: creado diff --git a/modules/invoiceIn/back/locale/invoiceInTax/en.yml b/modules/invoiceIn/back/locale/invoiceInTax/en.yml new file mode 100644 index 000000000..86a9e42c3 --- /dev/null +++ b/modules/invoiceIn/back/locale/invoiceInTax/en.yml @@ -0,0 +1,12 @@ +name: invoice in tax +colmns: + id: id + invoiceInFk: invoice in + taxCodeFk: tax + taxableBase: taxable base + expenceFk: expence + foreignValue: foreign amount + taxTypeSageFk: tax type + transactionTypeSageFk: transaction type + created: created + editorFk: editor diff --git a/modules/invoiceIn/back/locale/invoiceInTax/es.yml b/modules/invoiceIn/back/locale/invoiceInTax/es.yml new file mode 100644 index 000000000..233c591e9 --- /dev/null +++ b/modules/invoiceIn/back/locale/invoiceInTax/es.yml @@ -0,0 +1,12 @@ +name: factura recibida impuesto +colmns: + id: id + invoiceInFk: factura recibida + taxCodeFk: código IVA + taxableBase: base imponible + expenceFk: código gasto + foreignValue: importe divisa + taxTypeSageFk: código impuesto + transactionTypeSageFk: código transacción + created: creado + editorFk: editor \ No newline at end of file From 4061f3e5ce87668745a74e04986aaee49c35e926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 28 Jul 2023 12:28:41 +0200 Subject: [PATCH 50/53] #refs 6077 espacios por tabulaciones --- .../invoiceIn/back/locale/invoiceIn/en.yml | 36 +++++++++---------- .../invoiceIn/back/locale/invoiceIn/es.yml | 36 +++++++++---------- .../back/locale/invoiceInDueDay/en.yml | 14 ++++---- .../back/locale/invoiceInDueDay/es.yml | 14 ++++---- .../invoiceIn/back/locale/invoiceInTax/en.yml | 20 +++++------ .../invoiceIn/back/locale/invoiceInTax/es.yml | 20 +++++------ 6 files changed, 70 insertions(+), 70 deletions(-) diff --git a/modules/invoiceIn/back/locale/invoiceIn/en.yml b/modules/invoiceIn/back/locale/invoiceIn/en.yml index 4110dcdbc..5aa81b9ff 100644 --- a/modules/invoiceIn/back/locale/invoiceIn/en.yml +++ b/modules/invoiceIn/back/locale/invoiceIn/en.yml @@ -1,20 +1,20 @@ name: invoice in columns: - id: id - serialNumber: serial number - serial: serial - supplierFk: supplier - issued: issued - supplierRef: supplierRef - isBooked: is booked - currencyFk: currency - created: created - companyFk: company - docFk: document - booked: booked - operated: operated - bookEntried: book entried - isVatDeductible: is VAT deductible - withholdingSageFk: withholding - expenceFkDeductible: expence deductible - editorFk: editor \ No newline at end of file + id: id + serialNumber: serial number + serial: serial + supplierFk: supplier + issued: issued + supplierRef: supplierRef + isBooked: is booked + currencyFk: currency + created: created + companyFk: company + docFk: document + booked: booked + operated: operated + bookEntried: book entried + isVatDeductible: is VAT deductible + withholdingSageFk: withholding + expenceFkDeductible: expence deductible + editorFk: editor \ No newline at end of file diff --git a/modules/invoiceIn/back/locale/invoiceIn/es.yml b/modules/invoiceIn/back/locale/invoiceIn/es.yml index 432b27cb3..61f62f022 100644 --- a/modules/invoiceIn/back/locale/invoiceIn/es.yml +++ b/modules/invoiceIn/back/locale/invoiceIn/es.yml @@ -1,20 +1,20 @@ name: factura recibida columns: - id: id - serialNumber: número de serie - serial: serie - supplierFk: proveedor - issued: fecha emisión - supplierRef: referéncia proveedor - isBooked: facturado - currencyFk: moneda - created: creado - companyFk: empresa - docFk: documento - booked: fecha contabilización - operated: fecha entrega - bookEntried: fecha asiento - isVatDeductible: impuesto deducible - withholdingSageFk: código de retención - expenceFkDeductible: gasto deducible - editorFk: editor \ No newline at end of file + id: id + serialNumber: número de serie + serial: serie + supplierFk: proveedor + issued: fecha emisión + supplierRef: referéncia proveedor + isBooked: facturado + currencyFk: moneda + created: creado + companyFk: empresa + docFk: documento + booked: fecha contabilización + operated: fecha entrega + bookEntried: fecha asiento + isVatDeductible: impuesto deducible + withholdingSageFk: código de retención + expenceFkDeductible: gasto deducible + editorFk: editor \ No newline at end of file diff --git a/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml b/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml index 5e42dfc66..f01a0de46 100644 --- a/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml +++ b/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml @@ -1,9 +1,9 @@ name: invoice in due day columns: - id: id - invoiceInFk: invoice in - dueDated: due date - bankFk: bank - amount: amount - foreignValue : foreign amount - created: created + id: id + invoiceInFk: invoice in + dueDated: due date + bankFk: bank + amount: amount + foreignValue : foreign amount + created: created diff --git a/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml b/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml index 168db9803..34b20b37d 100644 --- a/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml +++ b/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml @@ -1,9 +1,9 @@ name: vencimientos factura recibida columns: - id: id - invoiceInFk: factura - dueDated: fecha vto. - bankFk: banco - amount: importe - foreignValue : importe divisa - created: creado + id: id + invoiceInFk: factura + dueDated: fecha vto. + bankFk: banco + amount: importe + foreignValue : importe divisa + created: creado diff --git a/modules/invoiceIn/back/locale/invoiceInTax/en.yml b/modules/invoiceIn/back/locale/invoiceInTax/en.yml index 86a9e42c3..374f62e7d 100644 --- a/modules/invoiceIn/back/locale/invoiceInTax/en.yml +++ b/modules/invoiceIn/back/locale/invoiceInTax/en.yml @@ -1,12 +1,12 @@ name: invoice in tax colmns: - id: id - invoiceInFk: invoice in - taxCodeFk: tax - taxableBase: taxable base - expenceFk: expence - foreignValue: foreign amount - taxTypeSageFk: tax type - transactionTypeSageFk: transaction type - created: created - editorFk: editor + id: id + invoiceInFk: invoice in + taxCodeFk: tax + taxableBase: taxable base + expenceFk: expence + foreignValue: foreign amount + taxTypeSageFk: tax type + transactionTypeSageFk: transaction type + created: created + editorFk: editor diff --git a/modules/invoiceIn/back/locale/invoiceInTax/es.yml b/modules/invoiceIn/back/locale/invoiceInTax/es.yml index 233c591e9..b20663dd4 100644 --- a/modules/invoiceIn/back/locale/invoiceInTax/es.yml +++ b/modules/invoiceIn/back/locale/invoiceInTax/es.yml @@ -1,12 +1,12 @@ name: factura recibida impuesto colmns: - id: id - invoiceInFk: factura recibida - taxCodeFk: código IVA - taxableBase: base imponible - expenceFk: código gasto - foreignValue: importe divisa - taxTypeSageFk: código impuesto - transactionTypeSageFk: código transacción - created: creado - editorFk: editor \ No newline at end of file + id: id + invoiceInFk: factura recibida + taxCodeFk: código IVA + taxableBase: base imponible + expenceFk: código gasto + foreignValue: importe divisa + taxTypeSageFk: código impuesto + transactionTypeSageFk: código transacción + created: creado + editorFk: editor \ No newline at end of file From 136b401ede36eed3d0e3cc9025a429bf74d48ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Fri, 28 Jul 2023 14:17:50 +0200 Subject: [PATCH 51/53] refs #6077 espacios correctos --- .../invoiceIn/back/locale/invoiceIn/en.yml | 36 +++++++++---------- .../invoiceIn/back/locale/invoiceIn/es.yml | 36 +++++++++---------- .../back/locale/invoiceInDueDay/en.yml | 14 ++++---- .../back/locale/invoiceInDueDay/es.yml | 14 ++++---- .../invoiceIn/back/locale/invoiceInTax/en.yml | 22 ++++++------ .../invoiceIn/back/locale/invoiceInTax/es.yml | 22 ++++++------ 6 files changed, 72 insertions(+), 72 deletions(-) diff --git a/modules/invoiceIn/back/locale/invoiceIn/en.yml b/modules/invoiceIn/back/locale/invoiceIn/en.yml index 5aa81b9ff..ec9a824b6 100644 --- a/modules/invoiceIn/back/locale/invoiceIn/en.yml +++ b/modules/invoiceIn/back/locale/invoiceIn/en.yml @@ -1,20 +1,20 @@ name: invoice in columns: - id: id - serialNumber: serial number - serial: serial - supplierFk: supplier - issued: issued - supplierRef: supplierRef - isBooked: is booked - currencyFk: currency - created: created - companyFk: company - docFk: document - booked: booked - operated: operated - bookEntried: book entried - isVatDeductible: is VAT deductible - withholdingSageFk: withholding - expenceFkDeductible: expence deductible - editorFk: editor \ No newline at end of file + id: id + serialNumber: serial number + serial: serial + supplierFk: supplier + issued: issued + supplierRef: supplierRef + isBooked: is booked + currencyFk: currency + created: created + companyFk: company + docFk: document + booked: booked + operated: operated + bookEntried: book entried + isVatDeductible: is VAT deductible + withholdingSageFk: withholding + expenceFkDeductible: expence deductible + editorFk: editor \ No newline at end of file diff --git a/modules/invoiceIn/back/locale/invoiceIn/es.yml b/modules/invoiceIn/back/locale/invoiceIn/es.yml index 61f62f022..64e96b379 100644 --- a/modules/invoiceIn/back/locale/invoiceIn/es.yml +++ b/modules/invoiceIn/back/locale/invoiceIn/es.yml @@ -1,20 +1,20 @@ name: factura recibida columns: - id: id - serialNumber: número de serie - serial: serie - supplierFk: proveedor - issued: fecha emisión - supplierRef: referéncia proveedor - isBooked: facturado - currencyFk: moneda - created: creado - companyFk: empresa - docFk: documento - booked: fecha contabilización - operated: fecha entrega - bookEntried: fecha asiento - isVatDeductible: impuesto deducible - withholdingSageFk: código de retención - expenceFkDeductible: gasto deducible - editorFk: editor \ No newline at end of file + id: id + serialNumber: número de serie + serial: serie + supplierFk: proveedor + issued: fecha emisión + supplierRef: referéncia proveedor + isBooked: facturado + currencyFk: moneda + created: creado + companyFk: empresa + docFk: documento + booked: fecha contabilización + operated: fecha entrega + bookEntried: fecha asiento + isVatDeductible: impuesto deducible + withholdingSageFk: código de retención + expenceFkDeductible: gasto deducible + editorFk: editor \ No newline at end of file diff --git a/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml b/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml index f01a0de46..7a6c0dfaf 100644 --- a/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml +++ b/modules/invoiceIn/back/locale/invoiceInDueDay/en.yml @@ -1,9 +1,9 @@ name: invoice in due day columns: - id: id - invoiceInFk: invoice in - dueDated: due date - bankFk: bank - amount: amount - foreignValue : foreign amount - created: created + id: id + invoiceInFk: invoice in + dueDated: due date + bankFk: bank + amount: amount + foreignValue : foreign amount + created: created diff --git a/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml b/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml index 34b20b37d..993437b05 100644 --- a/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml +++ b/modules/invoiceIn/back/locale/invoiceInDueDay/es.yml @@ -1,9 +1,9 @@ name: vencimientos factura recibida columns: - id: id - invoiceInFk: factura - dueDated: fecha vto. - bankFk: banco - amount: importe - foreignValue : importe divisa - created: creado + id: id + invoiceInFk: factura + dueDated: fecha vto. + bankFk: banco + amount: importe + foreignValue : importe divisa + created: creado diff --git a/modules/invoiceIn/back/locale/invoiceInTax/en.yml b/modules/invoiceIn/back/locale/invoiceInTax/en.yml index 374f62e7d..c0d12c37d 100644 --- a/modules/invoiceIn/back/locale/invoiceInTax/en.yml +++ b/modules/invoiceIn/back/locale/invoiceInTax/en.yml @@ -1,12 +1,12 @@ name: invoice in tax -colmns: - id: id - invoiceInFk: invoice in - taxCodeFk: tax - taxableBase: taxable base - expenceFk: expence - foreignValue: foreign amount - taxTypeSageFk: tax type - transactionTypeSageFk: transaction type - created: created - editorFk: editor +columns: + id: id + invoiceInFk: invoice in + taxCodeFk: tax + taxableBase: taxable base + expenceFk: expence + foreignValue: foreign amount + taxTypeSageFk: tax type + transactionTypeSageFk: transaction type + created: created + editorFk: editor diff --git a/modules/invoiceIn/back/locale/invoiceInTax/es.yml b/modules/invoiceIn/back/locale/invoiceInTax/es.yml index b20663dd4..7cb847ed8 100644 --- a/modules/invoiceIn/back/locale/invoiceInTax/es.yml +++ b/modules/invoiceIn/back/locale/invoiceInTax/es.yml @@ -1,12 +1,12 @@ name: factura recibida impuesto -colmns: - id: id - invoiceInFk: factura recibida - taxCodeFk: código IVA - taxableBase: base imponible - expenceFk: código gasto - foreignValue: importe divisa - taxTypeSageFk: código impuesto - transactionTypeSageFk: código transacción - created: creado - editorFk: editor \ No newline at end of file +columns: + id: id + invoiceInFk: factura recibida + taxCodeFk: código IVA + taxableBase: base imponible + expenceFk: código gasto + foreignValue: importe divisa + taxTypeSageFk: código impuesto + transactionTypeSageFk: código transacción + created: creado + editorFk: editor \ No newline at end of file From e253dd79822b068849a43dc78f5167bfb15388a8 Mon Sep 17 00:00:00 2001 From: alexm Date: Fri, 28 Jul 2023 14:39:01 +0200 Subject: [PATCH 52/53] refs #5351 fix(worker_model): remove required userFk --- modules/worker/back/models/worker.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/worker/back/models/worker.json b/modules/worker/back/models/worker.json index 6d23c1b66..6e1371055 100644 --- a/modules/worker/back/models/worker.json +++ b/modules/worker/back/models/worker.json @@ -25,8 +25,7 @@ "type" : "string" }, "userFk": { - "type" : "number", - "required": true + "type" : "number" }, "bossFk": { "type" : "number" From 30c5e8d8ccd638e57e85f35f55de8f16fe7c1103 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 1 Aug 2023 11:11:29 +0200 Subject: [PATCH 53/53] hotFix(canBeInvoiced): no de vuelve error si hay mas de un ticket y uno esta a 0 --- modules/ticket/back/methods/ticket/canBeInvoiced.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket/canBeInvoiced.js b/modules/ticket/back/methods/ticket/canBeInvoiced.js index 0f6cb476b..348f02348 100644 --- a/modules/ticket/back/methods/ticket/canBeInvoiced.js +++ b/modules/ticket/back/methods/ticket/canBeInvoiced.js @@ -67,7 +67,7 @@ module.exports = function(Self) { throw new UserError(`This ticket is already invoiced`); const priceZero = ticket.totalWithVat == 0; - if (priceZero) + if (ticketsIds.length == 1 && priceZero) throw new UserError(`A ticket with an amount of zero can't be invoiced`); });