27require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
50 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
70 public $code_modifiable;
72 public $code_modifiable_invalide;
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")).
')';
145 $s .= $langs->trans(
"Name").
': <b>'.$this->
getNom($langs).
'</b><br>';
146 } elseif ($type == -1) {
147 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
148 } elseif ($type == 0) {
149 $s .= $langs->trans(
"CustomerCodeDesc").
'<br>';
150 } elseif ($type == 1) {
151 $s .= $langs->trans(
"SupplierCodeDesc").
'<br>';
154 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getNom($langs).
'</b><br>';
157 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
159 $s .= $langs->trans(
"RequiredIfCustomer").
': '.$strikestart;
160 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
162 } elseif ($type == 1) {
163 $s .= $langs->trans(
"RequiredIfSupplier").
': '.$strikestart;
164 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
166 } elseif ($type == -1) {
167 $s .= $langs->trans(
"Required").
': '.$strikestart;
168 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
171 $s .= $langs->trans(
"CanBeModifiedIfOk").
': ';
172 $s .=
yn($this->code_modifiable, 1, 2);
174 $s .= $langs->trans(
"CanBeModifiedIfKo").
': '.
yn($this->code_modifiable_invalide, 1, 2).
'<br>';
175 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
177 if ($type == 0 || $type == -1) {
179 if (empty($nextval)) {
180 $nextval = $langs->trans(
"Undefined");
182 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Customer").
')' :
'').
': <b>'.$nextval.
'</b><br>';
184 if ($type == 1 || $type == -1) {
186 if (empty($nextval)) {
187 $nextval = $langs->trans(
"Undefined");
189 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Supplier").
')' :
'').
': <b>'.$nextval.
'</b>';
230 $langs->load(
"admin");
234 $s .= $langs->trans(
"Name").
': <b>'.$this->
name.
'</b><br>';
235 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
240 if ($type == 0 || $type == -1) {
241 $result = $this->
get_code($db, $soc,
'customer');
242 $nextval = $this->code;
243 if (empty($nextval)) {
244 $nextval = $langs->trans(
"Undefined");
246 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Customer").
')' :
'').
': <b>'.$nextval.
'</b><br>';
248 if ($type == 1 || $type == -1) {
249 $result = $this->
get_code($db, $soc,
'supplier');
250 $nextval = $this->code;
251 if (empty($nextval)) {
252 $nextval = $langs->trans(
"Undefined");
254 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Supplier").
')' :
'').
': <b>'.$nextval.
'</b>';
268 public function get_code($db, $societe, $type =
'')
273 return $langs->trans(
"NotAvailable");
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 for third parties accountancy code generators.
getToolTip($langs, $soc, $type)
Return description of module parameters.
get_code($db, $societe, $type='')
Set accountancy account code for a third party into this->code.
Parent class for third parties code generators.
verif_prefixIsUsed()
Check if mask/numbering use prefix.
getNextValue($objsoc=0, $type=-1)
Return next value available.
static liste_modeles($dbs, $maxfilenamelength=0)
Renvoie la liste des modeles de numérotation.
getToolTip($langs, $soc, $type)
Return description of module parameters.
Parent class for third parties models of doc generators.
static liste_modeles($dbs, $maxfilenamelength=0)
Return list of active generation modules.
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.
$conf db name
Only used if Module[ID]Name translation string is not found.