mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-21 09:00:07 +00:00
This will be the first release!
This commit is contained in:
@@ -110,8 +110,8 @@ class Budget implements BudgetInterface
|
||||
// get the limits:
|
||||
if ($useSessionDates) {
|
||||
$limits = $budget->limits()->where('startdate', '>=', $sessionStart->format('Y-m-d'))->where(
|
||||
'startdate', '<=', $sessionEnd->format('Y-m-d')
|
||||
)->get();
|
||||
'startdate', '<=', $sessionEnd->format('Y-m-d')
|
||||
)->get();
|
||||
} else {
|
||||
$limits = $budget->limits;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ interface BudgetInterface
|
||||
|
||||
/**
|
||||
* @param \Budget $budget
|
||||
* @param bool $useSessionDates
|
||||
* @param bool $useSessionDates
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function organizeRepetitions(\Budget $budget, $useSessionDates = false);
|
||||
|
||||
@@ -169,8 +169,8 @@ class Chart implements ChartInterface
|
||||
$amount = floatval($rep->amount);
|
||||
$spent = $rep->spent;
|
||||
$color = $spent > $amount ? '#FF0000' : null;
|
||||
$data['series'][0]['data'][] = ['y' => $amount, 'id' => 'def'];
|
||||
$data['series'][1]['data'][] = ['y' => $rep->spent, 'color' => $color, 'id' => 'abc'];
|
||||
$data['series'][0]['data'][] = ['y' => $amount, 'id' => 'amount-' . $rep->id];
|
||||
$data['series'][1]['data'][] = ['y' => $rep->spent, 'color' => $color, 'id' => 'spent-' . $rep->id];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,29 @@ class Toolkit implements ToolkitInterface
|
||||
return [\Session::get('start'), \Session::get('end')];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getReminders()
|
||||
{
|
||||
// get reminders, for menu, mumble mumble:
|
||||
$today = new Carbon;
|
||||
$reminders = \Auth::user()->reminders()->where('class', 'PiggybankReminder')->validOn($today)->get();
|
||||
|
||||
/** @var \Reminder $reminder */
|
||||
foreach ($reminders as $index => $reminder) {
|
||||
if (\Session::has('dismissal-' . $reminder->id)) {
|
||||
$time = \Session::get('dismissal-' . $reminder->id);
|
||||
if ($time >= $today) {
|
||||
unset($reminders[$index]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
\Session::put('reminderCount', count($reminders));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -302,26 +325,4 @@ class Toolkit implements ToolkitInterface
|
||||
return $end;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getReminders() {
|
||||
// get reminders, for menu, mumble mumble:
|
||||
$today = new Carbon;
|
||||
$reminders = \Auth::user()->reminders()->validOn($today)->get();
|
||||
|
||||
/** @var \Reminder $reminder */
|
||||
foreach($reminders as $index => $reminder) {
|
||||
if(\Session::has('dismissal-' . $reminder->id)) {
|
||||
$time = \Session::get('dismissal-' . $reminder->id);
|
||||
if($time >= $today) {
|
||||
unset($reminders[$index]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
\Session::put('reminderCount',count($reminders));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user