Beispiel #1
0
/**
 * Get annotations for the project sub list. Currently it's just the time, like
 * in the timesheet extension.
 *
 * @param int $start Time from which to take entries into account.
 * @param int $end Time until which to take entries into account.
 * @param array $users Array of user IDs to filter by.
 * @param array $customers Array of customer IDs to filter by.
 * @param array $projects Array of project IDs to filter by.
 * @param array $activities Array of activity IDs to filter by.
 * @return array Array which assigns every project (via his ID) the data to show.
 */
function export_get_project_annotations($start, $end, $users = null, $customers = null, $projects = null, $activities = null)
{
    global $expense_ext_available, $database;
    $arr = $database->get_time_projects($start, $end, $users, $customers, $projects, $activities);
    if ($expense_ext_available) {
        $expenses = expenses_by_project($start, $end, $users, $customers, $projects);
        merge_annotations($arr, $expenses);
    }
    return $arr;
}
Beispiel #2
0
     }
     if (isset($kga['customer'])) {
         $filterCustomers = array($kga['customer']['customerID']);
     }
     $view->assign('expenses', get_expenses($in, $out, $filterUsers, $filterCustomers, $filterProjects, 1));
     $view->assign('total', Kimai_Format::formatCurrency(array_reduce($view->expenses, function ($sum, $expense) {
         return $sum + $expense['multiplier'] * $expense['value'];
     }, 0)));
     $ann = expenses_by_user($in, $out, $filterUsers, $filterCustomers, $filterProjects);
     $ann = Kimai_Format::formatCurrency($ann);
     $view->assign('user_annotations', $ann);
     // TODO: function for loops or convert it in template with new function
     $ann = expenses_by_customer($in, $out, $filterUsers, $filterCustomers, $filterProjects);
     $ann = Kimai_Format::formatCurrency($ann);
     $view->assign('customer_annotations', $ann);
     $ann = expenses_by_project($in, $out, $filterUsers, $filterCustomers, $filterProjects);
     $ann = Kimai_Format::formatCurrency($ann);
     $view->assign('project_annotations', $ann);
     $view->assign('activity_annotations', array());
     if (isset($kga['user'])) {
         $view->assign('hideComments', !$kga->getSettings()->isShowComments());
     } else {
         $view->assign('hideComments', true);
     }
     echo $view->render("expenses.php");
     break;
     // =======================================
     // = Erase expense entry via quickdelete =
     // =======================================
 // =======================================
 // = Erase expense entry via quickdelete =
Beispiel #3
0
    // customer logged in
    $ann = expenses_by_user($in, $out, null, array($kga['customer']['customerID']));
}
$ann = Format::formatCurrency($ann);
$view->user_annotations = $ann;
// TODO: function for loops or convert it in template with new function
if (isset($kga['user'])) {
    // user logged in
    $ann = expenses_by_customer($in, $out, array($kga['user']['userID']));
} else {
    // customer logged in
    $ann = expenses_by_customer($in, $out, null, array($kga['customer']['customerID']));
}
$ann = Format::formatCurrency($ann);
$view->customer_annotations = $ann;
if (isset($kga['user'])) {
    // user logged in
    $ann = expenses_by_project($in, $out, array($kga['user']['userID']));
} else {
    // customer logged in
    $ann = expenses_by_project($in, $out, null, array($kga['customer']['customerID']));
}
$ann = Format::formatCurrency($ann);
$view->project_annotations = $ann;
if (isset($kga['user'])) {
    $view->hideComments = $database->user_get_preference('ui.showCommentsByDefault') != 1;
} else {
    $view->hideComments = true;
}
$view->expenses_display = $view->render("expenses.php");
echo $view->render('main.php');