fixed total widgets

This commit is contained in:
denisdulici 2020-02-09 15:23:11 +03:00
parent dc12b1111d
commit 04af057194
6 changed files with 12 additions and 6 deletions

View File

@ -29,6 +29,8 @@ class TotalExpenses extends Widget
$overdue += $overdue_tmp;
});
$grand = $current + $open + $overdue;
$progress = 100;
if (!empty($open) && !empty($overdue)) {
@ -36,7 +38,7 @@ class TotalExpenses extends Widget
}
$totals = [
'current' => $current,
'grand' => money($grand, setting('default.currency'), true),
'open' => money($open, setting('default.currency'), true),
'overdue' => money($overdue, setting('default.currency'), true),
'progress' => $progress,

View File

@ -29,6 +29,8 @@ class TotalIncome extends Widget
$overdue += $overdue_tmp;
});
$grand = $current + $open + $overdue;
$progress = 100;
if (!empty($open) && !empty($overdue)) {
@ -36,7 +38,7 @@ class TotalIncome extends Widget
}
$totals = [
'current' => $current,
'grand' => money($grand, setting('default.currency'), true),
'open' => money($open, setting('default.currency'), true),
'overdue' => money($overdue, setting('default.currency'), true),
'progress' => $progress,

View File

@ -48,6 +48,8 @@ class TotalProfit extends Widget
$open = $open_invoice - $open_bill;
$overdue = $overdue_invoice - $overdue_bill;
$grand = $current + $open + $overdue;
$progress = 100;
if (!empty($open) && !empty($overdue)) {
@ -55,7 +57,7 @@ class TotalProfit extends Widget
}
$totals = [
'current' => $current,
'grand' => money($grand, setting('default.currency'), true),
'open' => money($open, setting('default.currency'), true),
'overdue' => money($overdue, setting('default.currency'), true),
'progress' => $progress,

View File

@ -6,7 +6,7 @@
<div class="row">
<div class="col">
<h5 class="text-uppercase text-white mb-0">{{ $class->model->name }}</h5>
<span class="font-weight-bold text-white mb-0">@money($totals['current'], setting('default.currency'), true)</span>
<span class="font-weight-bold text-white mb-0">{{ $totals['grand'] }}</span>
</div>
<div class="col-auto">

View File

@ -6,7 +6,7 @@
<div class="row">
<div class="col">
<h5 class="text-uppercase text-white mb-0">{{ $class->model->name }}</h5>
<span class="font-weight-bold text-white mb-0">@money($totals['current'], setting('default.currency'), true)</span>
<span class="font-weight-bold text-white mb-0">{{ $totals['grand'] }}</span>
</div>
<div class="col-auto">

View File

@ -6,7 +6,7 @@
<div class="row">
<div class="col">
<h5 class="text-uppercase text-white mb-0">{{ $class->model->name }}</h5>
<span class="font-weight-bold text-white mb-0">@money($totals['current'], setting('default.currency'), true)</span>
<span class="font-weight-bold text-white mb-0">{{ $totals['grand'] }}</span>
</div>
<div class="col-auto">