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

(-)a/t/db_dependent/Reserves.t (-3 / +3 lines)
Lines 309-315 is( $messages->{ResFound}->{borrowernumber}, Link Here
309
$biblio = Koha::Biblios->find( $biblionumber );
309
$biblio = Koha::Biblios->find( $biblionumber );
310
$holds = $biblio->holds;
310
$holds = $biblio->holds;
311
is($holds->count, 1, "Only one reserves for this biblio");
311
is($holds->count, 1, "Only one reserves for this biblio");
312
my $reserve_id = $holds->next->reserve_id;
312
$holds->next->reserve_id;
313
313
314
# Tests for bug 9761 (ConfirmFutureHolds): new CheckReserves lookahead parameter, and corresponding change in AddReturn
314
# Tests for bug 9761 (ConfirmFutureHolds): new CheckReserves lookahead parameter, and corresponding change in AddReturn
315
# Note that CheckReserve uses its lookahead parameter and does not check ConfirmFutureHolds pref (it should be passed if needed like AddReturn does)
315
# Note that CheckReserve uses its lookahead parameter and does not check ConfirmFutureHolds pref (it should be passed if needed like AddReturn does)
Lines 332-338 $resdate= dt_from_string(); Link Here
332
$resdate->add_duration(DateTime::Duration->new(days => 4));
332
$resdate->add_duration(DateTime::Duration->new(days => 4));
333
$resdate=output_pref($resdate);
333
$resdate=output_pref($resdate);
334
$expdate= undef; #no expdate
334
$expdate= undef; #no expdate
335
AddReserve($branch_1,  $requesters{$branch_1}, $bibnum,
335
my $reserve_id = AddReserve($branch_1,  $requesters{$branch_1}, $bibnum,
336
           $bibitems,  1, $resdate, $expdate, $notes,
336
           $bibitems,  1, $resdate, $expdate, $notes,
337
           'a title',      $checkitem, $found);
337
           'a title',      $checkitem, $found);
338
($status)=CheckReserves($itemnumber,undef,undef);
338
($status)=CheckReserves($itemnumber,undef,undef);
Lines 378-384 is( Link Here
378
    'item that is captured to fill a hold cannot be deleted',
378
    'item that is captured to fill a hold cannot be deleted',
379
);
379
);
380
380
381
my $letter = ReserveSlip( { branchcode => $branch_1, borrowernumber => $requesters{$branch_1}, biblionumber => $bibnum } );
381
my $letter = ReserveSlip( { branchcode => $branch_1, reserve_id => $reserve_id } );
382
ok(defined($letter), 'can successfully generate hold slip (bug 10949)');
382
ok(defined($letter), 'can successfully generate hold slip (bug 10949)');
383
383
384
# Tests for bug 9788: Does Koha::Item->current_holds return a future wait?
384
# 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