dolibarr 21.0.0-alpha
mod_codecompta_panicum.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2010 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
27require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php';
28
29
34{
38 public $name = 'Panicum';
39
43 public $code;
44
49 public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
50
51 public $position = 10;
52
53
57 public function __construct()
58 {
59 }
60
61
68 public function info($langs)
69 {
70 return $langs->trans("ModuleCompanyCode".$this->name);
71 }
72
73
82 public function getExample($langs = null, $objsoc = '', $type = -1)
83 {
84 return '';
85 }
86
87 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
96 public function get_code($db, $societe, $type = '')
97 {
98 // phpcs:enable
99 $this->code = '';
100
101 if (is_object($societe)) {
102 if ($type == 'supplier') {
103 $this->code = (($societe->code_compta_fournisseur != "") ? $societe->code_compta_fournisseur : '');
104 } else {
105 $this->code = (($societe->code_compta_client != "") ? $societe->code_compta_client : '');
106 }
107 }
108
109 return 0; // return ok
110 }
111}
Parent class for third parties accountancy code generators.
Class to manage accountancy code of thirdparties with Panicum rules.
getExample($langs=null, $objsoc='', $type=-1)
Return an example of result returned by getNextValue.
get_code($db, $societe, $type='')
Set accountancy account code for a third party into this->code.
info($langs)
Return description of module.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140