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