Lines 63-88
else {
Link Here
|
63 |
my ( $status, $error ) = |
63 |
my ( $status, $error ) = |
64 |
CanBookBeRenewed( $borrowernumber, $itemnumber ); |
64 |
CanBookBeRenewed( $borrowernumber, $itemnumber ); |
65 |
if ( $status == 1 && $opacrenew == 1 ) { |
65 |
if ( $status == 1 && $opacrenew == 1 ) { |
66 |
my $renewalbranch = C4::Context->preference('OpacRenewalBranch'); |
66 |
AddRenewal( $borrowernumber, $itemnumber ); |
67 |
my $branchcode; |
|
|
68 |
if ( $renewalbranch eq 'itemhomebranch' ) { |
69 |
my $item = Koha::Items->find($itemnumber); |
70 |
$branchcode = $item->homebranch; |
71 |
} |
72 |
elsif ( $renewalbranch eq 'patronhomebranch' ) { |
73 |
$branchcode = Koha::Patrons->find( $borrowernumber )->branchcode; |
74 |
} |
75 |
elsif ( $renewalbranch eq 'checkoutbranch' ) { |
76 |
my $issue = GetOpenIssue($itemnumber); # FIXME Should not be $item->checkout? |
77 |
$branchcode = $issue->{'branchcode'}; |
78 |
} |
79 |
elsif ( $renewalbranch eq 'NULL' ) { |
80 |
$branchcode = ''; |
81 |
} |
82 |
else { |
83 |
$branchcode = 'OPACRenew'; |
84 |
} |
85 |
AddRenewal( $borrowernumber, $itemnumber, $branchcode, undef, undef ); |
86 |
push( @renewed, $itemnumber ); |
67 |
push( @renewed, $itemnumber ); |
87 |
} |
68 |
} |
88 |
else { |
69 |
else { |
89 |
- |
|
|