Fix: orthographe de remuneration
This commit is contained in:
parent
7b742d599a
commit
3a0141f961
@ -27,8 +27,8 @@
|
||||
<input type="number" v-model="monthCopy.retro" id="retro" class="value" >
|
||||
</li>
|
||||
<li>
|
||||
<label for="remumeration">Rémunération effectuée</label>
|
||||
<input type="number" v-model="monthCopy.remumeration" id="remumeration" class="value">
|
||||
<label for="remuneration">Rémunération effectuée</label>
|
||||
<input type="number" v-model="monthCopy.remuneration" id="remuneration" class="value">
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -6,17 +6,17 @@
|
||||
<div id="display">
|
||||
<ul>
|
||||
<li>
|
||||
<label for="ca-theo">CA théorique</label>
|
||||
<label for="ca-theo">CA "Séances effectuées"</label>
|
||||
<span class="value" v-show="!editing">{{ TheMonth.ca_theo ?? "∅"}}€</span>
|
||||
<input type="number" v-model="monthCopy.ca_theo" id="ca-theo" class="value" v-show="editing">
|
||||
</li>
|
||||
<li>
|
||||
<label for="ca-retro">CA rétrocession</label>
|
||||
<label for="ca-retro">CA "Séances facturées"</label>
|
||||
<span class="value" v-show="!editing">{{ TheMonth.ca_retro ?? "∅"}}€</span>
|
||||
<input type="number" v-model="monthCopy.ca_retro" id="ca-retro" class="value" v-show="editing">
|
||||
</li>
|
||||
<li>
|
||||
<label for="ca-react">CA réactualisé</label>
|
||||
<label for="ca-react">CA "Séances facturées" réactualisé</label>
|
||||
<span class="value" v-show="!editing">{{ TheMonth.ca_react ?? "∅"}}€</span>
|
||||
<input type="number" v-model="monthCopy.ca_react" id="ca-react" class="value" v-show="editing">
|
||||
</li>
|
||||
@ -31,9 +31,9 @@
|
||||
<input type="number" v-model="monthCopy.retro" id="retro" class="value" v-show="editing">
|
||||
</li>
|
||||
<li>
|
||||
<label for="remumeration">Rémunération effectuée</label>
|
||||
<span class="value" v-show="!editing">{{ TheMonth.remumeration ?? "∅"}}€</span>
|
||||
<input type="number" v-model="monthCopy.remumeration" id="remumeration" class="value" v-show="editing">
|
||||
<label for="remuneration">Rémunération </label>
|
||||
<span class="value" v-show="!editing">{{ TheMonth.remuneration ?? "∅"}}€</span>
|
||||
<input type="number" v-model="monthCopy.remuneration" id="remuneration" class="value" v-show="editing">
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -1,6 +1,14 @@
|
||||
function monthCA(month) {
|
||||
if (month.ca_react) {
|
||||
return month.ca_react
|
||||
} else {
|
||||
return month.ca_retro
|
||||
}
|
||||
}
|
||||
|
||||
const travail = {
|
||||
namespaced: true,
|
||||
state () {
|
||||
state() {
|
||||
return {
|
||||
empty: {
|
||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||
@ -8,7 +16,7 @@ const travail = {
|
||||
ca_retro: null, // ca au moment de la rétrocession
|
||||
ca_react: null, // ca réactualisé
|
||||
retro: 0, // montant de la rétrocession
|
||||
remumeration: 0, // rémunération décidée
|
||||
remuneration: 0, // rémunération décidée
|
||||
},
|
||||
months: {
|
||||
"2021-01": {
|
||||
@ -17,7 +25,7 @@ const travail = {
|
||||
ca_retro: 6747, // ca au moment de la rétrocession
|
||||
ca_react: null, // ca réactualisé
|
||||
retro: 893, // montant de la rétrocession
|
||||
remumeration: 2000, // rémunération décidée
|
||||
remuneration: 2000, // rémunération décidée
|
||||
},
|
||||
"2021-02": {
|
||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||
@ -25,7 +33,7 @@ const travail = {
|
||||
ca_retro: 5183, // ca au moment de la rétrocession
|
||||
ca_react: null, // ca réactualisé
|
||||
retro: 665, // montant de la rétrocession
|
||||
remumeration: 1500, // rémunération décidée
|
||||
remuneration: 1500, // rémunération décidée
|
||||
},
|
||||
"2021-03": {
|
||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||
@ -33,7 +41,7 @@ const travail = {
|
||||
ca_retro: 7088, // ca au moment de la rétrocession
|
||||
ca_react: null, // ca réactualisé
|
||||
retro: 855, // montant de la rétrocession
|
||||
remumeration: 2000, // rémunération décidée
|
||||
remuneration: 2000, // rémunération décidée
|
||||
},
|
||||
"2021-04": {
|
||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||
@ -41,7 +49,7 @@ const travail = {
|
||||
ca_retro: 4194, // ca au moment de la rétrocession
|
||||
ca_react: 5630, // ca réactualisé
|
||||
retro: 627, // montant de la rétrocession
|
||||
remumeration: 2000, // rémunération décidée
|
||||
remuneration: 2000, // rémunération décidée
|
||||
},
|
||||
"2021-05": {
|
||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||
@ -49,7 +57,7 @@ const travail = {
|
||||
ca_retro: 5564, // ca au moment de la rétrocession
|
||||
ca_react: 6335, // ca réactualisé
|
||||
retro: 699, // montant de la rétrocession
|
||||
remumeration: 2800, // rémunération décidée
|
||||
remuneration: 2800, // rémunération décidée
|
||||
},
|
||||
"2021-06": {
|
||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||
@ -57,7 +65,7 @@ const travail = {
|
||||
ca_retro: 5442, // ca au moment de la rétrocession
|
||||
ca_react: 6335, // ca réactualisé
|
||||
retro: 638, // montant de la rétrocession
|
||||
remumeration: 2800, // rémunération décidée
|
||||
remuneration: 2800, // rémunération décidée
|
||||
},
|
||||
},
|
||||
range: {
|
||||
@ -67,57 +75,124 @@ const travail = {
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
Count (state) {return state.months.length},
|
||||
TheEmptyMonth (state) {return {...state.empty}},
|
||||
Range (state) {return state.range},
|
||||
MonthsDate (state) {
|
||||
TheEmptyMonth(state) { return { ...state.empty } },
|
||||
Range(state) { return state.range },
|
||||
MonthsDate(state) {
|
||||
// Get months inside the range
|
||||
return Object.keys(state.months).filter(date => (date >= state.range.start)&&(date <= state.range.end) ).sort().reverse()
|
||||
return Object.keys(state.months).filter(date => (date >= state.range.start) && (date <= state.range.end)).sort().reverse()
|
||||
},
|
||||
MonthsAllDate (state) {
|
||||
MonthsAllDate(state) {
|
||||
// Get all the months
|
||||
return Object.keys(state.months).sort().reverse()
|
||||
},
|
||||
months: (state, getters) => {
|
||||
// Get in range months
|
||||
return Object.keys(state.months)
|
||||
.filter(a => getters.MonthsDate.includes(a))
|
||||
.reduce((acc, v) => {
|
||||
acc[v] = state.months[v];
|
||||
return acc;
|
||||
}, {})
|
||||
},
|
||||
getMonth: (state) => (date) => {
|
||||
return state.months[date]
|
||||
},
|
||||
count: (state, getters) => {
|
||||
// Amount of mounts
|
||||
return Object.keys(getters.months).length
|
||||
},
|
||||
ca: (state) => {
|
||||
// Total CA (ca_react if sets, ca_retro otherwise)
|
||||
return Object.values(state.months).map(a => monthCA(a)).reduce(
|
||||
(acc, v) => acc + v,
|
||||
0
|
||||
)
|
||||
},
|
||||
caMean: (state, getters) => {
|
||||
// Mean of CA
|
||||
return Math.floor(Object.values(state.months).map(a => monthCA(a)).reduce(
|
||||
(acc, v) => acc + v,
|
||||
0
|
||||
) / getters.count)
|
||||
},
|
||||
caTheo: (state) => {
|
||||
// Total theorical CA
|
||||
return Object.values(state.months).map(a => a.ca_theo).reduce(
|
||||
(acc, v) => acc + v,
|
||||
0
|
||||
)
|
||||
},
|
||||
remuneration: (state) => {
|
||||
// Total remuneration
|
||||
return Object.values(state.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(
|
||||
(acc, v) => acc + v,
|
||||
0
|
||||
) / getters.count)
|
||||
},
|
||||
retrocession: (state) => {
|
||||
// Total retrocession
|
||||
return Object.values(state.months)
|
||||
.map(a => a.retro)
|
||||
.reduce(
|
||||
(acc, v) => acc + v,
|
||||
0
|
||||
)
|
||||
},
|
||||
retrocessionMean: (state, getters) => {
|
||||
// Mean of retrocession
|
||||
return Math.floor(
|
||||
Object.values(state.months)
|
||||
.map(a => a.retro)
|
||||
.reduce(
|
||||
(acc, v) => acc + v,
|
||||
0
|
||||
) / getters.count
|
||||
)
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
updateMonth (state, {date, month}) {
|
||||
updateMonth(state, { date, month }) {
|
||||
state.months[date] = month
|
||||
},
|
||||
createMonth (state, {date, month}) {
|
||||
createMonth (state, { date, month }) {
|
||||
state.months[date] = month
|
||||
},
|
||||
setRange (state, range) {
|
||||
setRange(state, range) {
|
||||
state.range = range
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
actions: {
|
||||
updateMonth (context, {date, month}) {
|
||||
actions: {
|
||||
updateMonth(context, { date, month }) {
|
||||
// update month's datas
|
||||
if (date in context.state.months) {
|
||||
context.commit('updateMonth', {date, month})
|
||||
context.commit('updateMonth', { date, month })
|
||||
} else {
|
||||
console.log("This month does not exists")
|
||||
}
|
||||
},
|
||||
createMonth (context, {date, month}) {
|
||||
createMonth(context, { date, month }) {
|
||||
// Create a new month
|
||||
if (!(date in context.state.months)) {
|
||||
console.log(date)
|
||||
context.commit('createMonth', {date, month})
|
||||
context.commit('createMonth', { date, month })
|
||||
console.log(context.state.months)
|
||||
} else {
|
||||
console.log("This month already exists")
|
||||
}
|
||||
},
|
||||
setRange (context, range) {
|
||||
setRange(context, range) {
|
||||
context.commit("setRange", range)
|
||||
},
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default travail
|
||||
|
Loading…
Reference in New Issue
Block a user