@@ -, +, @@ --- t/db_dependent/Circulation.t | 29 ++++++++++++---------------- t/db_dependent/Circulation/Returns.t | 2 +- t/db_dependent/Circulation/issue.t | 2 +- 3 files changed, 14 insertions(+), 19 deletions(-) --- a/t/db_dependent/Circulation.t +++ a/t/db_dependent/Circulation.t @@ -2964,7 +2964,7 @@ $cache->clear_from_cache('single_holidays'); subtest 'AddRenewal and AddIssuingCharge tests' => sub { - plan tests => 13; + plan tests => 10; $schema->storage->txn_begin; @@ -3024,34 +3024,29 @@ subtest 'AddRenewal and AddIssuingCharge tests' => sub { # The following will fail if run on 00:00:00 unlike ( $checkouts->next->lastreneweddate, qr/00:00:00/, 'AddRenewal should set the renewal date with the time part'); - t::lib::Mocks::mock_preference( 'RenewalLog', 1 ); - $date = output_pref( { dt => dt_from_string(), dateonly => 1, dateformat => 'iso' } ); - $old_log_size = Koha::ActionLogs->count( \%params_renewal ); - AddRenewal( $patron->id, $item->id, $library->id ); - $new_log_size = Koha::ActionLogs->count( \%params_renewal ); - is( $new_log_size, $old_log_size + 1, 'renew log successfully added' ); - my $lines = Koha::Account::Lines->search({ borrowernumber => $patron->id, itemnumber => $item->id }); - is( $lines->count, 3 ); + is( $lines->count, 2 ); my $line = $lines->next; - is( $line->accounttype, 'Rent', 'The issuing charge generates an accountline' ); + is( $line->accounttype, 'RENT', 'The issue of item with issueing charge generates an accountline of the correct type' ); is( $line->branchcode, $library->id, 'AddIssuingCharge correctly sets branchcode' ); - is( $line->description, 'Rental', 'AddIssuingCharge set a hardcoded description for the accountline' ); + is( $line->description, '', 'AddIssue does not set a hardcoded description for the accountline' ); $line = $lines->next; - is( $line->accounttype, 'Rent', 'Fine on renewed item is closed out properly' ); + is( $line->accounttype, 'RENT_RENEW', 'The renewal of item with issuing charge generates an accountline of the correct type' ); is( $line->branchcode, $library->id, 'AddRenewal correctly sets branchcode' ); - is( $line->description, "Renewal of Rental Item $title $barcode", 'AddRenewal set a hardcoded description for the accountline' ); + is( $line->description, '', 'AddRenewal does not set a hardcoded description for the accountline' ); - $line = $lines->next; - is( $line->accounttype, 'Rent', 'Fine on renewed item is closed out properly' ); - is( $line->branchcode, $library->id, 'AddRenewal correctly sets branchcode' ); - is( $line->description, "Renewal of Rental Item $title $barcode", 'AddRenewal set a hardcoded description for the accountline' ); + t::lib::Mocks::mock_preference( 'RenewalLog', 1 ); + $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } ); + $old_log_size = Koha::ActionLogs->count( \%params_renewal ); + AddRenewal( $patron->id, $item->id, $library->id ); + $new_log_size = Koha::ActionLogs->count( \%params_renewal ); + is( $new_log_size, $old_log_size + 1, 'renew log successfully added' ); $schema->storage->txn_rollback; }; --- a/t/db_dependent/Circulation/Returns.t +++ a/t/db_dependent/Circulation/Returns.t @@ -277,7 +277,7 @@ subtest 'Handle ids duplication' => sub { my $issue_id = $original_checkout->issue_id; my $account_lines = Koha::Account::Lines->search({ borrowernumber => $patron->borrowernumber, issue_id => $issue_id }); is( $account_lines->count, 1, '1 account line should exist for this issue_id' ); - is( $account_lines->next->description, 'Rental', 'patron has been charged the rentalcharge' ); + is( $account_lines->next->accounttype, 'RENT', 'patron has been charged the rentalcharge' ); $account_lines->delete; # Create an existing entry in old_issue --- a/t/db_dependent/Circulation/issue.t +++ a/t/db_dependent/Circulation/issue.t @@ -211,7 +211,7 @@ $sth->execute; my $countaccount = $sth->fetchrow_array; is ($countaccount,0,"0 accountline exists"); my $checkout = Koha::Checkouts->find( $issue_id1 ); -my $charge = C4::Circulation::AddIssuingCharge( $checkout, 10 ); +my $charge = C4::Circulation::AddIssuingCharge( $checkout, 10, 'rent' ); is( ref( $charge ), 'Koha::Account::Line', "An issuing charge has been added" ); is( $charge->issue_id, $issue_id1, 'Issue id is set correctly for issuing charge' ); my $offset = Koha::Account::Offsets->find( { debit_id => $charge->id } ); --