Skip to content

Commit

Permalink
Fix Dienstleistungsstatistik
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasAFink committed Nov 30, 2023
1 parent 495b43b commit e3df73b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
15 changes: 10 additions & 5 deletions zmsentities/src/Zmsentities/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,18 @@ public function getGroupedHashSet(array $fields, array $hashfields)
if (count($fields)) {
$field = array_shift($fields);
$fieldposition = $this->getPositionByName($field);

foreach ($this->data as $element) {
if (! isset($list[$element[$fieldposition]])) {
$list[$element[$fieldposition]] = clone $this;
$list[$element[$fieldposition]]->data = [];
// Check if $fieldposition exists in $element
if (isset($element[$fieldposition])) {
if (!isset($list[$element[$fieldposition]])) {
$list[$element[$fieldposition]] = clone $this;
$list[$element[$fieldposition]]->data = [];
}
$list[$element[$fieldposition]]->data[] = $element;
}
$list[$element[$fieldposition]]->data[] = $element;
}

foreach ($list as $key => $row) {
if ($row instanceof Exchange) {
$list[$key] = $row->getGroupedHashSet($fields, $hashfields);
Expand All @@ -256,5 +261,5 @@ public function getGroupedHashSet(array $fields, array $hashfields)
return $this->getHashData($hashfields, true);
}
return $list;
}
}
}
3 changes: 2 additions & 1 deletion zmsstatistic/src/Zmsstatistic/ReportRequestDepartment.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function readResponse(
->readGetResult('/warehouse/requestdepartment/' . $this->department->id . '/'. $args['period']. '/')
->getEntity()
->toGrouped($this->groupfields, $this->hashset)
->withRequestsSum();
->withRequestsSum()
->withAverage('processingtime');
}

$type = $validator->getParameter('type')->isString()->getValue();
Expand Down
3 changes: 2 additions & 1 deletion zmsstatistic/src/Zmsstatistic/ReportRequestOrganisation.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function readResponse(
->readGetResult('/warehouse/requestorganisation/' . $this->organisation->id . '/'. $args['period']. '/')
->getEntity()
->toGrouped($this->groupfields, $this->hashset)
->withRequestsSum();
->withRequestsSum()
->withAverage('processingtime');
}

$type = $validator->getParameter('type')->isString()->getValue();
Expand Down

0 comments on commit e3df73b

Please sign in to comment.