@@ -, +, @@ module home page |____ Book |_____ Adult fiction --- acqui/acqui-home.pl | 8 +++++++- .../intranet-tmpl/prog/en/modules/acqui/acqui-home.tt | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) --- a/acqui/acqui-home.pl +++ a/acqui/acqui-home.pl @@ -78,6 +78,12 @@ foreach my $budget ( @{$budget_arr} ) { if ( !defined $budget->{budget_amount} ) { $budget->{budget_amount} = 0; } + + $budget->{'budget_ordered'} = GetBudgetOrdered( $budget->{'budget_id'} ); + $budget->{'budget_spent'} = GetBudgetSpent( $budget->{'budget_id'} ); + $budget->{'total_spent'} = GetBudgetHierarchySpent( $budget->{'budget_id'} ) // 0; + $budget->{'total_ordered'} = GetBudgetHierarchyOrdered( $budget->{'budget_id'} ) // 0; + if ( !defined $budget->{budget_spent} ) { $budget->{budget_spent} = 0; } @@ -85,7 +91,7 @@ foreach my $budget ( @{$budget_arr} ) { $budget->{budget_ordered} = 0; } $budget->{'budget_avail'} = - $budget->{'budget_amount'} - ( $budget->{'budget_spent'} + $budget->{'budget_ordered'} ); + $budget->{'budget_amount'} - ( $budget->{'total_spent'} + $budget->{'total_ordered'} ); $total += $budget->{'budget_amount'}; $totspent += $budget->{'budget_spent'}; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt @@ -85,8 +85,10 @@ Owner Library Amount - Ordered - Spent + Base-level ordered + Total ordered + Base-level spent + Total spent Total available @@ -97,7 +99,9 @@ Total + [% totordered_active | $Price %] + [% totspent_active | $Price %] @@ -143,7 +147,10 @@ - + [% loop_budge.total_ordered | $Price %] + + + [% IF loop_budge.budget_parent_id %] [% loop_budge.budget_spent | $Price %] [% ELSE %] @@ -152,6 +159,9 @@ + [% loop_budge.total_spent | $Price %] + + [% IF loop_budge.budget_parent_id %] [% loop_budge.budget_avail | $Price %] [% ELSE %] --