Not sure if this is not a bug instead of an enh? Created attachment 97354 [details] [review] Bug 23929 : Invoice adjustments should filter inactive funds Test plan : Go to details of an invoice. In the adjustments block, click on Add an adjustment and click again on Fund select list. If you have been using Koha for some years, you risk to see many funds with same name listed successively (inactive funds from past years). Install the patch. click again the Fund select list in ajustment block : now, you have only active funds. Olivier Crouzet Patch tested with a sandbox, by Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> Created attachment 97399 [details] [review] Bug 23929 - Invoice adjustments should filter inactive funds Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@collecto.ca> We usually have a "Show inactive" checkbox right after the dropdown list. Should not we implement that here as well? (In reply to Jonathan Druart from comment #5) > We usually have a "Show inactive" checkbox right after the dropdown list. > Should not we implement that here as well? Failing QA to get feedback on that. (In reply to Jonathan Druart from comment #5) > We usually have a "Show inactive" checkbox right after the dropdown list. > Should not we implement that here as well? I Believe that would probably be the most consistent solution in regard to the rest of the GUI. But I think we should fix this with some urgency as the list of funds can get pretty confusing for libraries with several years of acq data right now. Created attachment 115836 [details] [review] Bug 23929 - Invoice adjustments should filter inactive funds Looking at invoice details, this makes the Adjustments Fund dropdown act exactly like the Shipping Fund dropdown above, with a Show inactive checkbox to help filter (by default) the inactive funds out of the list. Test plan: 0) requires a database with inactive (old) funds along with active ones. 1) Go to invoice details page 2) Click "Add adjustment" 3) Open the drop down beside the Fund label, you should see EVERY fund in database. 4) Compare with behavior of Shipping fund dropdown above. Not every fund is listed there 5) Apply patch 6) Now behavior is the same, only active fund are listed by default. 7) click "Show inactive" checkbox and see all the funds in the dropdown. I coded that fix in 20.05 and rebased it for master. It's clean, but it's not "nice" as it really duplicate the code from Shipment Fund. But the problem was serious for our customers so here's a solution that answers Jonathan's comments. Lyon 3, Could you test this patch? Hi, I've tested it on a sandbox and it works as expected : I've duplicated the budgets ans marked the initial ones as inactive, and I have changed the name of the funds to be able to identify the inactive. In the invoice, I add an adjustment : in the fund list, I can see only the active one in the dropdown list. If I tick "show inactive", I can see all the funds but the inactive are marked with "(incative)" behind their name. It's the same behaviour when you select the shipment fund. Sonia Patch tested with a sandbox, by Sonia BOUIS <sonia.bouis@univ-lyon3.fr> Created attachment 116066 [details] [review] Bug 23929 - Invoice adjustments should filter inactive funds Looking at invoice details, this makes the Adjustments Fund dropdown act exactly like the Shipping Fund dropdown above, with a Show inactive checkbox to help filter (by default) the inactive funds out of the list. Test plan: 0) requires a database with inactive (old) funds along with active ones. 1) Go to invoice details page 2) Click "Add adjustment" 3) Open the drop down beside the Fund label, you should see EVERY fund in database. 4) Compare with behavior of Shipping fund dropdown above. Not every fund is listed there 5) Apply patch 6) Now behavior is the same, only active fund are listed by default. 7) click "Show inactive" checkbox and see all the funds in the dropdown. Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr> Created attachment 117169 [details] [review] Bug 23929: Invoice adjustments should filter inactive funds Looking at invoice details, this makes the Adjustments Fund dropdown act exactly like the Shipping Fund dropdown above, with a Show inactive checkbox to help filter (by default) the inactive funds out of the list. Test plan: 0) requires a database with inactive (old) funds along with active ones. 1) Go to invoice details page 2) Click "Add adjustment" 3) Open the drop down beside the Fund label, you should see EVERY fund in database. 4) Compare with behavior of Shipping fund dropdown above. Not every fund is listed there 5) Apply patch 6) Now behavior is the same, only active fund are listed by default. 7) click "Show inactive" checkbox and see all the funds in the dropdown. Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Works well, passes qa scripts and addresses previous concerns. Passing QA (and correcting commit title inline to squash the only QA script failure) Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.04 Doesn't apply cleanly to 20.05, please rebase if needed. Created attachment 118552 [details] [review] Bug 23929: [20.05.x] Invoice adjustments should filter inactive funds Looking at invoice details, this makes the Adjustments Fund dropdown act exactly like the Shipping Fund dropdown above, with a Show inactive checkbox to help filter (by default) the inactive funds out of the list. Test plan: 0) requires a database with inactive (old) funds along with active ones. 1) Go to invoice details page 2) Click "Add adjustment" 3) Open the drop down beside the Fund label, you should see EVERY fund in database. 4) Compare with behavior of Shipping fund dropdown above. Not every fund is listed there 5) Apply patch 6) Now behavior is the same, only active fund are listed by default. 7) click "Show inactive" checkbox and see all the funds in the dropdown. Signed-off-by: Sonia BOUIS <sonia.bouis@univ-lyon3.fr> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Pushed to 20.05.x for 20.05.10 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |
Created attachment 94893 [details] Screenshot of unfiltered funds in adjustments When adding an adjustment to an invoice, the funds dropdown shows all funds. There should be a filter to allow only active funds, similar to the one on the shipping fund dropdown, as it is impossible to identify the active fund when they are similarly named. See screenshot.