When adding the VOID account line type in bug 27971 I neglected to update the logic for the display of the 'Issue refund' button on the patron transactions page.
Created attachment 122587 [details] [review] Bug 28664: Prevent redunfs against void lines With the introduction of double entry accounting for VOID actions, we need to add an additional filter to the 'Issue refund' button appearance Test plan 1/ Add a debt 2/ Pay the debt 3/ Void the payment 4/ Confirm that with the patch applied the 'Issue refund' button doesn not appear on the 'Void' accountline.
Patch doesn't apply 8-(.. Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 28664: Prevent redunfs 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 28664: Prevent redunfs against void lines
Created attachment 127537 [details] [review] Bug 28664: Prevent refunds against void lines With the introduction of double entry accounting for VOID actions, we need to add an additional filter to the 'Issue refund' button appearance Test plan 1/ Add a debt 2/ Pay the debt 3/ Void the payment 4/ Confirm that with the patch applied the 'Issue refund' button doesn not appear on the 'Void' accountline.
Always moving is our Koha!... :) Rebased, thanks for looking David.
Created attachment 127548 [details] [review] Bug 28664: Prevent refunds against void lines With the introduction of double entry accounting for VOID actions, we need to add an additional filter to the 'Issue refund' button appearance Test plan 1/ Add a debt 2/ Pay the debt 3/ Void the payment 4/ Confirm that with the patch applied the 'Issue refund' button doesn not appear on the 'Void' accountline. Signed-off-by: David Nind <david@davidnind.com>
The patch itself is simple and does the job. But I think we are a bit fragile here. Too much calculation in the controller/templates. Can we add something like: Koha::Account::Line->can_be_reduced Koha::Account::Line->refund and reuse it both in the templates and controllers? I would like the code to explode if tricked to try refunding a 'VOID' line. I can help coding or writing the tests if required. If this is being worked on somewhere else, please point me to the right direction.
I think this should really have gone in.. I don't really have the time spare capacity to build the new methods on top
Created attachment 168205 [details] [review] Bug 28664: Prevent refunds against void lines With the introduction of double entry accounting for VOID actions, we need to add an additional filter to the 'Issue refund' button appearance Test plan 1/ Add a debt 2/ Pay the debt 3/ Void the payment 4/ Confirm that with the patch applied the 'Issue refund' button doesn not appear on the 'Void' accountline. Signed-off-by: David Nind <david@davidnind.com>
Created attachment 168206 [details] [review] Bug 28664: (follow-up) Throw exception if debt if VOID This patch adds an exception when an attempt is made to refund against a VOID debit. Test plan 1) Run the included unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I've added an exception that follows how other exceptions for similar use cases are raised. Hopefully this, with it's corresponding unit test, is enough to get us through QA
Created attachment 168228 [details] [review] Bug 28664: Prevent refunds against void lines With the introduction of double entry accounting for VOID actions, we need to add an additional filter to the 'Issue refund' button appearance Test plan 1/ Add a debt 2/ Pay the debt 3/ Void the payment 4/ Confirm that with the patch applied the 'Issue refund' button doesn not appear on the 'Void' accountline. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 168229 [details] [review] Bug 28664: (follow-up) Throw exception if debt if VOID This patch adds an exception when an attempt is made to refund against a VOID debit. Test plan 1) Run the included unit test Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed for 24.11! Well done everyone, thank you!
Backported to 24.05.x for upcoming 24.05.02
Pushed to 23.11.x for 23.11.07
Not backporting to 23.05.x unless requested