dolibarr  16.0.1
modules_expensereport.php
1 <?php
2 /* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
18 require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
19 
20 
25 {
29  public $error = '';
30 
34  public $page_largeur;
35 
39  public $page_hauteur;
40 
44  public $format;
45 
49  public $marge_gauche;
50 
54  public $marge_droite;
55 
59  public $marge_haute;
60 
64  public $marge_basse;
65 
66 
67  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
75  public static function liste_modeles($db, $maxfilenamelength = 0)
76  {
77  // phpcs:enable
78  global $conf;
79 
80  $type = 'expensereport';
81  $list = array();
82 
83  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
84  $list = getListOfModels($db, $type, $maxfilenamelength);
85 
86  return $list;
87  }
88 }
89 
103 function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
104 {
105  return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
106 }
107 
114 {
118  public $error = '';
119 
125  public function isEnabled()
126  {
127  return true;
128  }
129 
135  public function info()
136  {
137  global $langs;
138  $langs->load("orders");
139  return $langs->trans("NoDescription");
140  }
141 
147  public function getExample()
148  {
149  global $langs;
150  $langs->load("trips");
151  return $langs->trans("NoExample");
152  }
153 
159  public function canBeActivated()
160  {
161  return true;
162  }
163 
170  public function getNextValue($object)
171  {
172  global $langs;
173  return $langs->trans("NotAvailable");
174  }
175 
181  public function getVersion()
182  {
183  global $langs;
184  $langs->load("admin");
185 
186  if ($this->version == 'development') {
187  return $langs->trans("VersionDevelopment");
188  } elseif ($this->version == 'experimental') {
189  return $langs->trans("VersionExperimental");
190  } elseif ($this->version == 'dolibarr') {
191  return DOL_VERSION;
192  } elseif ($this->version) {
193  return $this->version;
194  } else {
195  return $langs->trans("NotAvailable");
196  }
197  }
198 }
static liste_modeles($db, $maxfilenamelength=0)
Return list of active models generation.
getVersion()
Returns the version of the numbering module.
getExample()
Returns an example of numbering.
getNextValue($object)
Returns next assigned value.
isEnabled()
Return if a model can be used or not.
Class to manage Dolibarr database access.
Parent class for trips and expenses templates.
Parent class for numbering masks of expense reports.
Class to manage Trips and Expenses.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk accordign to template module.
Parent class for documents generators.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
canBeActivated()
Test whether the numbers already in force in the base do not cause conflicts that would prevent this ...
info()
Returns the default description of the numbering model.