25 require_once DOL_DOCUMENT_ROOT.
'/core/modules/member/modules_member.class.php';
37 public $version =
'dolibarr';
39 public $prefix =
'MEM';
51 public $nom =
'Simple';
56 public $name =
'Simple';
67 return $langs->trans(
"SimpleNumRefModelDesc", $this->prefix);
78 return $this->prefix.
"0501-0001";
90 global $conf, $langs, $db;
95 $posindice = strlen($this->prefix) + 6;
96 $sql =
"SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.
") AS SIGNED)) as max";
97 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent";
98 $sql .=
" WHERE ref LIKE '".$db->escape($this->prefix).
"____-%'";
99 $sql .=
" AND entity = ".$conf->entity;
100 $resql = $db->query($sql);
102 $row = $db->fetch_row(
$resql);
104 $coyymm = substr($row[0], 0, 6);
108 if (!$coyymm || preg_match(
'/'.$this->prefix.
'[0-9][0-9][0-9][0-9]/i', $coyymm)) {
111 $langs->load(
"errors");
112 $this->error = $langs->trans(
'ErrorNumRefModel', $max);
166 $sql =
"SELECT MAX(rowid) as max";
167 $sql .=
" FROM ".MAIN_DB_PREFIX.
"adherent";
169 $resql = $db->query($sql);
171 $obj = $db->fetch_object(
$resql);
173 $max = intval($obj->max);
178 dol_syslog(
"mod_member_simple::getNextValue", LOG_DEBUG);
info()
Return description of numbering module.
getExample()
Return an example of numbering module values.
Classe mere des modeles de numerotation des references de members.
getNextValue($objsoc, $object)
Return next value.
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.
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->supplier_invoice->lire)) if(isModEnabled('don')&&!empty($user->rights->don->lire)) if(isModEnabled('tax')&&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture')&&isModEnabled('commande')&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...