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';
72 abstract public function write_file(
$object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
90 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
107 $resql = $dbs->query($sql);
109 $num = $dbs->num_rows($resql);
112 $row = $dbs->fetch_row($resql);
113 $list[$row[0]] = $row[1];
134 $langs->loadLangs(array(
"admin",
"companies"));
138 if (
getDolGlobalString(
'MAIN_COMPANY_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
139 $strikestart =
'<strike>';
140 $strikeend =
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
144 $s .= $langs->trans(
"Name").
': <b>'.$this->
getName($langs).
'</b><br>';
145 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
146 } elseif ($type == 0) {
147 $s .= $langs->trans(
"ProductCodeDesc").
'<br>';
148 } elseif ($type == 1) {
149 $s .= $langs->trans(
"ServiceCodeDesc").
'<br>';
152 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getName($langs).
'</b><br>';
155 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
157 $s .= $langs->trans(
"RequiredIfProduct").
': '.$strikestart;
158 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
160 } elseif ($type == 1) {
161 $s .= $langs->trans(
"RequiredIfService").
': '.$strikestart;
162 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
164 } elseif ($type == -1) {
165 $s .= $langs->trans(
"Required").
': '.$strikestart;
166 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
169 $s .= $langs->trans(
"CanBeModifiedIfOk").
': ';
170 $s .=
yn($this->code_modifiable, 1, 2);
172 $s .= $langs->trans(
"CanBeModifiedIfKo").
': '.
yn($this->code_modifiable_invalide, 1, 2).
'<br>';
173 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
175 if ($type == 0 || $type == -1) {
177 if (empty($nextval)) {
178 $nextval = $langs->trans(
"Undefined");
180 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Product").
')' :
'').
': <b>'.$nextval.
'</b><br>';
182 if ($type == 1 || $type == -1) {
184 if (empty($nextval)) {
185 $nextval = $langs->trans(
"Undefined");
187 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Service").
')' :
'').
': <b>'.$nextval.
'</b>';
213 abstract public function getExample($langs =
null, $objproduct =
'', $type = -1);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build document.
static liste_modeles($db, $maxfilenamelength=0)
Return list of active generation modules.
Class template for classes of numbering product.
getExample($langs=null, $objproduct='', $type=-1)
Return an example of result returned by getNextValue.
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 a Dolibarr global constant string value.