[biblibre-newacq](bug #3611) fix aqbudgets.pl page
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Mon, 14 Sep 2009 15:22:55 +0000 (17:22 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 30 Sep 2009 09:30:32 +0000 (11:30 +0200)
do not show total available if total is zero.
Adding a budget, does not show the available parent budgets.

admin/aqbudgets.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl

index 17926c2..a537908 100755 (executable)
@@ -187,7 +187,7 @@ if ($op eq 'add_form') {
     $template->param(
         add_validate                  => 1,
         dateformat                => C4::Dates->new()->visual(),
-        budget_dropbox                   => $budget_period_dropbox,
+        budget_dropbox                   => $budget_parent_dropbox,
         budget_perm_dropbox       => $budget_perm_dropbox,
         branchloop_select         => \@branchloop_select,
                %$period,
@@ -305,10 +305,11 @@ if ($op eq 'add_form') {
         );
     }
 
+    my $budget_period_total = $num->format_price($$period{budget_period_total}) if $$period{budget_period_total};
     $template->param(
         else                   => 1,
         budget                 => \@loop,
-        budget_period_total    => $num->format_price($$period{budget_period_total}),
+        budget_period_total    => $budget_period_total,
         period_alloc_total     => $num->format_price($period_alloc_total),
         base_alloc_total       => $num->format_price($base_alloc_total),
         sub_alloc_total        => $num->format_price($sub_alloc_total),
index 64115d5..9c8a3c5 100644 (file)
 
     <tfoot>
     <tr>
-    <th colspan='2' style='text-align: left;' nowrap>Period allocated <!-- TMPL_VAR NAME='budget_period_total'-->  </th>
+    <th colspan='2' style='text-align: left;' nowrap>Period allocated <!--TMPL_IF NAME="budget_period_total" --><!-- TMPL_VAR NAME='budget_period_total'--><!-- /TMPL_IF -->  </th>
     <th nowrap style='text-align: right;' > <!-- TMPL_VAR NAME='period_alloc_total'--></th>
     <th nowrap  style='text-align: right;'> <!-- TMPL_VAR NAME='base_alloc_total'--></th>
     <th nowrap  style='text-align: center;'> <!-- TMPL_VAR NAME='sub_alloc_total'--></th>