Compare commits
No commits in common. "a021fe80937d7e9515646e8854b127a8680f3315" and "7b742d599a0ee25647aafc8a1157d37f6e5793ca" have entirely different histories.
a021fe8093
...
7b742d599a
1605
package-lock.json
generated
1605
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -15,7 +15,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
"date-fns": "^2.23.0",
|
"date-fns": "^2.23.0",
|
||||||
"vls": "^0.7.4",
|
|
||||||
"vue": "^3.0.0",
|
"vue": "^3.0.0",
|
||||||
"vue-router": "^4.0.8",
|
"vue-router": "^4.0.8",
|
||||||
"vuex": "^4.0.2"
|
"vuex": "^4.0.2"
|
||||||
|
@ -9,7 +9,7 @@ import Nav from './components/nav.vue'
|
|||||||
export default {
|
export default {
|
||||||
name: 'App',
|
name: 'App',
|
||||||
components: {
|
components: {
|
||||||
Nav
|
Nav
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -27,8 +27,8 @@
|
|||||||
<input type="number" v-model="monthCopy.retro" id="retro" class="value" >
|
<input type="number" v-model="monthCopy.retro" id="retro" class="value" >
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="remuneration">Rémunération effectuée</label>
|
<label for="remumeration">Rémunération effectuée</label>
|
||||||
<input type="number" v-model="monthCopy.remuneration" id="remuneration" class="value">
|
<input type="number" v-model="monthCopy.remumeration" id="remumeration" class="value">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -6,17 +6,17 @@
|
|||||||
<div id="display">
|
<div id="display">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="ca-theo">CA "Séances effectuées"</label>
|
<label for="ca-theo">CA théorique</label>
|
||||||
<span class="value" v-show="!editing">{{ TheMonth.ca_theo ?? "∅"}}€</span>
|
<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">
|
<input type="number" v-model="monthCopy.ca_theo" id="ca-theo" class="value" v-show="editing">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="ca-retro">CA "Séances facturées"</label>
|
<label for="ca-retro">CA rétrocession</label>
|
||||||
<span class="value" v-show="!editing">{{ TheMonth.ca_retro ?? "∅"}}€</span>
|
<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">
|
<input type="number" v-model="monthCopy.ca_retro" id="ca-retro" class="value" v-show="editing">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="ca-react">CA "Séances facturées" réactualisé</label>
|
<label for="ca-react">CA réactualisé</label>
|
||||||
<span class="value" v-show="!editing">{{ TheMonth.ca_react ?? "∅"}}€</span>
|
<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">
|
<input type="number" v-model="monthCopy.ca_react" id="ca-react" class="value" v-show="editing">
|
||||||
</li>
|
</li>
|
||||||
@ -31,9 +31,9 @@
|
|||||||
<input type="number" v-model="monthCopy.retro" id="retro" class="value" v-show="editing">
|
<input type="number" v-model="monthCopy.retro" id="retro" class="value" v-show="editing">
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<label for="remuneration">Rémunération </label>
|
<label for="remumeration">Rémunération effectuée</label>
|
||||||
<span class="value" v-show="!editing">{{ TheMonth.remuneration ?? "∅"}}€</span>
|
<span class="value" v-show="!editing">{{ TheMonth.remumeration ?? "∅"}}€</span>
|
||||||
<input type="number" v-model="monthCopy.remuneration" id="remuneration" class="value" v-show="editing">
|
<input type="number" v-model="monthCopy.remumeration" id="remumeration" class="value" v-show="editing">
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,80 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="hightlights">
|
|
||||||
<div class="hightlight">
|
|
||||||
<ul>
|
|
||||||
<li>{{ ca }}</li>
|
|
||||||
<li>CA</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="hightlight">
|
|
||||||
<ul>
|
|
||||||
<li>{{ caMean }}</li>
|
|
||||||
<li>CA moyen</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="hightlight">
|
|
||||||
<ul>
|
|
||||||
<li>{{ caTheo }}</li>
|
|
||||||
<li>CA des séances effectuées</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="hightlight">
|
|
||||||
<ul>
|
|
||||||
<li>{{ caTheo - ca }}</li>
|
|
||||||
<li>Non facturé</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="hightlight">
|
|
||||||
<ul>
|
|
||||||
<li>{{ remuneration }}</li>
|
|
||||||
<li>Rémunération</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="hightlight">
|
|
||||||
<ul>
|
|
||||||
<li>{{ remunerationMean }}</li>
|
|
||||||
<li>Rémunération moyenne</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="hightlight">
|
|
||||||
<ul>
|
|
||||||
<li>{{ retrocession }}</li>
|
|
||||||
<li>Rétrocession</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div class="hightlight">
|
|
||||||
<ul>
|
|
||||||
<li>{{ retrocessionMean }}</li>
|
|
||||||
<li>Rétrocession moyenne</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { mapGetters } from 'vuex'
|
|
||||||
export default {
|
|
||||||
name: 'Hightlights',
|
|
||||||
components: {
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters('travail', {
|
|
||||||
ca: "ca",
|
|
||||||
caMean: "caMean",
|
|
||||||
caTheo: "caTheo",
|
|
||||||
remuneration: "remuneration",
|
|
||||||
remunerationMean: "remunerationMean",
|
|
||||||
retrocession: "retrocession",
|
|
||||||
retrocessionMean: "retrocessionMean",
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
</style>
|
|
@ -1,14 +1,6 @@
|
|||||||
function monthCA(month) {
|
|
||||||
if (month.ca_react) {
|
|
||||||
return month.ca_react
|
|
||||||
} else {
|
|
||||||
return month.ca_retro
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const travail = {
|
const travail = {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state() {
|
state () {
|
||||||
return {
|
return {
|
||||||
empty: {
|
empty: {
|
||||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||||
@ -16,7 +8,7 @@ const travail = {
|
|||||||
ca_retro: null, // ca au moment de la rétrocession
|
ca_retro: null, // ca au moment de la rétrocession
|
||||||
ca_react: null, // ca réactualisé
|
ca_react: null, // ca réactualisé
|
||||||
retro: 0, // montant de la rétrocession
|
retro: 0, // montant de la rétrocession
|
||||||
remuneration: 0, // rémunération décidée
|
remumeration: 0, // rémunération décidée
|
||||||
},
|
},
|
||||||
months: {
|
months: {
|
||||||
"2021-01": {
|
"2021-01": {
|
||||||
@ -25,7 +17,7 @@ const travail = {
|
|||||||
ca_retro: 6747, // ca au moment de la rétrocession
|
ca_retro: 6747, // ca au moment de la rétrocession
|
||||||
ca_react: null, // ca réactualisé
|
ca_react: null, // ca réactualisé
|
||||||
retro: 893, // montant de la rétrocession
|
retro: 893, // montant de la rétrocession
|
||||||
remuneration: 2000, // rémunération décidée
|
remumeration: 2000, // rémunération décidée
|
||||||
},
|
},
|
||||||
"2021-02": {
|
"2021-02": {
|
||||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||||
@ -33,7 +25,7 @@ const travail = {
|
|||||||
ca_retro: 5183, // ca au moment de la rétrocession
|
ca_retro: 5183, // ca au moment de la rétrocession
|
||||||
ca_react: null, // ca réactualisé
|
ca_react: null, // ca réactualisé
|
||||||
retro: 665, // montant de la rétrocession
|
retro: 665, // montant de la rétrocession
|
||||||
remuneration: 1500, // rémunération décidée
|
remumeration: 1500, // rémunération décidée
|
||||||
},
|
},
|
||||||
"2021-03": {
|
"2021-03": {
|
||||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||||
@ -41,7 +33,7 @@ const travail = {
|
|||||||
ca_retro: 7088, // ca au moment de la rétrocession
|
ca_retro: 7088, // ca au moment de la rétrocession
|
||||||
ca_react: null, // ca réactualisé
|
ca_react: null, // ca réactualisé
|
||||||
retro: 855, // montant de la rétrocession
|
retro: 855, // montant de la rétrocession
|
||||||
remuneration: 2000, // rémunération décidée
|
remumeration: 2000, // rémunération décidée
|
||||||
},
|
},
|
||||||
"2021-04": {
|
"2021-04": {
|
||||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||||
@ -49,7 +41,7 @@ const travail = {
|
|||||||
ca_retro: 4194, // ca au moment de la rétrocession
|
ca_retro: 4194, // ca au moment de la rétrocession
|
||||||
ca_react: 5630, // ca réactualisé
|
ca_react: 5630, // ca réactualisé
|
||||||
retro: 627, // montant de la rétrocession
|
retro: 627, // montant de la rétrocession
|
||||||
remuneration: 2000, // rémunération décidée
|
remumeration: 2000, // rémunération décidée
|
||||||
},
|
},
|
||||||
"2021-05": {
|
"2021-05": {
|
||||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||||
@ -57,7 +49,7 @@ const travail = {
|
|||||||
ca_retro: 5564, // ca au moment de la rétrocession
|
ca_retro: 5564, // ca au moment de la rétrocession
|
||||||
ca_react: 6335, // ca réactualisé
|
ca_react: 6335, // ca réactualisé
|
||||||
retro: 699, // montant de la rétrocession
|
retro: 699, // montant de la rétrocession
|
||||||
remuneration: 2800, // rémunération décidée
|
remumeration: 2800, // rémunération décidée
|
||||||
},
|
},
|
||||||
"2021-06": {
|
"2021-06": {
|
||||||
ca_theo: null, // ca théorique basé sur les séances effectuées
|
ca_theo: null, // ca théorique basé sur les séances effectuées
|
||||||
@ -65,7 +57,7 @@ const travail = {
|
|||||||
ca_retro: 5442, // ca au moment de la rétrocession
|
ca_retro: 5442, // ca au moment de la rétrocession
|
||||||
ca_react: 6335, // ca réactualisé
|
ca_react: 6335, // ca réactualisé
|
||||||
retro: 638, // montant de la rétrocession
|
retro: 638, // montant de la rétrocession
|
||||||
remuneration: 2800, // rémunération décidée
|
remumeration: 2800, // rémunération décidée
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
range: {
|
range: {
|
||||||
@ -75,124 +67,57 @@ const travail = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
TheEmptyMonth(state) { return { ...state.empty } },
|
Count (state) {return state.months.length},
|
||||||
Range(state) { return state.range },
|
TheEmptyMonth (state) {return {...state.empty}},
|
||||||
MonthsDate(state) {
|
Range (state) {return state.range},
|
||||||
|
MonthsDate (state) {
|
||||||
// Get months inside the range
|
// 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
|
// Get all the months
|
||||||
return Object.keys(state.months).sort().reverse()
|
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) => {
|
getMonth: (state) => (date) => {
|
||||||
return state.months[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: {
|
mutations: {
|
||||||
updateMonth(state, { date, month }) {
|
updateMonth (state, {date, month}) {
|
||||||
state.months[date] = month
|
state.months[date] = month
|
||||||
},
|
},
|
||||||
createMonth (state, { date, month }) {
|
createMonth (state, {date, month}) {
|
||||||
state.months[date] = month
|
state.months[date] = month
|
||||||
},
|
},
|
||||||
setRange(state, range) {
|
setRange (state, range) {
|
||||||
state.range = range
|
state.range = range
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
updateMonth(context, { date, month }) {
|
updateMonth (context, {date, month}) {
|
||||||
// update month's datas
|
// update month's datas
|
||||||
if (date in context.state.months) {
|
if (date in context.state.months) {
|
||||||
context.commit('updateMonth', { date, month })
|
context.commit('updateMonth', {date, month})
|
||||||
} else {
|
} else {
|
||||||
console.log("This month does not exists")
|
console.log("This month does not exists")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
createMonth(context, { date, month }) {
|
createMonth (context, {date, month}) {
|
||||||
// Create a new month
|
// Create a new month
|
||||||
if (!(date in context.state.months)) {
|
if (!(date in context.state.months)) {
|
||||||
console.log(date)
|
console.log(date)
|
||||||
context.commit('createMonth', { date, month })
|
context.commit('createMonth', {date, month})
|
||||||
console.log(context.state.months)
|
console.log(context.state.months)
|
||||||
} else {
|
} else {
|
||||||
console.log("This month already exists")
|
console.log("This month already exists")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setRange(context, range) {
|
setRange (context, range) {
|
||||||
context.commit("setRange", range)
|
context.commit("setRange", range)
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export default travail
|
export default travail
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
</section>
|
</section>
|
||||||
<section id="stats">
|
<section id="stats">
|
||||||
<h2>Résumé</h2>
|
<h2>Résumé</h2>
|
||||||
<highlights></highlights>
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -22,14 +23,12 @@ import { mapGetters, mapActions } from 'vuex'
|
|||||||
import MonthsList from '../components/MonthsUl.vue'
|
import MonthsList from '../components/MonthsUl.vue'
|
||||||
import CreateMonth from '../components/CreateMonth.vue'
|
import CreateMonth from '../components/CreateMonth.vue'
|
||||||
import MonthSelector from '../components/monthSelector.vue'
|
import MonthSelector from '../components/monthSelector.vue'
|
||||||
import Highlights from '../components/hightlights.vue'
|
|
||||||
export default {
|
export default {
|
||||||
name: 'home',
|
name: 'home',
|
||||||
components: {
|
components: {
|
||||||
MonthsList: MonthsList,
|
MonthsList: MonthsList,
|
||||||
CreateMonth: CreateMonth,
|
CreateMonth: CreateMonth,
|
||||||
MonthSelector: MonthSelector,
|
MonthSelector: MonthSelector,
|
||||||
highlights: Highlights,
|
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {}
|
return {}
|
||||||
|
Loading…
Reference in New Issue
Block a user