my $branches = GetBranches();
my @branchloop;
for my $thisbranch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
- my $selected = 1 if $thisbranch eq $branch;
- my %row =(value => $thisbranch,
- selected => $selected,
- branchname => $branches->{$thisbranch}->{'branchname'},
- );
- push @branchloop, \%row;
+ push @branchloop, {
+ value => $thisbranch,
+ selected => $thisbranch eq $branch,
+ branchname => $branches->{$thisbranch}->{'branchname'},
+ };
}
my $sth=$dbh->prepare("SELECT description,categorycode FROM categories ORDER BY description");
$sth2->execute($branch);
while (my $row = $sth2->fetchrow_hashref) {
+ $row->{'current_branch'} ||= $row->{'branchcode'};
$row->{'humanitemtype'} ||= $row->{'itemtype'};
$row->{'default_humanitemtype'} = 1 if $row->{'humanitemtype'} eq '*';
$row->{'humancategorycode'} ||= $row->{'categorycode'};
$entry->{unlimited_maxissueqty} = 1 unless defined($entry->{maxissueqty});
}
-my @sorted_row_loop = sort by_category_and_itemtype @row_loop;
+@sorted_row_loop = sort by_category_and_itemtype @row_loop;
my $sth_branch_item;
if ($branch eq "*") {