dolibarr 21.0.0-alpha
mod_sn_free.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) 2024 Frédéric France <frederic.france@free.fr>
5 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.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
28require_once DOL_DOCUMENT_ROOT.'/core/modules/product_batch/modules_product_batch.class.php';
29
35{
36 /*
37 * :warning:
38 * This module is used by default if none was set in the configuration.
39 * Therefore, the implementation must remain as open as possible.
40 */
41
42 // variables inherited from ModeleNumRefBatch class
43 public $name = 'sn_free';
44 public $version = 'dolibarr';
45
49 public function __construct()
50 {
51 $this->code_null = 1;
52 $this->code_modifiable = 1;
53 $this->code_modifiable_invalide = 1;
54 $this->code_modifiable_null = 1;
55 $this->code_auto = 0;
56 }
57
58
65 public function info($langs)
66 {
67 global $langs;
68 $langs->load("companies");
69 return $langs->trans("LeopardNumRefModelDesc");
70 }
71
77 public function getExample()
78 {
79 global $db;
80
81 require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
82
83 $thirdparty = new Societe($db);
84 $thirdparty->initAsSpecimen();
85
86 return $this->getNextValue($thirdparty, null);
87 }
88
96 public function getNextValue($objsoc, $object)
97 {
98 return '';
99 }
100}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
Parent class to manage numbering of batch products.
Class to manage third parties objects (customers, suppliers, prospects...)
__construct()
Constructor.
info($langs)
Return description of module.
getNextValue($objsoc, $object)
Return next free value.
getExample()
Return an example of numbering.