@@ -, +, @@ --- C4/Accounts.pm | 2 +- C4/Circulation.pm | 2 +- Koha/Account.pm | 14 +++++-- Koha/Account/Line.pm | 2 +- .../prog/en/includes/accounts.inc | 2 +- .../prog/en/modules/members/maninvoice.tt | 2 +- .../bootstrap/en/includes/account-table.inc | 2 +- opac/opac-user.pl | 2 +- t/db_dependent/Accounts.t | 40 +++++++++---------- t/db_dependent/Circulation.t | 10 ++--- 10 files changed, 42 insertions(+), 36 deletions(-) --- a/C4/Accounts.pm +++ a/C4/Accounts.pm @@ -91,7 +91,7 @@ sub chargelostitem{ my $existing_charges = $account->lines->search( { itemnumber => $itemnumber, - accounttype => 'L', + accounttype => 'LOST', } )->count(); --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -2408,7 +2408,7 @@ sub _FixAccountForLostAndReturned { my $accountlines = Koha::Account::Lines->search( { itemnumber => $itemnumber, - accounttype => { -in => [ 'L', 'W' ] }, + accounttype => { -in => [ 'LOST', 'W' ] }, }, { order_by => { -desc => [ 'date', 'accountlines_id' ] } --- a/Koha/Account.pm +++ a/Koha/Account.pm @@ -1,4 +1,4 @@ -package Koha::Account; + package Koha::Account; # Copyright 2016 ByWater Solutions # @@ -109,7 +109,10 @@ sub pay { $balance_remaining = $balance_remaining - $amount_to_pay; # Same logic exists in Koha::Account::Line::apply - if ( $new_amountoutstanding == 0 && $fine->itemnumber && $fine->accounttype && ( $fine->accounttype eq 'L' ) ) + if ( $new_amountoutstanding == 0 + && $fine->itemnumber + && $fine->accounttype + && ( $fine->accounttype eq 'LOST' ) ) { C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber ); } @@ -165,7 +168,10 @@ sub pay { $fine->amountoutstanding( $old_amountoutstanding - $amount_to_pay ); $fine->store(); - if ( $fine->amountoutstanding == 0 && $fine->itemnumber && $fine->accounttype && ( $fine->accounttype eq 'L' ) ) + if ( $fine->amountoutstanding == 0 + && $fine->itemnumber + && $fine->accounttype + && ( $fine->accounttype eq 'LOST' ) ) { C4::Circulation::ReturnLostItem( $self->{patron_id}, $fine->itemnumber ); } @@ -727,7 +733,7 @@ our $account_type_credit = { our $account_type_debit = { 'account' => 'A', 'overdue' => 'OVERDUE', - 'lost_item' => 'L', + 'lost_item' => 'LOST', 'new_card' => 'N', 'sundry' => 'M', 'processing' => 'PF', --- a/Koha/Account/Line.pm +++ a/Koha/Account/Line.pm @@ -226,7 +226,7 @@ sub apply { if ( $debit->amountoutstanding == 0 && $debit->itemnumber && $debit->accounttype - && $debit->accounttype eq 'L' ) + && $debit->accounttype eq 'LOST' ) { C4::Circulation::ReturnLostItem( $self->borrowernumber, $debit->itemnumber ); } --- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc @@ -8,7 +8,7 @@ [%- CASE 'OVERDUE' -%]Fine [%- CASE 'A' -%]Account management fee [%- CASE 'M' -%]Sundry - [%- CASE 'L' -%]Lost item + [%- CASE 'LOST' -%]Lost item [%- CASE 'W' -%]Writeoff [%- CASE 'HE' -%]Hold waiting too long [%- CASE 'Rent' -%]Rental fee --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt @@ -79,7 +79,7 @@ [% INCLUDE 'str/members-menu.inc' %] [% Asset.js("js/members-menu.js") | $raw %]