Bugzilla – Attachment 98457 Details for
Bug 24592
Clarify LOST_RETURN process by using FOUND over RETURNED
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24592: Reword LOST_RETURN to LOST_FOUND
Bug-24592-Reword-LOSTRETURN-to-LOSTFOUND.patch (text/plain), 11.85 KB, created by
Martin Renvoize (ashimema)
on 2020-02-05 12:20:18 UTC
(
hide
)
Description:
Bug 24592: Reword LOST_RETURN to LOST_FOUND
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-02-05 12:20:18 UTC
Size:
11.85 KB
patch
obsolete
>From ad93ef03d2829a6d0bfaf8759496d3f33dccb364 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 5 Feb 2020 11:54:20 +0000 >Subject: [PATCH] Bug 24592: Reword LOST_RETURN to LOST_FOUND > >This patch updates the wording in the 'lost and found' process to more >closely reflect what the process is achieving by replacing 'RETURNED' >with 'FOUND' >--- > C4/Circulation.pm | 24 ++++++++++--------- > Koha/Account.pm | 4 ++-- > .../definitions/patron_account_credit.json | 2 +- > .../prog/en/includes/accounts.inc | 2 +- > .../bootstrap/en/includes/account-table.inc | 2 +- > t/db_dependent/Circulation.t | 24 +++++++++---------- > 6 files changed, 30 insertions(+), 28 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 813c064fd6..7cb44cf6ef 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1455,7 +1455,7 @@ sub AddIssue { > ) > ) > { >- _FixAccountForLostAndReturned( $item_object->itemnumber, undef, >+ _FixAccountForLostAndFound( $item_object->itemnumber, undef, > $item_object->barcode ); > } > } >@@ -2037,7 +2037,7 @@ sub AddReturn { > ) > ) > { >- _FixAccountForLostAndReturned( $item->itemnumber, >+ _FixAccountForLostAndFound( $item->itemnumber, > $borrowernumber, $barcode ); > $messages->{'LostItemFeeRefunded'} = 1; > } >@@ -2443,9 +2443,9 @@ sub _FixOverduesOnReturn { > return $result; > } > >-=head2 _FixAccountForLostAndReturned >+=head2 _FixAccountForLostAndFound > >- &_FixAccountForLostAndReturned($itemnumber, [$borrowernumber, $barcode]); >+ &_FixAccountForLostAndFound($itemnumber, [$borrowernumber, $barcode]); > > Finds the most recent lost item charge for this item and refunds the borrower > appropriatly, taking into account any payments or writeoffs already applied >@@ -2455,7 +2455,7 @@ Internal function, not exported, called only by AddReturn. > > =cut > >-sub _FixAccountForLostAndReturned { >+sub _FixAccountForLostAndFound { > my $itemnumber = shift or return; > my $borrowernumber = @_ ? shift : undef; > my $item_id = @_ ? shift : $itemnumber; # Send the barcode if you want that logged in the description >@@ -2467,7 +2467,7 @@ sub _FixAccountForLostAndReturned { > { > itemnumber => $itemnumber, > debit_type_code => 'LOST', >- status => [ undef, { '<>' => 'RETURNED' } ] >+ status => [ undef, { '<>' => 'FOUND' } ] > }, > { > order_by => { -desc => [ 'date', 'accountlines_id' ] } >@@ -2506,11 +2506,13 @@ sub _FixAccountForLostAndReturned { > if ( $credit_total > 0 ) { > my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef; > $credit = $account->add_credit( >- { amount => $credit_total, >- description => 'Item Returned ' . $item_id, >- type => 'LOST_RETURN', >+ { >+ amount => $credit_total, >+ description => 'Item found ' . $item_id, >+ type => 'LOST_FOUND', > interface => C4::Context->interface, >- library_id => $branchcode >+ library_id => $branchcode, >+ itemnumber => $itemnumber > } > ); > >@@ -2518,7 +2520,7 @@ sub _FixAccountForLostAndReturned { > } > > # Update the account status >- $accountline->discard_changes->status('RETURNED'); >+ $accountline->discard_changes->status('FOUND'); > $accountline->store; > > if ( defined $account and C4::Context->preference('AccountAutoReconcile') ) { >diff --git a/Koha/Account.pm b/Koha/Account.pm >index ae6bebbb7a..6fc464178f 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -326,7 +326,7 @@ $credit_type can be any of: > - 'CREDIT' > - 'PAYMENT' > - 'FORGIVEN' >- - 'LOST_RETURN' >+ - 'LOST_FOUND' > - 'WRITEOFF' > > =cut >@@ -741,7 +741,7 @@ sub reconcile_balance { > our $offset_type = { > 'CREDIT' => 'Manual Credit', > 'FORGIVEN' => 'Writeoff', >- 'LOST_RETURN' => 'Lost Item', >+ 'LOST_FOUND' => 'Lost Item Found', > 'PAYMENT' => 'Payment', > 'WRITEOFF' => 'Writeoff', > 'ACCOUNT' => 'Account Fee', >diff --git a/api/v1/swagger/definitions/patron_account_credit.json b/api/v1/swagger/definitions/patron_account_credit.json >index a231471c21..ba156fe9ff 100644 >--- a/api/v1/swagger/definitions/patron_account_credit.json >+++ b/api/v1/swagger/definitions/patron_account_credit.json >@@ -3,7 +3,7 @@ > "properties": { > "credit_type": { > "type": "string", >- "description": "Type of credit ('CREDIT', 'FORGIVEN', 'LOST_RETURN', 'PAYMENT', 'WRITEOFF' )" >+ "description": "Type of credit ('CREDIT', 'FORGIVEN', 'LOST_FOUND', 'PAYMENT', 'WRITEOFF' )" > }, > "amount": { > "type": "number", >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >index 162a641e57..172acc6347 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/accounts.inc >@@ -6,7 +6,7 @@ > [%- CASE 'WRITEOFF' -%]Writeoff > [%- CASE 'FORGIVEN' -%]Forgiven > [%- CASE 'CREDIT' -%]Credit >- [%- CASE 'LOST_RETURN' -%]Lost item fee refund >+ [%- CASE 'LOST_FOUND' -%]Lost item fee refund > [%- CASE 'Refund' -%]Refund > [%- CASE -%][% account.credit_type.description | html %] > [%- END -%] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >index 8f38a70d7d..a193b11a4c 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/account-table.inc >@@ -175,7 +175,7 @@ > [%- CASE 'WRITEOFF' -%]Writeoff > [%- CASE 'FORGIVEN' -%]Forgiven > [%- CASE 'CREDIT' -%]Credit >- [%- CASE 'LOST_RETURN' -%]Lost item fee refund >+ [%- CASE 'LOST_FOUND' -%]Lost item fee refund > [%- CASE -%][% account.credit_type.description | html %] > [%- END -%] > [%- ELSIF account.debit_type_code -%] >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index 4b17bf5d61..b3d8277b17 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -2425,7 +2425,7 @@ subtest '_FixAccountForLostAndReturned' => sub { > $credit->apply( { debits => [ $debts->as_list ], offset_type => 'Writeoff' } ); > > my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item->itemnumber, $patron->id ); >- is( $credit_return_id, undef, 'No LOST_RETURN account line added' ); >+ is( $credit_return_id, undef, 'No LOST_FOUND account line added' ); > > $lost_fee_line->discard_changes; # reload from DB > is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' ); >@@ -2489,11 +2489,11 @@ 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->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); >+ is( $credit_return->credit_type_code, 'LOST_FOUND', 'An account line of type LOST_FOUND is added' ); > is( $credit_return->amount + 0, >- -99.00, 'The account line of type LOST_RETURN has an amount of -99' ); >+ -99.00, 'The account line of type LOST_FOUND has an amount of -99' ); > is( $credit_return->amountoutstanding + 0, >- -99.00, 'The account line of type LOST_RETURN has an amountoutstanding of -99' ); >+ -99.00, 'The account line of type LOST_FOUND has an amountoutstanding of -99' ); > > $lost_fee_line->discard_changes; > is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' ); >@@ -2547,9 +2547,9 @@ 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->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' ); >+ is( $credit_return->credit_type_code, 'LOST_FOUND', 'An account line of type LOST_FOUND is added' ); >+ is( $credit_return->amount + 0, -99.00, 'The account line of type LOST_FOUND has an amount of -99' ); >+ is( $credit_return->amountoutstanding + 0, 0, 'The account line of type LOST_FOUND has an amountoutstanding of 0' ); > > $lost_fee_line->discard_changes; > is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' ); >@@ -2633,7 +2633,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( $account->balance, $processfee_amount - $payment_amount, 'Balance is PROCESSING - PAYMENT (LOST_RETURN)' ); >+ is( $account->balance, $processfee_amount - $payment_amount, 'Balance is PROCESSING - PAYMENT (LOST_FOUND)' ); > > $lost_fee_line->discard_changes; > is( $lost_fee_line->amountoutstanding + 0, 0, 'Lost fee has no outstanding amount' ); >@@ -2641,14 +2641,14 @@ 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->credit_type_code, 'LOST_RETURN', 'An account line of type LOST_RETURN is added' ); >+ is( $credit_return->credit_type_code, 'LOST_FOUND', 'An account line of type LOST_FOUND 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' >+ 'The account line of type LOST_FOUND has an amount equal to the payment + outstanding' > ); > is( $credit_return->amountoutstanding + 0, > $payment_amount * -1, >- 'The account line of type LOST_RETURN has an amountoutstanding equal to the payment' >+ 'The account line of type LOST_FOUND has an amountoutstanding equal to the payment' > ); > > is( $account->balance, >@@ -2729,7 +2729,7 @@ subtest '_FixAccountForLostAndReturned' => sub { > my $credit_return_id = C4::Circulation::_FixAccountForLostAndReturned( $item_id, $patron->id ); > my $credit_return = Koha::Account::Lines->find($credit_return_id); > >- is( $account->balance, $manual_debit_amount - $payment_amount, 'Balance is PROCESSING - payment (LOST_RETURN)' ); >+ is( $account->balance, $manual_debit_amount - $payment_amount, 'Balance is PROCESSING - payment (LOST_FOUND)' ); > > my $manual_debit = Koha::Account::Lines->search({ borrowernumber => $patron->id, debit_type_code => 'OVERDUE', status => 'UNRETURNED' })->next; > is( $manual_debit->amountoutstanding + 0, $manual_debit_amount - $payment_amount, 'reconcile_balance was called' ); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24592
:
98457
|
98458
|
98481
|
98482
|
98643
|
98644
|
98680
|
98681
|
98852
|
98853