dolibarr  13.0.2
modules_facture.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
5  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2014 Marcos GarcĂ­a <marcosgdf@gmail.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <https://www.gnu.org/licenses/>.
20  * or see https://www.gnu.org/
21  */
22 
30 require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required because used in classes that inherit
33 
34 
38 abstract class ModelePDFFactures extends CommonDocGenerator
39 {
43  public $error = '';
44 
45  public $atleastonediscount = 0;
46  public $atleastoneratenotnull = 0;
47 
48 
49  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
57  public static function liste_modeles($db, $maxfilenamelength = 0)
58  {
59  // phpcs:enable
60  global $conf;
61 
62  $type = 'invoice';
63  $liste = array();
64 
65  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
66  $liste = getListOfModels($db, $type, $maxfilenamelength);
67 
68  return $liste;
69  }
70 }
71 
75 abstract class ModeleNumRefFactures
76 {
80  public $error = '';
81 
87  public function isEnabled()
88  {
89  return true;
90  }
91 
97  public function info()
98  {
99  global $langs;
100  $langs->load("bills");
101  return $langs->trans("NoDescription");
102  }
103 
109  public function getExample()
110  {
111  global $langs;
112  $langs->load("bills");
113  return $langs->trans("NoExample");
114  }
115 
122  public function canBeActivated()
123  {
124  return true;
125  }
126 
134  public function getNextValue($objsoc, $facture)
135  {
136  global $langs;
137  return $langs->trans("NotAvailable");
138  }
139 
145  public function getVersion()
146  {
147  global $langs;
148  $langs->load("admin");
149 
150  if ($this->version == 'development') return $langs->trans("VersionDevelopment");
151  elseif ($this->version == 'experimental') return $langs->trans("VersionExperimental");
152  elseif ($this->version == 'dolibarr') return DOL_VERSION;
153  elseif ($this->version) return $this->version;
154  else return $langs->trans("NotAvailable");
155  }
156 }
info()
Renvoi la description par defaut du modele de numerotation.
isEnabled()
Return if a module can be used or not.
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
getVersion()
Renvoi version du modele de numerotation.
Parent class of invoice document generators.
getNextValue($objsoc, $facture)
Renvoi prochaine valeur attribuee.
Parent class of invoice reference numbering templates.
getExample()
Return an example of numbering.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Parent class for documents generators.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.