From 37e84301aaa5fd99a44793243eabae944895c952 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 Signed-off-by: Jonathan Druart (cherry picked from commit bdfb78a69a1f78488b800bd38392c60812717cc7) Signed-off-by: Fridolin Somers --- .../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.39.5