Bug 31632

Summary: Add ability to manually link orders to suggestions
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: AcquisitionsAssignee: Nick Clemens (kidclamp) <nick>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, kebliss, michaela.sieber, severine.queune
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 19358    
Attachments: Bug 31632: Add missing suggestion statuses to API
Bug 31632: Add ability to link orders to suggestions when adding to basket from a file
Bug 31632: Display multiple suggestions for record in basket

Description Nick Clemens (kidclamp) 2022-09-27 11:19:24 UTC

    
Comment 1 Katrin Fischer 2022-09-27 12:48:04 UTC
+1 Having a direct link from suggestion to order would be great.
Comment 2 Nick Clemens (kidclamp) 2022-09-27 13:09:39 UTC
Created attachment 141028 [details] [review]
Bug 31632: Add missing suggestion statuses to API
Comment 3 Nick Clemens (kidclamp) 2022-09-27 13:09:43 UTC
Created attachment 141029 [details] [review]
Bug 31632: Add ability to link orders to suggestions when adding to basket from a file

This patch adds a new include for suggestions searching, and adds JS on the addorderiso2907 page
to allow linking new orders to suggestions while importing into a basket

To test:
 1 - Export or find a file of bibs
 2 - Stage the file using Tools->Stage MARC for Import
 3 - Find or create an open basket in acquisitions
 4 - Add to basket from the staged file
 5 - Select/check a record
 6 - Note new 'Suggestions' area
 7 - Click 'Link suggestions'
 8 - Search for suggestions - click 'Select'
 9 - Select button is gone
10 - Dismiss modal
11 - Suggestion is listed for this record
12 - Click 'Link suggestions'
13 - Confirm the suggestion cannot be chosen again
14 - Add another
15 - Dismiss the modal
16 - Click 'Remove' on the first suggestion
17 - Confirm it is removed
18 - Confirm you can now link it again
19 - Select budget etc and submit
20 - Confirm record linked to suggestions
Comment 4 Nick Clemens (kidclamp) 2022-09-27 13:09:47 UTC
Created attachment 141030 [details] [review]
Bug 31632: Display multiple suggestions for record in basket

In case suggestions are duplicated, allow several to be attached and display them all

To test:
1 - Follow plan in previous patch to attach 2 suggestions when adding order
2 - Confirm both suggestions display after record added to basket
Comment 5 Nick Clemens (kidclamp) 2022-09-27 13:11:05 UTC
(In reply to Katrin Fischer from comment #1)
> +1 Having a direct link from suggestion to order would be great.

This is really 'link to biblio' during ordering - maybe another bug to add suggestion_id to aqorders table?

Still need to cleanup and add to neworderempty - but attaching WIP to clarify
Comment 6 Katrin Fischer 2022-09-27 13:16:47 UTC
(In reply to Nick Clemens from comment #5)
> (In reply to Katrin Fischer from comment #1)
> > +1 Having a direct link from suggestion to order would be great.
> 
> This is really 'link to biblio' during ordering - maybe another bug to add
> suggestion_id to aqorders table?

I think it already exists, but couldn't find it. The current approach is problematic, because you might end up emailing the 'wrong' users.

Also: We'd need suggestions.ordernumber, because you might have several people suggesting the same popular item at the same time, less likely to have multiple orders for one suggestion.
Comment 7 Katrin Fischer 2022-09-27 13:18:24 UTC
Is this a (partial) duplicate of bug 19358?
Comment 8 Nick Clemens (kidclamp) 2022-09-27 13:23:41 UTC
(In reply to Katrin Fischer from comment #7)
> Is this a (partial) duplicate of bug 19358?

It's a step towards that one, adding depends/blocks
Comment 9 Aleisha Amohia 2023-11-20 07:45:28 UTC
*** Bug 35367 has been marked as a duplicate of this bug. ***