Bug 14850 - Funds from inactive budgets appear in 'Funds' dropdown on acqui/invoice.pl
Summary: Funds from inactive budgets appear in 'Funds' dropdown on acqui/invoice.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 11176 22405 22498
  Show dependency treegraph
 
Reported: 2015-09-18 12:27 UTC by Barton Chittenden
Modified: 2020-09-24 12:40 UTC (History)
14 users (show)

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


Attachments
Bug 14850 - Add Koha Objects (2.54 KB, patch)
2017-08-28 16:03 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 14850 - Use optgroups for active and inactive budgets on invoice.pl (4.04 KB, patch)
2017-08-28 16:03 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 14850: Use optgroups to display active/inactive budgets (11.49 KB, patch)
2018-08-07 13:13 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 14850: Funds from inactive budgets appear in 'Funds' dropdown on acqui/invoice.pl (7.26 KB, patch)
2019-02-22 12:17 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14850: Funds from inactive budgets appear in 'Funds' dropdown on acqui/invoice.pl (7.45 KB, patch)
2019-02-22 12:32 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 14850: (QA follow-up) Remove debugging code (849 bytes, patch)
2019-02-25 09:25 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 14850: Funds from inactive budgets appear in 'Funds' dropdown on acqui/invoice.pl (7.52 KB, patch)
2019-02-25 09:26 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 14850: (QA follow-up) Remove debugging code (849 bytes, patch)
2019-02-25 09:26 UTC, Josef Moravec
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Barton Chittenden 2015-09-18 12:27:24 UTC
To reproduce:

1) Create two budgets -- let's say 'Budget 2014' and 'Budget 2015'
2) Create 'Books 2014' in Budget 2014 and 'Books 2015' in Budget 2015.
3) Mark Budget 2014 as inactive
4) Create a new invoice. Click on the 'Funds' drop down, and note that both 'Books 2014' and 'Books 2015' appear.
Comment 1 Jacqueline 2017-06-30 20:57:40 UTC
This is also showing up when receiving items.

Example:
When receiving a new shipment the shipping funds display as an option ONLY active funds. There is an option to show inactive funds as well.

In another screen at the invoice detail level---the pull down menu to shipping costs shows ALL inactive and active funds. This can be a problem if you have to edit shipping cost and you use the same duplicated fund structure year after year. Would be nice to have only active funds shown here and then have the option check box as the prior screen to show inactive funds IF you want.
Comment 2 Katrin Fischer 2017-08-15 17:50:53 UTC
I agree, a checkbox to show the funds from the inactive budgets would be a good solution here. The list can get quite long for libraries using acquisitions over mulitple years.
Comment 3 Nick Clemens 2017-08-28 16:03:46 UTC
Created attachment 66555 [details] [review]
Bug 14850 - Add Koha Objects
Comment 4 Nick Clemens 2017-08-28 16:03:49 UTC
Created attachment 66556 [details] [review]
Bug 14850 - Use optgroups for active and inactive budgets on invoice.pl

To test:
1 - Have some inactive and active budgets
2 - View an invoice in acquisitions
3 - Select the shipping fund dropdown
4 - Note you see all the budgets
5 - Apply patch
6 - View invoice and select shipping fund dropdown
7 - Note you see active budgets followed by inactive budgets
Comment 5 Mark Tompsett 2017-08-28 19:03:28 UTC
Not a hard fail.

Missing License.
https://wiki.koha-community.org/wiki/Coding_Guidelines#Licence

Budget.pm is not perl tidy.
https://wiki.koha-community.org/wiki/Coding_Guidelines#PERL1:_Perltidy


> push @budgets_loop, \%$line;

Isn't this the same as $line? You already treat $line as a hash ref in the previous line code change. Haven't tested just read it and thinking out loud.
Comment 6 Nick Clemens 2018-08-07 13:13:00 UTC
Created attachment 77522 [details] [review]
Bug 14850: Use optgroups to display active/inactive budgets

This is incomplete, some issues:
1 - It doesn't match current use of checkbox on other pages
2 - It should use a block instead of repeating code
3 - All of the dropdowns for funds should probably be moved to a single
include file and/or use a template plugin

Leaving this here rather for future work
Comment 7 Katrin Fischer 2018-08-23 13:29:49 UTC
This is still an issue and very annoying for libraries with a lot of acq data from various years.
Comment 8 Katrin Fischer 2019-01-03 10:08:48 UTC
Would love to see this fixed.
Comment 9 Sandre Cunha 2019-02-08 18:38:38 UTC
Ditto, to Karin's remark. We have been with Koha for 5 years, have a general and  trust fund budget, plus we share our catalog with a partner library, so around 15 listings per code.
Comment 10 Marjorie Barry-Vila 2019-02-19 15:40:30 UTC
+1
Marjorie
Comment 11 Kyle M Hall 2019-02-22 12:17:25 UTC
Created attachment 85521 [details] [review]
Bug 14850: Funds from inactive budgets appear in 'Funds' dropdown on acqui/invoice.pl

Test Plan:
1) Create some inactive and active budgets
2) View an invoice in acquisitions
4) Note the shipping fund dropdown behaves like acqui/parcels.pl
Comment 12 Biblibre Sandboxes 2019-02-22 12:32:11 UTC
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Comment 13 Biblibre Sandboxes 2019-02-22 12:32:35 UTC
Created attachment 85522 [details] [review]
Bug 14850: Funds from inactive budgets appear in 'Funds' dropdown on acqui/invoice.pl

Test Plan:
1) Create some inactive and active budgets
2) View an invoice in acquisitions
4) Note the shipping fund dropdown behaves like acqui/parcels.pl

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 14 Séverine Queune 2019-02-22 12:33:41 UTC
Looked ok for me !
Comment 15 Josef Moravec 2019-02-25 09:25:57 UTC
Created attachment 85600 [details] [review]
Bug 14850: (QA follow-up) Remove debugging code

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 16 Josef Moravec 2019-02-25 09:26:38 UTC
Created attachment 85601 [details] [review]
Bug 14850: Funds from inactive budgets appear in 'Funds' dropdown on acqui/invoice.pl

Test Plan:
1) Create some inactive and active budgets
2) View an invoice in acquisitions
4) Note the shipping fund dropdown behaves like acqui/parcels.pl

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 17 Josef Moravec 2019-02-25 09:26:42 UTC
Created attachment 85602 [details] [review]
Bug 14850: (QA follow-up) Remove debugging code

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 18 Josef Moravec 2019-02-25 09:30:32 UTC
I passed this QA, as it fixes the annoying bug. This patch do it in the way other acquisition scripts do it. There is much of duplicate code, and too much of manipulation with budget data on the wrong place (.pl script). But the budget managament does not use Koha::Objects yet, and we will need a template plugin to generate budget dropdown the same way. This is out of scope of this bug.
Comment 19 Nick Clemens 2019-02-26 14:38:33 UTC
Awesome work all!

Pushed to master for 19.05
Comment 20 Martin Renvoize 2019-03-01 11:00:32 UTC
Pushed to 18.11.x for 18.11.04
Comment 21 Jesse Maseto 2019-03-08 18:34:11 UTC
Did not apply to 18.05.x. Please rebase to 18.05.x if needed.