The default sort order for items attached to a title in staff mode is
items.dateaccessioned desc. This means that a particular library's holdings
will be scattered through the list -- a special problem when it comes to serial
issues. I've done a change to Items.pm that makes the sort order branch
description followed by dateaccessioned. Thus, a library's holdings will be
grouped together in the display.
items.notforloan as itemnotforloan,
itemtypes.description
FROM items
+ LEFT JOIN branches ON items.homebranch = branches.branchcode
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber
LEFT JOIN itemtypes ON itemtypes.itemtype = "
. (C4::Context->preference('item-level_itypes') ? 'items.itype' : 'biblioitems.itemtype');
- $query .= " WHERE items.biblionumber = ? ORDER BY items.dateaccessioned desc" ;
+ $query .= " WHERE items.biblionumber = ? ORDER BY branches.branchname,items.dateaccessioned desc" ;
my $sth = $dbh->prepare($query);
$sth->execute($biblionumber);
my $i = 0;