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

(-)a/C4/Budgets.pm (+1 lines)
Lines 610-615 sub GetBudgetHierarchy { Link Here
610
        $r->{'budget_name_indent'} = $moo;
610
        $r->{'budget_name_indent'} = $moo;
611
611
612
        $r->{'budget_spent'}       = GetBudgetSpent( $r->{'budget_id'} );
612
        $r->{'budget_spent'}       = GetBudgetSpent( $r->{'budget_id'} );
613
        $r->{budget_ordered} = GetBudgetOrdered( $r->{budget_id} );
613
614
614
        $r->{'budget_amount_total'} =  $r->{'budget_amount'};
615
        $r->{'budget_amount_total'} =  $r->{'budget_amount'};
615
616
(-)a/admin/aqbudgets.pl (-2 / +9 lines)
Lines 276-282 if ($op eq 'add_form') { Link Here
276
    my $toggle = 0;
276
    my $toggle = 0;
277
    my @loop;
277
    my @loop;
278
    my $period_total = 0;
278
    my $period_total = 0;
279
    my ( $period_alloc_total, $base_spent_total );
279
    my ( $period_alloc_total, $base_spent_total, $base_ordered_total );
280
280
281
	#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 ?
281
	#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
282
Lines 303-308 if ($op eq 'add_form') { Link Here
303
        # adds to total  - only if budget is a 'top-level' budget
303
        # adds to total  - only if budget is a 'top-level' budget
304
        $period_alloc_total += $budget->{'budget_amount_total'} if $budget->{'depth'} == 0;
304
        $period_alloc_total += $budget->{'budget_amount_total'} if $budget->{'depth'} == 0;
305
        $base_spent_total += $budget->{'budget_spent'};
305
        $base_spent_total += $budget->{'budget_spent'};
306
        $base_ordered_total += $budget->{budget_ordered};
306
        $budget->{'budget_remaining'} = $budget->{'budget_amount'} - $budget->{'total_levels_spent'};
307
        $budget->{'budget_remaining'} = $budget->{'budget_amount'} - $budget->{'total_levels_spent'};
307
308
308
# if amount == 0 dont display...
309
# if amount == 0 dont display...
Lines 312-323 if ($op eq 'add_form') { Link Here
312
313
313
        $budget->{'remaining_pos'} = 1 if $budget->{'budget_remaining'} > 0;
314
        $budget->{'remaining_pos'} = 1 if $budget->{'budget_remaining'} > 0;
314
        $budget->{'remaining_neg'} = 1 if $budget->{'budget_remaining'} < 0;
315
        $budget->{'remaining_neg'} = 1 if $budget->{'budget_remaining'} < 0;
315
		for (grep {/total_levels_spent|budget_spent|budget_amount|budget_remaining|budget_unalloc/} keys %$budget){
316
		for (grep {/total_levels_spent|budget_spent|budget_ordered|budget_amount|budget_remaining|budget_unalloc/} keys %$budget){
316
            $budget->{$_}               = $num->format_price( $budget->{$_} ) if defined($budget->{$_})
317
            $budget->{$_}               = $num->format_price( $budget->{$_} ) if defined($budget->{$_})
317
		}
318
		}
318
319
319
        # Value of budget_spent equals 0 instead of undefined value
320
        # Value of budget_spent equals 0 instead of undefined value
320
        $budget->{"budget_spent"} = $num->format_price(0) unless defined($budget->{"budget_spent"});
321
        $budget->{"budget_spent"} = $num->format_price(0) unless defined($budget->{"budget_spent"});
322
        $budget->{budget_ordered} = $num->format_price(0) unless defined($budget->{"budget_ordered"});
321
323
322
        my $borrower = &GetMember( borrowernumber=>$budget->{budget_owner_id} );
324
        my $borrower = &GetMember( borrowernumber=>$budget->{budget_owner_id} );
323
        $budget->{"budget_owner_name"}     = $borrower->{'firstname'} . ' ' . $borrower->{'surname'};
325
        $budget->{"budget_owner_name"}     = $borrower->{'firstname'} . ' ' . $borrower->{'surname'};
Lines 356-367 if ($op eq 'add_form') { Link Here
356
        $base_spent_total = $num->format_price($base_spent_total);
358
        $base_spent_total = $num->format_price($base_spent_total);
357
    }
359
    }
358
360
361
    if ($base_ordered_total) {
362
        $base_ordered_total = $num->format_price($base_ordered_total);
363
    }
364
359
    $template->param(
365
    $template->param(
360
        else                   => 1,
366
        else                   => 1,
361
        budget                 => \@loop,
367
        budget                 => \@loop,
362
        budget_period_total    => $budget_period_total,
368
        budget_period_total    => $budget_period_total,
363
        period_alloc_total     => $period_alloc_total,
369
        period_alloc_total     => $period_alloc_total,
364
        base_spent_total       => $base_spent_total,
370
        base_spent_total       => $base_spent_total,
371
        base_ordered_total     => $base_ordered_total,
365
        branchloop             => \@branchloop2,
372
        branchloop             => \@branchloop2,
366
    );
373
    );
367
374
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt (-1 / +3 lines)
Lines 247-252 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
247
            <th>Fund name</th>
247
            <th>Fund name</th>
248
            <th>Total<br />allocated</th>
248
            <th>Total<br />allocated</th>
249
            <th>Base-level<br />allocated</th>
249
            <th>Base-level<br />allocated</th>
250
            <th>Base-level<br />ordered</th>
250
            <th>Base-level<br />spent</th>
251
            <th>Base-level<br />spent</th>
251
            <th>Total sublevels<br />spent</th>
252
            <th>Total sublevels<br />spent</th>
252
            <th>Base-level<br />remaining</th>
253
            <th>Base-level<br />remaining</th>
Lines 259-264 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
259
    <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF ( budget_period_total ) %][% budget_period_total %][% END %]  </th>
260
    <th colspan="2" style="text-align: left;" nowrap="nowrap">Period allocated [% IF ( budget_period_total ) %][% budget_period_total %][% END %]  </th>
260
    <th nowrap="nowrap" class="data"> [% period_alloc_total %]</th>
261
    <th nowrap="nowrap" class="data"> [% period_alloc_total %]</th>
261
    <th nowrap="nowrap"  class="data"> [% base_alloc_total %]</th>
262
    <th nowrap="nowrap"  class="data"> [% base_alloc_total %]</th>
263
    <th class="data">[% base_ordered_total %]</th>
262
    <th class="data">[% base_spent_total %]</th>
264
    <th class="data">[% base_spent_total %]</th>
263
    <th class="data">[% base_spent_total %]</th>
265
    <th class="data">[% base_spent_total %]</th>
264
    <th class="data">[% base_remaining_total %]</th>
266
    <th class="data">[% base_remaining_total %]</th>
Lines 278-283 var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget") Link Here
278
    <td>[% budge.budget_name %]</td>
280
    <td>[% budge.budget_name %]</td>
279
    <td class="data">[% budge.budget_amount_total %]</td>
281
    <td class="data">[% budge.budget_amount_total %]</td>
280
    <td class="data">[% budge.budget_amount %] </td>
282
    <td class="data">[% budge.budget_amount %] </td>
283
    <td class="data">[% budge.budget_ordered %]</td>
281
    <td class="data">[% budge.budget_spent %] </td>
284
    <td class="data">[% budge.budget_spent %] </td>
282
    <td class="data">[% budge.total_levels_spent %]</td>
285
    <td class="data">[% budge.total_levels_spent %]</td>
283
    [% IF ( budge.remaining_pos ) %]
286
    [% IF ( budge.remaining_pos ) %]
284
- 

Return to bug 7308