Bug 35823 - When uploading a MARC file to a basket it is showing inactive funds without them being selected
Summary: When uploading a MARC file to a basket it is showing inactive funds without t...
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Alexandre Noel
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 35254
Blocks: 35824
  Show dependency treegraph
 
Reported: 2024-01-16 21:51 UTC by Laura Escamilla
Modified: 2024-12-02 10:35 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06,23.11.11
Circulation function:


Attachments
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected (5.47 KB, patch)
2024-06-18 19:24 UTC, Alexandre Noel
Details | Diff | Splinter Review
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected (5.63 KB, patch)
2024-06-21 07:26 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected (3.80 KB, patch)
2024-06-26 13:42 UTC, Alexandre Noel
Details | Diff | Splinter Review
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected (3.86 KB, patch)
2024-07-01 02:09 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected (3.92 KB, patch)
2024-07-01 15:52 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Laura Escamilla 2024-01-16 21:51:11 UTC
To recreate:

1) Create two budgets -- let's say 'Active Budget 2024' and 'Inactive Budget 2024'
2) Create 'Fund1' in Active Budget 2024 and 'Fund2' in Inactive Budget 2024.
3) Mark Inactive Budget 2024 as inactive.
4) Create a vendor and new basket if not already available. Add to the basket using either a new MARC file or a staged MARC file. 
5) When adding the items to the order click on "Fund" and notice that 'Fund2' is appearing in the dropdown despite the "Show inactive funds" box not being ticked.
Comment 1 Alexandre Noel 2024-06-18 19:24:18 UTC
Created attachment 167865 [details] [review]
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected

Prerequisites:
    - Have at least 2 budgets with funds
        1. Add several budgets ("Acquisitions" > "Budget") with funds ("Actions" > "Add fund")
        2. Keep one budget active (check the "Make Budget active" box in
           the budget edit page)
    - Have at least one file of records imported into Koha ("Cataloging" >
      "Stage records for import" > "Upload a file")

To test:
    1. Go to Acquisitions page.
    2. Create a vendor and new basket if not already available.
    3. In your vendor, "Add to the basket" > "From a staged MARC file".
    4. Click "Add orders" of one of the MARC file.
    5. Check the checkbox in the "Select for import" tab.
    6. In the dropdown menu of the "Fund" field, verify the budget
       names.
    --> Ensure Koha displays all inactive budgets even if the "Show
    inactive funds" checkbox is not checked.
    7. Apply patch, and refresh the page (crtl + F5)
    8. Verify the budgets in the "Fund" dropdown menu and test it with
       the "Show inactive funds" checked and uncheked"
Comment 2 Thibault Keromnès 2024-06-19 09:53:52 UTC
Tried on a sandbox, it worked :)
Comment 3 Biblibre Sandboxes 2024-06-21 07:26:16 UTC
Created attachment 167945 [details] [review]
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected

Prerequisites:
    - Have at least 2 budgets with funds
        1. Add several budgets ("Acquisitions" > "Budget") with funds ("Actions" > "Add fund")
        2. Keep one budget active (check the "Make Budget active" box in
           the budget edit page)
    - Have at least one file of records imported into Koha ("Cataloging" >
      "Stage records for import" > "Upload a file")

To test:
    1. Go to Acquisitions page.
    2. Create a vendor and new basket if not already available.
    3. In your vendor, "Add to the basket" > "From a staged MARC file".
    4. Click "Add orders" of one of the MARC file.
    5. Check the checkbox in the "Select for import" tab.
    6. In the dropdown menu of the "Fund" field, verify the budget
       names.
    --> Ensure Koha displays all inactive budgets even if the "Show
    inactive funds" checkbox is not checked.
    7. Apply patch, and refresh the page (crtl + F5)
    8. Verify the budgets in the "Fund" dropdown menu and test it with
       the "Show inactive funds" checked and uncheked"

Signed-off-by: Thibault Keromnès <thibault.keromnes@univ-paris8.fr>
Comment 4 Nick Clemens (kidclamp) 2024-06-26 01:28:54 UTC
The patch here adds a new class, and adds it to the selectors - the problem stems from bug 35254 which updated the select name, but not the jQuery selectors.

