Lines 3986-3993
subtest 'CanBookBeIssued & CircConfirmItemParts' => sub {
Link Here
|
3986 |
|
3986 |
|
3987 |
t::lib::Mocks::mock_preference('CircConfirmItemParts', 1); |
3987 |
t::lib::Mocks::mock_preference('CircConfirmItemParts', 1); |
3988 |
|
3988 |
|
3989 |
my $library = |
|
|
3990 |
$builder->build_object( { class => 'Koha::Libraries' } )->store; |
3991 |
my $patron = $builder->build_object( |
3989 |
my $patron = $builder->build_object( |
3992 |
{ |
3990 |
{ |
3993 |
class => 'Koha::Patrons', |
3991 |
class => 'Koha::Patrons', |
Lines 3995-4034
subtest 'CanBookBeIssued & CircConfirmItemParts' => sub {
Link Here
|
3995 |
} |
3993 |
} |
3996 |
)->store; |
3994 |
)->store; |
3997 |
|
3995 |
|
3998 |
my $itemtype = $builder->build_object( |
3996 |
my $item = $builder->build_sample_item( |
3999 |
{ |
|
|
4000 |
class => 'Koha::ItemTypes', |
4001 |
value => { |
4002 |
notforloan => 0, |
4003 |
rentalcharge => 0, |
4004 |
rentalcharge_daily => 0 |
4005 |
} |
4006 |
} |
4007 |
); |
4008 |
|
4009 |
my $biblioitem = $builder->build( { source => 'Biblioitem' } ); |
4010 |
my $item = $builder->build_object( |
4011 |
{ |
3997 |
{ |
4012 |
class => 'Koha::Items', |
3998 |
materials => 'includes DVD', |
4013 |
value => { |
|
|
4014 |
homebranch => $library->id, |
4015 |
holdingbranch => $library->id, |
4016 |
notforloan => 0, |
4017 |
itemlost => 0, |
4018 |
withdrawn => 0, |
4019 |
itype => $itemtype->id, |
4020 |
biblionumber => $biblioitem->{biblionumber}, |
4021 |
biblioitemnumber => $biblioitem->{biblioitemnumber}, |
4022 |
materials => 'includes DVD', |
4023 |
} |
4024 |
} |
3999 |
} |
4025 |
)->store; |
4000 |
)->store; |
4026 |
|
4001 |
|
4027 |
my ( $issuingimpossible, $needsconfirmation ); |
4002 |
my $dt_due = dt_from_string->add( days => 3 ); |
4028 |
my $dt_from = dt_from_string(); |
|
|
4029 |
my $dt_due = $dt_from->clone->add( days => 3 ); |
4030 |
|
4003 |
|
4031 |
( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, $dt_due, undef, undef, undef ); |
4004 |
my ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->barcode, $dt_due, undef, undef, undef ); |
4032 |
is_deeply( $needsconfirmation, { additional_materials => 'includes DVD' }, 'Item needs confirmation of additional parts' ); |
4005 |
is_deeply( $needsconfirmation, { additional_materials => 'includes DVD' }, 'Item needs confirmation of additional parts' ); |
4033 |
}; |
4006 |
}; |
4034 |
|
4007 |
|
4035 |
- |
|
|