|
Lines 498-504
subtest "GetIssuingCharges tests" => sub {
Link Here
|
| 498 |
|
498 |
|
| 499 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
499 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
| 500 |
subtest "CanBookBeRenewed tests" => sub { |
500 |
subtest "CanBookBeRenewed tests" => sub { |
| 501 |
plan tests => 114; |
501 |
plan tests => 116; |
| 502 |
|
502 |
|
| 503 |
C4::Context->set_preference( 'ItemsDeniedRenewal', '' ); |
503 |
C4::Context->set_preference( 'ItemsDeniedRenewal', '' ); |
| 504 |
|
504 |
|
|
Lines 1824-1829
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 1824 |
"Account line description must not contain 'Lost Items ', but be title, barcode, itemcallnumber" |
1824 |
"Account line description must not contain 'Lost Items ', but be title, barcode, itemcallnumber" |
| 1825 |
); |
1825 |
); |
| 1826 |
|
1826 |
|
|
|
1827 |
t::lib::Mocks::mock_preference('FineNoRenewals', 0); |
| 1828 |
|
| 1827 |
# Recalls |
1829 |
# Recalls |
| 1828 |
t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); |
1830 |
t::lib::Mocks::mock_preference( 'UseRecalls', 1 ); |
| 1829 |
Koha::CirculationRules->set_rules( |
1831 |
Koha::CirculationRules->set_rules( |
|
Lines 1900-1905
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
| 1900 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $recall_issue ); |
1902 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $recall_issue ); |
| 1901 |
is( $renewokay, 1, 'Can renew item if biblio-level recall has already been allocated an item' ); |
1903 |
is( $renewokay, 1, 'Can renew item if biblio-level recall has already been allocated an item' ); |
| 1902 |
$recall->set_cancelled; |
1904 |
$recall->set_cancelled; |
|
|
1905 |
|
| 1906 |
# Too much debt |
| 1907 |
t::lib::Mocks::mock_preference('FineNoRenewals', 1); |
| 1908 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrower_obj, $issue_1); |
| 1909 |
is( $renewokay, 0, 'Cannot renew, too much debt and FineNoRenewals=1' ); |
| 1910 |
is( $error, 'too_much_oweing', 'Cannot renew, debt not allowed (returned code is too_much_oweing)'); |
| 1911 |
C4::Context->dbh->do("DELETE FROM accountlines"); |
| 1903 |
}; |
1912 |
}; |
| 1904 |
|
1913 |
|
| 1905 |
subtest "CanBookBeRenewed | bookings" => sub { |
1914 |
subtest "CanBookBeRenewed | bookings" => sub { |
| 1906 |
- |
|
|