29require_once DOL_DOCUMENT_ROOT.
'/core/class/commondocgenerator.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
52 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
82 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
100 $resql = $dbs->query($sql);
102 $num = $dbs->num_rows($resql);
105 $row = $dbs->fetch_row($resql);
106 $list[$row[0]] = $row[1];
128 $langs->loadLangs(array(
"admin",
"companies"));
132 if (
getDolGlobalString(
'MAIN_COMPANY_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
133 $strikestart =
'<strike>';
134 $strikeend =
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
139 $s .= $langs->trans(
"Name").
': <b>'.$this->
getName($langs).
'</b><br>';
140 } elseif ($type == 0) {
141 $s .= $langs->trans(
"CustomerCodeDesc").
'<br>';
142 } elseif ($type == 1) {
143 $s .= $langs->trans(
"SupplierCodeDesc").
'<br>';
146 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getName($langs).
'</b><br>';
149 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
151 $s .= $langs->trans(
"RequiredIfCustomer").
': '.$strikestart;
152 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
154 } elseif ($type == 1) {
155 $s .= $langs->trans(
"RequiredIfSupplier").
': '.$strikestart;
156 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
158 } elseif ($type == -1) {
159 $s .= $langs->trans(
"Required").
': '.$strikestart;
160 $s .=
yn(!$this->code_null, 1, 2).$strikeend;
163 $s .= $langs->trans(
"CanBeModifiedIfOk").
': ';
164 $s .=
yn($this->code_modifiable, 1, 2);
166 $s .= $langs->trans(
"CanBeModifiedIfKo").
': '.
yn($this->code_modifiable_invalide, 1, 2).
'<br>';
167 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
169 if ($type == 0 || $type == -1) {
171 if (empty($nextval)) {
172 $nextval = $langs->trans(
"Undefined");
174 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Customer").
')' :
'').
': <b>'.$nextval.
'</b><br>';
176 if ($type == 1 || $type == -1) {
178 if (empty($nextval)) {
179 $nextval = $langs->trans(
"Undefined");
181 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Supplier").
')' :
'').
': <b>'.$nextval.
'</b>';
222 $langs->load(
"admin");
226 $s .= $langs->trans(
"Name").
': <b>'.$this->
name.
'</b><br>';
227 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
232 if ($type == 0 || $type == -1) {
233 $result = $this->
get_code($db, $soc,
'customer');
234 $nextval = $this->code;
235 if (empty($nextval)) {
236 $nextval = $langs->trans(
"Undefined");
238 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Customer").
')' :
'').
': <b>'.$nextval.
'</b><br>';
240 if ($type == 1 || $type == -1) {
241 $result = $this->
get_code($db, $soc,
'supplier');
242 $nextval = $this->code;
243 if (empty($nextval)) {
244 $nextval = $langs->trans(
"Undefined");
246 $s .= $langs->trans(
"NextValue").($type == -1 ?
' ('.$langs->trans(
"Supplier").
')' :
'').
': <b>'.$nextval.
'</b>';
260 public function get_code($db, $societe, $type =
'')
265 dol_syslog(get_class($this).
"::get_code".$langs->trans(
"NotAvailable"), LOG_ERR);
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 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.
__construct($db)
Constructor.
getNextValue($objsoc='', $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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db name
Only used if Module[ID]Name translation string is not found.