fixed total widgets
This commit is contained in:
		| @@ -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, | ||||
|   | ||||
| @@ -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, | ||||
|   | ||||
| @@ -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, | ||||
|   | ||||
| @@ -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"> | ||||
|   | ||||
| @@ -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"> | ||||
|   | ||||
| @@ -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"> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user