|
Lines 497-503
subtest "GetIssuingCharges tests" => sub {
Link Here
|
| 497 |
|
497 |
|
| 498 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
498 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
| 499 |
subtest "CanBookBeRenewed tests" => sub { |
499 |
subtest "CanBookBeRenewed tests" => sub { |
| 500 |
plan tests => 115; |
500 |
plan tests => 117; |
| 501 |
|
501 |
|
| 502 |
C4::Context->set_preference( 'ItemsDeniedRenewal', '' ); |
502 |
C4::Context->set_preference( 'ItemsDeniedRenewal', '' ); |
| 503 |
|
503 |
|
|
Lines 1893-1898
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 1893 |
"Account line description must not contain 'Lost Items ', but be title, barcode, itemcallnumber" |
1893 |
"Account line description must not contain 'Lost Items ', but be title, barcode, itemcallnumber" |
| 1894 |
); |
1894 |
); |
| 1895 |
|
1895 |
|
|
|
1896 |
t::lib::Mocks::mock_preference('FineNoRenewals', 0); |
| 1897 |
|
| 1896 |
# Recalls |
1898 |
# Recalls |
| 1897 |
t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); |
1899 |
t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); |
| 1898 |
Koha::CirculationRules->set_rules( |
1900 |
Koha::CirculationRules->set_rules( |
|
Lines 1969-1974
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 1969 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $recall_issue ); |
1971 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $recall_issue ); |
| 1970 |
is( $renewokay, 1, 'Can renew item if biblio-level recall has already been allocated an item' ); |
1972 |
is( $renewokay, 1, 'Can renew item if biblio-level recall has already been allocated an item' ); |
| 1971 |
$recall->set_cancelled; |
1973 |
$recall->set_cancelled; |
|
|
1974 |
|
| 1975 |
# Too much debt |
| 1976 |
t::lib::Mocks::mock_preference('FineNoRenewals', 1); |
| 1977 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrower_obj, $issue_1); |
| 1978 |
is( $renewokay, 0, 'Cannot renew, too much debt and FineNoRenewals=1' ); |
| 1979 |
is( $error, 'too_much_oweing', 'Cannot renew, debt not allowed (returned code is too_much_oweing)'); |
| 1980 |
C4::Context->dbh->do("DELETE FROM accountlines"); |
| 1972 |
}; |
1981 |
}; |
| 1973 |
|
1982 |
|
| 1974 |
subtest "CanBookBeRenewed | bookings" => sub { |
1983 |
subtest "CanBookBeRenewed | bookings" => sub { |
| 1975 |
- |
|
|