fix: List of travel entries in travel reimbursement PDF is not sorted on date.
This commit is contained in:
@@ -17,7 +17,17 @@ if (!$GLOBALS['modules_enabled']['office']) {
|
||||
if ($API_office_travel_reimburse->request_method === 'GET') {
|
||||
$API_office_travel_reimburse->checkPermissions('office-travel-reimburse', 'RO');
|
||||
|
||||
$_GET['builder'] = [1 => ['where' => [0 => 'user_uuid', 1 => $_SESSION['user']['user_uuid']]]];
|
||||
if (!isset($_GET['builder']) || !is_array($_GET['builder'])) {
|
||||
$_GET['builder'] = [];
|
||||
}
|
||||
|
||||
# Append user_uuid where builder to always search for the user_uuid that is requesting the travel entries
|
||||
$_GET['builder'][] = [
|
||||
'where' => [
|
||||
0 => 'user_uuid',
|
||||
1 => $_SESSION['user']['user_uuid']
|
||||
]
|
||||
];
|
||||
|
||||
$travel_reimbursements = $API_office_travel_reimburse->getTravelReimburse();
|
||||
$API_office_travel_reimburse->apiOutput($code = 200, $travel_reimbursements);
|
||||
|
||||
Reference in New Issue
Block a user