26require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/commonnumrefgenerator.class.php';
60 abstract public function info($langs);
73 public function writeBarCode($code, $encoding, $readable =
'Y', $scale = 1, $nooutputiferror = 0)
112 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
136 $langs->loadLangs(array(
"admin",
"companies"));
139 $s .= $langs->trans(
"Name").
': <b>'.$this->
name.
'</b><br>';
140 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
142 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getName($langs).
'</b><br>';
145 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
147 $s .= $langs->trans(
"RequiredIfProduct").
': ';
148 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
151 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
152 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
153 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
158 $s .= $langs->trans(
"RequiredIfService").
': ';
159 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
162 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
163 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
164 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
169 $s .= $langs->trans(
"Required").
': ';
170 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
173 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
174 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
175 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
184 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
188 if (empty($nextval)) {
189 $nextval = $langs->trans(
"Undefined");
191 $s .= $langs->trans(
"NextValue").
': <b>'.$nextval.
'</b><br>';
212 abstract public function verif($db, &$code,
$object, $thirdparty_type, $type);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Parent class for number ref generators.
getVersion()
Returns version of numbering module.
getName($langs)
Return model name.
isEnabled()
Return if a model can be used or not.
writeBarCode($code, $encoding, $readable='Y', $scale=1, $nooutputiferror=0)
Save an image file on disk (with no output)
info($langs)
Return description.
encodingIsSupported($encoding)
Return true if encoding is supported.
verif($db, &$code, $object, $thirdparty_type, $type)
Check validity of code according to its rules.
getToolTip($langs, $soc, $type)
Return description of module parameters.
getNextValue($objcommon=null, $type='')
Return next value available.
getExample($langs=null, $object=null)
Return an example of result returned by getNextValue.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
$conf db name
Only used if Module[ID]Name translation string is not found.