27 require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
56 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
84 public function info($langs)
86 $langs->load(
"bills");
87 return $langs->trans(
"NoDescription");
108 $langs->load(
"bills");
109 return $langs->trans(
"NoExample");
133 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
145 $langs->load(
"admin");
147 if ($this->version ==
'development') {
148 return $langs->trans(
"VersionDevelopment");
149 } elseif ($this->version ==
'experimental') {
150 return $langs->trans(
"VersionExperimental");
151 } elseif ($this->version ==
'dolibarr') {
153 } elseif ($this->version) {
154 return $this->version;
156 return $langs->trans(
"NotAvailable");
174 $resql = $db->query($sql);
176 $num = $db->num_rows(
$resql);
179 $row = $db->fetch_row(
$resql);
180 $liste[$row[0]] = $row[1];
201 $langs->load(
"admin");
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");
422 dol_syslog(__METHOD__.
" is deprecated", LOG_WARNING);
424 return $object->
generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
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($db, $maxfilenamelength=0)
Return list of active generation modules.
Class to manage Dolibarr database access.
getVersion()
Return version of module.
static liste_modeles($db, $maxfilenamelength=0)
Renvoie la liste des modeles de numérotation.
thirdparty_doc_create(DoliDB $db, Societe $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Create a document onto disk according to template 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.
Class to manage third parties objects (customers, suppliers, prospects...)
getToolTip($langs, $soc, $type)
Return description of module parameters.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
getExample($langs, $objsoc=0, $type=-1)
Return an example of result returned by getNextValue.
getNextValue($objsoc=0, $type=-1)
Return next value available.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
get_code($db, $societe, $type= '')
Set accountancy account code for a third party into this->code.
info($langs)
Return description of module.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
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...