noalyss Version-9
balance_card.inc.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright Author Dany De Bontridder danydb@aevalys.eu
21
22/*!\file
23 * \brief show the status of a card
24 */
25if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
27
28global $g_user,$cn;
29echo '<div class="content">';
32$fiche=new Fiche($cn,$http->get('f_id',"number"));
33$year=$g_user->get_exercice();
34if ( $year == 0 )
35 {
36 $html=_("erreur aucune période par défaut, allez dans préférence pour en choisir une");
37 }
38else
39 {
40 $per=new Periode($cn);
42 $array['from_periode']=$limit_periode[0]->first_day();
43 $array['to_periode']=$limit_periode[1]->last_day();
44 if (isset($_GET['ex']))
45 {
46 $ex=$http->get('ex','number');
47 $limit_periode=$per->get_limit($ex);
48
49 // if user's preference is greater $ex than I need operation until $ex otherwise since $ex
50 if ( $ex > $year) {
51 $array['to_periode']=$limit_periode[0]->last_day();
52 } else {
53 $array['from_periode']=$limit_periode[0]->first_day();
54 }
55 }
56
57 /*
58 * Add button to select another year
59 */
60 if ($exercice->count() > 1 )
61 {
62 $default=$http->get("ex","number",$year);
64
65 $old='<form method="get" action="do.php">';
66 $is=$exercice->select('ex',$default,'onchange = "submit(this)"');
67 $old.=sprintf(_("Autre exercice %s"),$is->input());
68 $old.=HtmlInput::hidden('f_id',$http->get('f_id'));
69 $old.=HtmlInput::hidden('ac',$http->get('ac'));
70 $old.=HtmlInput::hidden('sb',$http->get('sb'));
71 $old.=HtmlInput::hidden('sc',$http->get('sc'));
72 $old.=dossier::hidden();
73 $old.='</form>';
74 }
75
76 if ( $fiche->HtmlTable($array,0,0)==-1){
77 echo h2(_("Aucune opération pour l'exercice courant"),'class="error"');
78 }
79 echo $old;
80
81 }
82
83echo '</div>';
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68
if(headers_sent() &&DEBUGNOALYSS > 0) $html
$input_from id
Definition: balance.inc.php:63
$ex
Definition: balance.inc.php:45
$limit_periode
global $g_user
global $cn
$array['from_periode']
$_GET['qcode']
$dossier
about the accountancy period (usually 1 year starting in January until december) = exercice
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Definition: fiche.class.php:38
static hidden($p_name, $p_value, $p_id="")
manage the http input (get , post, request) and extract from an array
For the periode tables parm_periode and jrn_periode.