View | Details | Raw Unified | Return to bug 12164
Collapse All | Expand All

(-)a/admin/aqbudgetperiods.pl (+12 lines)
Lines 243-248 elsif ( $op eq 'close_form' ) { Link Here
243
243
244
elsif ( $op eq 'close_confirmed' ) {
244
elsif ( $op eq 'close_confirmed' ) {
245
    my $to_budget_period_id    = $input->param('to_budget_period_id');
245
    my $to_budget_period_id    = $input->param('to_budget_period_id');
246
    my $from_budget_period_id  = $input->param('from_budget_period_id');
246
    my $move_remaining_unspent = $input->param('move_remaining_unspent');
247
    my $move_remaining_unspent = $input->param('move_remaining_unspent');
247
    my $report                 = C4::Budgets::MoveOrders(
248
    my $report                 = C4::Budgets::MoveOrders(
248
        {
249
        {
Lines 251-256 elsif ( $op eq 'close_confirmed' ) { Link Here
251
            move_remaining_unspent => $move_remaining_unspent,
252
            move_remaining_unspent => $move_remaining_unspent,
252
        }
253
        }
253
    );
254
    );
255
256
    my $from_budget_period = GetBudgetPeriod($from_budget_period_id);
257
    my $to_budget_period   = GetBudgetPeriod($to_budget_period_id);
258
    $template->param(
259
        closed           => 1,
260
        budget_period_id => $from_budget_period->{budget_period_id},
261
        budget_period_description => $from_budget_period->{budget_period_description},
262
        from_budget_period => $from_budget_period,
263
        to_budget_period   => $to_budget_period,
264
        report             => $report,
265
    );
254
}
266
}
255
267
256
# DEFAULT - DISPLAY AQPERIODS TABLE
268
# DEFAULT - DISPLAY AQPERIODS TABLE
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt (-4 / +98 lines)
Lines 104-109 Link Here
104
            return confirm ( alert_message );
104
            return confirm ( alert_message );
105
          });
105
          });
106
        [% END %]
106
        [% END %]
107
        [% IF closed %]
108
          var oTable = $("#closed_report").dataTable($.extend(true, {}, dataTablesDefaults, {
109
            // The following is a c/p from aqbudgets.tt and is a candidate for refactoring.
110
            "fnDrawCallback": function ( oSettings ) {
111
                if ( oSettings.aiDisplay.length == 0 )
112
                {
113
                    return;
114
                }
115
116
                var nTrs = $('#closed_report tbody tr');
117
                var iColspan = nTrs[1].getElementsByTagName('td').length;
118
                var sLastGroup = "";
119
                for ( var i=0 ; i<nTrs.length ; i++ )
120
                {
121
                    var iDisplayIndex = oSettings._iDisplayStart + i;
122
                    var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[0];
123
                    if ( sGroup != sLastGroup )
124
                    {
125
                        var nGroup = document.createElement( 'tr' );
126
                        var nCell = document.createElement( 'td' );
127
                        nCell.colSpan = iColspan;
128
                        nCell.className = "group";
129
                        nCell.innerHTML = sGroup;
130
                        nGroup.appendChild( nCell );
131
                        nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
132
                        sLastGroup = sGroup;
133
                    }
134
                }
135
            },
136
            "aoColumnDefs": [
137
                { "bVisible": false, "aTargets": [ 0, 1 ] },
138
                { "bSortable": false, "aTargets": ["_all"] }
139
            ],
140
            'bSort': true,
141
            'aaSortingFixed': [[ 1, 'asc' ]],
142
            'bPaginate': false,
143
            "bAutoWidth": false
144
          }));
145
        [% END %]
107
    });
146
    });
108
</script>
147
</script>
109
148
Lines 127-132 Link Here
127
    [% IF close_form %]&rsaquo;
166
    [% IF close_form %]&rsaquo;
128
      Close budget [% budget_period_description %]
