View | Details | Raw Unified | Return to bug 24612
Collapse All | Expand All

(-)a/t/db_dependent/Reserves.t (-3 / +3 lines)
Lines 333-339 is( $messages->{ResFound}->{borrowernumber}, Link Here
333
$biblio = Koha::Biblios->find( $biblionumber );
333
$biblio = Koha::Biblios->find( $biblionumber );
334
$holds = $biblio->holds;
334
$holds = $biblio->holds;
335
is($holds->count, 1, "Only one reserves for this biblio");
335
is($holds->count, 1, "Only one reserves for this biblio");
336
my $reserve_id = $holds->next->reserve_id;
336
$holds->next->reserve_id;
337
337
338
# Tests for bug 9761 (ConfirmFutureHolds): new CheckReserves lookahead parameter, and corresponding change in AddReturn
338
# Tests for bug 9761 (ConfirmFutureHolds): new CheckReserves lookahead parameter, and corresponding change in AddReturn
339
# Note that CheckReserve uses its lookahead parameter and does not check ConfirmFutureHolds pref (it should be passed if needed like AddReturn does)
339
# Note that CheckReserve uses its lookahead parameter and does not check ConfirmFutureHolds pref (it should be passed if needed like AddReturn does)
Lines 358-364 t::lib::Mocks::mock_preference('AllowHoldDateInFuture', 1); Link Here
358
my $resdate= dt_from_string();
358
my $resdate= dt_from_string();
359
$resdate->add_duration(DateTime::Duration->new(days => 4));
359
$resdate->add_duration(DateTime::Duration->new(days => 4));
360
$resdate=output_pref($resdate);
360
$resdate=output_pref($resdate);
361
AddReserve(
361
my $reserve_id = AddReserve(
362
    {
362
    {
363
        branchcode       => $branch_1,
363
        branchcode       => $branch_1,
364
        borrowernumber   => $requesters{$branch_1},
364
        borrowernumber   => $requesters{$branch_1},
Lines 411-417 is( Link Here
411
    'item that is captured to fill a hold cannot be deleted',
411
    'item that is captured to fill a hold cannot be deleted',
412
);
412
);
413
413
414
my $letter = ReserveSlip( { branchcode => $branch_1, borrowernumber => $requesters{$branch_1}, biblionumber => $bibnum } );
414
my $letter = ReserveSlip( { branchcode => $branch_1, reserve_id => $reserve_id } );
415
ok(defined($letter), 'can successfully generate hold slip (bug 10949)');
415
ok(defined($letter), 'can successfully generate hold slip (bug 10949)');
416
416
417
# Tests for bug 9788: Does Koha::Item->current_holds return a future wait?
417
# Tests for bug 9788: Does Koha::Item->current_holds return a future wait?
(-)a/t/db_dependent/Reserves/ReserveSlip.t (-36 / +3 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 5;
22
use Test::More tests => 3;
23
use t::lib::TestBuilder;
23
use t::lib::TestBuilder;
24
24
25
use C4::Reserves qw( ReserveSlip );
25
use C4::Reserves qw( ReserveSlip );
Lines 118-165 my $letter = $builder->build( Link Here
118
is ( ReserveSlip(), undef, "No hold slip returned if invalid or undef borrowernumber and/or biblionumber" );
118
is ( ReserveSlip(), undef, "No hold slip returned if invalid or undef borrowernumber and/or biblionumber" );
119
is ( ReserveSlip({
119
is ( ReserveSlip({
120
        branchcode     => $library->{branchcode},
120
        branchcode     => $library->{branchcode},
121
        borrowernumber => $patron->{borrowernumber},
121
        reserve_id     => $hold1->reserve_id,
122
        biblionumber   => $biblio->{biblionumber},
123
    })->{code},
122
    })->{code},
124
    'HOLD_SLIP', "Get a hold slip from library, patron and biblio" );
123
    'HOLD_SLIP', "Get a hold slip from library, patron and biblio" );
125
124
126
is (ReserveSlip({
125
is (ReserveSlip({
127
        branchcode     => $library->{branchcode},
126
        branchcode     => $library->{branchcode},
128
        borrowernumber => $patron->{borrowernumber},
127
        reserve_id     => $hold1->reserve_id,
129
        biblionumber   => $biblio->{biblionumber},
130
    })->{content},
128
    })->{content},
131
    "Hold found for $patron->{firstname}: Please pick up $biblio->{title} with barcode $item1->{barcode} at $library->{branchcode}.", "Hold slip contains correctly parsed content");
129
    "Hold found for $patron->{firstname}: Please pick up $biblio->{title} with barcode $item1->{barcode} at $library->{branchcode}.", "Hold slip contains correctly parsed content");
132
130
133
is_deeply(
134
    ReserveSlip({
135
        branchcode     => $library->{branchcode},
136
        borrowernumber => $patron->{borrowernumber},
137
        biblionumber   => $biblio->{biblionumber},
138
    }),
139
    ReserveSlip({
140
        branchcode     => $library->{branchcode},
141
        borrowernumber => $patron->{borrowernumber},
142
        biblionumber   => $biblio->{biblionumber},
143
        itemnumber     => $item1->{itemnumber},
144
        barcode        => $item1->{barcode},
145
    }),
146
    "No item as param generate hold slip from first item in reserves");
147
148
isnt (
149
    ReserveSlip({
150
        branchcode     => $library->{branchcode},
151
        borrowernumber => $patron->{borrowernumber},
152
        biblionumber   => $biblio->{biblionumber},
153
    })->{content},
154
    ReserveSlip({
155
        branchcode     => $library->{branchcode},
156
        borrowernumber => $patron->{borrowernumber},
157
        biblionumber   => $biblio->{biblionumber},
158
        itemnumber     => $item2->{itemnumber},
159
        barcode        => $item2->{barcode},
160
    })->{content},
161
    "Item and/or barcode as params return correct pickup item in hold slip");
162
163
$schema->storage->txn_rollback;
131
$schema->storage->txn_rollback;
164
132
165
1;
133
1;
166
- 

Return to bug 24612