This patch works, but either:
1 - We should remove the old 'name="budget_id"' selector as it is not working and just use the new one
2 - Don't add a new class, but update the selector to match the current name:
'name^="budget_id_"'
Comment 5 Alexandre Noel 2024-06-26 13:37:58 UTC
(In reply to Nick Clemens (kidclamp) from comment #4)
> The patch here adds a new class, and adds it to the selectors - the problem
> stems from bug 35254 which updated the select name, but not the jQuery
> selectors.
> 
> This patch works, but either:
> 1 - We should remove the old 'name="budget_id"' selector as it is not
> working and just use the new one
> 2 - Don't add a new class, but update the selector to match the current name:
> 'name^="budget_id_"'

You're right, it will be cleaner that way. I'm making the changes now!
Comment 6 Alexandre Noel 2024-06-26 13:42:25 UTC
Created attachment 168145 [details] [review]
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected

Prerequisites:
    - Have at least 2 budgets with funds
        1. Add several budgets ("Acquisitions" > "Budget") with funds ("Actions" > "Add fund")
        2. Keep one budget active (check the "Make Budget active" box in
           the budget edit page)
    - Have at least one file of records imported into Koha ("Cataloging" >
      "Stage records for import" > "Upload a file")

To test:
    1. Go to Acquisitions page.
    2. Create a vendor and new basket if not already available.
    3. In your vendor, "Add to the basket" > "From a staged MARC file".
    4. Click "Add orders" of one of the MARC file.
    5. Check the checkbox in the "Select for import" tab.
    6. In the dropdown menu of the "Fund" field, verify the budget
       names.
    --> Ensure Koha displays all inactive budgets even if the "Show
    inactive funds" checkbox is not checked.
    7. Apply patch, and refresh the page (crtl + F5)
    8. Verify the budgets in the "Fund" dropdown menu and test it with
       the "Show inactive funds" checked and uncheked"
Comment 7 Chris Cormack 2024-07-01 02:09:50 UTC
Created attachment 168304 [details] [review]
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected

Prerequisites:
    - Have at least 2 budgets with funds
        1. Add several budgets ("Acquisitions" > "Budget") with funds ("Actions" > "Add fund")
        2. Keep one budget active (check the "Make Budget active" box in
           the budget edit page)
    - Have at least one file of records imported into Koha ("Cataloging" >
      "Stage records for import" > "Upload a file")

To test:
    1. Go to Acquisitions page.
    2. Create a vendor and new basket if not already available.
    3. In your vendor, "Add to the basket" > "From a staged MARC file".
    4. Click "Add orders" of one of the MARC file.
    5. Check the checkbox in the "Select for import" tab.
    6. In the dropdown menu of the "Fund" field, verify the budget
       names.
    --> Ensure Koha displays all inactive budgets even if the "Show
    inactive funds" checkbox is not checked.
    7. Apply patch, and refresh the page (crtl + F5)
    8. Verify the budgets in the "Fund" dropdown menu and test it with
       the "Show inactive funds" checked and uncheked"

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Comment 8 Martin Renvoize (ashimema) 2024-07-01 15:52:08 UTC
Created attachment 168324 [details] [review]
Bug 35823: When uploading a MARC file to a basket it is showing inactive funds without the show checkbox button selected

Prerequisites:
    - Have at least 2 budgets with funds
        1. Add several budgets ("Acquisitions" > "Budget") with funds ("Actions" > "Add fund")
        2. Keep one budget active (check the "Make Budget active" box in
           the budget edit page)
    - Have at least one file of records imported into Koha ("Cataloging" >
      "Stage records for import" > "Upload a file")

To test:
    1. Go to Acquisitions page.
    2. Create a vendor and new basket if not already available.
    3. In your vendor, "Add to the basket" > "From a staged MARC file".
    4. Click "Add orders" of one of the MARC file.
    5. Check the checkbox in the "Select for import" tab.
    6. In the dropdown menu of the "Fund" field, verify the budget
       names.
    --> Ensure Koha displays all inactive budgets even if the "Show
    inactive funds" checkbox is not checked.
    7. Apply patch, and refresh the page (crtl + F5)
    8. Verify the budgets in the "Fund" dropdown menu and test it with
       the "Show inactive funds" checked and uncheked"

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2024-07-01 15:52:27 UTC
Simple clean fix, thanks everyone.

Passing QA
Comment 10 Katrin Fischer 2024-07-01 16:58:19 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 11 Lucas Gass (lukeg) 2024-11-18 17:16:29 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 12 Fridolin Somers 2024-12-02 10:35:31 UTC
Pushed to 23.11.x for 23.11.11