167
      Close budget [% budget_period_description %]
129
    [% END %]
168
    [% END %]
169
    [% IF closed %]&rsaquo;
170
      Budget [% budget_period_description %] closed
171
    [% END %]
130
</title>
172
</title>
131
173
132
174
Lines 175-181 Link Here
175
    <!-- close a budget -->
217
    <!-- close a budget -->
176
    [% IF close_form %]
218
    [% IF close_form %]
177
        <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
219
        <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
178
        Close budget <a href="cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>
220
        Close budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>
221
    [% END %]
222
223
    <!-- budget closed -->
224
    [% IF closed %]
225
        <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo;
226
        Budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a> closed
179
    [% END %]
227
    [% END %]
180
    <!-- display budget periods list -->
228
    <!-- display budget periods list -->
181
    <!-- ########################################## -->
229
    <!-- ########################################## -->
Lines 189-195 Link Here
189
<div id="yui-main">
237
<div id="yui-main">
190
<div class="yui-b">
238
<div class="yui-b">
191
239
192
[% UNLESS close_form %]
240
[% UNLESS close_form OR closed%]
193
  [% INCLUDE 'budgets-admin-toolbar.inc' %]
241
  [% INCLUDE 'budgets-admin-toolbar.inc' %]
194
[% END %]
242
[% END %]
195
243
Lines 349-355 Link Here
349
    <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
397
    <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
350
  [% ELSE %]
398
  [% ELSE %]
351
    <h3>Choose the funds you want to move unreceived orders:</h3>
399
    <h3>Choose the funds you want to move unreceived orders:</h3>
352
      Fund list of budget <a href="cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>:
400
      Fund list of budget <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id %]">[% budget_period_description %]</a>:
353
    <table id="budgeth">
401
    <table id="budgeth">
354
      <thead>
402
      <thead>
355
        <tr>
403
        <tr>
Lines 396-401 Link Here
396
      </fieldset>
444
      </fieldset>
397
    </form>
445
    </form>
398
  [% END %]
446
  [% END %]
447
[% ELSIF closed %]
448
  <h3>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%])</h3>
449
450
  <table id="closed_report">
451
    <thead>
452
      <tr>
453
        <td>Budget id</td>
454
        <td>Basket</td>
455
        <td>Ordernumber</td>
456
        <td>Informations</td>
457
      </tr>
458
    </thead>
459
    <tbody>
460
      [% FOR r IN report %]
461
          [% IF r.moved %]
462
            [% IF r.orders_moved.size > 0 %]
463
              [% FOR order IN r.orders_moved %]
464
                <tr>
465
                  <td>[% 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 %]</td>
466
                  <td>[% order.basketname %]</td>
467
                  <td>[% order.ordernumber %]</td>
468
                  <td>Moved!</td>
469
                </tr>
470
              [% END %]
471
            [% ELSE %]
472
              <tr>
473
                <td>[% r.budget.budget_name %] (id=[% r.budget.budget_id %])</td>
474
                <td></td>
475
                <td></td>
476
                <td>There was no unreceived orders for this fund.</td>
477
              </tr>
478
            [% END %]
479
          [% ELSE %]
480
            [% IF r.error == 'budget_code_not_exists' %]
481
              <tr>
482
                <td>[% r.budget.budget_id %] [% r.budget.budget_amount %][% IF r.unspent_moved %] ([% r.unspent_moved %] remaining has been moved)[% END %]</td>
483
                <td></td>
484
                <td></td>
485
                <td>This fund code does not exist in the destination budget.</td>
486
              </tr>
487
            [% END %]
488
          [% END %]
489
        </tr>
490
      [% END %]
491
    </tbody>
492
  </table>
493
  <a class="cancel" href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Back</a>
399
[% END %]
494
[% END %]
400
495
401
<!--  DEFAULT  display budget periods list -->
496
<!--  DEFAULT  display budget periods list -->
402
- 

Return to bug 12164