Bug 35717 - Link suggestions to orders by adding ordernumber to suggestions table
Summary: Link suggestions to orders by adding ordernumber to suggestions table
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-05 18:54 UTC by Nick Clemens
Modified: 2024-04-12 12:09 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 35717: DB changes (3.56 KB, patch)
2024-01-05 18:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: DBIC schema changes (3.17 KB, patch)
2024-01-05 18:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Add link between suggestions and orders (24.35 KB, patch)
2024-01-05 18:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Remove GetSuggestionInfoFromBiblionumber (5.39 KB, patch)
2024-01-05 18:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Replace GetSuggestionFromBiblionumber (1.68 KB, patch)
2024-01-05 18:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Remove GetSuggestionFromBiblionumber (4.09 KB, patch)
2024-01-05 18:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Adjust other calls (2.49 KB, patch)
2024-01-05 18:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Tidy (5.77 KB, patch)
2024-01-05 18:57 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: DB changes (3.56 KB, patch)
2024-04-12 12:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: DBIC schema changes (3.17 KB, patch)
2024-04-12 12:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Add link between suggestions and orders (24.66 KB, patch)
2024-04-12 12:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Remove GetSuggestionInfoFromBiblionumber (5.39 KB, patch)
2024-04-12 12:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Replace GetSuggestionFromBiblionumber (1.68 KB, patch)
2024-04-12 12:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Remove GetSuggestionFromBiblionumber (4.09 KB, patch)
2024-04-12 12:09 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 35717: Adjust other calls (2.87 KB, patch)
2024-04-12 12:09 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2024-01-05 18:54:28 UTC
This is bug 28844 reworked with the relationship defined in the reverse way.

There can be multiple suggestions for the same title currently (the check for duplicate suggestions includes the suggestedby field in the search, so only a single patron is prevented from requesting the same book twice)

While we can order only from a single suggestion, bug 19358 and 31632 seek to allow linking multiple suggestions to an order, I believe we need to define the relationship this way now, to allow for future changes.
Comment 1 Nick Clemens 2024-01-05 18:57:01 UTC
Created attachment 160576 [details] [review]
Bug 35717: DB changes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 2 Nick Clemens 2024-01-05 18:57:03 UTC
Created attachment 160577 [details] [review]
Bug 35717: DBIC schema changes
Comment 3 Nick Clemens 2024-01-05 18:57:05 UTC
Created attachment 160578 [details] [review]
Bug 35717: Add link between suggestions and orders

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Nick Clemens 2024-01-05 18:57:07 UTC
Created attachment 160579 [details] [review]
Bug 35717: Remove GetSuggestionInfoFromBiblionumber

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Nick Clemens 2024-01-05 18:57:09 UTC
Created attachment 160580 [details] [review]
Bug 35717: Replace GetSuggestionFromBiblionumber

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Nick Clemens 2024-01-05 18:57:10 UTC
Created attachment 160581 [details] [review]
Bug 35717: Remove GetSuggestionFromBiblionumber

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Nick Clemens 2024-01-05 18:57:12 UTC
Created attachment 160582 [details] [review]
Bug 35717: Adjust other calls

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 8 Nick Clemens 2024-01-05 18:57:14 UTC
Created attachment 160583 [details] [review]
Bug 35717: Tidy
Comment 9 Andrew Fuerste-Henry 2024-01-05 21:06:47 UTC
Test plan:
1 - apply patch, reset_all
2 - create purchase suggestion
3 - accept purchase suggestion
4 - create and receive order from suggestion
5 - confirm that notices were generated as suggestion is accepted, ordered, received
6 - confirm that order number is present in suggestions data

Anything else I need to check here?
Comment 10 Andrew Fuerste-Henry 2024-01-05 21:35:11 UTC
Test plan:
1 - apply patch, reset_all
2 - create purchase suggestion
3 - accept purchase suggestion
4 - create and receive order from suggestion
5 - confirm that notices were generated as suggestion is accepted, ordered, received
6 - confirm that order number is present in suggestions data
7 - submit a second suggestion, accept it, create order from it
8 - cancel order from suggestion, confirm suggestion status reverts from "Ordered" to "Accepted" and order number is removed from suggestion
Comment 11 Andrew Fuerste-Henry 2024-01-05 21:35:53 UTC
Hi these patches applied, I'm getting an error when attempting to receive an order tied to a suggestion. It looks like maybe an undefined basket number?
Comment 12 Lucas Gass 2024-01-17 23:03:52 UTC
(In reply to Andrew Fuerste-Henry from comment #11)
> Hi these patches applied, I'm getting an error when attempting to receive an
> order tied to a suggestion. It looks like maybe an undefined basket number?

I don't recreate this. Did you updatedatabase after applying the patch?
Comment 13 Andrew Fuerste-Henry 2024-01-18 15:24:27 UTC
(In reply to Lucas Gass from comment #12)
> (In reply to Andrew Fuerste-Henry from comment #11)
> > Hi these patches applied, I'm getting an error when attempting to receive an
> > order tied to a suggestion. It looks like maybe an undefined basket number?
> 
> I don't recreate this. Did you updatedatabase after applying the patch?

I'm getting this error on a sandbox that was provisioned with the patch applied from the start. My understanding is that inherently includes an updatedatabase, and I can see via SQL that the suggestions table *does* include the ordernumber field.
Comment 14 Katrin Fischer 2024-01-28 13:23:02 UTC
(In reply to Andrew Fuerste-Henry from comment #11)
> Hi these patches applied, I'm getting an error when attempting to receive an
> order tied to a suggestion. It looks like maybe an undefined basket number?

Was the suggestion created before or after applying the patch?
Comment 15 Andrew Fuerste-Henry 2024-01-29 16:16:39 UTC
(In reply to Katrin Fischer from comment #14)
> (In reply to Andrew Fuerste-Henry from comment #11)
> > Hi these patches applied, I'm getting an error when attempting to receive an
> > order tied to a suggestion. It looks like maybe an undefined basket number?
> 
> Was the suggestion created before or after applying the patch?

After. I tested this on a sandbox with the patch applied from creation.
Comment 16 Katrin Fischer 2024-01-29 20:41:10 UTC
I guess that was wishful thinking. I hope Nick will have time to have a look soon.
Comment 17 Nick Clemens 2024-04-12 12:08:53 UTC
Created attachment 164834 [details] [review]
Bug 35717: DB changes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 18 Nick Clemens 2024-04-12 12:08:55 UTC
Created attachment 164835 [details] [review]
Bug 35717: DBIC schema changes
Comment 19 Nick Clemens 2024-04-12 12:08:58 UTC
Created attachment 164836 [details] [review]
Bug 35717: Add link between suggestions and orders

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 20 Nick Clemens 2024-04-12 12:09:01 UTC
Created attachment 164837 [details] [review]
Bug 35717: Remove GetSuggestionInfoFromBiblionumber

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 21 Nick Clemens 2024-04-12 12:09:04 UTC
Created attachment 164838 [details] [review]
Bug 35717: Replace GetSuggestionFromBiblionumber

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 22 Nick Clemens 2024-04-12 12:09:06 UTC
Created attachment 164839 [details] [review]
Bug 35717: Remove GetSuggestionFromBiblionumber

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 23 Nick Clemens 2024-04-12 12:09:08 UTC
Created attachment 164840 [details] [review]
Bug 35717: Adjust other calls

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>