Fix: hightlights depends on period

This commit is contained in:
Bertrand Benjamin 2021-08-04 21:20:21 +02:00
parent 5683b57e24
commit 4d77e61b25

View File

@ -101,9 +101,9 @@ const travail = {
// Amount of mounts
return Object.keys(getters.months).length
},
ca: (state) => {
ca: (state, getters) => {
// Total CA (ca_react if sets, ca_retro otherwise)
return Object.values(state.months).map(a => monthCA(a)).reduce(
return Object.values(getters.months).map(a => monthCA(a)).reduce(
(acc, v) => acc + v,
0
)
@ -115,30 +115,30 @@ const travail = {
0
) / getters.count)
},
caTheo: (state) => {
caTheo: (state, getters) => {
// Total theorical CA
return Object.values(state.months).map(a => a.ca_theo).reduce(
return Object.values(getters.months).map(a => a.ca_theo).reduce(
(acc, v) => acc + v,
0
)
},
remuneration: (state) => {
remuneration: (state, getters) => {
// Total remuneration
return Object.values(state.months).map(a => a.remuneration).reduce(
return Object.values(getters.months).map(a => a.remuneration).reduce(
(acc, v) => acc + v,
0
)
},
remunerationMean: (state, getters) => {
// Mean of remuneration
return Math.floor(Object.values(state.months).map(a => a.remuneration).reduce(
return Math.floor(Object.values(getters.months).map(a => a.remuneration).reduce(
(acc, v) => acc + v,
0
) / getters.count)
},
retrocession: (state) => {
retrocession: (state, getters) => {
// Total retrocession
return Object.values(state.months)
return Object.values(getters.months)
.map(a => a.retro)
.reduce(
(acc, v) => acc + v,
@ -148,7 +148,7 @@ const travail = {
retrocessionMean: (state, getters) => {
// Mean of retrocession
return Math.floor(
Object.values(state.months)
Object.values(getters.months)
.map(a => a.retro)
.reduce(
(acc, v) => acc + v,