diff --git a/db/changes/10100-allSaints/01-zone_getLanded.sql b/db/changes/10100-allSaints/01-zone_getLanded.sql index fd3c6b6aa..a2bbe46a5 100644 --- a/db/changes/10100-allSaints/01-zone_getLanded.sql +++ b/db/changes/10100-allSaints/01-zone_getLanded.sql @@ -28,7 +28,7 @@ BEGIN JOIN zone z ON z.id = zo.zoneFk JOIN zoneWarehouse zw ON zw.zoneFk = z.id WHERE agencyModeFk = vAgencyModeFk - AND warehouseFk = vWarehouseFk; + AND zw.warehouseFk = vWarehouseFk; DROP TEMPORARY TABLE tmp.zone, diff --git a/db/changes/10110-postCampaign/00-department_doCalc.sql b/db/changes/10110-postCampaign/00-department_doCalc.sql new file mode 100644 index 000000000..7adeb30f0 --- /dev/null +++ b/db/changes/10110-postCampaign/00-department_doCalc.sql @@ -0,0 +1,3 @@ +USE `vn`; + +CREATE DEFINER=`root`@`%` EVENT `department_doCalc` ON SCHEDULE EVERY 15 SECOND STARTS '2019-11-15 00:00:00' ON COMPLETION PRESERVE ENABLE DO CALL vn.department_doCalc \ No newline at end of file diff --git a/modules/agency/back/methods/agency/getLanded.js b/modules/agency/back/methods/agency/getLanded.js index cc2d0d8a1..6c5a5d911 100644 --- a/modules/agency/back/methods/agency/getLanded.js +++ b/modules/agency/back/methods/agency/getLanded.js @@ -47,6 +47,7 @@ module.exports = Self => { let rsIndex = stmts.push( `SELECT * FROM tmp.zoneGetLanded`) - 1; + stmts.push(`DROP TEMPORARY TABLE tmp.zoneGetLanded`); let sql = ParameterizedSQL.join(stmts, ';'); let landed = await Self.rawStmt(sql); diff --git a/modules/agency/back/methods/agency/specs/getLanded.spec.js b/modules/agency/back/methods/agency/specs/getLanded.spec.js index 7582751cb..15c0f1ca9 100644 --- a/modules/agency/back/methods/agency/specs/getLanded.spec.js +++ b/modules/agency/back/methods/agency/specs/getLanded.spec.js @@ -1,8 +1,9 @@ const app = require('vn-loopback/server/server'); -// Petición #1848 -xdescribe('agency getLanded()', () => { + +describe('agency getLanded()', () => { it('should return a landing date', async() => { const shipped = new Date(); + shipped.setDate(shipped.getDate() + 1); const addressFk = 121; const agencyModeFk = 7; const warehouseFk = 1; diff --git a/modules/agency/back/methods/agency/specs/getShipped.spec.js b/modules/agency/back/methods/agency/specs/getShipped.spec.js index 44519e181..8f79dab3b 100644 --- a/modules/agency/back/methods/agency/specs/getShipped.spec.js +++ b/modules/agency/back/methods/agency/specs/getShipped.spec.js @@ -1,10 +1,9 @@ const app = require('vn-loopback/server/server'); -// Petición #1848 - -xdescribe('agency getShipped()', () => { +describe('agency getShipped()', () => { it('should return a shipment date', async() => { const landed = new Date(); + landed.setDate(landed.getDate() + 1); const addressFk = 121; const agencyModeFk = 7; const warehouseFk = 1; diff --git a/modules/agency/back/methods/agency/specs/landsThatDay.spec.js b/modules/agency/back/methods/agency/specs/landsThatDay.spec.js index 4c0235118..c6738afc3 100644 --- a/modules/agency/back/methods/agency/specs/landsThatDay.spec.js +++ b/modules/agency/back/methods/agency/specs/landsThatDay.spec.js @@ -1,6 +1,6 @@ const app = require('vn-loopback/server/server'); -// Petición #1848 -xdescribe('Agency landsThatDay()', () => { + +describe('Agency landsThatDay()', () => { const today = new Date(); it('should return a list of agencies that can land a shipment on a day for an address', async() => { let agencies = await app.models.Agency.landsThatDay(101, today); diff --git a/modules/agency/back/methods/zone-calendar/removeByDate.js b/modules/agency/back/methods/zone-calendar/removeByDate.js deleted file mode 100644 index f7871502e..000000000 --- a/modules/agency/back/methods/zone-calendar/removeByDate.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = Self => { - Self.remoteMethod('removeByDate', { - description: 'Removes one or more delivery dates for a zone', - accessType: 'WRITE', - accepts: [{ - arg: 'zoneFk', - type: 'Number', - required: true, - }, - { - arg: 'dates', - type: ['Date'], - required: true, - }], - returns: { - type: 'object', - root: true - }, - http: { - path: `/removeByDate`, - verb: 'POST' - } - }); - - Self.removeByDate = (zoneFk, dates) => { - return Self.destroyAll({zoneFk, delivered: {inq: dates}}); - }; -}; diff --git a/modules/agency/back/methods/zone/clone.js b/modules/agency/back/methods/zone/clone.js index 3d0008a27..fcae904b5 100644 --- a/modules/agency/back/methods/zone/clone.js +++ b/modules/agency/back/methods/zone/clone.js @@ -31,7 +31,6 @@ module.exports = Self => { fields: [ 'name', 'hour', - 'warehouseFk', 'agencyModeFk', 'travelingDays', 'price', @@ -47,7 +46,8 @@ module.exports = Self => { }, options); // Find all original selected days - const calendarDays = await models.ZoneCalendar.find({ + const calendarDays = await models.ZoneEvent.find({ + fields: {id: false}, where: {zoneFk: id} }, options); @@ -62,7 +62,7 @@ module.exports = Self => { }); await models.ZoneIncluded.create(newIncludedGeo, options); - await models.ZoneCalendar.create(newCalendayDays, options); + await models.ZoneEvent.create(newCalendayDays, options); await tx.commit(); return newZone; diff --git a/modules/agency/back/methods/zone/editPrices.js b/modules/agency/back/methods/zone/editPrices.js deleted file mode 100644 index b0203dc4b..000000000 --- a/modules/agency/back/methods/zone/editPrices.js +++ /dev/null @@ -1,81 +0,0 @@ -const mergeFilters = require('vn-loopback/util/filter').mergeFilters; - -module.exports = Self => { - Self.remoteMethod('editPrices', { - description: 'Changes the price and bonus of a delivery day', - accessType: 'WRITE', - accepts: [{ - arg: 'id', - type: 'Number', - description: 'The zone id', - http: {source: 'path'} - }, - { - arg: 'delivered', - type: 'Date', - required: true, - }, - { - arg: 'price', - type: 'Number', - required: true, - }, - { - arg: 'bonus', - type: 'Number', - required: true, - }, - { - arg: 'option', - type: 'String', - required: true, - }], - returns: { - type: 'object', - root: true - }, - http: { - path: `/:id/editPrices`, - verb: 'POST' - } - }); - - Self.editPrices = async(id, delivered, price, bonus, option) => { - const models = Self.app.models; - - let filter = { - where: { - zoneFk: id - } - }; - - let where; - let shouldPropagate = true; - - if (option == 'Only this day') { - shouldPropagate = false; - where = {delivered}; - } else if (option == 'From this day') { - where = { - delivered: { - gte: delivered - } - }; - } - - filter = mergeFilters(filter, {where}); - - const days = await models.ZoneCalendar.find(filter); - const areAllFromSameZone = days.every(day => day.zoneFk === id); - - if (!areAllFromSameZone) - throw new UserError('All delivery days must belong to the same zone'); - - if (shouldPropagate) { - const zone = await models.Zone.findById(id); - zone.updateAttributes({price, bonus}); - } - - return models.ZoneCalendar.updateAll(filter.where, {price, bonus}); - }; -}; diff --git a/modules/agency/back/methods/zone/specs/editPrices.spec.js b/modules/agency/back/methods/zone/specs/editPrices.spec.js deleted file mode 100644 index a9a2457ad..000000000 --- a/modules/agency/back/methods/zone/specs/editPrices.spec.js +++ /dev/null @@ -1,81 +0,0 @@ -const app = require('vn-loopback/server/server'); -// Petición #1848 -xdescribe('agency editPrices()', () => { - const zoneId = 1; - let originalZone; - - beforeAll(async done => { - originalZone = await app.models.Zone.findById(zoneId); - done(); - }); - - afterAll(async done => { - await await app.models.ZoneCalendar.updateAll({zoneFk: zoneId}, { - price: originalZone.price, - bonus: originalZone.bonus - }); - done(); - }); - - it('should apply price and bonus for a selected day', async() => { - const delivered = new Date(); - delivered.setHours(0, 0, 0, 0); - await app.models.Zone.editPrices(zoneId, delivered, 4.00, 2.00, 'Only this day'); - - const editedDays = await app.models.ZoneCalendar.find({ - where: { - zoneFk: zoneId, - delivered: delivered - } - }); - const firstEditedDay = editedDays[0]; - - expect(editedDays.length).toEqual(1); - expect(firstEditedDay.price).toEqual(4.00); - expect(firstEditedDay.bonus).toEqual(2.00); - }); - - it('should apply price and bonus for all delivery days starting from selected day', async() => { - const delivered = new Date(); - delivered.setHours(0, 0, 0, 0); - await app.models.Zone.editPrices(1, delivered, 5.50, 1.00, 'From this day'); - - const editedDays = await app.models.ZoneCalendar.find({ - where: { - zoneFk: zoneId, - delivered: { - gte: delivered - } - } - }); - const firstEditedDay = editedDays[0]; - const lastEditedDay = editedDays[editedDays.length - 1]; - - expect(editedDays.length).toEqual(5); - expect(firstEditedDay.price).toEqual(5.50); - expect(firstEditedDay.bonus).toEqual(1.00); - expect(lastEditedDay.price).toEqual(5.50); - expect(lastEditedDay.bonus).toEqual(1.00); - }); - - it('should apply price and bonus for all delivery days', async() => { - const delivered = new Date(); - delivered.setHours(0, 0, 0, 0); - await app.models.Zone.editPrices(1, delivered, 7.00, 0.00, 'All days'); - - const editedDays = await app.models.ZoneCalendar.find({ - where: { - zoneFk: zoneId - } - }); - const firstEditedDay = editedDays[0]; - const lastEditedDay = editedDays[editedDays.length - 1]; - - expect(editedDays.length).toEqual(5); - expect(firstEditedDay.price).toEqual(7.00); - expect(firstEditedDay.bonus).toEqual(0.00); - expect(lastEditedDay.price).toEqual(7.00); - expect(lastEditedDay.bonus).toEqual(0.00); - }); -}); - diff --git a/modules/agency/back/model-config.json b/modules/agency/back/model-config.json index aded3eb5d..cfdbb83d3 100644 --- a/modules/agency/back/model-config.json +++ b/modules/agency/back/model-config.json @@ -20,9 +20,6 @@ "ZoneExclusion": { "dataSource": "vn" }, - "ZoneCalendar": { - "dataSource": "vn" - }, "ZoneIncluded": { "dataSource": "vn" }, diff --git a/modules/agency/back/models/zone-calendar.js b/modules/agency/back/models/zone-calendar.js deleted file mode 100644 index 871852882..000000000 --- a/modules/agency/back/models/zone-calendar.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = Self => { - require('../methods/zone-calendar/removeByDate')(Self); -}; diff --git a/modules/agency/back/models/zone-calendar.json b/modules/agency/back/models/zone-calendar.json deleted file mode 100644 index bed9a8011..000000000 --- a/modules/agency/back/models/zone-calendar.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "ZoneCalendar", - "base": "VnModel", - "options": { - "mysql": { - "table": "zoneCalendar" - } - }, - "properties": { - "zoneFk": { - "id": true, - "type": "Number" - }, - "delivered": { - "id": true, - "type": "Date" - }, - "price": { - "type": "Number" - }, - "bonus": { - "type": "Number" - } - }, - "relations": { - "zone": { - "type": "belongsTo", - "model": "Zone", - "foreignKey": "zoneFk" - } - } -} \ No newline at end of file diff --git a/modules/agency/back/models/zone.js b/modules/agency/back/models/zone.js index 1f8b0a675..0c3ac24f6 100644 --- a/modules/agency/back/models/zone.js +++ b/modules/agency/back/models/zone.js @@ -1,6 +1,5 @@ module.exports = Self => { require('../methods/zone/clone')(Self); - require('../methods/zone/editPrices')(Self); require('../methods/zone/getLeaves')(Self); require('../methods/zone/getEvents')(Self); require('../methods/zone/toggleIsIncluded')(Self); diff --git a/modules/agency/front/edit/index.html b/modules/agency/front/edit/index.html deleted file mode 100644 index f66c289ee..000000000 --- a/modules/agency/front/edit/index.html +++ /dev/null @@ -1,80 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/modules/agency/front/location-search-panel/index.html b/modules/agency/front/location-search-panel/index.html deleted file mode 100644 index 57f661ddf..000000000 --- a/modules/agency/front/location-search-panel/index.html +++ /dev/null @@ -1,40 +0,0 @@ -
-
- - - - - - - - - - - - - - - - - -
-
\ No newline at end of file diff --git a/modules/agency/front/location-search-panel/index.js b/modules/agency/front/location-search-panel/index.js deleted file mode 100644 index c877bc83e..000000000 --- a/modules/agency/front/location-search-panel/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import ngModule from '../module'; -import SearchPanel from 'core/components/searchbar/search-panel'; - -ngModule.component('vnLocationSearchPanel', { - template: require('./index.html'), - controller: SearchPanel -}); diff --git a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.spec.js b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.spec.js index 14655e640..5fecf8bcd 100644 --- a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.spec.js +++ b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.spec.js @@ -1,6 +1,6 @@ const app = require('vn-loopback/server/server'); -// Petición #1848 -xdescribe('claimBeginning', () => { + +describe('claimBeginning', () => { let ticket; let refundTicketSales; let salesInsertedInClaimEnd; diff --git a/modules/order/back/methods/order/specs/catalogFilter.spec.js b/modules/order/back/methods/order/specs/catalogFilter.spec.js index f5ce2e1ae..12cafa5b7 100644 --- a/modules/order/back/methods/order/specs/catalogFilter.spec.js +++ b/modules/order/back/methods/order/specs/catalogFilter.spec.js @@ -1,7 +1,6 @@ const app = require('vn-loopback/server/server'); -// Petición #1848 -xdescribe('order catalogFilter()', () => { +describe('order catalogFilter()', () => { it('should return an array of items', async() => { let filter = { where: { diff --git a/modules/order/back/methods/order/specs/getItemTypeAvailable.spec.js b/modules/order/back/methods/order/specs/getItemTypeAvailable.spec.js index ac425c228..66be6462a 100644 --- a/modules/order/back/methods/order/specs/getItemTypeAvailable.spec.js +++ b/modules/order/back/methods/order/specs/getItemTypeAvailable.spec.js @@ -1,7 +1,6 @@ const app = require('vn-loopback/server/server'); -// Petición #1848 -xdescribe('order getItemTypeAvailable()', () => { +describe('order getItemTypeAvailable()', () => { it('should call the getItemTypeAvailable method with a valid order and item category', async() => { let orderId = 11; let itemCategoryId = 1; diff --git a/modules/ticket/back/methods/ticket/specs/componentUpdate.spec.js b/modules/ticket/back/methods/ticket/specs/componentUpdate.spec.js index d3473a51b..25ce90946 100644 --- a/modules/ticket/back/methods/ticket/specs/componentUpdate.spec.js +++ b/modules/ticket/back/methods/ticket/specs/componentUpdate.spec.js @@ -1,6 +1,6 @@ const app = require('vn-loopback/server/server'); -// Petición #1848 -xdescribe('ticket componentUpdate()', () => { + +describe('ticket componentUpdate()', () => { const ticketId = 11; const today = new Date(); const tomorrow = new Date(); diff --git a/modules/ticket/back/methods/ticket/specs/new.spec.js b/modules/ticket/back/methods/ticket/specs/new.spec.js index 12ae47bbc..80147c2f2 100644 --- a/modules/ticket/back/methods/ticket/specs/new.spec.js +++ b/modules/ticket/back/methods/ticket/specs/new.spec.js @@ -2,7 +2,7 @@ const app = require('vn-loopback/server/server'); let UserError = require('vn-loopback/util/user-error'); -xdescribe('ticket new()', () => { +describe('ticket new()', () => { let ticket; let today = new Date(); let ctx = {req: {accessToken: {userId: 1}}}; diff --git a/modules/ticket/back/methods/ticket/specs/priceDifference.spec.js b/modules/ticket/back/methods/ticket/specs/priceDifference.spec.js index c82e41e53..61060c9a2 100644 --- a/modules/ticket/back/methods/ticket/specs/priceDifference.spec.js +++ b/modules/ticket/back/methods/ticket/specs/priceDifference.spec.js @@ -1,7 +1,7 @@ const app = require('vn-loopback/server/server'); let UserError = require('vn-loopback/util/user-error'); -xdescribe('sale priceDifference()', () => { +describe('sale priceDifference()', () => { it('should return ticket price differences', async() => { let tomorrow = new Date(); tomorrow.setDate(tomorrow.getDate() + 1); diff --git a/modules/ticket/front/basic-data/step-one/index.js b/modules/ticket/front/basic-data/step-one/index.js index 568284198..820d3d2c6 100644 --- a/modules/ticket/front/basic-data/step-one/index.js +++ b/modules/ticket/front/basic-data/step-one/index.js @@ -46,7 +46,8 @@ class Controller { this.getShipped({ landed: this.ticket.landed, addressFk: value, - agencyModeFk: this.ticket.agencyModeFk + agencyModeFk: this.ticket.agencyModeFk, + warehouseFk: this.ticket.warehouseFk }); } } @@ -77,7 +78,8 @@ class Controller { this.getLanded({ shipped: value, addressFk: this.ticket.addressFk, - agencyModeFk: this.ticket.agencyModeFk + agencyModeFk: this.ticket.agencyModeFk, + warehouseFk: this.ticket.warehouseFk }); } @@ -90,7 +92,8 @@ class Controller { this.getShipped({ landed: value, addressFk: this.ticket.addressFk, - agencyModeFk: this.ticket.agencyModeFk + agencyModeFk: this.ticket.agencyModeFk, + warehouseFk: this.ticket.warehouseFk }); } @@ -104,7 +107,8 @@ class Controller { this.getLanded({ shipped: this.ticket.shipped, addressFk: this.ticket.addressFk, - agencyModeFk: value + agencyModeFk: value, + warehouseFk: this.ticket.warehouseFk }); } } @@ -197,7 +201,6 @@ class Controller { this.$http.get(query, {params}).then(res => { if (res.data) { this.ticket.zoneFk = res.data.zoneFk; - this.ticket.agencyModeFk = res.data.agencyModeFk; this.ticket.landed = res.data.landed; this.ticket.shipped = params.shipped; } else { @@ -217,7 +220,6 @@ class Controller { this.$http.get(query, {params}).then(res => { if (res.data) { this.ticket.zoneFk = res.data.zoneFk; - this.ticket.agencyModeFk = res.data.agencyModeFk; this.ticket.landed = params.landed; this.ticket.shipped = res.data.shipped; } else { diff --git a/modules/worker/back/methods/worker-calendar/absences.js b/modules/worker/back/methods/worker-calendar/absences.js index e822291b7..541f95ff5 100644 --- a/modules/worker/back/methods/worker-calendar/absences.js +++ b/modules/worker/back/methods/worker-calendar/absences.js @@ -108,10 +108,18 @@ module.exports = Self => { } }); - // Get number of total holidays + // Get number of worked days + let workedDays = 0; contracts.forEach(contract => { - calendar.totalHolidays += getHolidaysByContract(contract, yearEnded); + const started = contract.started; + const ended = contract.ended; + const startedTime = started.getTime(); + const endedTime = ended && ended.getTime() || yearEnded; + const dayTimestamp = 1000 * 60 * 60 * 24; + workedDays += Math.floor((endedTime - startedTime) / dayTimestamp); + + // Workcenter holidays let holidayList = contract.workCenter().holidays(); for (let day of holidayList) { day.dated = new Date(day.dated); @@ -120,26 +128,19 @@ module.exports = Self => { holidays.push(day); } }); + const currentContract = contracts.find(contract => { + return contract.started <= new Date() + && (contract.ended >= new Date() || contract.ended == null); + }); + + if (currentContract) { + const maxDays = currentContract.holidays().days; + calendar.totalHolidays = maxDays; + + if (workedDays < 365) + calendar.totalHolidays = Math.round(2 * maxDays * (workedDays + 1) / 365) / 2; + } return [calendar, absences, holidays]; }; - - function getHolidaysByContract(contract, endOfYear) { - const dayTimestamp = 1000 * 60 * 60 * 24; - - const started = contract.started; - const ended = contract.ended; - const startedTime = started.getTime(); - const endedTime = ended && ended.getTime() || endOfYear; - - const contractDays = Math.floor((endedTime - startedTime) / dayTimestamp); - - if (contractDays < 365) { - let holidays = Math.round(2 * contract.holidays().days * (contractDays + 1) / 365) / 2; - - return holidays; - } - - return contract.holidays().days; - } }; diff --git a/modules/worker/back/methods/worker-calendar/specs/absences.spec.js b/modules/worker/back/methods/worker-calendar/specs/absences.spec.js index ccafa683d..0a5e92e1f 100644 --- a/modules/worker/back/methods/worker-calendar/specs/absences.spec.js +++ b/modules/worker/back/methods/worker-calendar/specs/absences.spec.js @@ -43,13 +43,13 @@ describe('Worker absences()', () => { expect(sixthType).toEqual('Holidays'); }); - it(`should fire the worker 106 on Juny and see he/she has 14`, async() => { + it(`should see he/she has 26.5`, async() => { let workerFk = 106; const firedWorker = await app.models.WorkerLabour.findById(workerFk); const endedDate = new Date(); - endedDate.setDate(30); - endedDate.setMonth(5); + endedDate.setDate(endedDate.getDate() + 1); + endedDate.setMonth(endedDate.getMonth() + 1); endedDate.setHours(0, 0, 0, 0); await firedWorker.updateAttributes({ended: endedDate}); @@ -71,7 +71,7 @@ describe('Worker absences()', () => { let calendar = result[0]; let absences = result[1]; - expect(calendar.totalHolidays).toEqual(13.5); + expect(calendar.totalHolidays).toEqual(26.5); expect(calendar.holidaysEnjoyed).toEqual(5); let firstType = absences[0].absenceType().name; @@ -81,13 +81,13 @@ describe('Worker absences()', () => { expect(sixthType).toEqual('Holidays'); }); - it(`should fire the worker 106 on March and see he/she has 7`, async() => { + it(`should see he/she has 26.5`, async() => { const firedWorker = await app.models.WorkerLabour.findById(106); const endedDate = new Date(); + endedDate.setDate(endedDate.getDate() + 1); + endedDate.setMonth(endedDate.getMonth() + 1); endedDate.setHours(0, 0, 0, 0); - endedDate.setMonth(2); - endedDate.setDate(31); await firedWorker.updateAttributes({ended: endedDate}); @@ -109,7 +109,7 @@ describe('Worker absences()', () => { let calendar = result[0]; let absences = result[1]; - expect(calendar.totalHolidays).toEqual(7); + expect(calendar.totalHolidays).toEqual(26.5); expect(calendar.holidaysEnjoyed).toEqual(5); let firstType = absences[0].absenceType().name; @@ -119,19 +119,13 @@ describe('Worker absences()', () => { expect(sixthType).toEqual('Holidays'); }); - it(`should fire the worker 106 on january and see he/she has x`, async() => { - const firedWorker = await app.models.WorkerLabour.findById(106); - - const endedDate = new Date(); - endedDate.setHours(0, 0, 0, 0); - endedDate.setMonth(0); - endedDate.setDate(28); - - await firedWorker.updateAttributes({ended: endedDate}); - + it(`should see he/she has 27.5`, async() => { let ctx = {req: {accessToken: {userId: 106}}}; let workerFk = 106; + const firedWorker = await app.models.WorkerLabour.findById(106); + await firedWorker.updateAttributes({ended: null}); + const started = new Date(); started.setHours(0, 0, 0, 0); started.setMonth(0); @@ -147,7 +141,7 @@ describe('Worker absences()', () => { let calendar = result[0]; let absences = result[1]; - expect(calendar.totalHolidays).toEqual(2); + expect(calendar.totalHolidays).toEqual(27.5); expect(calendar.holidaysEnjoyed).toEqual(5); let firstType = absences[0].absenceType().name; diff --git a/modules/worker/front/calendar/index.js b/modules/worker/front/calendar/index.js index 38c147ec7..1860f6bdd 100644 --- a/modules/worker/front/calendar/index.js +++ b/modules/worker/front/calendar/index.js @@ -100,7 +100,7 @@ class Controller { let dayNumber = element.firstElementChild; dayNumber.title = event.name; dayNumber.style.backgroundColor = event.color; - dayNumber.style.color = 'white'; + dayNumber.style.color = 'rgba(0, 0, 0, 0.7)'; } } Controller.$inject = ['$element', '$http'];