diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index c61bc44ed..aa03c39b5 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2478,21 +2478,24 @@ INSERT INTO `bs`.`defaulter` (`clientFk`, `amount`, `created`, `defaulterSinced` (1109, 500, CURDATE(), CURDATE()); UPDATE `vn`.`agency` -SET `supplierFk`=1 -WHERE `id`=1; + SET `supplierFk`=1 + WHERE `id`=1; + UPDATE `vn`.`agency` -SET `supplierFk`=1 -WHERE `id`=2; + SET `supplierFk`=1 + WHERE `id`=2; + UPDATE `vn`.`agency` -SET `supplierFk`=2 -WHERE `id`=3; + SET `supplierFk`=2 + WHERE `id`=3; UPDATE `vn`.`route` -SET `invoiceInFk`=1 -WHERE `id`=1; + SET `invoiceInFk`=1 + WHERE `id`=1; + UPDATE `vn`.`route` -SET `invoiceInFk`=2 -WHERE `id`=2; + SET `invoiceInFk`=2 + WHERE `id`=2; INSERT INTO `bs`.`salesPerson` (`workerFk`, `year`, `month`, `portfolioWeight`) VALUES (18, YEAR(CURDATE()), MONTH(CURDATE()), 807.23), @@ -2505,6 +2508,7 @@ INSERT INTO `bs`.`sale` (`saleFk`, `amount`, `dated`, `typeFk`, `clientFk`) (3, 200.78, CURDATE(), 2, 1101), (4, 33.8, CURDATE(), 1, 1101), (30, 34.4, CURDATE(), 1, 1108); + INSERT INTO `vn`.`docuware` (`code`, `fileCabinetName`, `dialogName` , `find`) VALUES ('deliveryClientTest', 'deliveryClientTest', 'findTest', 'word'); @@ -2513,6 +2517,18 @@ INSERT INTO `vn`.`docuwareConfig` (`url`) VALUES ('https://verdnatura.docuware.cloud/docuware/platform'); +INSERT INTO `vn`.`calendarHolidaysName` (`id`, `name`) + VALUES + (1, 'dayOfIT'); + +INSERT INTO `vn`.`calendarHolidaysType` (`id`, `name`, `hexColour`) + VALUES + (1, 'National', '#4169E1'); + +INSERT INTO `vn`.`calendarHolidays` (`id`, `calendarHolidaysTypeFk`, `dated`, `calendarHolidaysNameFk`, `workCenterFk`) + VALUES + (1, 1, CONCAT(YEAR(CURDATE()), '-12-09'), 1, 1); + INSERT INTO `vn`.`supplierAgencyTerm` (`agencyFk`, `supplierFk`, `minimumPackages`, `kmPrice`, `packagePrice`, `routePrice`, `minimumKm`, `minimumM3`, `m3Price`) VALUES (1, 1, 0, 0.00, 0.00, NULL, 0, 0.00, 23), diff --git a/modules/item/front/diary/index.js b/modules/item/front/diary/index.js index bf04fabe9..6d912ebe8 100644 --- a/modules/item/front/diary/index.js +++ b/modules/item/front/diary/index.js @@ -52,10 +52,12 @@ class Controller extends Section { } scrollToLine(lineFk) { - const hashFk = this.lineFk || lineFk; - const hash = `vnItemDiary-${hashFk}`; - this.$location.hash(hash); - this.$anchorScroll(); + this.$.$applyAsync(() => { + const hashFk = this.lineFk || lineFk; + const hash = `vnItemDiary-${hashFk}`; + this.$location.hash(hash); + this.$anchorScroll(); + }); } showDescriptor(event, sale) { diff --git a/modules/item/front/diary/index.spec.js b/modules/item/front/diary/index.spec.js index 988914978..78dae0883 100644 --- a/modules/item/front/diary/index.spec.js +++ b/modules/item/front/diary/index.spec.js @@ -47,6 +47,8 @@ describe('Item', () => { controller.lineFk = 1; controller.scrollToLine('invalidValue'); + $scope.$apply(); + expect(controller.$location.hash()).toEqual(`vnItemDiary-${1}`); expect(controller.$anchorScroll).toHaveBeenCalledWith(); }); @@ -56,6 +58,8 @@ describe('Item', () => { controller.lineFk = undefined; controller.scrollToLine(1); + $scope.$apply(); + expect(controller.$location.hash()).toEqual(`vnItemDiary-${1}`); expect(controller.$anchorScroll).toHaveBeenCalledWith(); }); diff --git a/modules/worker/back/models/department.json b/modules/worker/back/models/department.json index 7d6f7a7be..c3f627e93 100644 --- a/modules/worker/back/models/department.json +++ b/modules/worker/back/models/department.json @@ -34,6 +34,9 @@ }, "notificationEmail": { "type": "string" + }, + "hasToMistake": { + "type": "number" } } } diff --git a/modules/worker/front/calendar/index.js b/modules/worker/front/calendar/index.js index 92bad1f0f..95e1fc134 100644 --- a/modules/worker/front/calendar/index.js +++ b/modules/worker/front/calendar/index.js @@ -198,7 +198,7 @@ class Controller extends Section { const event = this.events[stamp]; const calendar = $event.target.closest('vn-calendar').$ctrl; - if (event) { + if (event && event.absenceId) { if (event.type == this.absenceType.code) this.delete(calendar, day, event); else @@ -230,6 +230,7 @@ class Controller extends Section { .then(calendar.repaint()) .then(() => this.getContractHolidays()) .then(() => this.getYearHolidays()) + .then(() => this.repaint()) ); }); } @@ -266,6 +267,7 @@ class Controller extends Section { .then(calendar.repaint()) .then(() => this.getContractHolidays()) .then(() => this.getYearHolidays()) + .then(() => this.repaint()) ); }); } diff --git a/modules/worker/front/calendar/index.spec.js b/modules/worker/front/calendar/index.spec.js index 3d5775663..1da4066d9 100644 --- a/modules/worker/front/calendar/index.spec.js +++ b/modules/worker/front/calendar/index.spec.js @@ -191,7 +191,8 @@ describe('Worker', () => { const selectedDay = new Date(); const expectedEvent = { dated: selectedDay, - type: 'holiday' + type: 'holiday', + absenceId: 1 }; const $event = { target: { @@ -214,7 +215,8 @@ describe('Worker', () => { const selectedDay = new Date(); const expectedEvent = { dated: selectedDay, - type: 'leaveOfAbsence' + type: 'leaveOfAbsence', + absenceId: 1 }; const $event = { target: {