Skip to content
Snippets Groups Projects
Commit 6d8d80f1 authored by Ere Maijala's avatar Ere Maijala Committed by Robert Lange
Browse files

Treat missing or unknown dueStatus as normal in GetUserTransactions. (#1577)

parent 28c8bc9e
No related merge requests found
......@@ -64,15 +64,16 @@ class GetUserTransactions extends AbstractIlsAndUserAction
'overdue' => 0
];
foreach ($items['records'] as $item) {
if (!isset($item['dueStatus'])) {
continue;
}
if ($item['dueStatus'] == 'overdue') {
$counts['overdue'] += 1;
} elseif ($item['dueStatus'] == 'due') {
$counts['warn'] += 1;
} else {
$counts['ok'] += 1;
switch ($item['dueStatus'] ?? '') {
case 'due':
$counts['warn']++;
break;
case 'overdue':
$counts['overdue']++;
break;
default:
$counts['ok']++;
break;
}
}
return $this->formatResponse($counts);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment