noalyss Version-9
impress_bilan.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*/
19if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
20
21//ini_set("memory_limit","150M");
22/*! \file
23 * \brief form who call the printing of the bilan in RTF
24 * file included by user_impress
25 *
26 * some variable are already defined ($cn, $g_user ...)
27 */
28
29//-----------------------------------------------------
30// Show the jrn and date
31//-----------------------------------------------------
33//-----------------------------------------------------
34// Form
35//-----------------------------------------------------
36$http=new \HttpInput();
38$bilan->get_request_get();
39echo '<div class="content">';
40$exercice=$http->get("exercice","number",$g_user->get_exercice());
41//----------------------------------------------------------------
42// Verification
43//----------------------------------------------------------------
44if ( ! isset ($_GET['verif']))
45{
46 /*
47 * Let you change the exercice
48 */
49 echo '<fieldset><legend>'._('Exercice').'</legend>';;
50 echo '<form method="GET" onsubmit="return waiting_box()">';
51 echo _('Choisissez un autre exercice');
52 $ex=new Exercice($cn);
53 $wex=$ex->select('exercice',$exercice,' onchange="submit(this)"');
54 echo $wex->input();
55 echo dossier::hidden();
56 echo HtmlInput::get_to_hidden(array('ac','type'));
57 echo '</form>';
58 echo '</fieldset>';
59
60 $filter_year=" where p_exercice='".sql_string($exercice)."'";
61 echo '<FORM METHOD="GET" onsubmit="waiting_box()">';
62 echo HtmlInput::hidden('type','bilan');
63 echo dossier::hidden();
64
65 // By default , show last day of exercice
66 if ($bilan->to == -1 ){
68 list($per_max,$per_min)=$t_periode->get_limit($exercice);
69 $bilan->to=$per_min->p_id;
70 }
71 echo $bilan->display_form ($filter_year);
72 echo '<span class="notice"> '._('Attention : si le bilan n\'est pas équilibré.<br> Vérifiez <ul>
73 <li>L\'affectation du résultat est fait</li>
74 <li>Vos comptes actifs ont un solde débiteur (sauf les comptes dit inversés)</li>
75 <li> les comptes passifs ont un solde créditeur (sauf les comptes dit inversés) </li>
76 </ul>
77 Utilisez la balance des comptes pour vérifier.').' </span>';
78 echo HtmlInput::submit('verif',_('Verification comptabilite'));
79 echo HtmlInput::get_to_hidden(array('ac','exercice'));
80 echo '</FORM>';
81}
82//----------------------------------------------------------------
83// Print
84//----------------------------------------------------------------
85if ( isset($_GET['verif']))
86{
87 $periode=new Periode($cn);
88 if ( $g_parameter->MY_REPORT=='Y') {
89 $date_from=$periode->first_day($bilan->from);
90 $date_to=$periode->last_day($bilan->to);
91 }
92 else {
93 $date_from=$bilan->from;
94 $date_to=$bilan->to;
95 }
96 echo '<h2>'._('Etape 2 :Impression')." ".$date_from.'-'.$date_to.'</h2>';
97
98 $bilan->get_request_get();
99 $bilan->verify();
100 $url_verify=http_build_query(array('ac'=>'VERIFBIL','gDossier'=>dossier::id()));
101 echo _('Pour une vérification complète, allez dans ').'<a class="line" TARGET="_blank" href="?'.$url_verify.'"> VERIFBIL</a>';
102 $id=uniqid("export_");
103
104 echo '<FORM METHOD="GET" ACTION="export.php" ';
105 printf( 'id="%s" onsubmit="download_document_form(\'%s\')">',$id,$id);
106
107 echo dossier::hidden();
108 echo HtmlInput::get_to_hidden(array('exercice'));
109 echo HtmlInput::hidden('b_id',$bilan->b_id);
110 echo HtmlInput::hidden('act','OTH:Bilan');
111
112 echo HtmlInput::hidden('from_periode',$bilan->from);
113 echo HtmlInput::hidden('to_periode',$bilan->to);
114 echo HtmlInput::submit('Impression','Impression');
115 echo '</form>';
116
117}
118
119echo '<hr>';
120echo '</div>';
121
$wex
Definition: balance.inc.php:47
$input_from id
Definition: balance.inc.php:63
$ex
Definition: balance.inc.php:45
$_GET['qcode']
this class handle the different bilan, from the table bilan, parse the form and replace in the templa...
about the accountancy period (usually 1 year starting in January until december) = exercice
static hidden($p_name, $p_value, $p_id="")
static get_to_hidden($array)
transform $_GET data to hidden
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
For the periode tables parm_periode and jrn_periode.
$t_periode
global $g_user
global $g_parameter