dolibarr  16.0.5
modules_facturefournisseur.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
3  * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
4  * Copyright (C) 2013-2016 Philippe Grand <philippe.grand@atoo-net.com>
5  * Copyright (C) 2014 Marcos GarcĂ­a <marcosgdf@gmail.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  * or see https://www.gnu.org/
20  */
21 
28 require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // required for use by classes that inherit
30 
31 
36 {
40  public $error = '';
41 
42 
43  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
51  public static function liste_modeles($db, $maxfilenamelength = 0)
52  {
53  // phpcs:enable
54  global $conf;
55 
56  $type = 'invoice_supplier';
57  $list = array();
58 
59  include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
60  $list = getListOfModels($db, $type, $maxfilenamelength);
61 
62  return $list;
63  }
64 }
65 
70 {
74  public $error = '';
75 
80  public function isEnabled()
81  {
82  return true;
83  }
84 
89  public function info()
90  {
91  global $langs;
92  $langs->load("invoices");
93  return $langs->trans("NoDescription");
94  }
95 
100  public function getExample()
101  {
102  global $langs;
103  $langs->load("invoices");
104  return $langs->trans("NoExample");
105  }
106 
111  public function canBeActivated()
112  {
113  return true;
114  }
115 
123  public function getNextValue($objsoc, $object, $mode = 'next')
124  {
125  global $langs;
126  return $langs->trans("NotAvailable");
127  }
128 
133  public function getVersion()
134  {
135  global $langs;
136  $langs->load("admin");
137 
138  if ($this->version == 'development') {
139  return $langs->trans("VersionDevelopment");
140  }
141  if ($this->version == 'experimental') {
142  return $langs->trans("VersionExperimental");
143  }
144  if ($this->version == 'dolibarr') {
145  return DOL_VERSION;
146  }
147  if ($this->version) {
148  return $this->version;
149  }
150  return $langs->trans("NotAvailable");
151  }
152 }
ModeleNumRefSuppliersInvoices\getNextValue
getNextValue($objsoc, $object, $mode='next')
Returns next value assigned.
Definition: modules_facturefournisseur.php:123
ModelePDFSuppliersInvoices
Parent class for supplier invoices models.
Definition: modules_facturefournisseur.php:35
ModeleNumRefSuppliersInvoices\info
info()
Returns the default description of the model numbering.
Definition: modules_facturefournisseur.php:89
ModeleNumRefSuppliersInvoices\canBeActivated
canBeActivated()
Tests if the numbers already in force in the database do not cause conflicts that would prevent this ...
Definition: modules_facturefournisseur.php:111
ModelePDFSuppliersInvoices\liste_modeles
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation models.
Definition: modules_facturefournisseur.php:51
ModeleNumRefSuppliersInvoices\getVersion
getVersion()
Returns version of the model numbering.
Definition: modules_facturefournisseur.php:133
ModeleNumRefSuppliersInvoices\getExample
getExample()
Returns a numbering example.
Definition: modules_facturefournisseur.php:100
getListOfModels
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
Definition: functions2.lib.php:1919
ModeleNumRefSuppliersInvoices
Parent Class of numbering models of suppliers invoices references.
Definition: modules_facturefournisseur.php:69
ModeleNumRefSuppliersInvoices\isEnabled
isEnabled()
Return if a model can be used or not.
Definition: modules_facturefournisseur.php:80
CommonDocGenerator
Parent class for documents generators.
Definition: commondocgenerator.class.php:36