Bug 33098 - Revert suggestion status to 'Accepted' when orders made from a suggestion are cancelled
Summary: Revert suggestion status to 'Accepted' when orders made from a suggestion are...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
: 18770 29027 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-02-28 21:35 UTC by Aleisha Amohia
Modified: 2023-12-29 15:07 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact: Philip Orr
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/776
Text to go in the release notes:
This enhancement will revert the status of a suggestion from `ORDERED` to `ACCEPTED` when an order made from a suggestion is cancelled.
Version(s) released in:
23.05.00


Attachments
Bug 33098: Revert suggestion status when orders are cancelled (4.25 KB, patch)
2023-03-01 01:14 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 33098: Revert suggestion status when orders are cancelled (4.38 KB, patch)
2023-04-18 18:45 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2023-02-28 21:35:02 UTC
Currently when adding an order to a basket from an accepted suggestion, the status of the suggestion goes from 'accepted' to 'ordered'.

If the order is then cancelled, the suggestion remains as 'ordered'. The status should be reverted to 'accepted' as it is no longer on order.
Comment 1 Aleisha Amohia 2023-03-01 01:14:20 UTC
Created attachment 147526 [details] [review]
Bug 33098: Revert suggestion status when orders are cancelled

This enhancement will revert the status of a suggestion from ORDERED to
ACCEPTED when an order made from a suggestion is cancelled.

To test:
1. Log into the OPAC and go to purchase suggestions
2. Add a new purchase suggestion
3. Log into the staff interface. The suggestion will show on the home
page
4. Select the suggestion and mark it as Accepted
5. Go to Acquisitions. Find or create a basket
6. Add an order to the basket from a suggestion
7. You'll be redirected to the suggestions page. Click the order button
next to your suggestion
8. Fill out the order details as normal and confirm the order.
9. In a new tab, go to the suggestions management page and confirm the
suggestion now shows as ORDERED.
10. In the other tab with your basket, cancel the order you just made
from the suggestion.
11. Refresh the suggestions management tab. Confirm the suggestion now
shows as ACCEPTED.
12. Confirm tests pass t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Waikato Institute of Technology
Comment 2 Laura Escamilla 2023-03-06 19:36:11 UTC
When testing, I still see the canceled orders as "ordered" on both the Staff Intranet and Opac.
Comment 3 Aleisha Amohia 2023-03-06 20:30:25 UTC
Thanks Laura, if a test plan fails please set the Status to "failed QA".

I'll take another look at this.
Comment 4 Aleisha Amohia 2023-03-07 02:05:19 UTC
I've just re-tested this and the test plan still works - perhaps you forgot to restart services after applying the patch?
Comment 5 Laura Escamilla 2023-03-07 11:55:45 UTC
(In reply to Aleisha Amohia from comment #4)
> I've just re-tested this and the test plan still works - perhaps you forgot
> to restart services after applying the patch?

Aleisha, 

I indeed forgot to restart the services after applying the patch. I retested everything and it works as expected. 

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 6 Victor Grousset/tuxayo 2023-04-18 18:45:05 UTC
Created attachment 149826 [details] [review]
Bug 33098: Revert suggestion status when orders are cancelled

This enhancement will revert the status of a suggestion from ORDERED to
ACCEPTED when an order made from a suggestion is cancelled.

To test:
1. Log into the OPAC and go to purchase suggestions
2. Add a new purchase suggestion
3. Log into the staff interface. The suggestion will show on the home
page
4. Select the suggestion and mark it as Accepted
5. Go to Acquisitions. Find or create a basket
6. Add an order to the basket from a suggestion
7. You'll be redirected to the suggestions page. Click the order button
next to your suggestion
8. Fill out the order details as normal and confirm the order.
9. In a new tab, go to the suggestions management page and confirm the
suggestion now shows as ORDERED.
10. In the other tab with your basket, cancel the order you just made
from the suggestion.
11. Refresh the suggestions management tab. Confirm the suggestion now
shows as ACCEPTED.
12. Confirm tests pass t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Waikato Institute of Technology
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 7 Victor Grousset/tuxayo 2023-04-18 18:51:19 UTC
@Laura hi, thanks for the signoff :)

The "Signed-off-by" line needs to be added to the patch itself and the updated/signed patch needs to be attached to the ticket here.

You likely have git bz installed in you test environment or maybe you are using the sandboxes. Here is some documentation about how add a signoff to a patch and how to attach it here.

You might want to discuss that with a colleague to find what's the most efficient or simplest workflow for your case.

https://wiki.koha-community.org/wiki/Sign_off_on_patches#Method_1:_Using_sandboxes
https://wiki.koha-community.org/wiki/Sign_off_on_patches#Method_2%3A_Using_git_bz
https://wiki.koha-community.org/wiki/Git_bz_configuration#Signing_off
Comment 8 Victor Grousset/tuxayo 2023-04-18 18:51:35 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 9 Tomás Cohen Arazi 2023-05-16 13:18:06 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 10 Matt Blenkinsop 2023-06-08 15:58:38 UTC
Enhancement - not backporting to 22.11.x
Comment 11 Katrin Fischer 2023-06-24 18:05:19 UTC
*** Bug 29027 has been marked as a duplicate of this bug. ***
Comment 12 Katrin Fischer 2023-06-24 18:07:29 UTC
*** Bug 18770 has been marked as a duplicate of this bug. ***