3621-fix(worker_calendar): absence in holiday day #911

Merged
carlosjr merged 6 commits from 3621-worker_calendar into dev 2022-03-29 08:27:26 +00:00
3 changed files with 33 additions and 13 deletions

View File

@ -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
alexm marked this conversation as resolved Outdated

Don't use words like test in fixtures as it makes it difficult to discern what is a real fixture and what is a temporary change made by a test.

Don't use words like test in fixtures as it makes it difficult to discern what is a real fixture and what is a temporary change made by a test.
('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),

View File

@ -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())
);
});
}

View File

@ -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: {