|
Lines 1110-1116
C4::Context->dbh->do("DELETE FROM accountlines");
Link Here
|
| 1110 |
} |
1110 |
} |
| 1111 |
|
1111 |
|
| 1112 |
subtest 'CanBookBeIssued & AllowReturnToBranch' => sub { |
1112 |
subtest 'CanBookBeIssued & AllowReturnToBranch' => sub { |
| 1113 |
plan tests => 23; |
1113 |
plan tests => 26; |
| 1114 |
|
1114 |
|
| 1115 |
my $homebranch = $builder->build( { source => 'Branch' } ); |
1115 |
my $homebranch = $builder->build( { source => 'Branch' } ); |
| 1116 |
my $holdingbranch = $builder->build( { source => 'Branch' } ); |
1116 |
my $holdingbranch = $builder->build( { source => 'Branch' } ); |
|
Lines 1127-1132
subtest 'CanBookBeIssued & AllowReturnToBranch' => sub {
Link Here
|
| 1127 |
notforloan => 0, |
1127 |
notforloan => 0, |
| 1128 |
itemlost => 0, |
1128 |
itemlost => 0, |
| 1129 |
withdrawn => 0, |
1129 |
withdrawn => 0, |
|
|
1130 |
restricted => 0, |
| 1130 |
biblionumber => $biblioitem->{biblionumber} |
1131 |
biblionumber => $biblioitem->{biblionumber} |
| 1131 |
} |
1132 |
} |
| 1132 |
} |
1133 |
} |
|
Lines 1144-1159
subtest 'CanBookBeIssued & AllowReturnToBranch' => sub {
Link Here
|
| 1144 |
## Can be issued from homebranch |
1145 |
## Can be issued from homebranch |
| 1145 |
set_userenv($homebranch); |
1146 |
set_userenv($homebranch); |
| 1146 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, $item->{barcode} ); |
1147 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, $item->{barcode} ); |
| 1147 |
is( keys(%$error) + keys(%$alerts), 0 ); |
1148 |
is( keys(%$error), 0, 'There should not be any errors (impossible)' ); |
|
|
1149 |
is( keys(%$alerts), 0, 'There should not be any alerts' ); |
| 1148 |
is( exists $question->{ISSUED_TO_ANOTHER}, 1 ); |
1150 |
is( exists $question->{ISSUED_TO_ANOTHER}, 1 ); |
| 1149 |
## Can be issued from holdingbranch |
1151 |
## Can be issued from holdingbranch |
| 1150 |
set_userenv($holdingbranch); |
1152 |
set_userenv($holdingbranch); |
| 1151 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, $item->{barcode} ); |
1153 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, $item->{barcode} ); |
| 1152 |
is( keys(%$error) + keys(%$alerts), 0 ); |
1154 |
is( keys(%$error), 0, 'There should not be any errors (impossible)' ); |
|
|
1155 |
is( keys(%$alerts), 0, 'There should not be any alerts' ); |
| 1153 |
is( exists $question->{ISSUED_TO_ANOTHER}, 1 ); |
1156 |
is( exists $question->{ISSUED_TO_ANOTHER}, 1 ); |
| 1154 |
## Can be issued from another branch |
1157 |
## Can be issued from another branch |
| 1155 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, $item->{barcode} ); |
1158 |
( $error, $question, $alerts ) = CanBookBeIssued( $patron_2, $item->{barcode} ); |
| 1156 |
is( keys(%$error) + keys(%$alerts), 0 ); |
1159 |
is( keys(%$error), 0, 'There should not be any errors (impossible)' ); |
|
|
1160 |
is( keys(%$alerts), 0, 'There should not be any alerts' ); |
| 1157 |
is( exists $question->{ISSUED_TO_ANOTHER}, 1 ); |
1161 |
is( exists $question->{ISSUED_TO_ANOTHER}, 1 ); |
| 1158 |
|
1162 |
|
| 1159 |
# AllowReturnToBranch == holdingbranch |
1163 |
# AllowReturnToBranch == holdingbranch |
| 1160 |
- |
|
|