From 3de68819491c1bd02f9d7389ba3d8e2162262de0 Mon Sep 17 00:00:00 2001 From: Blou Date: Tue, 26 Jan 2021 15:36:31 -0500 Subject: [PATCH] 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 Signed-off-by: Martin Renvoize --- .../prog/en/modules/acqui/invoice.tt | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt index 2348004cd6..6638449a4b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -278,13 +278,19 @@
  • + +
  • @@ -516,6 +522,18 @@ $('.b_inactive').remove(); } }); + // same effort for the adjustments + var adjBudgetId = $("#budget_id_new"); + var disabledAdjBudgetsCopy = adjBudgetId.html(); + $('.ab_inactive').remove(); + $('#showallfunds_adj').click(function() { + if ($(this).is(":checked")) { + adjBudgetId.html(disabledAdjBudgetsCopy); //Puts back all the funds + } + else { + $('.ab_inactive').remove(); + } + }); }); [% END %] -- 2.20.1