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

(-)a/acqui/parcels.pl (-6 / +18 lines)
Lines 179-191 if ($count_parcels) { Link Here
179
    $template->param( searchresults => $loopres, count => $count_parcels );
179
    $template->param( searchresults => $loopres, count => $count_parcels );
180
}
180
}
181
181
182
my $budgets = GetBudgets();
182
# build budget list
183
my @budgets_loop;
183
my $budget_loop = [];
184
foreach my $budget (@$budgets) {
184
my $budgets = GetBudgetHierarchy;
185
    next unless CanUserUseBudget($loggedinuser, $budget, $flags);
185
foreach my $r (@{$budgets}) {
186
    push @budgets_loop, $budget;
186
    next unless (CanUserUseBudget($loggedinuser, $r, $flags));
187
    if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) {
188
        next;
189
    }
190
    push @{$budget_loop}, {
191
        b_id  => $r->{budget_id},
192
        b_txt => $r->{budget_name},
193
        b_active => $r->{budget_period_active},
194
    };
187
}
195
}
188
196
197
@{$budget_loop} =
198
  sort { uc( $a->{b_txt}) cmp uc( $b->{b_txt}) } @{$budget_loop};
199
200
189
$template->param(
201
$template->param(
190
    orderby                  => $order,
202
    orderby                  => $order,
191
    filter                   => $code,
203
    filter                   => $code,
Lines 196-202 $template->param( Link Here
196
    shipmentdate_today       => C4::Dates->new()->output(),
208
    shipmentdate_today       => C4::Dates->new()->output(),
197
    booksellerid             => $booksellerid,
209
    booksellerid             => $booksellerid,
198
    GST                      => C4::Context->preference('gist'),
210
    GST                      => C4::Context->preference('gist'),
199
    budgets                  => \@budgets_loop,
211
    budgets                  => $budget_loop,
200
);
212
);
201
213
202
output_html_with_http_headers $input, $cookie, $template->output;
214
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-1 / +1 lines)
Lines 426-432 $(document).ready(function() Link Here
426
                        <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
426
                        <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
427
                    [% ELSE %]
427
                    [% ELSE %]
428
                        [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
428
                        [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
429
                        [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %]</option>
429
                        [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %] (inactive)</option>
430
                        [% END %]
430
                        [% END %]
431
                    [% END %]
431
                    [% END %]
432
                [% END %]
432
                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt (-2 / +22 lines)
Lines 16-21 Link Here
16
    var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, {
16
    var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, {
17
        "sPaginationType": "four_button"
17
        "sPaginationType": "four_button"
18
    } ) );
18
    } ) );
19
20
    //keep a copy of all budgets before removing the inactives
21
    var budgetId = $("#shipmentcost_budgetid");
22
    var disabledBudgetsCopy = budgetId.html();
23
    $('.b_inactive').remove();
24
25
    $('#showallfunds').click(function() {
26
        if ($(this).is(":checked")) {
27
            budgetId.html(disabledBudgetsCopy); //Puts back all the funds
28
        }
29
        else {
30
            $('.b_inactive').remove();
31
        }
32
    });
19
 });
33
 });
20
 //]]>
34
 //]]>
21
</script>
35
</script>
Lines 172-180 Link Here
172
            <select id="shipmentcost_budgetid" name="shipmentcost_budgetid">
186
            <select id="shipmentcost_budgetid" name="shipmentcost_budgetid">
173
                <option value="">No fund</option>
187
                <option value="">No fund</option>
174
                [% FOREACH budget IN budgets %]
188
                [% FOREACH budget IN budgets %]
175
                    <option value="[% budget.budget_id %]">[% budget.budget_name %]</option>
189
                    [% IF ( budget.b_active ) %]
190
                        <option value="[% budget.b_id %]">[% budget.b_txt %]</option>
191
                    [% ELSE %]
192
                        <option value="[% budget.b_id %]" class="b_inactive">[% budget.b_txt %] (inactive)</option>
193
                    [% END %]
176
                [% END %]
194
                [% END %]
177
            </select>
195
            </select>
196
            <label for="showallfunds" style="float:none;width:auto;">&nbsp;Show all:</label>
197
            <input type="checkbox" id="showallfunds" />
198
178
        </li>
199
        </li>
179
		</ol>
200
		</ol>
180
    </fieldset>
201
    </fieldset>
181
- 

Return to bug 8821