Go to the documentation of this file.
26 require_once DOL_DOCUMENT_ROOT.
'/core/modules/member/modules_member.class.php';
38 public $version =
'dolibarr';
55 public $name =
'Simple';
60 public $code_auto = 1;
70 return $langs->trans(
"SimpleRefNumRefModelDesc");
93 global $conf, $langs, $db;
98 $sql =
"SELECT MAX(CAST(ref AS SIGNED)) as max";
99 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent";
100 $sql .=
" WHERE entity = ".$conf->entity;
101 $resql = $db->query(
$sql);
103 $row = $db->fetch_row($resql);
105 $coyymm = substr($row[0], 0, 6);
109 if (!$coyymm || preg_match(
'/[0-9][0-9][0-9][0-9]/i', $coyymm)) {
112 $langs->load(
"errors");
113 $this->error = $langs->trans(
'ErrorNumRefModel', $max);
131 $sql =
"SELECT MAX(CAST(ref AS SIGNED)) as max";
132 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent";
133 $sql .=
" WHERE entity = ".(int) $conf->entity;
135 $resql = $db->query(
$sql);
137 $obj = $db->fetch_object($resql);
139 $max = intval($obj->max) + 1;
144 dol_syslog(
"mod_member_simple::getNextValue", LOG_DEBUG);
147 $max = str_pad((
string) $max,
getDolGlobalInt(
'MEMBER_MOD_SIMPLE_LPAD'),
"0", STR_PAD_LEFT);
Classe mere des modeles de numerotation des references de members.
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
Class to manage the numbering module Simple for member references.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
getExample()
Return an example of numbering module values.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
info()
Return description of numbering module.
getNextValue($objsoc, $object)
Return next value.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.