Skip to content

Firefly III: a personal finances manager

Fix #11328

Sander Dorigo566704434995
diff --git a/app/Http/Controllers/Budget/IndexController.php b/app/Http/Controllers/Budget/IndexController.php
index efe15e03bb..95f6d2167d 100644
--- a/app/Http/Controllers/Budget/IndexController.php
+++ b/app/Http/Controllers/Budget/IndexController.php
@@ -122,6 +122,9 @@ class IndexController extends Controller
$availableBudgets = $this->getAllAvailableBudgets($start, $end);
// get all active budgets:
$budgets = $this->getAllBudgets($start, $end, $currencies, $this->primaryCurrency);
+
+// echo '<pre>';
+// var_dump($budgets[0]);exit;
$sums = $this->getSums($budgets);
// get budgeted for default currency:
diff --git a/resources/views/budgets/index.twig b/resources/views/budgets/index.twig
index 014742cc74..b80d34798d 100644
--- a/resources/views/budgets/index.twig
+++ b/resources/views/budgets/index.twig
@@ -366,13 +366,21 @@
</span>
<br/>
{% endif %}
- {% if spentInfo.currency_id == budgetLimit.currency_id and not budgetLimit.in_range %}
+ {% if spentInfo.currency_id == budgetLimit.currency_id and not budgetLimit.in_range and 0.0 == budgetLimit.total_days %}
<span class="left_span" data-currency="{{ spentInfo.currency_id }}" data-limit="{{ budgetLimit.id }}"
data-value="{{ spentInfo.spent + budgetLimit.amount }}" class="amount_left">
{{ formatAmountBySymbol(spentInfo.spent + budgetLimit.amount, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }}
</span>
<span class="text-muted">({{ 'unknown'|_ }})</span>
{% endif %}
+ {% if spentInfo.currency_id == budgetLimit.currency_id and not budgetLimit.in_range and 0.0 != budgetLimit.total_days %}
+ <span class="left_span" data-currency="{{ spentInfo.currency_id }}" data-limit="{{ budgetLimit.id }}"
+ data-value="{{ spentInfo.spent + budgetLimit.amount }}" class="amount_left">
+ {{ formatAmountBySymbol(spentInfo.spent + budgetLimit.amount, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }}
+ </span>
+ ({{ formatAmountBySymbol((spentInfo.spent + budgetLimit.amount) / budgetLimit.total_days, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }})
+ {% endif %}
+
{% endfor %}
{% if countLimit == 0 %}