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 830-835
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
830 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
831 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
831 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
832 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_too_soon limit is overridden' ); |
832 |
$dbh->do('UPDATE circulation_rules SET rule_value = 0 where rule_name = "norenewalbefore"'); |
833 |
$dbh->do('UPDATE circulation_rules SET rule_value = 0 where rule_name = "norenewalbefore"'); |
|
|
834 |
Koha::Cache::Memory::Lite->flush(); |
833 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
835 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber, 1 ); |
834 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
836 |
is( $renewokay, 0, 'Still should not be able to renew' ); |
835 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_renew only happens if not on reserve' ); |
837 |
is( $error, 'on_reserve', 'returned code is on_reserve, auto_renew only happens if not on reserve' ); |
Lines 880-885
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
880 |
# Change policy so that loans can only be renewed exactly on due date (0 days prior to due date) |
882 |
# Change policy so that loans can only be renewed exactly on due date (0 days prior to due date) |
881 |
# and test automatic renewal again |
883 |
# and test automatic renewal again |
882 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '0' WHERE rule_name = 'norenewalbefore'}); |
884 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '0' WHERE rule_name = 'norenewalbefore'}); |
|
|
885 |
Koha::Cache::Memory::Lite->flush(); |
883 |
( $renewokay, $error, $info ) = |
886 |
( $renewokay, $error, $info ) = |
884 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
887 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
885 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic and premature' ); |
888 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic and premature' ); |
Lines 898-903
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
898 |
# Change policy so that loans can be renewed 99 days prior to the due date |
901 |
# Change policy so that loans can be renewed 99 days prior to the due date |
899 |
# and test automatic renewal again |
902 |
# and test automatic renewal again |
900 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '99' WHERE rule_name = 'norenewalbefore'}); |
903 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '99' WHERE rule_name = 'norenewalbefore'}); |
|
|
904 |
Koha::Cache::Memory::Lite->flush(); |
901 |
( $renewokay, $error ) = |
905 |
( $renewokay, $error ) = |
902 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
906 |
CanBookBeRenewed( $renewing_borrowernumber, $item_4->itemnumber ); |
903 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic' ); |
907 |
is( $renewokay, 0, 'Bug 14101: Cannot renew, renewal is automatic' ); |
Lines 1241-1246
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1241 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '10' WHERE rule_name = 'norenewalbefore'}); |
1245 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '10' WHERE rule_name = 'norenewalbefore'}); |
1242 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '15' WHERE rule_name = 'no_auto_renewal_after'}); |
1246 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = '15' WHERE rule_name = 'no_auto_renewal_after'}); |
1243 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = NULL WHERE rule_name = 'no_auto_renewal_after_hard_limit'}); |
1247 |
$dbh->do(q{UPDATE circulation_rules SET rule_value = NULL WHERE rule_name = 'no_auto_renewal_after_hard_limit'}); |
|
|
1248 |
Koha::Cache::Memory::Lite->flush(); |
1244 |
Koha::CirculationRules->set_rules( |
1249 |
Koha::CirculationRules->set_rules( |
1245 |
{ |
1250 |
{ |
1246 |
categorycode => undef, |
1251 |
categorycode => undef, |
1247 |
- |
|
|