mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-18 04:19:12 +00:00
Some expansion on the index of repeated expenses, and the first reference to the show page.
This commit is contained in:
@@ -205,10 +205,14 @@ class Piggybank
|
||||
*/
|
||||
public function validateRepeatedExpenses()
|
||||
{
|
||||
if(!\Auth::check()) {
|
||||
return;
|
||||
}
|
||||
/** @var \FireflyIII\Database\RepeatedExpense $repository */
|
||||
$repository = \App::make('FireflyIII\Database\RepeatedExpense');
|
||||
|
||||
$list = $repository->get();
|
||||
$list = $repository->get();
|
||||
$today = Carbon::now();
|
||||
|
||||
/** @var \Piggybank $entry */
|
||||
foreach ($list as $entry) {
|
||||
@@ -225,7 +229,7 @@ class Piggybank
|
||||
$repetition->save();
|
||||
}
|
||||
// then continue and do something in the current relevant timeframe.
|
||||
$today = Carbon::now();
|
||||
|
||||
$currentTarget = clone $target;
|
||||
$currentStart = null;
|
||||
while ($currentTarget < $today) {
|
||||
@@ -243,7 +247,6 @@ class Piggybank
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ class Date
|
||||
case 'monthly':
|
||||
$date->addMonths($add);
|
||||
break;
|
||||
case 'quarter':
|
||||
case 'quarterly':
|
||||
$months = $add * 3;
|
||||
$date->addMonths($months);
|
||||
@@ -142,6 +143,7 @@ class Date
|
||||
case 'monthly':
|
||||
$date->startOfMonth();
|
||||
break;
|
||||
case 'quarter':
|
||||
case 'quarterly':
|
||||
$date->firstOfQuarter();
|
||||
break;
|
||||
@@ -184,6 +186,7 @@ class Date
|
||||
case 'monthly':
|
||||
$date->subMonths($subtract);
|
||||
break;
|
||||
case 'quarter':
|
||||
case 'quarterly':
|
||||
$months = $subtract * 3;
|
||||
$date->subMonths($months);
|
||||
|
||||
Reference in New Issue
Block a user