From 9538cd656d4190b61d7be5ffe0d55dd0a6a6ca74 Mon Sep 17 00:00:00 2001 From: Your Full Name Date: Thu, 19 Jan 2017 02:57:39 +0000 Subject: [PATCH] Bug 9692: [FOLLOWUP] Add a checkbox to display statistical fields in basket.tt --- .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 57 ++++++++++------------ 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index 20b98d3..5f3b445 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -23,26 +23,8 @@ } } - function updateStatisticsColumnsVisibility(visible) { - if ( visible ) { - $("table .statistics").show(); - } else { - [% IF ( listincgst ) %] - $("table .statistics").hide(); - [% ELSE %] - $("table .statistics").hide(); - [% END %] - } - } - $(document).ready(function() { $('#toolbar').fixFloat(); - $("#show_all_details").click(function(){ - updateColumnsVisibility($(this).is(":checked")); - }); - - $("#show_all_details").prop('checked', false); - updateColumnsVisibility(false); [% UNLESS ( closedate ) %] $('#addtoBasket').on('show', function () { $(this).find(".modal-body").html($(".acqui_basket_add")[0].outerHTML); @@ -63,19 +45,30 @@ e.preventDefault(); transfer_order_popup( $(this).data("ordernumber")); }); - $("#show_all_prices").click(function(){ - updatePricesColumnsVisibility($(this+":checked").val()); - }); - - $("#show_all_prices").attr('checked', false); - updatePricesColumnsVisibility(false); - $("#show_statistics").click(function(){ - updateStatisticsColumnsVisibility($(this+":checked").val()); + $("table .statistics").hide(); + $("table .tax_included").hide(); + + $("#show_all_prices").on("click",function(){ + if ($("#show_all_prices").is(":checked") ){ + $("table .tax_included").show(); + $("table .tax_excluded").show(); + } else { + [% IF ( listincgst ) %] + $("table .tax_excluded").hide(); + [% ELSE %] + $("table .tax_included").hide(); + [% END %] + } }); - $("#show_statistics").attr('checked', false); - updateStatisticsColumnsVisibility(false); + $("#show_statistics").on("click",function(){ + if ($("#show_statistics").is(":checked") ){ + $("table .statistics").show(); + } else { + $("table .statistics").hide(); + } + }); }); //]]> @@ -528,8 +521,8 @@ [% foot_loo.tax_value | $Price %] [% foot_loo.totalgste %] [% foot_loo.totalgsti %] - Statistic 1 - Statistic 2 +   +   [% IF ( active ) %] [% UNLESS ( closedate ) %]   @@ -552,8 +545,8 @@ [% total_tax_value | $Price %] [% foot_loo.totalgste %] [% foot_loo.totalgsti %] - Statistic 1 - Statistic 2 +   +   [% IF ( active ) %] [% UNLESS ( closedate ) %] -- 2.1.4