From e1c4f144a79e6473a6748499ff8d79dfa0663b45 Mon Sep 17 00:00:00 2001 From: vicent Date: Thu, 23 Dec 2021 14:57:22 +0100 Subject: [PATCH] feat: add code --- modules/worker/front/calendar/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/worker/front/calendar/index.js b/modules/worker/front/calendar/index.js index 014a35b63..82195f1d9 100644 --- a/modules/worker/front/calendar/index.js +++ b/modules/worker/front/calendar/index.js @@ -23,6 +23,7 @@ class Controller extends Section { this.refresh() .then(() => this.repaint()) .then(() => this.getContractHolidays()) + .then(() => this.getPayedHolidays()) .then(() => this.getYearHolidays()); } @@ -36,6 +37,7 @@ class Controller extends Section { this.refresh() .then(() => this.repaint()) .then(() => this.getContractHolidays()) + .then(() => this.getPayedHolidays()) .then(() => this.getYearHolidays()); } } @@ -104,6 +106,15 @@ class Controller extends Section { }, data => this.contractHolidays = data); } + getPayedHolidays() { + this.getContractHolidays(); + if (this.contractHolidays !== undefined) {// && business.reasonEndFk !== null + const daysToPay = this.contractHolidays.totalHolidays - this.contractHolidays.holidaysEnjoyed; + console.log(this.businessId, this.contractHolidays.totalHolidays, this.contractHolidays.holidaysEnjoyed); + console.log(daysToPay); + } + } + getYearHolidays() { this.getHolidays({ year: this.year @@ -225,6 +236,7 @@ class Controller extends Section { this.refresh() .then(calendar.repaint()) .then(() => this.getContractHolidays()) + .then(() => this.getPayedHolidays()) .then(() => this.getYearHolidays()) ); }); @@ -246,6 +258,7 @@ class Controller extends Section { this.refresh() .then(calendar.repaint()) .then(() => this.getContractHolidays()) + .then(() => this.getPayedHolidays()) .then(() => this.getYearHolidays()) ); }); @@ -261,6 +274,7 @@ class Controller extends Section { this.refresh() .then(calendar.repaint()) .then(() => this.getContractHolidays()) + .then(() => this.getPayedHolidays()) .then(() => this.getYearHolidays()) ); });