Bug 11176 - Purchase suggestions should respect the 'active' switch on budgets
Summary: Purchase suggestions should respect the 'active' switch on budgets
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low minor with 11 votes (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
: 12047 21040 (view as bug list)
Depends on: 14850
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-31 12:02 UTC by David Roberts
Modified: 2020-09-28 14:10 UTC (History)
9 users (show)

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


Attachments
Bug 11176: Add active switch on budgets select in suggestions (5.64 KB, patch)
2020-09-24 12:35 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 11176: Add active switch on budgets select in suggestions (5.71 KB, patch)
2020-09-24 13:58 UTC, David Nind
Details | Diff | Splinter Review
Bug 11176: Add active switch on budgets select in suggestions (5.76 KB, patch)
2020-09-24 19:44 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Roberts 2013-10-31 12:02:51 UTC
When creating a new purchase suggestion, all funds display and are available for selection. 

The behaviour of this drop-down menu should mirror that of those drop-down menus elsewhere in acquisitions, where only funds that are linked to active budgets display to the user.
Comment 1 Fridolin Somers 2014-01-31 16:01:33 UTC
Isn't this a duplicate of Bug 10875 ?
Comment 2 Fridolin Somers 2014-01-31 16:03:11 UTC
(In reply to Fridolin SOMERS from comment #1)
> Isn't this a duplicate of Bug 10875 ?
No, this bug is about suggestions, sorry.
Comment 3 Marjorie Barry-Vila 2016-09-26 17:33:46 UTC
*** Bug 12047 has been marked as a duplicate of this bug. ***
Comment 4 Amit Gupta 2017-04-10 04:50:24 UTC
Hi 

In this we have to show only active budget or we have to give option to select inactive also.

I m interested to work on this bug.
Comment 5 Maura Stephens 2018-01-18 15:14:32 UTC
I would very much support some work to be done on this bug and this issue gaining some traction.
Comment 6 Marjorie Barry-Vila 2018-07-16 13:46:22 UTC
In 17.05, there is an other problem: when creating a new suggestion, active funds do not appear at first time. 
You have to save the suggestion and then go back to see active funds (with all inactive funds too).

Anyone works on this?

Regards
Marjorie
Comment 7 Katrin Fischer 2019-02-20 20:50:27 UTC
*** Bug 21040 has been marked as a duplicate of this bug. ***
Comment 8 Donna 2020-07-21 14:35:39 UTC
This is still an issue.  It has been corrected in other places in acq with bugs 22405 and 14805 leaving purchase suggestions as the last place it is a problem.  With libraries using the same fund names year to year, it is really confusing and causes a great number of errors.
Comment 9 Marjorie Barry-Vila 2020-09-04 10:24:45 UTC
+1
Comment 10 Fridolin Somers 2020-09-24 12:35:47 UTC
Created attachment 110646 [details] [review]
Bug 11176: Add active switch on budgets select in suggestions

When creating a new purchase suggestion, all funds display and are available for selection.
The behaviour of this drop-down menu should mirror that of those drop-down menus elsewhere in acquisitions,
where only funds that are linked to active budgets display to the user.

This patch add the active switch based on what exists in acqui/invoice.tt and acqui/invoice.pl.

Looks like actually in suggestion.pl budgets list was fetches with GetBudgets().
But this is for the filter in 'Acquisition information'.
Budgets selection on suggestion creation/edition must use GetBudgetHierarchy(), like in acqui/invoice.pl,
in order to have the actif status.

Test plan :
1) Create a budget periods active B1 with a fund F1
2) Create a budget periods inactive B2 with a fund F2
3) Go to suggestions module
4) Create a new suggestion
5) Check you see only active fund F1
6) Click on 'Show inactive'
7) Check you see also 'F2 (inactive)'
8) Choose fund F1 and save
9) Select the suggestion and edit
10) Check fund F1 is selected
11) Come back to suggestion table
12) Check filter 'Book fund' under 'Acquisition information' contains all funds
Comment 11 Fridolin Somers 2020-09-24 12:36:58 UTC Comment hidden (obsolete)
Comment 12 Fridolin Somers 2020-09-24 12:42:48 UTC
Bug 22405 also needs a patch BTW
Comment 13 David Nind 2020-09-24 13:58:04 UTC
Created attachment 110659 [details] [review]
Bug 11176: Add active switch on budgets select in suggestions

When creating a new purchase suggestion, all funds display and are available for selection.
The behaviour of this drop-down menu should mirror that of those drop-down menus elsewhere in acquisitions,
where only funds that are linked to active budgets display to the user.

This patch add the active switch based on what exists in acqui/invoice.tt and acqui/invoice.pl.

Looks like actually in suggestion.pl budgets list was fetches with GetBudgets().
But this is for the filter in 'Acquisition information'.
Budgets selection on suggestion creation/edition must use GetBudgetHierarchy(), like in acqui/invoice.pl,
in order to have the actif status.

Test plan :
1) Create a budget periods active B1 with a fund F1
2) Create a budget periods inactive B2 with a fund F2
3) Go to suggestions module
4) Create a new suggestion
5) Check you see only active fund F1
6) Click on 'Show inactive'
7) Check you see also 'F2 (inactive)'
8) Choose fund F1 and save
9) Select the suggestion and edit
10) Check fund F1 is selected
11) Come back to suggestion table
12) Check filter 'Book fund' under 'Acquisition information' contains all funds

Signed-off-by: David Nind <david@davidnind.com>
Comment 14 Katrin Fischer 2020-09-24 19:43:07 UTC
First of all: I am really glad to see this one moving! Thx Frido!
Comment 15 Katrin Fischer 2020-09-24 19:44:23 UTC
Created attachment 110699 [details] [review]
Bug 11176: Add active switch on budgets select in suggestions

When creating a new purchase suggestion, all funds display and are available for selection.
The behaviour of this drop-down menu should mirror that of those drop-down menus elsewhere in acquisitions,
where only funds that are linked to active budgets display to the user.

This patch add the active switch based on what exists in acqui/invoice.tt and acqui/invoice.pl.

Looks like actually in suggestion.pl budgets list was fetches with GetBudgets().
But this is for the filter in 'Acquisition information'.
Budgets selection on suggestion creation/edition must use GetBudgetHierarchy(), like in acqui/invoice.pl,
in order to have the actif status.

Test plan :
1) Create a budget periods active B1 with a fund F1
2) Create a budget periods inactive B2 with a fund F2
3) Go to suggestions module
4) Create a new suggestion
5) Check you see only active fund F1
6) Click on 'Show inactive'
7) Check you see also 'F2 (inactive)'
8) Choose fund F1 and save
9) Select the suggestion and edit
10) Check fund F1 is selected
11) Come back to suggestion table
12) Check filter 'Book fund' under 'Acquisition information' contains all funds

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Jonathan Druart 2020-09-28 14:10:50 UTC
Pushed to master for 20.11, thanks to everybody involved!