noalyss Version-9
export_ledger_pdf.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21
22// Copyright Author Dany De Bontridder danydb@aevalys.eu
23/*! \file
24 * \brief Send a ledger in a pdf format
25 *
26 */
27if (!defined('ALLOWED'))
28 die('Appel direct ne sont pas permis');
30require_once NOALYSS_INCLUDE.'/lib/ac_common.php';
31
35try
36{
37 $jrn_id=$http->get('jrn_id',"number");
38 $p_simple=$http->get('p_simple',"string");
39 $filter_operation=$http->get("operation_type");
40 $from=$http->get("from_periode","number");
41 $to=$http->get("to_periode","number");
42
43}
44catch (Exception $exc)
45{
46 echo $exc->getMessage();
47 error_log($exc->getTraceAsString());
48 throw $exc;
49}
50$l_type = "JRN";
52
54
55$Jrn->get_name();
56$g_user->Check();
57$g_user->check_dossier($gDossier);
58
59// Security
60if ($jrn_id != 0 && $g_user->check_jrn($jrn_id) == 'X') {
61 /* Cannot Access */
62 NoAccess();
63}
64
65$ret = "";
66if ( $jrn_id == 0 ) $Jrn->id=0;
67$jrn_type = $Jrn->get_type();
68
70$pdf->setDossierInfo($Jrn->jrn_def_name);
71$pdf->AliasNbPages();
72$pdf->AddPage();
73$pdf->SetAuthor('NOALYSS');
74$pdf->setTitle(_("Journal"), true);
75
76$pdf->export();
77
78$fDate = date('dmy-Hi');
79$pdf->Output('journal-' . $fDate . '.pdf', 'D');
80exit(0);
81
82
83?>
NoAccess($js=1)
Echo no access and stop.
Definition: ac_common.php:480
global $g_user
if no group available , then stop
$input_from id
Definition: balance.inc.php:63
static connect()
manage the http input (get , post, request) and extract from an array
Class to manage the company parameter (address, name...)
For the periode tables parm_periode and jrn_periode.
static factory(Database $cn, $p_type_export, Acc_Ledger $p_ledger, $p_from, $p_to, $p_filter_operation)
Create an object Print_Ledger* depending on $p_type_export ( 0 => accounting 1-> one row per operatio...
for($e=0; $e< count($afiche); $e++) exit
catch(Exception $exc) $l_type
$filter_operation
if($jrn_id !=0 && $g_user->check_jrn($jrn_id)=='X') $ret