X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=time.php;h=7252f476ff1fd420e7e057c6b151ecb60e150f77;hb=dff61baa6b8f972c0a74119258b81e6884a9191f;hp=ac6b69b5f23dde902116f26b918338c72843c73b;hpb=0f6454bb20d223018d0f969ab5e1d46f4ce14b96;p=timetracker.git diff --git a/time.php b/time.php index ac6b69b5..7252f476 100644 --- a/time.php +++ b/time.php @@ -86,10 +86,16 @@ if ($user->isPluginEnabled('mq')){ require_once('plugins/MonthlyQuota.class.php'); $quota = new MonthlyQuota(); $month_quota_minutes = $quota->getUserQuota($selected_date->mYear, $selected_date->mMonth); + $quota_minutes_from_1st = $quota->getUserQuotaFrom1st($selected_date); $month_total = ttTimeHelper::getTimeForMonth($selected_date); - $minutes_left = $month_quota_minutes - ttTimeHelper::toMinutes($month_total); + $month_total_minutes = ttTimeHelper::toMinutes($month_total); + $balance_left = $quota_minutes_from_1st - $month_total_minutes; + $minutes_left = $month_quota_minutes - $month_total_minutes; $smarty->assign('month_total', $month_total); + $smarty->assign('month_quota', ttTimeHelper::toAbsDuration($month_quota_minutes)); + $smarty->assign('over_balance', $balance_left < 0); + $smarty->assign('balance_remaining', ttTimeHelper::toAbsDuration($balance_left)); $smarty->assign('over_quota', $minutes_left < 0); $smarty->assign('quota_remaining', ttTimeHelper::toAbsDuration($minutes_left)); }