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);
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];
133 $langs->loadLangs(array(
"admin",
"companies"));
137 if (
getDolGlobalString(
'MAIN_COMPANY_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
138 $strikestart =
'<strike>';
139 $strikeend =
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
143 $s .= $langs->trans(
"Name").
': <b>'.$this->
getName($langs).
'</b><br>';
144 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
145 } elseif ($type == 0) {
146 $s .= $langs->trans(
"ProductCodeDesc").
'<br>';
147 } elseif ($type == 1) {
148 $s .= $langs->trans(
"ServiceCodeDesc").
'<br>';
151 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getName($langs).
'</b><br>';
154 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
156 $s .= $langs->trans(
"RequiredIfProduct").
': '.$strikestart;
157 $s .=
yn($this->code_null ? 0 : 1, 1, 2).$strikeend;
159 } elseif ($type == 1) {
160 $s .= $langs->trans(
"RequiredIfService").
': '.$strikestart;
161 $s .=
yn($this->code_null ? 0 : 1, 1, 2).$strikeend;
163 } elseif ($type == -1) {
164 $s .= $langs->trans(
"Required").
': '.$strikestart;
165 $s .=
yn($this->code_null ? 0 : 1, 1, 2).$strikeend;
168 $s .= $langs->trans(
"CanBeModifiedIfOk").
': ';
169 $s .=
yn($this->code_modifiable, 1, 2);
171 $s .= $langs->trans(
"CanBeModifiedIfKo").
': '.
yn($this->code_modifiable_invalide, 1, 2).
'<br>';
172 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
174 if ($type == 0 || $type == -1) {
176 if (empty($nextval)) {
177 $nextval = $langs->trans(
"Undefined");
179 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Product").
')' :
'').
': <b>'.$nextval.
'</b><br>';
181 if ($type == 1 || $type == -1) {
183 if (empty($nextval)) {
184 $nextval = $langs->trans(
"Undefined");
186 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Service").
')' :
'').
': <b>'.$nextval.
'</b>';
212 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, $format=1, $color=0)
Return yes or no in current language.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.