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

(-)a/C4/Budgets.pm (+1 lines)
Lines 587-592 sub GetBudgetHierarchy { Link Here
587
        $r->{'budget_name_indent'} = $moo;
587
        $r->{'budget_name_indent'} = $moo;
588
588
589
        $r->{'budget_spent'}       = GetBudgetSpent( $r->{'budget_id'} );
589
        $r->{'budget_spent'}       = GetBudgetSpent( $r->{'budget_id'} );
590
        $r->{budget_ordered} = GetBudgetOrdered( $r->{budget_id} );
590
591
591
        $r->{'budget_amount_total'} =  $r->{'budget_amount'};
592
        $r->{'budget_amount_total'} =  $r->{'budget_amount'};
592
593
(-)a/admin/aqbudgets.pl (-2 / +9 lines)
Lines 277-283 if ($op eq 'add_form') { Link Here
277
    my $toggle = 0;
277
    my $toggle = 0;
278
    my @loop;
278
    my @loop;
279
    my $period_total = 0;
279
    my $period_total = 0;
280
    my ( $period_alloc_total, $base_spent_total );
280
    my ( $period_alloc_total, $base_spent_total, $base_ordered_total );
281
281
282
	#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 ?
282
	#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 ?
283
283
Lines 304-309 if ($op eq 'add_form') { Link Here
304
        # adds to total  - only if budget is a 'top-level' budget
304
        # adds to total  - only if budget is a 'top-level' budget
305
        $period_alloc_total += $budget->{'budget_amount_total'} if $budget->{'depth'} == 0;
305
        $period_alloc_total += $budget->{'budget_amount_total'} if $budget->{'depth'} == 0;
306
        $base_spent_total += $budget->{'budget_spent'};
306
        $base_spent_total += $budget->{'budget_spent'};
307
        $base_ordered_total += $budget->{budget_ordered};
307
        $budget->{'budget_remaining'} = $budget->{'budget_amount'} - $budget->{'total_levels_spent'};
308
        $budget->{'budget_remaining'} = $budget->{'budget_amount'} - $budget->{'total_levels_spent'};
308
309
309
# if amount == 0 dont display...
310
# if amount == 0 dont display...
Lines 313-324 if ($op eq 'add_form') { Link Here
313
314
314
        $budget->{'remaining_pos'} = 1 if $budget->{'budget_remaining'} > 0;
315
        $budget->{'remaining_pos'} = 1 if $budget->{'budget_remaining'} > 0;
315
        $budget->{'remaining_neg'} = 1 if $budget->{'budget_remaining'} < 0;
316
        $budget->{'remaining_neg'} = 1 if $budget->{'budget_remaining'} < 0;
316
		for (grep {/total_levels_spent|budget_spent|budget_amount|budget_remaining|budget_unalloc/} keys %$budget){
317
		for (grep {/total_levels_spent|budget_spent|budget_ordered|budget_amount|budget_remaining|budget_unalloc/} keys %$budget){
317
            $budget->{$_}               = $num->format_price( $budget->{$_} ) if defined($budget->{$_})
318
            $budget->{$_}               = $num->format_price( $budget->{$_} ) if defined($budget->{$_})
318
		}
319
		}
319
320
320
        # Value of budget_spent equals 0 instead of undefined value
321
        # Value of budget_spent equals 0 instead of undefined value
321
        $budget->{"budget_spent"} = $num->format_price(0) unless defined($budget->{"budget_spent"});
322
        $budget->{"budget_spent"} = $num->format_price(0) unless defined($budget->{"budget_spent"});
323
        $budget->{budget_ordered} = $num->format_price(0) unless defined($budget->{"budget_ordered"});
322
324
323
        my $borrower = &GetMember( borrowernumber=>$budget->{budget_owner_id} );
325
        my $borrower = &GetMember( borrowernumber=>$budget->{budget_owner_id} );
324
        $budget->{"budget_owner_name"}     = $borrower->{'firstname'} . ' ' . $borrower->{'surname'};
326
        $budget->{"budget_owner_name"}     = $borrower->{'firstname'} . ' ' . $borrower->{'surname'};
Lines 357-368 if ($op eq 'add_form') { Link Here
357
        $base_spent_total = $num->format_price($base_spent_total);
359
        $base_spent_total = $num->format_price($base_spent_total);
358
    }
360
    }
359
361
362
    if ($base_ordered_total) {
363
        $base_ordered_total = $num->format_price($base_ordered_total);
364
    }
365
360
    $template->param(
366
    $template->param(
361
        else                   => 1,
367
        else                   => 1,
362
        budget                 => \@loop,
368
        budget                 => \@loop,
363
        budget_period_total    => $budget_period_total,
369
        budget_period_total    => $budget_period_total,
364
        period_alloc_total     => $period_alloc_total,
370
        period_alloc_total     => $period_alloc_total,
365
        base_spent_total       => $base_spent_total,
371
        base_spent_total       => $base_spent_total,
372
        base_ordered_total     => $base_ordered_total,
366
        branchloop             => \@branchloop2,
373
        branchloop             => \@branchloop2,
367
    );
374
    );
368
375
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt (-1 / +3 lines)
Lines 228-233 Link Here
228
            <th>Fund name</th>
228
            <th>Fund name</th>
229
            <th>Total<br />allocated</th>
229
            <th>Total<br />allocated</th>
230
            <th>Base-level<br />allocated</th>
230
            <th>Base-level<br />allocated</th>
231
            <th>Base-level<br />ordered</th>
231
            <th>Base-level<br />spent</th>
232
            <th>Base-level<br />spent</th>
232
            <th>Total sublevels<br />spent</th>
233
            <th>Total sublevels<br />spent</th>
233
            <th>Base-level<br />remaining</th>
234
            <th>Base-level<br />remaining</th>
Lines 240-245 Link Here
240
    <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF ( budget_period_total ) %][% budget_period_total %][% END %]  </th>
241
    <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF ( budget_period_total ) %][% budget_period_total %][% END %]  </th>
241
    <th nowrap="nowrap" class="data"> [% period_alloc_total %]</th>
242
    <th nowrap="nowrap" class="data"> [% period_alloc_total %]</th>
242
    <th nowrap="nowrap"  class="data"> [% base_alloc_total %]</th>
243
    <th nowrap="nowrap"  class="data"> [% base_alloc_total %]</th>
244
    <th class="data">[% base_ordered_total %]</th>
243
    <th class="data">[% base_spent_total %]</th>
245
    <th class="data">[% base_spent_total %]</th>
244
    <th class="data">[% base_spent_total %]</th>
246
    <th class="data">[% base_spent_total %]</th>
245
    <th class="data">[% base_remaining_total %]</th>
247
    <th class="data">[% base_remaining_total %]</th>
Lines 260-265 Link Here
260
    <td>[% budge.budget_name %]</td>
262
    <td>[% budge.budget_name %]</td>
261
    <td class="data">[% budge.budget_amount_total %]</td>
263
    <td class="data">[% budge.budget_amount_total %]</td>
262
    <td class="data">[% budge.budget_amount %] </td>
264
    <td class="data">[% budge.budget_amount %] </td>
265
    <td class="data">[% budge.budget_ordered %]</td>
263
    <td class="data">[% budge.budget_spent %] </td>
266
    <td class="data">[% budge.budget_spent %] </td>
264
    <td class="data">[% budge.total_levels_spent %]</td>
267
    <td class="data">[% budge.total_levels_spent %]</td>
265
    [% IF ( budge.remaining_pos ) %]
268
    [% IF ( budge.remaining_pos ) %]
266
- 

Return to bug 7308