Bug 29221

Summary: On returns.tt modal displays wrong message when lost items are returned
Product: Koha Reporter: Lucas Gass <lucas>
Component: CirculationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: major    
Priority: P5 - low CC: andrewfh, gmcharlt, jonathan.druart, kyle.m.hall, kyle, lisettepalouse+koha
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00
Bug Depends on: 18501, 23091    
Bug Blocks:    
Attachments: Bug 29221: Correctly display refund info
Bug 29221: Correctly display refund info
Bug 29221: Correctly display refund info

Description Lucas Gass 2021-10-13 13:56:45 UTC
TO recreate:

1. Set BlockReturnOfLostItems to 'don't block'
2. Make sure your 'Default lost item fee refund on return policy' circ rule is set to 'Leave lost item charge'
3. Check something out and then mark it as lost.
4. Check the item in and notice that the modal popup says "A refund has been applied to the borrowing patron's account."
5. This is not true, a refund is not issued.

Pretty sure this is caused by Bug 23091
Comment 1 Jonathan Druart 2021-10-19 09:39:44 UTC
Looks related to commit bb7a865fb8142252732a5fb255a1db95fe92c3e0
Bug 18501: set the is_refunded flag as internal var
Comment 2 Jonathan Druart 2021-10-19 09:41:36 UTC
Created attachment 126476 [details] [review]
Bug 29221: Correctly display refund info

2132             $messages->{'LostItemFeeRefunded'} = $updated_item->{_refunded};

But, in returns.pl:
495     elsif ( $code eq 'LostItemFeeRefunded' ) {
496         $template->param( LostItemFeeRefunded => 1 );
497     }

1. Set BlockReturnOfLostItems to 'don't block'
2. Make sure your 'Default lost item fee refund on return policy' circ rule is set to 'Leave lost item charge'
3. Check something out and then mark it as lost.
4. Check the item in
=> No message to tell there was a refund
Comment 3 Martin Renvoize 2021-10-19 10:07:44 UTC
Created attachment 126478 [details] [review]
Bug 29221: Correctly display refund info

2132             $messages->{'LostItemFeeRefunded'} = $updated_item->{_refunded};

But, in returns.pl:
495     elsif ( $code eq 'LostItemFeeRefunded' ) {
496         $template->param( LostItemFeeRefunded => 1 );
497     }

1. Set BlockReturnOfLostItems to 'don't block'
2. Make sure your 'Default lost item fee refund on return policy' circ rule is set to 'Leave lost item charge'
3. Check something out and then mark it as lost.
4. Check the item in
=> No message to tell there was a refund

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize 2021-10-19 10:07:59 UTC
Good catch, signing off.
Comment 5 Katrin Fischer 2021-10-19 22:30:37 UTC
Created attachment 126557 [details] [review]
Bug 29221: Correctly display refund info

2132             $messages->{'LostItemFeeRefunded'} = $updated_item->{_refunded};

But, in returns.pl:
495     elsif ( $code eq 'LostItemFeeRefunded' ) {
496         $template->param( LostItemFeeRefunded => 1 );
497     }

1. Set BlockReturnOfLostItems to 'don't block'
2. Make sure your 'Default lost item fee refund on return policy' circ rule is set to 'Leave lost item charge'
3. Check something out and then mark it as lost.
4. Check the item in
=> No message to tell there was a refund

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Jonathan Druart 2021-10-21 08:33:06 UTC
Pushed to master for 21.11, thanks to everybody involved!