Bug 11176: Add active switch on budgets select in suggestions
authorFridolin Somers <fridolin.somers@biblibre.com>
Thu, 24 Sep 2020 12:21:43 +0000 (14:21 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 28 Sep 2020 14:09:11 +0000 (16:09 +0200)
commit8dca36661d7cca5a60aaacc44d2e6a774f78da7a
tree436664fb9ad65e164ee0de0990201f842c7eae7f
parent80993795ddf7c7b3c37262dc5f10a9771e5eaa37
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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
suggestion/suggestion.pl