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

(-)a/acqui/parcels.pl (-6 / +17 lines)
Lines 161-173 if ($count_parcels) { Link Here
161
    $template->param( searchresults => $loopres, count => $count_parcels );
161
    $template->param( searchresults => $loopres, count => $count_parcels );
162
}
162
}
163
163
164
my $budgets = GetBudgets();
164
# build budget list
165
my @budgets_loop;
165
my $budget_loop = [];
166
foreach my $budget (@$budgets) {
166
my $budgets = GetBudgetHierarchy;
167
    next unless CanUserUseBudget($loggedinuser, $budget, $flags);
167
foreach my $r (@{$budgets}) {
168
    push @budgets_loop, $budget;
168
    next unless (CanUserUseBudget($loggedinuser, $r, $flags));
169
    if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) {
170
        next;
171
    }
172
    push @{$budget_loop}, {
173
        b_id  => $r->{budget_id},
174
        b_txt => $r->{budget_name},
175
        b_active => $r->{budget_period_active},
176
    };
169
}
177
}
170
178
179
@{$budget_loop} =
180
  sort { uc( $a->{b_txt}) cmp uc( $b->{b_txt}) } @{$budget_loop};
181
171
$template->param(
182
$template->param(
172
    orderby                  => $order,
183
    orderby                  => $order,
173
    filter                   => $code,
184
    filter                   => $code,
Lines 179-185 $template->param( Link Here
179
    shipmentdate_today       => C4::Dates->new()->output(),
190
    shipmentdate_today       => C4::Dates->new()->output(),
180
    booksellerid             => $booksellerid,
191
    booksellerid             => $booksellerid,
181
    GST                      => C4::Context->preference('gist'),
192
    GST                      => C4::Context->preference('gist'),
182
    budgets                  => \@budgets_loop,
193
    budget_loop              => $budget_loop,
183
);
194
);
184
195
185
output_html_with_http_headers $input, $cookie, $template->output;
196
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt (-5 / +19 lines)
Lines 12-17 Link Here
12
    var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, {
12
    var parcelst = $("#parcelst").dataTable($.extend(true, {}, dataTablesDefaults, {
13
        "sPaginationType": "four_button"
13
        "sPaginationType": "four_button"
14
    } ) );
14
    } ) );
15
    $('#showallfunds').click(function() {
16
        if ( $('#shipmentcost_budgetid .b_inactive').is(":visible") )
17
        {
18
        $('#shipmentcost_budgetid .b_inactive').hide();
19
        }
20
        else {
21
        $('#shipmentcost_budgetid .b_inactive').show();
22
        }
23
    });
15
 });
24
 });
16
 //]]>
25
 //]]>
17
</script>
26
</script>
Lines 136-148 Link Here
136
            <input type="text" id="shipmentcost" name="shipmentcost" size="10" />
145
            <input type="text" id="shipmentcost" name="shipmentcost" size="10" />
137
        </li>
146
        </li>
138
        <li>
147
        <li>
139
            <label for="shipmentcost_budgetid">Budget: </label>
148
            <label for="shipmentcost_budgetid">Fund: </label>
140
            <select id="shipmentcost_budgetid" name="shipmentcost_budgetid">
149
            <select id="shipmentcost_budgetid" name="shipmentcost_budgetid">
141
                <option value="">No budget</option>
150
                    <option value="">No fund</option>
142
                [% FOREACH budget IN budgets %]
151
            [% FOREACH budget_loo IN budget_loop %]
143
                    <option value="[% budget.budget_id %]">[% budget.budget_name %]</option>
152
                [% IF ( budget_loo.b_active ) %]
153
                    <option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
154
                [% ELSE %]
155
                    <option value="[% budget_loo.b_id %]" class="b_inactive" style="display : none;">[% budget_loo.b_txt %]</option>
144
                [% END %]
156
                [% END %]
157
            [% END %]
145
            </select>
158
            </select>
159
            <label for="showallfunds" style="float:none;width:auto;">&nbsp;Show all:</label>
160
            <input type="checkbox" id="showallfunds" />
146
        </li>
161
        </li>
147
		</ol>
162
		</ol>
148
    </fieldset>
163
    </fieldset>
149
- 

Return to bug 8821