dolibarr 18.0.6
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
18require_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
101function 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
118 public $version;
119
120
126 public function isEnabled()
127 {
128 return true;
129 }
130
136 public function info()
137 {
138 global $langs;
139 $langs->load("orders");
140 return $langs->trans("NoDescription");
141 }
142
148 public function getExample()
149 {
150 global $langs;
151 $langs->load("trips");
152 return $langs->trans("NoExample");
153 }
154
160 public function canBeActivated()
161 {
162 return true;
163 }
164
171 public function getNextValue($object)
172 {
173 global $langs;
174 return $langs->trans("NotAvailable");
175 }
176
182 public function getVersion()
183 {
184 global $langs;
185 $langs->load("admin");
186
187 if ($this->version == 'development') {
188 return $langs->trans("VersionDevelopment");
189 } elseif ($this->version == 'experimental') {
190 return $langs->trans("VersionExperimental");
191 } elseif ($this->version == 'dolibarr') {
192 return DOL_VERSION;
193 } elseif ($this->version) {
194 return $this->version;
195 } else {
196 return $langs->trans("NotAvailable");
197 }
198 }
199}
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.