diff --git a/app/Resources/views/logged/previsionnel.html.twig b/app/Resources/views/logged/previsionnel.html.twig
index 6ee05212..1e9dc713 100755
--- a/app/Resources/views/logged/previsionnel.html.twig
+++ b/app/Resources/views/logged/previsionnel.html.twig
@@ -25,6 +25,12 @@
+
+ Gérer délais
+
+ Gérer répétitions
+
+
Dépenses mensuelles: {{ sumMonthlyExpenses() }} €
@@ -55,13 +61,13 @@
Nom
|
-
+ |
débute dans X mois
|
-
+ |
mois répétitions
|
-
+ |
prix répétitions
|
@@ -83,14 +89,14 @@
|
|
-
+ |
|
-
+ |
|
-
+ |
{{ e.repeat * e.amount }}
|
@@ -146,6 +152,9 @@
Simulation sur {{config.lines}} mois
+
+ Ce sera la dèche dans {{config.monthsBeforeNoMoney}} mois
+
diff --git a/assets/js/parts/main.js b/assets/js/parts/main.js
index 08d7e2f2..2b48b475 100755
--- a/assets/js/parts/main.js
+++ b/assets/js/parts/main.js
@@ -232,7 +232,10 @@ angular
*/
disponibility: 5000,
averageMonthlyEarnings: 600,
- warningThershold: 2000
+ warningThershold: 2000,
+ showDelays: false,
+ showRepeats: false,
+ monthsBeforeNoMoney: null,
};
let exampleExpenses = [
@@ -266,6 +269,7 @@ angular
let monthly = $scope.sumMonthlyExpenses();
let available = $scope.config.disponibility;
let previsionTable = [];
+ let changedNoMoneyConfig = false;
for (let i = 0; i <= turns; i++) {
// TODO take in account delays in expenses
available = available - monthly + $scope.config.averageMonthlyEarnings;
@@ -273,6 +277,10 @@ angular
expense: monthly,
available: available,
};
+ if (available <= 0 && !changedNoMoneyConfig) {
+ $scope.config.monthsBeforeNoMoney = i;
+ changedNoMoneyConfig = true;
+ }
previsionTable.push(newLine);
}
return previsionTable;
|