Bug 27433

Summary: Issue refund button appears after applying a discount
Product: Koha Reporter: Marjorie Barry-Vila <marjorie.barry-vila>
Component: Fines and feesAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: martin.renvoize, patrick.robitaille
Version: 20.05   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 14825    
Attachments: issue refund

Description Marjorie Barry-Vila 2021-01-14 15:11:28 UTC
Created attachment 115163 [details]
issue refund

Hi,

In the 20.05 version, after using the "Apply discount" button,  the "Issue refund" button appears. 

If there was a discount given on a fine, it shoudn't be possible to refund that amount. Only the fully or partially paid fines should.

Is this the right way to use the "Issue refund" button?

Regards,

Marjorie
Comment 1 Martin Renvoize (ashimema) 2021-02-03 10:40:50 UTC
Hmm, I see what you mean.

I'm not sure how to resolve this one.. we don't really have easy access to how the outstanding amount was offset at this level.

The current code looks for any debit lines that have been at least partially 'paid'.. but 'paid' in this case means 'offset' and a discount is an offset the same way a payment or credit it.

[% IF CAN_user_updatecharges_refund && account.is_debit && ( account.amountoutstanding != account.amount ) && !(account.status == 'REFUNDED') && !(account.debit_type_code == 'PAYOUT') %]

I'll have a think
Comment 2 Martin Renvoize (ashimema) 2021-02-03 10:53:05 UTC
I think perhaps we need to impliment some of the idea's in https://wiki.koha-community.org/wiki/Account_view_RFC prior to being able to fix this.. that way we add context to the display lines.