Bug 30215 - "Item found" in accountlines untranslatable
Summary: "Item found" in accountlines untranslatable
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-02 23:57 UTC by Caroline Cyr La Rose
Modified: 2022-03-06 12:52 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2022-03-02 23:57:00 UTC
When a lost item is returned and refunded to the patron, the accountline description contains "Item found" which is untranslatable.

To generate this accountline:
0- Make sure BlockReturnOfLostItems is set to Don't Block
0- Make sure WhenLostChargeReplacementFee is set to Charge
0- In Circulation rules, make sure Default lost item fee refund on return policy is set to one of the Refund options
0- Make sure your item has a replacement price (field v of the item)
1- Check out the item to a patron
2- Change the status of the item to lost
The patron should be charged the replacement price
3- Check in the item
The patron should have a new credit Lost item fee refund

In the description of this new credit, it says "Item found <itemnumber>".

I couldn't find "Item found" anywhere in the po files. 

In fact, when I git grep it, it only shows up in C4/Items.

(Also, I'm wondering if the itemnumber is really useful here, I think it will confuse library staff as I myself was confused, but this is not the point of this bug)
Comment 1 Katrin Fischer 2022-03-06 12:52:02 UTC
The problem is here:

                my $credit;
                if ( $credit_total > 0 ) {
                    my $branchcode =
                      C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
                    $credit = $account->add_credit(
                        {
                            amount      => $credit_total,
                            description => 'Item found ' . $self->itemnumber,
                            type        => 'LOST_FOUND',
                            interface   => C4::Context->interface,
                            library_id  => $branchcode,
                            item_id     => $self->itemnumber,
                            issue_id    => $lost_charge->issue_id
                        }
                    );

Having the description option seems to be a bad idea in the first place when it's not used for adding variables like the title, due date etc. Always meant trouble for translations.

I also agree about the itemnumber not being useful. We do have the link to the item displaying in the table, there is no need for it in the description.