Lines 475-481
subtest "GetIssuingCharges tests" => sub {
Link Here
|
475 |
|
475 |
|
476 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
476 |
my ( $reused_itemnumber_1, $reused_itemnumber_2 ); |
477 |
subtest "CanBookBeRenewed tests" => sub { |
477 |
subtest "CanBookBeRenewed tests" => sub { |
478 |
plan tests => 114; |
478 |
plan tests => 116; |
479 |
|
479 |
|
480 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
480 |
C4::Context->set_preference('ItemsDeniedRenewal',''); |
481 |
# Generate test biblio |
481 |
# Generate test biblio |
Lines 1727-1732
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1727 |
"Account line description must not contain 'Lost Items ', but be title, barcode, itemcallnumber" |
1727 |
"Account line description must not contain 'Lost Items ', but be title, barcode, itemcallnumber" |
1728 |
); |
1728 |
); |
1729 |
|
1729 |
|
|
|
1730 |
t::lib::Mocks::mock_preference('FineNoRenewals', 0); |
1731 |
|
1730 |
# Recalls |
1732 |
# Recalls |
1731 |
t::lib::Mocks::mock_preference('UseRecalls', 1); |
1733 |
t::lib::Mocks::mock_preference('UseRecalls', 1); |
1732 |
Koha::CirculationRules->set_rules({ |
1734 |
Koha::CirculationRules->set_rules({ |
Lines 1793-1798
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1793 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $recall_issue ); |
1795 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $recall_issue ); |
1794 |
is( $renewokay, 1, 'Can renew item if biblio-level recall has already been allocated an item' ); |
1796 |
is( $renewokay, 1, 'Can renew item if biblio-level recall has already been allocated an item' ); |
1795 |
$recall->set_cancelled; |
1797 |
$recall->set_cancelled; |
|
|
1798 |
|
1799 |
# Too much debt |
1800 |
t::lib::Mocks::mock_preference('FineNoRenewals', 1); |
1801 |
( $renewokay, $error ) = CanBookBeRenewed($renewing_borrower_obj, $issue_1); |
1802 |
is( $renewokay, 0, 'Cannot renew, too much debt and FineNoRenewals=1' ); |
1803 |
is( $error, 'too_much_oweing', 'Cannot renew, debt not allowed (returned code is too_much_oweing)'); |
1804 |
C4::Context->dbh->do("DELETE FROM accountlines"); |
1796 |
}; |
1805 |
}; |
1797 |
|
1806 |
|
1798 |
subtest "CanBookBeRenewed | bookings" => sub { |
1807 |
subtest "CanBookBeRenewed | bookings" => sub { |
1799 |
- |
|
|