diff --git a/app/controllers/RepeatedExpenseController.php b/app/controllers/RepeatedExpenseController.php index a72da7bba0..9284cc43a7 100644 --- a/app/controllers/RepeatedExpenseController.php +++ b/app/controllers/RepeatedExpenseController.php @@ -39,7 +39,6 @@ class RepeatedExpenseController extends BaseController $expenses->each( function (Piggybank $piggyBank) use ($repository) { $piggyBank->currentRelevantRep(); - $piggyBank->currentRep = $repository->calculateParts($piggyBank->currentRep); } ); diff --git a/app/lib/FireflyIII/Shared/Toolkit/Steam.php b/app/lib/FireflyIII/Shared/Toolkit/Steam.php index 50b06fce46..3b52592a6b 100644 --- a/app/lib/FireflyIII/Shared/Toolkit/Steam.php +++ b/app/lib/FireflyIII/Shared/Toolkit/Steam.php @@ -1,6 +1,7 @@ currentamount / $piggyBank->targetamount * 100; + if ($pct > 100) { + return 100; + } else { + return floor($pct); + } + } + } \ No newline at end of file diff --git a/app/views/repeatedexpense/index.blade.php b/app/views/repeatedexpense/index.blade.php index 00b8115387..5df04f1f7f 100644 --- a/app/views/repeatedexpense/index.blade.php +++ b/app/views/repeatedexpense/index.blade.php @@ -13,68 +13,34 @@ -@foreach($expenses as $entry) -currentRep->bars->count()) == 0 ? 1 : floor(12 / $entry->currentRep->bars->count()); -?>
-
+@foreach($expenses as $entry) +
{{{$entry->name}}} + ({{mf($entry->targetamount)}})
-
-
-

- Target amount: {{mf($entry->targetamount)}}. Currently saved: {{mf($entry->currentRep->currentamount)}}. Left to save: {{mf($entry->targetamount-$entry->currentRep->currentamount)}}
- Runs from {{$entry->currentRep->startdate->format('j F Y')}} to {{$entry->currentRep->targetdate->format('j F Y')}} -

+
+
+ @if(Steam::percentage($entry,$entry->currentRep) > 30) + {{mf($entry->currentRep->currentamount,false)}} + @endif
+ @if(Steam::percentage($entry,$entry->currentRep) <= 30) +  {{mf($entry->currentRep->currentamount,false)}} + @endif
-
- @foreach($entry->currentRep->bars as $bar) -
-
- -
-
-
- -
- @endforeach - {{-- - @for($i=0;$i<$entry->parts;$i++) - -
-
- @if($entry->currentRep->currentamount < $entry->bars[$i]['amount']) - -
{{mf($entry->bars[$i]['amount'],false)}}
- @else - -
{{mf($entry->bars[$i]['amount'],false)}}
- @endif -
- -
- @endfor - --}} -
-
- {{-- - @for($i=0;$i<$entry->parts;$i++) -
- {{DateKit::periodShow($entry->bars[$i]['date'],$entry->reminder)}} -
- @endfor - --}} -
+
+
+ @endforeach
-@endforeach + diff --git a/app/views/repeatedexpense/show.blade.php b/app/views/repeatedexpense/show.blade.php index 1e29b380dc..19455c3641 100644 --- a/app/views/repeatedexpense/show.blade.php +++ b/app/views/repeatedexpense/show.blade.php @@ -43,9 +43,11 @@ {{mf($rep->currentamount,false)}} @endif
-
-
+
+

+ {{$bar->getStartDate()->format('j F Y')}} — {{$bar->getTargetDate()->format('j F Y')}} +

@endforeach