[Koha-patches] [PATCH 21/78] planning management

paul.poulain at biblibre.com paul.poulain at biblibre.com
Thu May 28 18:32:31 CEST 2009


From: Paul Poulain <paul.poulain at biblibre.com>

for each budget period and budget, the library can enter planning on branches, itemtype, month or any auth_value selected as planning category for a given budget
---
 admin/aqplan.pl                                    |  457 ++++++++++++++++++++
 .../prog/en/modules/admin/aqplan.tmpl              |  207 +++++++++
 2 files changed, 664 insertions(+), 0 deletions(-)
 create mode 100755 admin/aqplan.pl
 create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl

diff --git a/admin/aqplan.pl b/admin/aqplan.pl
new file mode 100755
index 0000000..8eb95e1
--- /dev/null
+++ b/admin/aqplan.pl
@@ -0,0 +1,457 @@
+#!/usr/bin/perl
+
+# Copyright 2008-2009 BibLibre SARL
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+#script to administer the aqbudgets0 table
+#written 20/02/2002 by paul.poulain at free.fr
+# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html)
+
+use strict;
+use CGI;
+use List::Util qw/min/;
+use Date::Calc qw/Delta_YMD Easter_Sunday Today Decode_Date_EU/;
+use Date::Manip qw/ ParseDate UnixDate DateCalc/;
+use C4::Dates qw/format_date format_date_in_iso/;
+use Number::Format qw(format_price);      
+use Text::CSV_XS;
+
+use C4::Acquisition;
+use C4::Budgets;
+use C4::Context;
+use C4::Output;
+use C4::Koha;
+use C4::Auth;
+use C4::Input;
+use C4::Debug;
+
+my $input = new CGI;
+####  $input
+
+my $dbh = C4::Context->dbh;
+
+my ( $template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user(
+    {   template_name   => "admin/aqplan.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 1,
+        flagsrequired   => { acquisition => 'planning_manage' },
+        debug           => 1,
+    }
+);
+
+my $budget_period_id = $input->param('budget_period_id');
+# ' ------- get periods stuff ------------------'
+# IF PERIOD_ID IS DEFINED,  GET THE PERIOD - ELSE GET THE ACTIVE PERIOD BY DEFAULT
+my $period = GetBudgetPeriod($budget_period_id);
+my $count  = GetPeriodsCount();
+my $cur    = GetCurrency;
+
+$template->param( period_button_only => 1 ) if $count == 0;
+
+# authcats_loop populates the YUI planning button
+my @auth_cats_loop            = GetBudgetAuthCats();
+my $budget_period_id          = $period->{'budget_period_id'};
+my $budget_period_startdate   = $period->{'budget_period_startdate'};
+my $budget_period_enddate     = $period->{'budget_period_enddate'};
+my $budget_period_locked      = $period->{'budget_period_locked'};
+my $budget_period_description = $period->{'budget_period_description'};
+my $budget_period_dropbox     = GetBudgetPeriodsDropbox($budget_period_id );
+
+$template->param(
+    budget_period_id          => $budget_period_id,
+    budget_period_locked      => $budget_period_locked,
+    budget_period_description => $budget_period_description,
+    budget_period_dropbox     => $budget_period_dropbox,
+    auth_cats_loop            => \@auth_cats_loop,
+);
+
+# ------- get periods stuff ------------------
+
+my $borrower_id         = $template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'};
+my $borrower_branchcode = $template->{param_map}->{'USER_INFO'}[0]->{'branchcode'};
+
+my $periods;
+my $authcat      = $input->param('authcat');
+my $show_active  = $input->param('show_active');
+my $show_actual  = $input->param('show_actual');
+my $show_percent = $input->param('show_percent');
+my $output       = $input->param("output");
+my $basename     = $input->param("basename");
+my $mime         = $input->param("MIME");
+my $del          = $input->param("sep");
+
+my $show_mine    = 1; #SHOW BY DEFAULT
+my $show         = $input->param('show'); # SET TO 1, BY A FORM SUMBIT
+$show_mine       = $input->param('show_mine') if $show == 1;
+
+my $cur_format = C4::Context->preference("CurrencyFormat");
+my $num;
+
+if ( $cur_format eq 'FR' ) {
+    $num = new Number::Format(
+        'decimal_fill'      => '2',
+        'decimal_point'     => ',',
+        'int_curr_symbol'   => '',
+        'mon_thousands_sep' => ' ',
+        'thousands_sep'     => ' ',
+        'mon_decimal_point' => ','
+    );
+} else {  # US by default..
+    $num = new Number::Format(
+        'int_curr_symbol'   => '',
+        'mon_thousands_sep' => ',',
+        'mon_decimal_point' => '.'
+    );
+}
+
+if ( $budget_period_locked == 1  && not defined  $show_actual ) { 
+     $show_actual  = 1;
+}
+
+$authcat = 'Asort1' if  not defined $authcat; # defaults to Asort if no authcat given
+
+my $budget_id = $input->param('budget_id');
+my $op        = $input->param("op");
+
+my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{param_map}->{'USER_INFO'}[0]->{'branchcode'}:'', $show_mine?$template->{param_map}->{'USER_INFO'}[0]->{'borrowernumber'}:'' );
+
+# build categories list
+my $sth = $dbh->prepare("select distinct category from authorised_values where category like 'A%' ");
+$sth->execute;
+
+# the list
+my @category_list;
+
+# a hash, to check that some hardcoded categories exist.
+my %categories;
+while ( my ($category) = $sth->fetchrow_array ) {
+    push( @category_list, $category );
+    $categories{$category} = 1;
+}
+
+push( @category_list, 'MONTHS' );
+push( @category_list, 'ITEMTYPES' );
+push( @category_list, 'BRANCHES' );
+
+# push koha system categories
+
+#reorder the list
+ at category_list = sort { $a cmp $b } @category_list;
+my $tab_list = CGI::scrolling_list(
+    -name     => 'authcat',
+    -id       => 'authcat',
+    -values   => \@category_list,
+    -default  => $authcat,
+    -size     => 1,
+    -tabindex => '',
+    -multiple => 0,
+);
+
+$template->param( authcat_dropbox => $tab_list );
+
+my @budgets = @$budgets_ref;
+my $CGISort;
+my @authvals;
+my %labels;
+
+if ( $authcat =~ m/^Asort/ ) {
+
+    # ----------- copied from C4::Input::buildCGIsort()
+    my $query = qq{SELECT * FROM authorised_values WHERE category=? order by lib};
+    my $sth   = $dbh->prepare($query);
+    $sth->execute($authcat);
+
+    if ( $sth->rows > 0 ) {
+        for ( my $i = 0 ; $i < $sth->rows ; $i++ ) {
+            my $results = $sth->fetchrow_hashref;
+            push @authvals, $results->{authorised_value};
+            $labels{ $results->{authorised_value} } = $results->{lib};
+        }
+    }
+    $sth->finish;
+    @authvals = sort { $a <=> $b } @authvals;
+
+}
+elsif ( $authcat eq 'MONTHS' ) {
+
+    # build months
+    my @start_date = UnixDate( $budget_period_startdate, ( '%Y', '%m', '%d' ) );
+    my @end_date   = UnixDate( $budget_period_enddate,   ( '%Y', '%m', '%d' ) );
+
+    my ( $Dy, $Dm, $Dd ) = Delta_YMD( @start_date, @end_date );
+
+    #calc number of months between
+    my $months      = ( $Dy * 12 ) + $Dm;
+    my $start_month = @start_date[1];
+    my $end_month   = ( $Dy * 12 ) + $Dm;
+
+    for my $mth ( 0 ... $months ) {
+        $mth = DateCalc( $budget_period_startdate, "+ $mth months" );
+        $mth = UnixDate( $mth, "%Y-%m" );
+        push( @authvals, $mth );
+    }
+    foreach my $vv (@authvals) {
+        $labels{$vv} = $vv;
+    }
+}
+
+elsif ( $authcat eq 'ITEMTYPES' ) {
+
+    my $query = qq| SELECT itemtype, description FROM itemtypes |;
+    my $sth   = $dbh->prepare($query);
+    $sth->execute();
+
+    if ( $sth->rows > 0 ) {
+        for ( my $i = 0 ; $i < $sth->rows ; $i++ ) {
+            my $results = $sth->fetchrow_hashref;
+            push @authvals, $results->{itemtype};
+            $labels{ $results->{itemtype} } = $results->{description};
+        }
+    }
+    $sth->finish;
+
+} elsif ( $authcat eq 'BRANCHES' ) {
+
+    my $query = qq| SELECT branchcode, branchname FROM branches |;
+    my $sth   = $dbh->prepare($query);
+    $sth->execute();
+
+    if ( $sth->rows > 0 ) {
+        for ( my $i = 0 ; $i < $sth->rows ; $i++ ) {
+            my $results = $sth->fetchrow_hashref;
+            push @authvals, $results->{branchcode};
+            $labels{ $results->{branchcode} } = $results->{branchname};
+        }
+    }
+    $sth->finish;
+}
+
+my @authvals_row;
+foreach my $val (@authvals) {
+    my %auth_hash;
+    $auth_hash{val} =   $labels{$val};
+    push( @authvals_row, \%auth_hash );
+}
+
+# ------------------------------------------------------------
+if ( $op eq 'save' ) {
+    ### ---------------------  save
+    my @names = $input->param();
+
+    #get budgets
+    my ( @buds, @auth_values );
+    foreach my $n (@names) {
+        next if $n =~ m/^[^0-9]/;
+        $n =~ m/(\d*),(.*)/;
+        push @buds, $1;
+        push @auth_values, $2;
+    }
+
+    #uniq buds and auth
+    my %seen;
+    @buds        = grep { !$seen{$_}++ } @buds;
+    @auth_values = grep { !$seen{$_}++ } @auth_values;
+    my @budget_ids;
+    my @budget_lines;
+
+    foreach my $budget (@buds) {
+        my %budget_line;
+        my @cells_line;
+        my %cell_hash;
+        foreach my $authvalue (@auth_values) {
+            # get actual stats
+            my $cell_name        = "$budget,$authvalue";
+            my $estimated_amount = $input->param("$cell_name");
+            my %cell_hash = (
+                estimated_amount => $estimated_amount,
+                authvalue        => $authvalue,
+                authcat          => $authcat,
+                budget_id        => $budget,
+                budget_period_id => $budget_period_id,
+            );
+            push( @cells_line, \%cell_hash );
+        }
+        %budget_line = (
+            lines => \@cells_line,
+        );
+        push( @budget_lines, \%budget_line );
+    }
+    my $plan = \@budget_lines;
+    ModBudgetPlan( $plan, $budget_period_id, $authcat );
+}
+# ------------------------------------------------------------
+#         DEFAULT DISPLAY BEGINS
+
+my @mime = ( C4::Context->preference("MIME") );
+foreach my $mime (@mime) {
+    #               warn "".$mime;
+}
+
+my $CGIextChoice = CGI::scrolling_list(
+    -name     => 'MIME',
+    -id       => 'MIME',
+    -values   => \@mime,
+    -size     => 1,
+    -multiple => 0
+);
+
+my @dels         = ( C4::Context->preference("delimiter") );
+my $CGIsepChoice = CGI::scrolling_list(
+    -name     => 'sep',
+    -id       => 'sep',
+    -values   => \@dels,
+    -size     => 1,
+    -multiple => 0
+);
+
+my ( @budget_lines, %cell_hash );
+
+foreach my $budget (@budgets) {
+    my $budget_lock;
+
+    # check budget permission
+    if ( $period->{budget_period_locked} == 1 ) {
+        $budget_lock = 1;
+    } elsif ( $budget->{budget_permission} == 1 ) {
+        $budget_lock = 1 if $borrower_id != $budget->{'budget_owner_id'};
+    } elsif ( $budget->{budget_permission} == 2 ) {
+        $budget_lock = 1 if $borrower_branchcode ne $budget->{budget_branchcode};
+    }
+
+    # allow hard-coded itemtype and branch planning
+    unless ( $authcat eq 'ITEMTYPES'
+        or  $authcat eq 'BRANCHES'
+        or  $authcat eq 'MONTHS' ) {
+
+        # but skip budgets that dont match the current auth-category
+        next if ( $budget->{'sort1_authcat'} ne $authcat
+            && $budget->{'sort2_authcat'} ne $authcat );
+    }
+
+    my %budget_line;
+    my @cells_line;
+    my $actual_spent;
+    my $estimated_spent;
+    foreach my $authvalue (@authvals) {
+
+        # get actual stats
+        my %cell = (
+            budget_id        => $budget->{'budget_id'},
+            budget_period_id => $budget->{'budget_period_id'},
+            cell_name        => $budget->{'budget_id'} . ',' . $authvalue,
+            authvalue        => $authvalue,
+            authcat          => $authcat,
+            cell_authvalue   => $authvalue,
+            budget_lock      => $budget_lock,
+        );
+
+        my ( $actual, $estimated ) = GetBudgetsPlanCell( \%cell, $period, $budget );
+        $cell{actual_amount}    = sprintf( "%.2f", $actual );
+        $cell{estimated_amount} = sprintf( "%.2f", $estimated );
+        $actual_spent    += $cell{actual_amount};
+        $estimated_spent += $cell{estimated_amount};
+        push( @cells_line, \%cell );
+    }
+
+    #     lines => \@cells_line,
+    my $budget_act_remain = $budget->{budget_amount} - $actual_spent;
+    my $budget_est_remain = $budget->{budget_amount} - $estimated_spent;
+
+    %budget_line = (
+        lines                   => \@cells_line,
+        budget_name_indent      => $budget->{budget_name_indent},
+        budget_amount_formatted => $num->format_price( $budget->{budget_amount} ),
+        budget_amount           => $budget->{budget_amount},
+        budget_alloc            => $budget->{budget_alloc},
+        budget_act_remain       => sprintf( "%.2f", $budget_act_remain ),
+        budget_est_remain       => sprintf( "%.2f", $budget_est_remain ),
+        budget_id               => $budget->{budget_id}
+    );
+
+    $budget_line{est_negative} = '1' if $budget_est_remain < 0;
+    $budget_line{est_positive} = '1' if $budget_est_remain > 0;
+    $budget_line{act_negative} = '1' if $budget_act_remain < 0;
+    $budget_line{act_positive} = '1' if $budget_act_remain > 0;
+
+    # skip if active set , and spent == 0
+    next if ( $show_active == '1' && ( $actual_spent == 0 ) );
+
+    push( @budget_lines, \%budget_line );
+}
+
+if ( $output eq "file" ) {
+    _print_to_csv(\@authvals_row, \@budget_lines);
+    exit(1);
+}
+
+    ## ## @budget_lines
+$template->param(
+    authvals_row              => \@authvals_row,
+    budget_lines              => \@budget_lines,
+    budget_period_description => $period->{'budget_period_description'},
+    budget_period_locked      => $period->{'budget_period_locked'},
+    budget_period_id          => $budget_period_id,
+    authcat                   => $authcat,
+    show_active               => $show_active,
+    show_actual               => $show_actual,
+    show_percent              => $show_percent,
+    show_mine                  => $show_mine,
+    cur                       => $cur->{symbol},
+    cur_format                => $cur_format,
+    CGIextChoice              => $CGIextChoice,
+    CGIsepChoice              => $CGIsepChoice,
+);
+
+output_html_with_http_headers $input, $cookie, $template->output;
+
+sub _print_to_csv {
+    my ( $header, $results ) = @_;
+
+    my $csv = Text::CSV_XS->new(
+        {   sep_char     => $del,
+            always_quote => 'TRUE',
+        }
+    );
+    print $input->header(
+        -type       => 'application/vnd.sun.xml.calc',
+        -encoding   => 'utf-8',
+        -attachment => "$basename.csv",
+        -name       => "$basename.csv"
+    );
+    my @col = ( 'Budget name', 'Budget total' );
+    foreach my $row (@$header) {
+        push @col, $row->{'val'};
+    }
+    push @col, 'Budget remaining';
+
+    $csv->combine(@col);
+    my $str = $csv->string;
+    print "$str\n";
+
+    foreach my $row (@$results) {
+        my @col = ( $row->{'budget_name'}, $row->{'budget_amount'} );
+        my $l = $row->{'lines'};
+        foreach my $line (@$l) {
+            push @col, $line->{'estimated_amount'};
+        }
+        push @col, $row->{'budget_est_remain'};
+        $csv->combine(@col);
+        my $str = $csv->string;
+        print "$str\n";
+    }
+}
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl
new file mode 100644
index 0000000..af170a6
--- /dev/null
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqplan.tmpl
@@ -0,0 +1,207 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+<title>
+Budget planning
+</title>
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="calendar.inc" -->
+
+</head>
+<body>
+<!-- TMPL_INCLUDE NAME="header.inc" -->
+<!-- TMPL_INCLUDE NAME="budgets-admin-search.inc" -->
+
+<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
+<script type="text/javascript">
+// ######################################################################
+// Javascript
+// ######################################################################
+    function Check(f) {
+            var ok=1;
+            var _alertString="";
+            var alertString2;
+            var arr = document.getElementsByName('est_total')
+
+            for ( var i=0, len=arr.length; i<len; ++i ){
+                    var tot = arr[i].innerHTML;
+
+                    if (tot == 'NaN') {
+                        _alertString += "\n- " + _("One or more cell values is non-numeric");
+                    }
+            }
+
+            if (_alertString.length==0) {
+                    document.Aform.submit();
+            } else {
+                    alertString2  = _("Form not submitted because of the following problem(s)");
+                    alertString2 += "\n------------------------------------------------------------------------------------\n";
+                    alertString2 += _alertString;
+                    alert(alertString2);
+            }
+    }
+</script>
+
+<div id="breadcrumbs">
+    <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
+    <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
+    <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->">Budgets</a> &rsaquo;
+    <a href="/cgi-bin/koha/admin/aqplan.pl?budget_period_id=   <!-- TMPL_VAR NAME="budget_period_id" -->">Planning</a> &rsaquo;
+</div>
+
+<div id="doc3" class="yui-t2">
+<div id="bd">
+<div id="yui-main">
+<div class="yui-b">
+
+<!-- TMPL_INCLUDE NAME="budgets-admin.inc" -->    
+
+<h1>Planning for <!-- TMPL_VAR NAME="budget_period_description" --> by <!-- TMPL_VAR NAME="authcat" --></h1>
+<br>
+
+<form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
+    <fieldset>
+    <legend>Planning options</legend>
+     <li><label for="budget_period_dropbox">Select budget period:</label>
+     <!-- TMPL_VAR name="budget_period_dropbox" -->
+    </li>
+
+    <li><label for="authcat_dropbox"  > Select planning type:</label>
+    <!-- TMPL_VAR NAME="authcat_dropbox" -->
+    </li>
+
+    <li>
+    <!-- TMPL_IF NAME="show_mine" -->
+        <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
+    <!-- TMPL_ELSE -->  
+        <input type="checkbox" id="show_mine"  name="show_mine" value="1"  />
+    <!-- /TMPL_IF -->  
+    <label for="show_mine">Show my budgets only</label>
+    </li>
+    <input type="hidden" name="show" value="1"  -->
+
+    <li>
+    <!-- TMPL_IF NAME="show_active" -->
+        <input type="checkbox" id="show_active" name="show_active" value="1" checked="checked" />
+    <!-- TMPL_ELSE -->  
+        <input type="checkbox" id="show_active" name="show_active" value="1" />
+        <!-- /TMPL_IF --> 
+    <label for="show_active">Show active budgets only</label>
+    </li>
+
+    <!-- TMPL_UNLESS  name="budget_period_locked" -->
+        <li>
+        <label for="show_actual">Show actual/estimated values:</label>
+        <!-- TMPL_IF NAME="show_actual" -->
+            <input type="checkbox" name="show_actual" value="1"   checked="checked" />
+        <!-- TMPL_ELSE -->  
+            <input type="checkbox" name="show_actual" value="1"  />
+        <!-- /TMPL_IF -->
+        </li>
+    <!-- /TMPL_UNLESS -->
+
+    <li>
+    <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->" />
+     <input style="position:relative; left:180px"   type="submit" value="Select" />
+    </li>
+    <br>
+    </fieldset>
+</form>
+
+<form method="post" name="Aform"  ction="/cgi-bin/koha/admin/aqplan.pl">
+    <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->" />
+
+    <table>
+    <tr>
+    <th>Budget name</th>
+    <th>Budget total</th>
+    <!-- TMPL_LOOP NAME="authvals_row" -->
+        <th><!-- TMPL_VAR NAME="val" --></th>
+    <!-- /TMPL_LOOP -->
+    <th >Budget remaining</th>
+
+    <!-- TMPL_UNLESS Name="budget_period_locked" -->
+        <th></th>
+    <!-- /TMPL_UNLESS -->
+    </tr>
+
+    <!-- TMPL_LOOP NAME="budget_lines" -->
+        <tr>
+        <td align='left'><!-- TMPL_VAR NAME="budget_name_indent"--></td>
+        <td align='center'><span id='budget_tot_formatted" -->'><!-- TMPL_VAR NAME="budget_amount_formatted"--></span></td>
+
+        <!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
+        <div style="display:none;" id='budget_tot_<!-- TMPL_VAR NAME="budget_id" -->'><!-- TMPL_VAR NAME="budget_amount"--></div>
+        <!-- TMPL_LOOP NAME="lines"	-->
+
+            <td align='center'>
+            <span>
+            <!-- TMPL_IF Name="show_actual" -->
+                <!-- TMPL_VAR NAME="actual_amount" --> /
+            <!--/TMPL_IF -->
+            <!-- TMPL_IF Name="budget_period_locked" -->
+                <!-- TMPL_VAR NAME="estimated_amount" -->
+            <!--TMPL_ELSIF  Name="budget_lock" -->
+                <!-- TMPL_VAR NAME="estimated_amount" -->
+            <!--TMPL_ELSE -->
+            <input type="text" style="text-align: right;" size='6' name='<!-- TMPL_VAR NAME="cell_name"-->'  value="<!-- TMPL_VAR NAME="estimated_amount" -->"  id='<!-- TMPL_VAR NAME="budget_id"-->' class='<!-- TMPL_VAR NAME="budget_id"-->' onchange="calcTotalRow(this);" >
+            <!--/TMPL_IF -->
+
+            </span>
+            </td>
+        <!-- /TMPL_LOOP -->
+
+        <td align="center">
+
+        <!-- TMPL_IF Name="show_actual" -->
+            <span
+            <!-- TMPL_IF NAME="act_negative" --> style="color: red;" <!--/TMPL_IF -->
+                <!-- TMPL_IF NAME="act_positive" --> style="color: green;" <!--/TMPL_IF --> >
+                <!-- TMPL_VAR NAME="budget_act_remain"-->
+            </span> /
+        <!-- /TMPL_IF -->
+        <span
+        <!-- TMPL_IF NAME="est_negative" --> style="color: red;" <!--/TMPL_IF -->
+        <!-- TMPL_IF NAME="est_positive" --> style="color: green;" <!--/TMPL_IF -->
+        name="est_total" id='budget_est_<!-- TMPL_VAR NAME="budget_id"-->'><!-- TMPL_VAR NAME="budget_est_remain"-->
+        </span></td>
+        <!-- TMPL_UNLESS Name="budget_period_locked" -->
+            <td><input type="button"  onclick="autoFillRow('<!-- TMPL_VAR NAME="budget_id"-->')" value="Auto-fill row"/> </td>
+        <!-- /TMPL_UNLESS  -->
+        </tr>
+    <!-- /TMPL_LOOP -->
+    </table>
+    <!-- TMPL_IF NAME="show_actual" -->
+        <span><b>Cells contain 'Actual / Estimated' values.</b></span><br>
+    <!-- TMPL_ELSE -->
+        <span><b>Cells contain estimated values only.</b></span><br>
+    <!-- /TMPL_IF -->
+    <span><b>Currency = <!-- TMPL_VAR NAME="cur" --> <!-- TMPL_VAR NAME="cur_format" --></b></span><br>
+    <!-- TMPL_IF name="budget_period_locked" -->
+        <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled='disabled'/> -->
+    <!-- TMPL_ELSE -->
+        <input type="button"  onclick="Check(this.form)" value="Save"/>
+        <input type="hidden" name="op" value="save"/>
+    <!-- /TMPL_IF -->
+        <input type="hidden" name="authcat" value="<!-- TMPL_VAR NAME="authcat"-->"/>
+</form>
+
+<form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
+<fieldset class="rows">
+    <ol>
+    <li><label for="outputfile">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" />
+    <label class="inline" for="MIME">Into an application
+    </label><!-- TMPL_VAR NAME="CGIextChoice" -->
+    <!-- TMPL_VAR NAME="CGIsepChoice" --> &nbsp;&nbsp;&nbsp;
+    <input type="submit" value="Output"/>
+    <input type="hidden" name="report_name" value="<!--TMPL_VAR NAME="report_name" -->" />
+    <input type="hidden" name="output" value="file" />
+    </li></ol>
+    </fieldset>
+</form>
+
+</div>
+</div>
+<div class="yui-b">
+<!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
+</div>
+</div>
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
-- 
1.6.0.4




More information about the Koha-patches mailing list