diff --git a/src/store/travail/index.js b/src/store/travail/index.js index ad038af..5672197 100644 --- a/src/store/travail/index.js +++ b/src/store/travail/index.js @@ -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,