Lines 1322-1328
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1322 |
is( $error, 'auto_renew', 'Cannot renew, renew is automatic' ); |
1322 |
is( $error, 'auto_renew', 'Cannot renew, renew is automatic' ); |
1323 |
}; |
1323 |
}; |
1324 |
|
1324 |
|
1325 |
subtest "auto_too_much_oweing | OPACFineNoRenewalsBlockAutoRenew & OPACFineNoRenewalsIncludeCredit" => sub { |
1325 |
subtest "auto_too_much_oweing | OPACFineNoRenewalsBlockAutoRenew & OPACFineNoRenewalsIncludeCredits" => sub { |
1326 |
plan tests => 10; |
1326 |
plan tests => 10; |
1327 |
my $item_to_auto_renew = $builder->build_sample_item( |
1327 |
my $item_to_auto_renew = $builder->build_sample_item( |
1328 |
{ |
1328 |
{ |
Lines 1351-1357
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1351 |
); |
1351 |
); |
1352 |
C4::Context->set_preference( 'OPACFineNoRenewalsBlockAutoRenew', '1' ); |
1352 |
C4::Context->set_preference( 'OPACFineNoRenewalsBlockAutoRenew', '1' ); |
1353 |
C4::Context->set_preference( 'OPACFineNoRenewals', '10' ); |
1353 |
C4::Context->set_preference( 'OPACFineNoRenewals', '10' ); |
1354 |
C4::Context->set_preference( 'OPACFineNoRenewalsIncludeCredit', '1' ); |
1354 |
C4::Context->set_preference( 'OPACFineNoRenewalsIncludeCredits', '1' ); |
1355 |
my $fines_amount = 5; |
1355 |
my $fines_amount = 5; |
1356 |
my $account = Koha::Account->new( { patron_id => $renewing_borrowernumber } ); |
1356 |
my $account = Koha::Account->new( { patron_id => $renewing_borrowernumber } ); |
1357 |
$account->add_debit( |
1357 |
$account->add_debit( |
Lines 1405-1423
subtest "CanBookBeRenewed tests" => sub {
Link Here
|
1405 |
is( $renewokay, 1, 'Renew, even if renewal is automatic' ); |
1405 |
is( $renewokay, 1, 'Renew, even if renewal is automatic' ); |
1406 |
is( |
1406 |
is( |
1407 |
$error, 'auto_renew', |
1407 |
$error, 'auto_renew', |
1408 |
'Can auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit' |
1408 |
'Can auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredits=1, patron has 15 debt, 5 credit' |
1409 |
); |
1409 |
); |
1410 |
|
1410 |
|
1411 |
C4::Context->set_preference( 'OPACFineNoRenewalsIncludeCredit', '0' ); |
1411 |
C4::Context->set_preference( 'OPACFineNoRenewalsIncludeCredits', '0' ); |
1412 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $issue ); |
1412 |
( $renewokay, $error ) = CanBookBeRenewed( $renewing_borrower_obj, $issue ); |
1413 |
is( $renewokay, 0, 'Do not renew, renewal is automatic' ); |
1413 |
is( $renewokay, 0, 'Do not renew, renewal is automatic' ); |
1414 |
is( |
1414 |
is( |
1415 |
$error, 'auto_too_much_oweing', |
1415 |
$error, 'auto_too_much_oweing', |
1416 |
'Cannot auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredit=1, patron has 15 debt, 5 credit' |
1416 |
'Cannot auto renew, OPACFineNoRenewals=10, OPACFineNoRenewalsIncludeCredits=1, patron has 15 debt, 5 credit' |
1417 |
); |
1417 |
); |
1418 |
|
1418 |
|
1419 |
$dbh->do( 'DELETE FROM accountlines WHERE borrowernumber=?', undef, $renewing_borrowernumber ); |
1419 |
$dbh->do( 'DELETE FROM accountlines WHERE borrowernumber=?', undef, $renewing_borrowernumber ); |
1420 |
C4::Context->set_preference( 'OPACFineNoRenewalsIncludeCredit', '1' ); |
1420 |
C4::Context->set_preference( 'OPACFineNoRenewalsIncludeCredits', '1' ); |
1421 |
}; |
1421 |
}; |
1422 |
|
1422 |
|
1423 |
subtest "auto_account_expired | BlockExpiredPatronOpacActions" => sub { |
1423 |
subtest "auto_account_expired | BlockExpiredPatronOpacActions" => sub { |
1424 |
- |
|
|