From 21f41610434e56e495f5f5f77c3bce95eaa316fe Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 10 Oct 2019 16:41:22 +0100 Subject: [PATCH] Bug 23049: Capitalise type passed to add_debit for lost_item MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Séverine QUEUNE --- C4/Accounts.pm | 2 +- Koha/Account.pm | 6 +++--- t/db_dependent/Circulation/NoIssuesChargeGuarantees.t | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index 3f06595d74..53fd8b77fa 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -124,7 +124,7 @@ sub chargelostitem { user_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : undef, interface => C4::Context->interface, library_id => C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef, - type => 'lost_item', + type => 'LOST', item_id => $itemnumber, issue_id => $issue_id, } diff --git a/Koha/Account.pm b/Koha/Account.pm index 2c8c4a1e7d..fbb2731c95 100644 --- a/Koha/Account.pm +++ b/Koha/Account.pm @@ -447,7 +447,7 @@ $debit_type can be any of: - ACCOUNT - ACCOUNT_RENEW - RESERVE_EXPIRED - - lost_item + - LOST - sundry - new_card - overdue @@ -713,7 +713,7 @@ our $offset_type = { 'ACCOUNT_RENEW' => 'Account Fee', 'RESERVE' => 'Reserve Fee', 'PROCESSING' => 'Processing Fee', - 'lost_item' => 'Lost Item', + 'LOST' => 'Lost Item', 'RENT' => 'Rental Fee', 'RENT_DAILY' => 'Rental Fee', 'RENT_RENEW' => 'Rental Fee', @@ -743,7 +743,7 @@ our $account_type_debit = { 'ACCOUNT' => 'ACCOUNT', 'ACCOUNT_RENEW' => 'ACCOUNT_RENEW', 'RESERVE_EXPIRED' => 'RESERVE_EXPIRED', - 'lost_item' => 'LOST', + 'LOST_ITEM' => 'LOST', 'sundry' => 'M', 'new_card' => 'N', 'overdue' => 'OVERDUE', diff --git a/t/db_dependent/Circulation/NoIssuesChargeGuarantees.t b/t/db_dependent/Circulation/NoIssuesChargeGuarantees.t index ed15c4fd18..7f496aed83 100644 --- a/t/db_dependent/Circulation/NoIssuesChargeGuarantees.t +++ b/t/db_dependent/Circulation/NoIssuesChargeGuarantees.t @@ -81,7 +81,7 @@ my ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item- is( $issuingimpossible->{DEBT_GUARANTEES}, undef, "Patron can check out item" ); my $account = Koha::Account->new( { patron_id => $guarantee->id } ); -$account->add_debit({ amount => 10.00, type => 'lost_item', interface => 'test' }); +$account->add_debit({ amount => 10.00, type => 'LOST', interface => 'test' }); ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, $item->{barcode} ); is( $issuingimpossible->{DEBT_GUARANTEES} + 0, '10.00' + 0, "Patron cannot check out item due to debt for guarantee" ); -- 2.20.1