|
Lines 15-21
Link Here
|
| 15 |
# with Koha; if not, see <http://www.gnu.org/licenses>. |
15 |
# with Koha; if not, see <http://www.gnu.org/licenses>. |
| 16 |
|
16 |
|
| 17 |
use Modern::Perl; |
17 |
use Modern::Perl; |
| 18 |
use Test::More tests => 5; |
18 |
use Test::More tests => 8; |
| 19 |
use C4::Context; |
19 |
use C4::Context; |
| 20 |
|
20 |
|
| 21 |
use C4::Biblio; |
21 |
use C4::Biblio; |
|
Lines 117-124
my $another_item = $builder->build({
Link Here
|
| 117 |
}); |
117 |
}); |
| 118 |
|
118 |
|
| 119 |
C4::Circulation::AddIssue( $patron, $another_item->{barcode}, dt_from_string, undef, dt_from_string, undef, { onsite_checkout => 1 } ); |
119 |
C4::Circulation::AddIssue( $patron, $another_item->{barcode}, dt_from_string, undef, dt_from_string, undef, { onsite_checkout => 1 } ); |
| 120 |
( undef, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} ); |
120 |
( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} ); |
| 121 |
is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, '' ); |
121 |
is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, '' ); |
|
|
122 |
is( exists $impossible->{TOO_MANY}, '', '' ); |
| 123 |
|
| 124 |
$dbh->do(q|DELETE FROM issuingrules|); |
| 125 |
my $borrower_circ_rule = $builder->build({ |
| 126 |
source => 'DefaultCircRule', |
| 127 |
value => { |
| 128 |
branchcode => $branch->{branchcode}, |
| 129 |
categorycode => '*', |
| 130 |
maxissueqty => 2, |
| 131 |
maxonsiteissueqty => 1, |
| 132 |
}, |
| 133 |
}); |
| 134 |
( $impossible, undef, undef, $messages ) = C4::Circulation::CanBookBeIssued( $patron, $another_item->{barcode} ); |
| 135 |
is( $messages->{ONSITE_CHECKOUT_WILL_BE_SWITCHED}, 1, '' ); |
| 136 |
is( exists $impossible->{TOO_MANY}, '', '' ); |
| 122 |
|
137 |
|
| 123 |
$schema->storage->txn_rollback; |
138 |
$schema->storage->txn_rollback; |
| 124 |
|
139 |
|
| 125 |
- |
|
|