From 3e751ac8ee9abe346f77ffc0742eb80d6bca12e4 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 14 Oct 2019 11:42:57 +0100 Subject: [PATCH] Bug 23805: Update accounttype references in tests --- t/db_dependent/Accounts.t | 2 +- t/db_dependent/Circulation.t | 6 +++--- t/db_dependent/ILSDI_Services.t | 2 +- t/db_dependent/Koha/Account.t | 4 ++-- t/db_dependent/Koha/Account/Lines.t | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/t/db_dependent/Accounts.t b/t/db_dependent/Accounts.t index 4e93b9e85b..f0a822db2a 100644 --- a/t/db_dependent/Accounts.t +++ b/t/db_dependent/Accounts.t @@ -374,7 +374,7 @@ subtest "Koha::Account::pay writeoff tests" => sub { my $writeoff = Koha::Account::Lines->find( $id ); - is( $writeoff->accounttype, 'W', 'Type is correct for writeoff' ); + is( $writeoff->credit_type_code, 'W', 'Type is correct for writeoff' ); is( $writeoff->description, 'Writeoff', 'Description is correct' ); is( $writeoff->amount, '-42.000000', 'Amount is correct' ); }; diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t index b93fd50cd1..66b20376ef 100755 --- a/t/db_dependent/Circulation.t +++ b/t/db_dependent/Circulation.t @@ -2219,7 +2219,7 @@ subtest '_FixAccountForLostAndReturned' => sub { my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id ); my $credit_return = Koha::Account::Lines->find($credit_return_id); - is( $credit_return->accounttype, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); + is( $credit_return->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); is( $credit_return->amount + 0, -99.00, 'The account line of type LOST_RETURN has an amount of -99' ); is( $credit_return->amountoutstanding + 0, @@ -2277,7 +2277,7 @@ subtest '_FixAccountForLostAndReturned' => sub { my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id ); my $credit_return = Koha::Account::Lines->find($credit_return_id); - is( $credit_return->accounttype, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); + is( $credit_return->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); is( $credit_return->amount + 0, -99.00, 'The account line of type LOST_RETURN has an amount of -99' ); is( $credit_return->amountoutstanding + 0, 0, 'The account line of type LOST_RETURN has an amountoutstanding of 0' ); @@ -2371,7 +2371,7 @@ subtest '_FixAccountForLostAndReturned' => sub { 'LOST', 'Lost fee now still has account type of LOST' ); is( $lost_fee_line->status, 'RETURNED', "Lost fee now has account status of RETURNED"); - is( $credit_return->accounttype, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); + is( $credit_return->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); is( $credit_return->amount + 0, ($payment_amount + $outstanding ) * -1, 'The account line of type LOST_RETURN has an amount equal to the payment + outstanding' diff --git a/t/db_dependent/ILSDI_Services.t b/t/db_dependent/ILSDI_Services.t index b1288ec469..acd1828f19 100644 --- a/t/db_dependent/ILSDI_Services.t +++ b/t/db_dependent/ILSDI_Services.t @@ -200,7 +200,7 @@ subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes source => 'Accountline', value => { borrowernumber => $brwr->{borrowernumber}, - accounttype => 'xxx', + credit_type_code => 'Pay', amountoutstanding => 10 } } diff --git a/t/db_dependent/Koha/Account.t b/t/db_dependent/Koha/Account.t index 568cbf283e..a357a3e348 100755 --- a/t/db_dependent/Koha/Account.t +++ b/t/db_dependent/Koha/Account.t @@ -201,7 +201,7 @@ subtest 'add_credit() tests' => sub { is( $account->balance, -25, 'Patron has a balance of -25' ); is( $schema->resultset('ActionLog')->count(), $action_logs + 0, 'No log was added' ); is( $schema->resultset('Statistic')->count(), $statistics + 1, 'Action added to statistics' ); - is( $line_1->accounttype, $Koha::Account::account_type_credit->{'payment'}, 'Account type is correctly set' ); + is( $line_1->credit_type_code, $Koha::Account::account_type_credit->{'payment'}, 'Account type is correctly set' ); # Enable logs t::lib::Mocks::mock_preference( 'FinesLog', 1 ); @@ -219,7 +219,7 @@ subtest 'add_credit() tests' => sub { is( $account->balance, -62, 'Patron has a balance of -25' ); is( $schema->resultset('ActionLog')->count(), $action_logs + 1, 'Log was added' ); is( $schema->resultset('Statistic')->count(), $statistics + 2, 'Action added to statistics' ); - is( $line_2->accounttype, $Koha::Account::account_type_credit->{'payment'}, 'Account type is correctly set' ); + is( $line_2->credit_type_code, $Koha::Account::account_type_credit->{'payment'}, 'Account type is correctly set' ); # offsets have the credit_id set to accountlines_id, and debit_id is undef my $offset_1 = Koha::Account::Offsets->search({ credit_id => $line_1->id })->next; diff --git a/t/db_dependent/Koha/Account/Lines.t b/t/db_dependent/Koha/Account/Lines.t index 31ff05fd5e..dfd9dbb44c 100755 --- a/t/db_dependent/Koha/Account/Lines.t +++ b/t/db_dependent/Koha/Account/Lines.t @@ -571,7 +571,7 @@ subtest "void() tests" => sub { $line1->_result->discard_changes(); $line2->_result->discard_changes(); - is( $account_payment->accounttype, 'Pay', 'Voided payment accounttype is still Pay' ); + is( $account_payment->credit_type_code, 'Pay', 'Voided payment credit_type_code is still Pay' ); is( $account_payment->status, 'VOID', 'Voided payment status is VOID' ); is( $account_payment->amount+0, 0, 'Voided payment amount is 0' ); is( $account_payment->amountoutstanding+0, 0, 'Voided payment amount outstanding is 0' ); -- 2.20.1