31require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
54 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
75 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
92 $resql = $dbs->query($sql);
94 $num = $dbs->num_rows($resql);
97 $row = $dbs->fetch_row($resql);
98 $list[$row[0]] = $row[1];
119 $langs->loadLangs(array(
"admin",
"companies"));
123 if (
getDolGlobalString(
'MAIN_COMPANY_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
124 $strikestart =
'<strike>';
125 $strikeend =
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
129 $s .= $langs->trans(
"Name").
': <b>'.$this->
getName($langs).
'</b><br>';
130 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
131 } elseif ($type == 0) {
132 $s .= $langs->trans(
"ProductCodeDesc").
'<br>';
133 } elseif ($type == 1) {
134 $s .= $langs->trans(
"ServiceCodeDesc").
'<br>';
137 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getName($langs).
'</b><br>';
140 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
142 $s .= $langs->trans(
"RequiredIfProduct").
': '.$strikestart;
143 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
145 } elseif ($type == 1) {
146 $s .= $langs->trans(
"RequiredIfService").
': '.$strikestart;
147 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
149 } elseif ($type == -1) {
150 $s .= $langs->trans(
"Required").
': '.$strikestart;
151 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
154 $s .= $langs->trans(
"CanBeModifiedIfOk").
': ';
155 $s .=
yn($this->code_modifiable, 1, 2);
157 $s .= $langs->trans(
"CanBeModifiedIfKo").
': '.
yn($this->code_modifiable_invalide, 1, 2).
'<br>';
158 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
160 if ($type == 0 || $type == -1) {
162 if (empty($nextval)) {
163 $nextval = $langs->trans(
"Undefined");
165 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Product").
')' :
'').
': <b>'.$nextval.
'</b><br>';
167 if ($type == 1 || $type == -1) {
169 if (empty($nextval)) {
170 $nextval = $langs->trans(
"Undefined");
172 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Service").
')' :
'').
': <b>'.$nextval.
'</b>';
Parent class for documents (PDF, ODT, ...) generators.
Parent class for number ref generators.
getVersion()
Returns version of numbering module.
getName($langs)
Return model name.
Parent class to manage intervention document templates.
static liste_modeles($dbs, $maxfilenamelength=0)
Return list of active generation modules.
Class template for classes of numbering product.
getNextValue($objproduct='', $type=-1)
Return next value available.
verif_prefixIsUsed()
Check if mask/numbering use prefix.
getToolTip($langs, $product, $type)
Return description of module parameters.
static liste_modeles($dbs, $maxfilenamelength=0)
Renvoi la liste des modeles de numérotation.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.