dolibarr  x.y.z
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  $type = 'expensereport';
79  $list = array();
80 
81  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
82  $list = getListOfModels($db, $type, $maxfilenamelength);
83 
84  return $list;
85  }
86 }
87 
101 function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
102 {
103  return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
104 }
105 
112 {
116  public $error = '';
117 
123  public function isEnabled()
124  {
125  return true;
126  }
127 
133  public function info()
134  {
135  global $langs;
136  $langs->load("orders");
137  return $langs->trans("NoDescription");
138  }
139 
145  public function getExample()
146  {
147  global $langs;
148  $langs->load("trips");
149  return $langs->trans("NoExample");
150  }
151 
157  public function canBeActivated()
158  {
159  return true;
160  }
161 
168  public function getNextValue($object)
169  {
170  global $langs;
171  return $langs->trans("NotAvailable");
172  }
173 
179  public function getVersion()
180  {
181  global $langs;
182  $langs->load("admin");
183 
184  if ($this->version == 'development') {
185  return $langs->trans("VersionDevelopment");
186  } elseif ($this->version == 'experimental') {
187  return $langs->trans("VersionExperimental");
188  } elseif ($this->version == 'dolibarr') {
189  return DOL_VERSION;
190  } elseif ($this->version) {
191  return $this->version;
192  } else {
193  return $langs->trans("NotAvailable");
194  }
195  }
196 }
Parent class for documents generators.
Class to manage Dolibarr database access.
Class to manage Trips and Expenses.
Parent class for trips and expenses templates.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active models generation.
Parent class for numbering masks of expense reports.
getExample()
Returns an example of numbering.
isEnabled()
Return if a model can be used or not.
getVersion()
Returns the version of the numbering module.
info()
Returns the default description of the numbering model.
canBeActivated()
Test whether the numbers already in force in the base do not cause conflicts that would prevent this ...
getNextValue($object)
Returns next assigned value.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.