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 892-897
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
892 |
# Change policy so that loans can only be renewed exactly on due date (0 days prior to due date) |
894 |
# Change policy so that loans can only be renewed exactly on due date (0 days prior to due date) |
893 |
# and test automatic renewal again |
895 |
# and test automatic renewal again |
894 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '0' WHERE rule_name = 'norenewalbefore'}); |
896 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '0' WHERE rule_name = 'norenewalbefore'}); |
|
|
897 |
Koha::Cache::Memory::Lite->flush(); |
895 |
( $renewokay, $error ) = |
898 |
( $renewokay, $error ) = |
896 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
899 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
897 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic and premature' ); |
900 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic and premature' ); |
Lines 908-913
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
908 |
# Change policy so that loans can be renewed 99 days prior to the due date |
911 |
# Change policy so that loans can be renewed 99 days prior to the due date |
909 |
# and test automatic renewal again |
912 |
# and test automatic renewal again |
910 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '99' WHERE rule_name = 'norenewalbefore'}); |
913 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '99' WHERE rule_name = 'norenewalbefore'}); |
|
|
914 |
Koha::Cache::Memory::Lite->flush(); |
911 |
( $renewokay, $error ) = |
915 |
( $renewokay, $error ) = |
912 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
916 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
913 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic' ); |
917 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic' ); |
Lines 1251-1256
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1251 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '10' WHERE rule_name = 'norenewalbefore'}); |
1255 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '10' WHERE rule_name = 'norenewalbefore'}); |
1252 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '15' WHERE rule_name = 'no_auto_renewal_after'}); |
1256 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '15' WHERE rule_name = 'no_auto_renewal_after'}); |
1253 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = NULL WHERE rule_name = 'no_auto_renewal_after_hard_limit'}); |
1257 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = NULL WHERE rule_name = 'no_auto_renewal_after_hard_limit'}); |
|
|
1258 |
Koha::Cache::Memory::Lite->flush(); |
1254 |
Koha::CirculationRules->set_rules( |
1259 |
Koha::CirculationRules->set_rules( |
1255 |
{ |
1260 |
{ |
1256 |
categorycode => undef, |
1261 |
categorycode => undef, |
1257 |
- |
|
|