Bug 22774 - Limit Purchase Suggestion in a specified Time period
Summary: Limit Purchase Suggestion in a specified Time period
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Devinim
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-25 15:36 UTC by Joy Nelson
Modified: 2020-01-09 12:38 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 22774: New systempreferences for suggestions (2.34 KB, patch)
2019-12-03 10:52 UTC, Devinim
Details | Diff | Splinter Review
Bug 22774: Limit Purchase Suggestion in a specified Time period (8.68 KB, patch)
2019-12-03 10:54 UTC, Devinim
Details | Diff | Splinter Review
Bug 22774: (follow-up) Limit Purchase Suggestion in a specified Time period (8.76 KB, patch)
2020-01-09 10:50 UTC, Devinim
Details | Diff | Splinter Review
Bug 22774: New systempreferences for suggestions (2.40 KB, patch)
2020-01-09 12:33 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 22774: (follow-up) Limit Purchase Suggestion in a specified Time period (8.81 KB, patch)
2020-01-09 12:33 UTC, ByWater Sandboxes
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Joy Nelson 2019-04-25 15:36:07 UTC
Many libraries would like the ability to limit purchase suggestions made by a patron to a certain number over a specified period.  i.e. 3 suggestions every 30 days.  The MaxOpenSuggestions works to limit 'open' suggestions, but does not take into account the total suggestions made by patrons. We need the ability to limit the number of suggestions a patron can make in a "rolling number of weeks" (over last X weeks). 

The variables for this would be the number of suggestions and the number of rolling weeks.

Suggested system preference "MaxTotalSuggestions" with two variables.  First is the number of total suggestions and the second is the number of days.

e.g. MaxTotalSuggestion Allow 3 total suggestions over 30 days.  (user configures the numbers to suit their policy)

Result: Users are prevented from making any suggestions if the total suggestions (pending/checked/accepted/rejected) they've made over the last X days is equal to the max specified.
Comment 1 Lisette Scheer 2019-04-26 15:22:35 UTC
This would be very helpful for a number of libraries I've talked with about purchase suggestions. 
Lisette
Comment 2 Devinim 2019-12-03 10:52:53 UTC
Created attachment 95940 [details] [review]
Bug 22774: New systempreferences for suggestions
Comment 3 Devinim 2019-12-03 10:54:05 UTC
Created attachment 95941 [details] [review]
Bug 22774: Limit Purchase Suggestion in a specified Time period

Test plan:
1- Apply this patch
2- Run updatedatabase.pl
3- By default you may have max. 3 suggestions in last 30 days.
4- Go to purchase suggestion page from OPAC
5- If you exceed limits of suggestions in step 3 you will not able to add new suggestions.
6- If you want to change the limits go to systempreferences and change  MaxTotalSuggestions and NumberOfSuggestionDays parameters.
7- Test again from step 4.
Comment 4 Kelly McElligott 2020-01-07 13:49:53 UTC
Hi,
Upon testing this, I received this error when trying to place a hold on the OPAC side.

Could not compile /kohadevbox/koha/opac/opac-suggestions.pl: Global symbol "$suggestions_loop" requires explicit package name (did you forget to declare "my $suggestions_loop"?) at /kohadevbox/koha/opac/opac-suggestions.pl line 144
Comment 5 Devinim 2020-01-09 10:50:59 UTC
Created attachment 97061 [details] [review]
Bug 22774: (follow-up) Limit Purchase Suggestion in a specified Time period

This was resolved. Fail occured because of some changes after we commit the patch
Comment 6 ByWater Sandboxes 2020-01-09 12:33:33 UTC
Created attachment 97070 [details] [review]
Bug 22774: New systempreferences for suggestions

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Comment 7 ByWater Sandboxes 2020-01-09 12:33:35 UTC
Created attachment 97071 [details] [review]
Bug 22774: (follow-up) Limit Purchase Suggestion in a specified Time period

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>