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

(-)a/C4/Budgets.pm (+1 lines)
Lines 549-554 sub GetBudgetHierarchy { Link Here
549
        $r->{'budget_name_indent'} = $moo;
549
        $r->{'budget_name_indent'} = $moo;
550
550
551
        $r->{'budget_spent'}       = GetBudgetSpent( $r->{'budget_id'} );
551
        $r->{'budget_spent'}       = GetBudgetSpent( $r->{'budget_id'} );
552
        $r->{budget_ordered} = GetBudgetOrdered( $r->{budget_id} );
552
553
553
        $r->{'budget_amount_total'} =  $r->{'budget_amount'};
554
        $r->{'budget_amount_total'} =  $r->{'budget_amount'};
554
555
(-)a/admin/aqbudgets.pl (-2 / +5 lines)
Lines 235-241 if ($op eq 'add_form') { Link Here
235
    my $toggle = 0;
235
    my $toggle = 0;
236
    my @loop;
236
    my @loop;
237
    my $period_total = 0;
237
    my $period_total = 0;
238
    my ( $period_alloc_total, $base_spent_total );
238
    my ( $period_alloc_total, $base_spent_total, $base_ordered_total );
239
239
240
	#This Looks WEIRD to me : should budgets be filtered in such a way ppl who donot own it would not see the amount spent on the budget by others ?
240
	#This Looks WEIRD to me : should budgets be filtered in such a way ppl who donot own it would not see the amount spent on the budget by others ?
241
241
Lines 283-288 if ($op eq 'add_form') { Link Here
283
        # adds to total  - only if budget is a 'top-level' budget
283
        # adds to total  - only if budget is a 'top-level' budget
284
        $period_alloc_total += $budget->{'budget_amount_total'} if $budget->{'depth'} == 0;
284
        $period_alloc_total += $budget->{'budget_amount_total'} if $budget->{'depth'} == 0;
285
        $base_spent_total += $budget->{'budget_spent'};
285
        $base_spent_total += $budget->{'budget_spent'};
286
        $base_ordered_total += $budget->{budget_ordered};
286
        $budget->{'budget_remaining'} = $budget->{'budget_amount'} - $budget->{'total_levels_spent'};
287
        $budget->{'budget_remaining'} = $budget->{'budget_amount'} - $budget->{'total_levels_spent'};
287
288
288
# if amount == 0 dont display...
289
# if amount == 0 dont display...
Lines 290-301 if ($op eq 'add_form') { Link Here
290
291
291
        $budget->{'remaining_pos'} = 1 if $budget->{'budget_remaining'} > 0;
292
        $budget->{'remaining_pos'} = 1 if $budget->{'budget_remaining'} > 0;
292
        $budget->{'remaining_neg'} = 1 if $budget->{'budget_remaining'} < 0;
293
        $budget->{'remaining_neg'} = 1 if $budget->{'budget_remaining'} < 0;
293
		for (grep {/total_levels_spent|budget_spent|budget_amount|budget_remaining|budget_unalloc/} keys %$budget){
294
		for (grep {/total_levels_spent|budget_spent|budget_ordered|budget_amount|budget_remaining|budget_unalloc/} keys %$budget){
294
            $budget->{$_}               = $num->format_price( $budget->{$_} ) if defined($budget->{$_})
295
            $budget->{$_}               = $num->format_price( $budget->{$_} ) if defined($budget->{$_})
295
		}
296
		}
296
297
297
        # Value of budget_spent equals 0 instead of undefined value
298
        # Value of budget_spent equals 0 instead of undefined value
298
        $budget->{"budget_spent"} = $num->format_price(0) unless defined($budget->{"budget_spent"});
299
        $budget->{"budget_spent"} = $num->format_price(0) unless defined($budget->{"budget_spent"});
300
        $budget->{budget_ordered} = $num->format_price(0) unless defined($budget->{"budget_ordered"});
299
301
300
        my $borrower = &GetMember( borrowernumber=>$budget->{budget_owner_id} );
302
        my $borrower = &GetMember( borrowernumber=>$budget->{budget_owner_id} );
301
        $budget->{"budget_owner_name"}     = $borrower->{'firstname'} . ' ' . $borrower->{'surname'};
303
        $budget->{"budget_owner_name"}     = $borrower->{'firstname'} . ' ' . $borrower->{'surname'};
Lines 331-336 if ($op eq 'add_form') { Link Here
331
        budget_period_total    => $budget_period_total,
333
        budget_period_total    => $budget_period_total,
332
        period_alloc_total     => $num->format_price($period_alloc_total),
334
        period_alloc_total     => $num->format_price($period_alloc_total),
333
        base_spent_total       => $num->format_price($base_spent_total),
335
        base_spent_total       => $num->format_price($base_spent_total),
336
        base_ordered_total     => $num->format_price($base_ordered_total),
334
        branchloop             => \@branchloop2,
337
        branchloop             => \@branchloop2,
335
    );
338
    );
336
339
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt (-1 / +3 lines)
Lines 168-173 Link Here
168
            <th>Fund name</th>
168
            <th>Fund name</th>
169
            <th>Total<br />allocated</th>
169
            <th>Total<br />allocated</th>
170
            <th>Base-level<br />allocated</th>
170
            <th>Base-level<br />allocated</th>
171
            <th>Base-level<br />ordered</th>
171
            <th>Base-level<br />spent</th>
172
            <th>Base-level<br />spent</th>
172
            <th>Total sublevels<br />spent</th>
173
            <th>Total sublevels<br />spent</th>
173
            <th>Base-level<br />remaining</th>
174
            <th>Base-level<br />remaining</th>
Lines 180-185 Link Here
180
    <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF ( budget_period_total ) %][% budget_period_total %][% END %]  </th>
181
    <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF ( budget_period_total ) %][% budget_period_total %][% END %]  </th>
181
    <th nowrap="nowrap" class="data"> [% period_alloc_total %]</th>
182
    <th nowrap="nowrap" class="data"> [% period_alloc_total %]</th>
182
    <th nowrap="nowrap"  class="data"> [% base_alloc_total %]</th>
183
    <th nowrap="nowrap"  class="data"> [% base_alloc_total %]</th>
184
    <th class="data">[% base_ordered_total %]</th>
183
    <th class="data">[% base_spent_total %]</th>
185
    <th class="data">[% base_spent_total %]</th>
184
    <th class="data">[% base_spent_total %]</th>
186
    <th class="data">[% base_spent_total %]</th>
185
    <th class="data">[% base_remaining_total %]</th>
187
    <th class="data">[% base_remaining_total %]</th>
Lines 200-205 Link Here
200
    <td>[% budge.budget_name %]</td>
202
    <td>[% budge.budget_name %]</td>
201
    <td class="data">[% budge.budget_amount_total %]</td>
203
    <td class="data">[% budge.budget_amount_total %]</td>
202
    <td class="data">[% budge.budget_amount %] </td>
204
    <td class="data">[% budge.budget_amount %] </td>
205
    <td class="data">[% budge.budget_ordered %]</td>
203
    <td class="data">[% budge.budget_spent %] </td>
206
    <td class="data">[% budge.budget_spent %] </td>
204
    <td class="data">[% budge.total_levels_spent %]</td>
207
    <td class="data">[% budge.total_levels_spent %]</td>
205
    [% IF ( budge.remaining_pos ) %]
208
    [% IF ( budge.remaining_pos ) %]
206
- 

Return to bug 7308