dolibarr 18.0.6
mod_contract_olive.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2014 Floran Henry <florian.henry@open-concept.pro>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 * or see https://www.gnu.org/
19 */
20
27require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php';
28
29
34{
40 public $nom = 'Olive';
41
45 public $name = 'Olive';
46
47 public $code_modifiable = 1; // Code modifiable
48
49 public $code_modifiable_invalide = 1; // Code modifiable si il est invalide
50
51 public $code_modifiable_null = 1; // Code modifiables si il est null
52
53 public $code_null = 1; // Code facultatif
54
59 public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
60
64 public $code_auto = 0;
65
66
72 public function info()
73 {
74 global $langs;
75
76 $langs->load("companies");
77 return $langs->trans("LeopardNumRefModelDesc");
78 }
79
87 public function getNextValue($objsoc, $contract)
88 {
89 global $langs;
90 return '';
91 }
92
93
107 public function verif($db, &$code, $product, $type)
108 {
109 global $conf;
110
111 $result = 0;
112 $code = strtoupper(trim($code));
113
114 if (empty($code) && $this->code_null && empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) {
115 $result = 0;
116 } elseif (empty($code) && (!$this->code_null || !empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED))) {
117 $result = -2;
118 }
119
120 dol_syslog("mod_contract_olive::verif type=".$type." result=".$result);
121 return $result;
122 }
123}
Parent class for all contract numbering modules.
Class to manage contract numbering rules Olive.
verif($db, &$code, $product, $type)
Check validity of code according to its rules.
info()
Return description of module.
getNextValue($objsoc, $contract)
Return an example of result returned by getNextValue.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.