Lines 2964-2970
$cache->clear_from_cache('single_holidays');
Link Here
|
2964 |
|
2964 |
|
2965 |
subtest 'AddRenewal and AddIssuingCharge tests' => sub { |
2965 |
subtest 'AddRenewal and AddIssuingCharge tests' => sub { |
2966 |
|
2966 |
|
2967 |
plan tests => 13; |
2967 |
plan tests => 10; |
2968 |
|
2968 |
|
2969 |
$schema->storage->txn_begin; |
2969 |
$schema->storage->txn_begin; |
2970 |
|
2970 |
|
Lines 3024-3057
subtest 'AddRenewal and AddIssuingCharge tests' => sub {
Link Here
|
3024 |
# The following will fail if run on 00:00:00 |
3024 |
# The following will fail if run on 00:00:00 |
3025 |
unlike ( $checkouts->next->lastreneweddate, qr/00:00:00/, 'AddRenewal should set the renewal date with the time part'); |
3025 |
unlike ( $checkouts->next->lastreneweddate, qr/00:00:00/, 'AddRenewal should set the renewal date with the time part'); |
3026 |
|
3026 |
|
3027 |
t::lib::Mocks::mock_preference( 'RenewalLog', 1 ); |
|
|
3028 |
$date = output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); |
3029 |
$old_log_size = Koha::ActionLogs->count( \%params_renewal ); |
3030 |
AddRenewal( $patron->id, $item->id, $library->id ); |
3031 |
$new_log_size = Koha::ActionLogs->count( \%params_renewal ); |
3032 |
is( $new_log_size, $old_log_size + 1, 'renew log successfully added' ); |
3033 |
|
3034 |
my $lines = Koha::Account::Lines->search({ |
3027 |
my $lines = Koha::Account::Lines->search({ |
3035 |
borrowernumber => $patron->id, |
3028 |
borrowernumber => $patron->id, |
3036 |
itemnumber => $item->id |
3029 |
itemnumber => $item->id |
3037 |
}); |
3030 |
}); |
3038 |
|
3031 |
|
3039 |
is( $lines->count, 3 ); |
3032 |
is( $lines->count, 2 ); |
3040 |
|
3033 |
|
3041 |
my $line = $lines->next; |
3034 |
my $line = $lines->next; |
3042 |
is( $line->accounttype, 'Rent', 'The issuing charge generates an accountline' ); |
3035 |
is( $line->accounttype, 'RENT', 'The issue of item with issueing charge generates an accountline of the correct type' ); |
3043 |
is( $line->branchcode, $library->id, 'AddIssuingCharge correctly sets branchcode' ); |
3036 |
is( $line->branchcode, $library->id, 'AddIssuingCharge correctly sets branchcode' ); |
3044 |
is( $line->description, 'Rental', 'AddIssuingCharge set a hardcoded description for the accountline' ); |
3037 |
is( $line->description, '', 'AddIssue does not set a hardcoded description for the accountline' ); |
3045 |
|
3038 |
|
3046 |
$line = $lines->next; |
3039 |
$line = $lines->next; |
3047 |
is( $line->accounttype, 'Rent', 'Fine on renewed item is closed out properly' ); |
3040 |
is( $line->accounttype, 'RENT_RENEW', 'The renewal of item with issuing charge generates an accountline of the correct type' ); |
3048 |
is( $line->branchcode, $library->id, 'AddRenewal correctly sets branchcode' ); |
3041 |
is( $line->branchcode, $library->id, 'AddRenewal correctly sets branchcode' ); |
3049 |
is( $line->description, "Renewal of Rental Item $title $barcode", 'AddRenewal set a hardcoded description for the accountline' ); |
3042 |
is( $line->description, '', 'AddRenewal does not set a hardcoded description for the accountline' ); |
3050 |
|
3043 |
|
3051 |
$line = $lines->next; |
3044 |
t::lib::Mocks::mock_preference( 'RenewalLog', 1 ); |
3052 |
is( $line->accounttype, 'Rent', 'Fine on renewed item is closed out properly' ); |
3045 |
$date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } ); |
3053 |
is( $line->branchcode, $library->id, 'AddRenewal correctly sets branchcode' ); |
3046 |
$old_log_size = Koha::ActionLogs->count( \%params_renewal ); |
3054 |
is( $line->description, "Renewal of Rental Item $title $barcode", 'AddRenewal set a hardcoded description for the accountline' ); |
3047 |
AddRenewal( $patron->id, $item->id, $library->id ); |
|
|
3048 |
$new_log_size = Koha::ActionLogs->count( \%params_renewal ); |
3049 |
is( $new_log_size, $old_log_size + 1, 'renew log successfully added' ); |
3055 |
|
3050 |
|
3056 |
$schema->storage->txn_rollback; |
3051 |
$schema->storage->txn_rollback; |
3057 |
}; |
3052 |
}; |