Lines 54-59
use Koha::Account::Lines;
Link Here
|
54 |
use Koha::Account::Offsets; |
54 |
use Koha::Account::Offsets; |
55 |
use Koha::ActionLogs; |
55 |
use Koha::ActionLogs; |
56 |
use Koha::Notice::Messages; |
56 |
use Koha::Notice::Messages; |
|
|
57 |
use Koha::Cache::Memory::Lite; |
57 |
|
58 |
|
58 |
sub set_userenv { |
59 |
sub set_userenv { |
59 |
my ( $library ) = @_; |
60 |
my ( $library ) = @_; |
Lines 827-832
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
827 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
828 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
828 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
829 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
829 |
$dbh->do('UPDATE circulation_rules SET rule_value = 0 where rule_name = "norenewalbefore"'); |
830 |
$dbh->do('UPDATE circulation_rules SET rule_value = 0 where rule_name = "norenewalbefore"'); |
|
|
831 |
Koha::Cache::Memory::Lite->flush(); |
830 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
832 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
831 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
833 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
832 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_renew only happens if not on reserve' ); |
834 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_renew only happens if not on reserve' ); |
Lines 874-879
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
874 |
# Change policy so that loans can only be renewed exactly on due date (0 days prior to due date) |
876 |
# Change policy so that loans can only be renewed exactly on due date (0 days prior to due date) |
875 |
# and test automatic renewal again |
877 |
# and test automatic renewal again |
876 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '0' WHERE rule_name = 'norenewalbefore'}); |
878 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '0' WHERE rule_name = 'norenewalbefore'}); |
|
|
879 |
Koha::Cache::Memory::Lite->flush(); |
877 |
( $renewokay, $error ) = |
880 |
( $renewokay, $error ) = |
878 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
881 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
879 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic and premature' ); |
882 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic and premature' ); |
Lines 890-895
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
890 |
# Change policy so that loans can be renewed 99 days prior to the due date |
893 |
# Change policy so that loans can be renewed 99 days prior to the due date |
891 |
# and test automatic renewal again |
894 |
# and test automatic renewal again |
892 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '99' WHERE rule_name = 'norenewalbefore'}); |
895 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '99' WHERE rule_name = 'norenewalbefore'}); |
|
|
896 |
Koha::Cache::Memory::Lite->flush(); |
893 |
( $renewokay, $error ) = |
897 |
( $renewokay, $error ) = |
894 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
898 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
895 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic' ); |
899 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic' ); |
Lines 1233-1238
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1233 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '10' WHERE rule_name = 'norenewalbefore'}); |
1237 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '10' WHERE rule_name = 'norenewalbefore'}); |
1234 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '15' WHERE rule_name = 'no_auto_renewal_after'}); |
1238 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '15' WHERE rule_name = 'no_auto_renewal_after'}); |
1235 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = NULL WHERE rule_name = 'no_auto_renewal_after_hard_limit'}); |
1239 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = NULL WHERE rule_name = 'no_auto_renewal_after_hard_limit'}); |
|
|
1240 |
Koha::Cache::Memory::Lite->flush(); |
1236 |
Koha::CirculationRules->set_rules( |
1241 |
Koha::CirculationRules->set_rules( |
1237 |
{ |
1242 |
{ |
1238 |
categorycode => undef, |
1243 |
categorycode => undef, |
1239 |
- |
|
|