Summary: | One should not be able to apply a discount to a VOID accountline | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | Fines and fees | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | andrew, david, jonathan.druart, kyle, sally.healey, tomascohen, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This removes the display of the 'Apply discount' button for VOID transactions.
|
Version(s) released in: |
22.05.00,21.11.04,21.05.13
|
Circulation function: | |||
Bug Depends on: | 27971 | ||
Bug Blocks: | 13985 | ||
Attachments: |
Bug 28663: Prevent discounts against void lines
Bug 28663 - Screenshot Bug 28663: Prevent discounts against void lines Bug 28663: Prevent discounts against void lines Bug 28663: Prevent discounts against void lines |
Description
Martin Renvoize (ashimema)
2021-07-05 18:29:32 UTC
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. |