When adding the VOID account line type in bug 27971 I neglected to update the logic for the display of the 'Apply discount' button on the patron transactions page.
Created attachment 122588 [details] [review] Bug 28663: Prevent discounts against void lines With the introduction of double entry accounting for VOID actions, we need to add an additional filter to the 'Apply discount' button appearance Test plan 1/ Add a debt 2/ Pay the debt 3/ Void the payment 4/ Confirm that with the patch applied the 'Apply discount' button does not appear on the 'Void' accountline.
Created attachment 127519 [details] Bug 28663 - Screenshot For me (see screenshot) there is no apply discount button for the void transaction. Also, the patch doesn't apply 8-(.. Applying: Bug 28663: Prevent discounts against void lines Using index info to reconstruct a base tree... M koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt error: Failed to merge in the changes. Patch failed at 0001 Bug 28663: Prevent discounts against void lines
Created attachment 127538 [details] [review] Bug 28663: Prevent discounts against void lines With the introduction of double entry accounting for VOID actions, we need to add an additional filter to the 'Apply discount' button appearance Test plan 1/ Add a debt 2/ Pay the debt 3/ Void the payment 4/ Confirm that with the patch applied the 'Apply discount' button does not appear on the 'Void' accountline.
The logic is currently: CAN_user_updatecharges_discount && account.is_debit && ( account.amountoutstanding == account.amount ) && !(account.debit_type_code == 'PAYOUT') But a void is pretty much always applied immediately so the `account.amountoutstanding == account.amount` sohuldn't ever pass.. I have a feeling when I wrote this that there was a particular way to end up with it showing.. like a series of actions that would partially undo the void.. maybe now. I've rebased anyway.. but maybe leave this one for now.. marking back to minor.
Created attachment 130772 [details] [review] Bug 28663: Prevent discounts against void lines With the introduction of double entry accounting for VOID actions, we need to add an additional filter to the 'Apply discount' button appearance Test plan 1/ Add a debt 2/ Pay the debt 3/ Void the payment 4/ Confirm that with the patch applied the 'Apply discount' button does not appear on the 'Void' accountline. Signed-off-by: Michal Denar <black23@gmail.com>
Should this be enforced at lower (Koha:: module) level as well?
Created attachment 130927 [details] [review] Bug 28663: Prevent discounts against void lines With the introduction of double entry accounting for VOID actions, we need to add an additional filter to the 'Apply discount' button appearance Test plan 1/ Add a debt 2/ Pay the debt 3/ Void the payment 4/ Confirm that with the patch applied the 'Apply discount' button does not appear on the 'Void' accountline. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(In reply to Jonathan Druart from comment #6) > Should this be enforced at lower (Koha:: module) level as well? I believe this is a good first fix, but I am with you on that one as well. Keeping APIs etc in mind, we also should have a check on module level. Could/should we move it to a separate bug?
Pushed to master for 22.05, thanks to everybody involved [U+1F984]
Pushed to 21.11.x for 21.11.04
Pushed to 21.05.x for 21.05.13
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.