27 require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
55 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
83 public function info($langs)
85 $langs->load(
"bills");
86 return $langs->trans(
"NoDescription");
107 $langs->load(
"bills");
108 return $langs->trans(
"NoExample");
132 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
144 $langs->load(
"admin");
146 if ($this->version ==
'development') {
147 return $langs->trans(
"VersionDevelopment");
148 } elseif ($this->version ==
'experimental') {
149 return $langs->trans(
"VersionExperimental");
150 } elseif ($this->version ==
'dolibarr') {
152 } elseif ($this->version) {
153 return $this->version;
155 return $langs->trans(
"NotAvailable");
173 $resql = $dbs->query($sql);
175 $num = $dbs->num_rows(
$resql);
178 $row = $dbs->fetch_row(
$resql);
179 $list[$row[0]] = $row[1];
200 $langs->loadLangs(array(
"admin",
"companies"));
204 if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {
205 $strikestart =
'<strike>';
206 $strikeend =
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
211 $s .= $langs->trans(
"Name").
': <b>'.$this->
getNom($langs).
'</b><br>';
212 } elseif ($type == -1) {
213 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
214 } elseif ($type == 0) {
215 $s .= $langs->trans(
"CustomerCodeDesc").
'<br>';
216 } elseif ($type == 1) {
217 $s .= $langs->trans(
"SupplierCodeDesc").
'<br>';
220 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getNom($langs).
'</b><br>';
223 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
225 $s .= $langs->trans(
"RequiredIfCustomer").
': '.$strikestart;
226 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
228 } elseif ($type == 1) {
229 $s .= $langs->trans(
"RequiredIfSupplier").
': '.$strikestart;
230 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
232 } elseif ($type == -1) {
233 $s .= $langs->trans(
"Required").
': '.$strikestart;
234 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
237 $s .= $langs->trans(
"CanBeModifiedIfOk").
': ';
238 $s .=
yn($this->code_modifiable, 1, 2);
240 $s .= $langs->trans(
"CanBeModifiedIfKo").
': '.
yn($this->code_modifiable_invalide, 1, 2).
'<br>';
241 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
243 if ($type == 0 || $type == -1) {
245 if (empty($nextval)) {
246 $nextval = $langs->trans(
"Undefined");
248 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Customer").
')' :
'').
': <b>'.$nextval.
'</b><br>';
250 if ($type == 1 || $type == -1) {
252 if (empty($nextval)) {
253 $nextval = $langs->trans(
"Undefined");
255 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Supplier").
')' :
'').
': <b>'.$nextval.
'</b>';
293 $langs->load(
"bills");
294 return $langs->trans(
"NoDescription");
307 $langs->load(
"bills");
308 return $langs->trans(
"NoExample");
330 $langs->load(
"admin");
332 if ($this->version ==
'development') {
333 return $langs->trans(
"VersionDevelopment");
334 } elseif ($this->version ==
'experimental') {
335 return $langs->trans(
"VersionExperimental");
336 } elseif ($this->version ==
'dolibarr') {
338 } elseif ($this->version) {
339 return $this->version;
341 return $langs->trans(
"NotAvailable");
357 $langs->load(
"admin");
361 $s .= $langs->trans(
"Name").
': <b>'.$this->
name.
'</b><br>';
362 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
367 if ($type == 0 || $type == -1) {
368 $result = $this->
get_code($db, $soc,
'customer');
369 $nextval = $this->code;
370 if (empty($nextval)) {
371 $nextval = $langs->trans(
"Undefined");
373 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Customer").
')' :
'').
': <b>'.$nextval.
'</b><br>';
375 if ($type == 1 || $type == -1) {
376 $result = $this->
get_code($db, $soc,
'supplier');
377 $nextval = $this->code;
378 if (empty($nextval)) {
379 $nextval = $langs->trans(
"Undefined");
381 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Supplier").
')' :
'').
': <b>'.$nextval.
'</b>';
395 public function get_code($db, $societe, $type =
'')
400 return $langs->trans(
"NotAvailable");
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
getToolTip($langs, $soc, $type)
Return description of module parameters.
getExample($langs)
Return an example of numbering.
getNom($langs)
Return name of module.
static liste_modeles($dbs, $maxfilenamelength=0)
Return list of active generation modules.
getVersion()
Return version of module.
$conf db name
Only used if Module[ID]Name translation string is not found.
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
Parent class for third parties code generators.
Parent class for third parties accountancy code generators.
Parent class for third parties models of doc generators.
getToolTip($langs, $soc, $type)
Return description of module parameters.
static liste_modeles($dbs, $maxfilenamelength=0)
Renvoie la liste des modeles de numérotation.
getExample($langs, $objsoc=0, $type=-1)
Return an example of result returned by getNextValue.
getNextValue($objsoc=0, $type=-1)
Return next value available.
get_code($db, $societe, $type= '')
Set accountancy account code for a third party into this->code.
if(isModEnabled('facture')&&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur')&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)&&$user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice')&&$user->rights->supplier_invoice->lire)) if(isModEnabled('don')&&!empty($user->rights->don->lire)) if(isModEnabled('tax')&&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture')&&isModEnabled('commande')&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
info($langs)
Return description of module.
info($langs)
Renvoi la description par defaut du modele de numerotation.
getVersion()
Return version of module.
Parent class for documents generators.
getListOfModels($db, $type, $maxfilenamelength=0)
Return list of activated modules usable for document generation.
verif_prefixIsUsed()
Check if mask/numbering use prefix.
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...