From 4bb10a02445eda38939d528f77b23a96a577efb9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 2 May 2014 10:00:11 +0200 Subject: [PATCH] Bug 12164: Add UI report Signed-off-by: Paola Rossi Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- admin/aqbudgetperiods.pl | 12 +++ .../prog/en/modules/admin/aqbudgetperiods.tt | 101 +++++++++++++++++- 2 files changed, 110 insertions(+), 3 deletions(-) diff --git a/admin/aqbudgetperiods.pl b/admin/aqbudgetperiods.pl index 5034a58a4b..68e47dbbe5 100755 --- a/admin/aqbudgetperiods.pl +++ b/admin/aqbudgetperiods.pl @@ -248,6 +248,7 @@ elsif ( $op eq 'close_form' ) { elsif ( $op eq 'close_confirmed' ) { my $to_budget_period_id = $input->param('to_budget_period_id'); + my $from_budget_period_id = $input->param('from_budget_period_id'); my $move_remaining_unspent = $input->param('move_remaining_unspent'); my $report = C4::Budgets::MoveOrders( { @@ -256,6 +257,17 @@ elsif ( $op eq 'close_confirmed' ) { move_remaining_unspent => $move_remaining_unspent, } ); + + my $from_budget_period = GetBudgetPeriod($from_budget_period_id); + my $to_budget_period = GetBudgetPeriod($to_budget_period_id); + $template->param( + closed => 1, + budget_period_id => $from_budget_period->{budget_period_id}, + budget_period_description => $from_budget_period->{budget_period_description}, + from_budget_period => $from_budget_period, + to_budget_period => $to_budget_period, + report => $report, + ); } # DEFAULT - DISPLAY AQPERIODS TABLE diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt index 516115276d..ffb4c26068 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt @@ -104,6 +104,45 @@ return confirm ( alert_message ); }); [% END %] + [% IF closed %] + var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, { + // The following is a c/p from aqbudgets.tt and is a candidate for refactoring. + "fnDrawCallback": function ( oSettings ) { + if ( oSettings.aiDisplay.length == 0 ) + { + return; + } + + var nTrs = $('#closed_report tbody tr'); + var iColspan = nTrs[1].getElementsByTagName('td').length; + var sLastGroup = ""; + for ( var i=0 ; i @@ -127,6 +166,9 @@ [% IF close_form %]› Close budget [% budget_period_description %] [% END %] + [% IF closed %]› + Budget [% budget_period_description %] closed + [% END %] @@ -175,7 +217,13 @@ [% IF close_form %] Budgets › - Close budget [% budget_period_description %] + Close budget [% budget_period_description %] + [% END %] + + + [% IF closed %] + Budgets › + Budget [% budget_period_description %] closed [% END %] @@ -189,7 +237,7 @@
-[% UNLESS close_form %] +[% UNLESS close_form OR closed%] [% INCLUDE 'budgets-admin-toolbar.inc' %] [% END %] @@ -349,7 +397,7 @@ Back [% ELSE %]

Choose the funds you want to move unreceived orders:

- Fund list of budget [% budget_period_description %]: + Fund list of budget [% budget_period_description %]: @@ -396,6 +444,53 @@ [% END %] +[% ELSIF closed %] +

Report after moving unreceived orders from budget [% from_budget_period.budget_period_description %] ([% from_budget_period.budget_period_startdate | $KohaDates %] - [% to_budget_period.budget_period_enddate | $KohaDates %]) to [% to_budget_period.budget_period_description %] ([% to_budget_period.budget_period_startdate | $KohaDates %] - [% to_budget_period.budget_period_enddate | $KohaDates%])

+ +
+ + + + + + + + + + [% FOR r IN report %] + [% IF r.moved %] + [% IF r.orders_moved.size > 0 %] + [% FOR order IN r.orders_moved %] + + + + + + + [% END %] + [% ELSE %] + + + + + + + [% END %] + [% ELSE %] + [% IF r.error == 'budget_code_not_exists' %] + + + + + + + [% END %] + [% END %] + + [% END %] + +
Budget idBasketOrdernumberInformations
[% r.budget.budget_name %] (id=[% r.budget.budget_id %]) Amount=[% r.budget.budget_amount %][% IF r.unspent_moved %] ([% r.unspent_moved %] remaining has been moved)[% END %][% order.basketname %][% order.ordernumber %]Moved!
[% r.budget.budget_name %] (id=[% r.budget.budget_id %])There was no unreceived orders for this fund.
[% r.budget.budget_id %] [% r.budget.budget_amount %][% IF r.unspent_moved %] ([% r.unspent_moved %] remaining has been moved)[% END %]This fund code does not exist in the destination budget.
+ Back [% END %]