29require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
52 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
71 public $code_modifiable;
73 public $code_modifiable_invalide;
91 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
108 $resql = $dbs->query($sql);
110 $num = $dbs->num_rows($resql);
113 $row = $dbs->fetch_row($resql);
114 $list[$row[0]] = $row[1];
135 $langs->loadLangs(array(
"admin",
"companies"));
139 if (
getDolGlobalString(
'MAIN_COMPANY_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
140 $strikestart =
'<strike>';
141 $strikeend =
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
145 $s .= $langs->trans(
"Name").
': <b>'.$this->
getNom($langs).
'</b><br>';
146 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
147 } elseif ($type == 0) {
148 $s .= $langs->trans(
"ProductCodeDesc").
'<br>';
149 } elseif ($type == 1) {
150 $s .= $langs->trans(
"ServiceCodeDesc").
'<br>';
153 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getNom($langs).
'</b><br>';
156 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
158 $s .= $langs->trans(
"RequiredIfProduct").
': '.$strikestart;
159 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
161 } elseif ($type == 1) {
162 $s .= $langs->trans(
"RequiredIfService").
': '.$strikestart;
163 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
165 } elseif ($type == -1) {
166 $s .= $langs->trans(
"Required").
': '.$strikestart;
167 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
170 $s .= $langs->trans(
"CanBeModifiedIfOk").
': ';
171 $s .=
yn($this->code_modifiable, 1, 2);
173 $s .= $langs->trans(
"CanBeModifiedIfKo").
': '.
yn($this->code_modifiable_invalide, 1, 2).
'<br>';
174 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
176 if ($type == 0 || $type == -1) {
178 if (empty($nextval)) {
179 $nextval = $langs->trans(
"Undefined");
181 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Product").
')' :
'').
': <b>'.$nextval.
'</b><br>';
183 if ($type == 1 || $type == -1) {
185 if (empty($nextval)) {
186 $nextval = $langs->trans(
"Undefined");
188 $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.
getNom($langs)
Return model name TODO Replace with getName()
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.
verif_prefixIsUsed()
Check if mask/numbering use prefix.
getNextValue($objproduct=0, $type=-1)
Return next value available.
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.