Bug 33789: Return issue info. when adding a credit

To test:
1. Make sure MarkLostItemsAsReturned is set so a lost item will stay on a patrons account after being marked as lost.
2. Check an item out to a patron, make sure it has a replacementprice
3. Mark the item as lost.
4. Now check the item in.
5. Go to the patrons account -> transaction tab. You should see 2 accountlines related to the item.
6. For the account type 'Lost item' you will see issue infomation ( check out date, due date, checkouted out from, etc )
7. For the account type 'Lost item fee refund' there is no issue information.
8. Apply patch
9. Try 2 - 6 again. This time the 'Lost item fee refund' should include issue information.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 14e4a3b5c7)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Lucas Gass 2023-05-19 22:09:16 +00:00 committed by Tomas Cohen Arazi
parent 05af370ec1
commit cb7f3bbfdb
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 2 additions and 0 deletions

View File

@ -210,6 +210,7 @@ sub add_credit {
my $payment_type = $params->{payment_type};
my $credit_type = $params->{type} || 'PAYMENT';
my $item_id = $params->{item_id};
my $issue_id = $params->{issue_id};
Koha::Exceptions::Account::RegisterRequired->throw()
if ( C4::Context->preference("UseCashRegisters")
@ -239,6 +240,7 @@ sub add_credit {
branchcode => $library_id,
register_id => $cash_register,
itemnumber => $item_id,
issue_id => $issue_id,
}
)->store();