2018-08-22 16:42:21 +02:00
|
|
|
{% extends 'base.html.twig' %}
|
|
|
|
{% block body %}
|
2018-08-23 12:18:02 +02:00
|
|
|
{% verbatim %}
|
|
|
|
|
|
|
|
<div id="wrapper">
|
|
|
|
<div class="previsionnel"
|
|
|
|
ng-app="caisse"
|
|
|
|
ng-controller="previsionnelCtrl as pCtrl"
|
|
|
|
>
|
2018-08-23 18:12:32 +02:00
|
|
|
<div class="row">
|
2018-08-28 14:03:04 +02:00
|
|
|
<div class="col-xs-12 col-lg-6">
|
|
|
|
<h1>Prévisionnel</h1>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12 col-lg-6">
|
2018-08-23 18:12:32 +02:00
|
|
|
|
2018-08-28 14:03:04 +02:00
|
|
|
<div ng-if="config.initialLoadingDone && config.loading">
|
|
|
|
<i class="fa fa-spin fa-refresh"></i>
|
|
|
|
Chargement
|
|
|
|
</div>
|
|
|
|
<div ng-if="config.initialLoadingDone && !config.loading">
|
|
|
|
Modifications sauvegardées
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-08-23 18:12:32 +02:00
|
|
|
</div>
|
2018-08-28 14:03:04 +02:00
|
|
|
|
2018-08-23 12:18:02 +02:00
|
|
|
<div class="row">
|
2018-08-27 16:37:27 +02:00
|
|
|
<div class="col-xs-12">
|
2018-08-23 15:00:56 +02:00
|
|
|
<div class="config well">
|
2018-08-23 12:18:02 +02:00
|
|
|
<h2>
|
|
|
|
Configuration
|
|
|
|
</h2>
|
2018-08-28 14:03:04 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12 col-sm-6">
|
|
|
|
<p >
|
2018-08-28 15:29:58 +02:00
|
|
|
<label for="dispo">
|
2018-08-28 14:03:04 +02:00
|
|
|
|
|
|
|
Euros disponibles au départ:
|
2018-08-28 15:29:58 +02:00
|
|
|
</label>
|
2018-08-28 14:03:04 +02:00
|
|
|
<input
|
2018-08-28 15:29:58 +02:00
|
|
|
id="dispo"
|
|
|
|
class="big-number"
|
2018-08-28 14:03:04 +02:00
|
|
|
type="number"
|
|
|
|
ng-model="config.disponibility"
|
|
|
|
ng-change="save()"
|
|
|
|
ng-model-options="{ debounce: config.debounceTime }">
|
|
|
|
<br>
|
2018-08-28 15:29:58 +02:00
|
|
|
<label for="gains">
|
2018-08-28 14:03:04 +02:00
|
|
|
Gains moyen par mois:
|
2018-08-28 15:29:58 +02:00
|
|
|
</label>
|
|
|
|
|
2018-08-28 14:03:04 +02:00
|
|
|
<input type="number"
|
2018-08-28 15:29:58 +02:00
|
|
|
class="big-number"
|
|
|
|
id="gains"
|
2018-08-28 14:03:04 +02:00
|
|
|
ng-model="config.averageMonthlyEarnings"
|
|
|
|
ng-change="save()"
|
|
|
|
ng-model-options="{ debounce: config.debounceTime }">
|
|
|
|
</p>
|
2018-08-23 15:00:56 +02:00
|
|
|
<p>
|
2018-08-28 14:03:04 +02:00
|
|
|
Gérer délais de paiement
|
|
|
|
<input type="checkbox" ng-model="config.showDelays">
|
|
|
|
Gérer répétitions
|
|
|
|
<input type="checkbox" ng-model="config.showRepeats">
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12 col-sm-6">
|
2018-08-23 15:09:43 +02:00
|
|
|
<p>
|
2018-08-28 14:03:04 +02:00
|
|
|
<strong>
|
2018-08-28 15:29:58 +02:00
|
|
|
Dépenses mensuelles:
|
|
|
|
<span class="big-number">
|
|
|
|
|
|
|
|
{{ sumMonthlyExpenses() }} €
|
|
|
|
</span>
|
2018-08-28 14:03:04 +02:00
|
|
|
</strong>
|
|
|
|
</p>
|
2018-08-23 15:00:56 +02:00
|
|
|
<p>
|
2018-08-28 14:03:04 +02:00
|
|
|
<strong>
|
2018-08-28 15:29:58 +02:00
|
|
|
Bénef mensuel: <span class="big-number">{{ config.averageMonthlyEarnings - sumMonthlyExpenses() }} €</span>
|
2018-08-28 14:03:04 +02:00
|
|
|
</strong>
|
|
|
|
</p>
|
2018-08-23 15:00:56 +02:00
|
|
|
<p>
|
|
|
|
Crédit mensuel réalisable (33% des gains moyens par mois): {{ config.averageMonthlyEarnings * 0.33 |number }} €
|
2018-08-28 14:03:04 +02:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2018-08-23 12:18:02 +02:00
|
|
|
</div>
|
2018-08-27 16:37:27 +02:00
|
|
|
</div>
|
2018-08-28 14:03:04 +02:00
|
|
|
<div class="col-xs-12 col-lg-7 postes">
|
2018-08-23 18:12:32 +02:00
|
|
|
<h2>
|
|
|
|
{{expenses.length}} Postes de dépenses mensuelles
|
2018-08-23 12:18:02 +02:00
|
|
|
<button ng-click="addExpense()">+</button>
|
|
|
|
</h2>
|
|
|
|
<p class="desc">
|
|
|
|
Indiquez les catégories de dépenses mensuelles que vous faites pour faire évoluer la
|
|
|
|
simulation de budget restant dans plusieurs mois.
|
|
|
|
</p>
|
2018-08-28 15:29:58 +02:00
|
|
|
<table class="exepanse-table">
|
2018-08-23 12:18:02 +02:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2018-08-23 15:00:56 +02:00
|
|
|
<td class="padded" >
|
2018-08-23 12:18:02 +02:00
|
|
|
Nom
|
|
|
|
</td>
|
2018-08-23 15:09:43 +02:00
|
|
|
<td class="padded" ng-if="config.showDelays">
|
2018-08-23 12:18:02 +02:00
|
|
|
débute dans X mois
|
|
|
|
</td>
|
2018-08-23 15:09:43 +02:00
|
|
|
<td class="padded" ng-if="config.showRepeats">
|
2018-08-23 12:18:02 +02:00
|
|
|
mois répétitions
|
|
|
|
</td>
|
2018-08-23 15:09:43 +02:00
|
|
|
<td class="padded" ng-if="config.showRepeats">
|
2018-08-23 12:18:02 +02:00
|
|
|
prix répétitions
|
|
|
|
</td>
|
2018-08-23 15:00:56 +02:00
|
|
|
<td class="padded" >
|
2018-08-23 12:18:02 +02:00
|
|
|
prix mensuel
|
|
|
|
</td>
|
2018-08-23 15:00:56 +02:00
|
|
|
<td class="padded" >
|
2018-08-23 12:18:02 +02:00
|
|
|
prix annuel
|
|
|
|
</td>
|
2018-08-23 15:00:56 +02:00
|
|
|
<td class="padded" >
|
|
|
|
activé
|
|
|
|
</td>
|
2018-08-23 12:18:02 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
2018-08-22 16:42:21 +02:00
|
|
|
|
2018-08-23 12:18:02 +02:00
|
|
|
<tbody>
|
2018-08-22 16:42:21 +02:00
|
|
|
|
2018-08-23 12:18:02 +02:00
|
|
|
</tbody>
|
2018-08-23 15:00:56 +02:00
|
|
|
<tr ng-repeat="e in expenses ">
|
2018-08-23 12:18:02 +02:00
|
|
|
<td>
|
2018-08-28 11:15:07 +02:00
|
|
|
<input type="text" ng-model="e.name" ng-change="save()" ng-model-options="{ debounce: config.debounceTime }">
|
2018-08-23 12:18:02 +02:00
|
|
|
</td>
|
2018-08-23 15:09:43 +02:00
|
|
|
<td ng-if="config.showDelays">
|
2018-08-23 12:18:02 +02:00
|
|
|
|
2018-08-28 11:15:07 +02:00
|
|
|
<input type="number" ng-model="e.delay" ng-change="save()" ng-model-options="{ debounce: config.debounceTime }">
|
2018-08-23 12:18:02 +02:00
|
|
|
</td>
|
2018-08-23 15:09:43 +02:00
|
|
|
<td ng-if="config.showRepeats">
|
2018-08-28 11:15:07 +02:00
|
|
|
<input type="number" ng-model="e.repeat" ng-change="save()" ng-model-options="{ debounce: config.debounceTime }">
|
2018-08-23 12:18:02 +02:00
|
|
|
</td>
|
2018-08-23 15:09:43 +02:00
|
|
|
<td ng-if="config.showRepeats" class="text-right padded">
|
2018-08-23 12:18:02 +02:00
|
|
|
{{ e.repeat * e.amount }}
|
|
|
|
</td>
|
|
|
|
<td>
|
2018-08-28 11:15:07 +02:00
|
|
|
<input type="number" ng-model="e.amount" ng-change="save()" ng-model-options="{ debounce: config.debounceTime }">
|
2018-08-23 12:18:02 +02:00
|
|
|
</td>
|
|
|
|
<td class="text-right padded">
|
2018-08-23 15:00:56 +02:00
|
|
|
<strong>
|
|
|
|
|
|
|
|
{{ e.amount * 12 }}
|
|
|
|
</strong>
|
|
|
|
€
|
2018-08-23 12:18:02 +02:00
|
|
|
</td>
|
2018-08-23 15:00:56 +02:00
|
|
|
<td class="padded">
|
2018-08-28 11:15:07 +02:00
|
|
|
<input type="checkbox" ng-model="e.enabled" ng-change="save()" ng-model-options="{ debounce: config.debounceTime }">
|
2018-08-23 15:00:56 +02:00
|
|
|
</td>
|
2018-08-23 12:18:02 +02:00
|
|
|
</tr>
|
|
|
|
</table>
|
2018-08-23 15:00:56 +02:00
|
|
|
<div class="well examples-depenses">
|
2018-08-23 12:18:02 +02:00
|
|
|
<strong>
|
2018-08-23 15:36:36 +02:00
|
|
|
Exemples de postes de dépenses à ajouter:
|
2018-08-23 12:18:02 +02:00
|
|
|
</strong>
|
2018-08-23 15:00:56 +02:00
|
|
|
{% endverbatim %}
|
|
|
|
{{ "
|
2018-08-23 12:18:02 +02:00
|
|
|
appartement
|
|
|
|
mutuelle
|
|
|
|
transport en commun
|
|
|
|
assurance voiture
|
|
|
|
assurance moto
|
|
|
|
trucs de loisirs divers
|
|
|
|
gaz
|
|
|
|
elec
|
|
|
|
internet
|
|
|
|
épargne
|
|
|
|
impots
|
|
|
|
cottisation URSSAF
|
|
|
|
resto au boulot
|
|
|
|
courses
|
|
|
|
serveur wouaibe
|
|
|
|
abonnement protonmail VPN
|
|
|
|
abonnement service audio, vidéo
|
|
|
|
carburant véhicule
|
|
|
|
donations
|
|
|
|
médecin
|
|
|
|
chat
|
|
|
|
chien
|
2018-08-23 15:00:56 +02:00
|
|
|
licorne"|nl2br }}
|
|
|
|
|
|
|
|
{% verbatim %}
|
|
|
|
|
2018-08-23 12:18:02 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-08-28 14:03:04 +02:00
|
|
|
|
2018-08-27 16:37:27 +02:00
|
|
|
<div class="col-sm-12 col-lg-5">
|
2018-08-22 16:42:21 +02:00
|
|
|
|
2018-08-23 15:00:56 +02:00
|
|
|
<h2>Simulation sur {{config.lines}} mois</h2>
|
2018-08-28 15:16:13 +02:00
|
|
|
<div class="" id="simulationPrevision" style="display: inline-block; height: 300px; width: 90%;">(graphique)</div>
|
|
|
|
|
2018-08-28 14:53:05 +02:00
|
|
|
<!--block to insert the graph-->
|
2018-08-28 15:29:58 +02:00
|
|
|
<div class="well big-number" ng-if="config.monthsBeforeNoMoney && config.monthsBeforeNoMoney <= config.lines">
|
|
|
|
<i class="fa fa-warning"></i>
|
2018-08-23 15:09:43 +02:00
|
|
|
Ce sera la dèche dans {{config.monthsBeforeNoMoney}} mois
|
2018-08-28 15:29:58 +02:00
|
|
|
</div>
|
|
|
|
<div ng-if=" ! config.monthsBeforeNoMoney" class="bg-success padded">
|
|
|
|
cool ! votre plan est supportable dans le temps
|
2018-08-23 15:09:43 +02:00
|
|
|
</div>
|
2018-08-23 12:18:02 +02:00
|
|
|
<table>
|
|
|
|
<thead>
|
2018-08-23 15:00:56 +02:00
|
|
|
<tr >
|
|
|
|
<td class="padded" >
|
2018-08-23 12:18:02 +02:00
|
|
|
Month in the future
|
|
|
|
</td>
|
2018-08-23 15:00:56 +02:00
|
|
|
<td class="padded" >
|
2018-08-23 12:18:02 +02:00
|
|
|
date
|
|
|
|
</td>
|
2018-08-23 15:00:56 +02:00
|
|
|
<td class="padded" >
|
2018-08-23 12:18:02 +02:00
|
|
|
Dépenses
|
|
|
|
</td>
|
2018-08-23 15:00:56 +02:00
|
|
|
<td class="padded" >
|
2018-08-23 12:18:02 +02:00
|
|
|
Disponibilité
|
|
|
|
</td>
|
2018-08-23 15:00:56 +02:00
|
|
|
</trclass>
|
2018-08-23 12:18:02 +02:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-08-28 15:16:13 +02:00
|
|
|
<tr ng-repeat="line in previsionTable" >
|
2018-08-23 12:18:02 +02:00
|
|
|
<td>
|
2018-08-23 15:00:56 +02:00
|
|
|
<div ng-if="line.available > config.warningThershold"
|
|
|
|
class=" bgsuccess padded ">
|
2018-08-23 12:18:02 +02:00
|
|
|
{{ $index }}
|
2018-08-23 15:00:56 +02:00
|
|
|
</div>
|
|
|
|
<div ng-if="line.available > 0 && line.available < config.warningThershold"
|
|
|
|
class="bgwarning padded ">
|
|
|
|
{{ $index }} bientôt la dèche
|
|
|
|
</div>
|
|
|
|
<div ng-if="line.available < 0"
|
|
|
|
class="bgdanger padded ">
|
|
|
|
{{ $index }} DAMNED pu de pognon!
|
|
|
|
</div>
|
2018-08-23 12:18:02 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
-
|
|
|
|
</td>
|
2018-08-23 12:24:02 +02:00
|
|
|
<td class="text-right ">
|
2018-08-22 17:10:01 +02:00
|
|
|
|
2018-08-23 12:18:02 +02:00
|
|
|
{{ line.expense }}
|
|
|
|
</td>
|
2018-08-23 15:00:56 +02:00
|
|
|
<td class="text-right"
|
|
|
|
ngClass="{'bgdanger' : line.available < 0 }">
|
|
|
|
|
|
|
|
<strong>
|
2018-08-22 16:42:21 +02:00
|
|
|
|
2018-08-23 15:00:56 +02:00
|
|
|
{{ line.available}}
|
|
|
|
</strong>
|
|
|
|
€
|
2018-08-23 12:18:02 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2018-08-28 14:03:04 +02:00
|
|
|
</div>
|
2018-08-23 12:18:02 +02:00
|
|
|
</div>
|
2018-08-22 16:42:21 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-08-28 15:16:13 +02:00
|
|
|
<!--<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>-->
|
|
|
|
<script>
|
|
|
|
|
|
|
|
var dataPoints = {{graphPointsPrevision}} ;
|
|
|
|
var chartContainerChiffreAffaire = new CanvasJS.Chart("simulationPrevision", {
|
|
|
|
title:{
|
|
|
|
text: "Euros disponibles dans le temps"
|
|
|
|
},
|
|
|
|
animationEnabled: true,
|
|
|
|
data: [
|
|
|
|
{
|
|
|
|
// Change type to "doughnut", "line", "splineArea", etc.
|
|
|
|
type: "splineArea",
|
|
|
|
dataPoints: dataPoints
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
|
|
|
chartContainerChiffreAffaire.render();
|
|
|
|
</script>
|
|
|
|
|
2018-08-23 12:18:02 +02:00
|
|
|
{% endverbatim %}
|
|
|
|
{% endblock %}
|