Lines 245-253
my $stat = $dbh->selectrow_hashref("SELECT * FROM statistics WHERE type = 'renew
Link Here
|
245 |
ok( $stat, "Bug 17781 - 'Improper branchcode set during renewal' still fixed" ); |
245 |
ok( $stat, "Bug 17781 - 'Improper branchcode set during renewal' still fixed" ); |
246 |
|
246 |
|
247 |
subtest 'Show that AddRenewal respects OpacRenewalBranch and interface' => sub { |
247 |
subtest 'Show that AddRenewal respects OpacRenewalBranch and interface' => sub { |
248 |
plan tests => 5; |
248 |
plan tests => 10; |
249 |
|
|
|
250 |
$se->mock( 'interface', sub { return 'opac' } ); |
251 |
|
249 |
|
252 |
my $item_library = $builder->build_object( { class => 'Koha::Libraries' } ); |
250 |
my $item_library = $builder->build_object( { class => 'Koha::Libraries' } ); |
253 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
251 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
Lines 266-284
subtest 'Show that AddRenewal respects OpacRenewalBranch and interface' => sub {
Link Here
|
266 |
|
264 |
|
267 |
t::lib::Mocks::mock_preference( 'OpacRenewalBranch', $syspref ); |
265 |
t::lib::Mocks::mock_preference( 'OpacRenewalBranch', $syspref ); |
268 |
|
266 |
|
269 |
my $item = $builder->build_sample_item( |
267 |
{ |
270 |
{ library => $item_library->branchcode, itype => $itemtype } ); |
268 |
$se->mock( 'interface', sub { return 'opac' } ); |
271 |
my $opac_renew_issue = |
269 |
|
272 |
C4::Circulation::AddIssue( $patron->unblessed, $item->barcode ); |
270 |
my $item = $builder->build_sample_item( |
|
|
271 |
{ library => $item_library->branchcode, itype => $itemtype } ); |
272 |
my $opac_renew_issue = |
273 |
C4::Circulation::AddIssue( $patron->unblessed, $item->barcode ); |
274 |
|
275 |
AddRenewal( $patron->borrowernumber, $item->itemnumber, |
276 |
"Stavromula", $datedue1, $daysago10 ); |
277 |
|
278 |
my $stat = Koha::Statistics->search( |
279 |
{ itemnumber => $item->itemnumber, type => 'renew' } )->next; |
280 |
is( $stat->branch, $expected_branchcode, |
281 |
"->renewal_branchcode is respected for OpacRenewalBranch = $syspref" |
282 |
); |
283 |
} |
284 |
|
285 |
{ |
286 |
$se->mock( 'interface', sub { return 'intranet' } ); |
273 |
|
287 |
|
274 |
AddRenewal( $patron->borrowernumber, $item->itemnumber, |
288 |
my $item = $builder->build_sample_item( |
275 |
"Stavromula", $datedue1, $daysago10 ); |
289 |
{ library => $item_library->branchcode, itype => $itemtype } ); |
|
|
290 |
my $opac_renew_issue = |
291 |
C4::Circulation::AddIssue( $patron->unblessed, $item->barcode ); |
276 |
|
292 |
|
277 |
my $stat = Koha::Statistics->search( |
293 |
AddRenewal( $patron->borrowernumber, $item->itemnumber, |
278 |
{ itemnumber => $item->itemnumber, type => 'renew' } )->next; |
294 |
"Stavromula", $datedue1, $daysago10 ); |
279 |
is( $stat->branch, $expected_branchcode, |
295 |
|
280 |
"->renewal_branchcode is respected for OpacRenewalBranch = $syspref" |
296 |
my $stat = Koha::Statistics->search( |
281 |
); |
297 |
{ itemnumber => $item->itemnumber, type => 'renew' } )->next; |
|
|
298 |
is( $stat->branch, $logged_in_user->branchcode, |
299 |
"->renewal_branchcode is always logged in branch for intranet" |
300 |
); |
301 |
} |
282 |
} |
302 |
} |
283 |
}; |
303 |
}; |
284 |
|
304 |
|
285 |
- |
|
|