Bug 34161

Summary: Asort1 appears in budget planning filters even when not used
Product: Koha Reporter: Caroline Cyr La Rose <caroline.cyr-la-rose>
Component: AcquisitionsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34159
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

Description Caroline Cyr La Rose 2023-06-29 19:26:51 UTC
When I go to Plan by X in the Funds administration, and one of my funds has a statistic 1 or 2, there is an option to Plan by Asort1, even if my statistics 1/2 is not Asort1.

To recreate:
1. Add a budget
   1.1. Go to Administration > Budgets
   1.2. Click 'New budget'
   1.3. Fill in the form (make sure there are a couple of months between the start and end dates), e.g.
        - Start date: 01/01/2023
        - End date: 12/31/2023
        - Description: 2023
        - Total amount: 10000
        - Make budget active: check
        - Lock budget: leave unchecked
   1.4. Click 'Save'

2. Add at least one fund to the budget, choosing at least one statistical category
   2.1. Click 'Actions' next to the budget and choose 'Add fund'
   2.2. Fill out the form, e.g.
        - Fund code: PRINT
        - Fund name: Print material
        - Amount: 6000
        - Statistic 1 done on: CCODE
   2.3. Click 'Submit'

3. View the planning page, e.g. Plan by months
   3.1. Click 'Planning' at the top of the page and choose 'Plan by months'
   3.2. In the Filter box on the left, open the 'Select planning type' drop-down menu
   --> There is one choice called 'Plan by Asort1' 

If you select this option and click 'Submit', it says there is nothing to show.