Lines 8-18
return {
Link Here
|
8 |
my ($args) = @_; |
8 |
my ($args) = @_; |
9 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
9 |
my ($dbh, $out) = @$args{qw(dbh out)}; |
10 |
|
10 |
|
11 |
my $holds_no_branch = Koha::Holds->search({ branchcode => undef }); |
11 |
my $sth = $dbh->prepare(q{ |
12 |
if( $holds_no_branch->count > 0 ){ |
12 |
SELECT borrowernumber, biblionumber |
|
|
13 |
FROM reserves |
14 |
WHERE branchcode IS NULL; |
15 |
}); |
16 |
$sth->execute; |
17 |
my $holds_no_branch = $sth->fetchall_arrayref( {} ); |
18 |
|
19 |
if ( scalar @{$holds_no_branch} > 0 ) { |
13 |
say $out "Holds with no branchcode were found and will be updated to the first branch in the system"; |
20 |
say $out "Holds with no branchcode were found and will be updated to the first branch in the system"; |
14 |
while ( my $hnb = $holds_no_branch->next ){ |
21 |
foreach my $hnb ( @{$holds_no_branch} ) { |
15 |
say $out "Please review hold for borrowernumber " . $hnb->borrowernumber . " on biblionumber " . $hnb->biblionumber . " to correct pickup branch if necessary"; |
22 |
say $out "Please review hold for borrowernumber " |
|
|
23 |
. $hnb->{borrowernumber} |
24 |
. " on biblionumber " |
25 |
. $hnb->{biblionumber} |
26 |
. " to correct pickup branch if necessary"; |
16 |
} |
27 |
} |
17 |
} |
28 |
} |
18 |
|
29 |
|
19 |
- |
|
|