-my @branchloop;
-
-foreach my $branchcode ( keys %$branches ) {
- my %linebranch;
- $linebranch{issues} = issuesat( $itm, $branchcode );
- my $date = lastseenat( $itm, $branchcode );
- $linebranch{seen} = slashdate($date);
- $linebranch{branchname} = $branches->{$branchcode}->{'branchname'};
- push( @branchloop, \%linebranch );
+my $branchloop = GetBranchesLoop(C4::Context->userenv->{branch});
+foreach (@$branchloop) {
+ my $date = lastseenat( $itm, $_->{value} );
+ my ($datechunk, $timechunk) = slashdate($date);
+ $_->{issues} = issuesat($itm, $_->{value});
+ $_->{seen} = $datechunk;
+ $_->{seentime} = $timechunk;