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)
109 return $langs->trans(
"Function_getNextValue_InModuleNotWorking");
133 $langs->loadLangs(array(
"admin",
"companies"));
136 $s .= $langs->trans(
"Name").
': <b>'.$this->
name.
'</b><br>';
137 $s .= $langs->trans(
"Version").
': <b>'.$this->
getVersion().
'</b><br>';
139 $s .= $langs->trans(
"ValidityControledByModule").
': <b>'.$this->
getName($langs).
'</b><br>';
142 $s .=
'<u>'.$langs->trans(
"ThisIsModuleRules").
':</u><br>';
144 $s .= $langs->trans(
"RequiredIfProduct").
': ';
145 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
148 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
149 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
150 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
155 $s .= $langs->trans(
"RequiredIfService").
': ';
156 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
159 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
160 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
161 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
166 $s .= $langs->trans(
"Required").
': ';
167 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
170 $s .=
yn($this->code_null ? 0 : 1, 1, 2);
171 if (
getDolGlobalString(
'MAIN_BARCODE_CODE_ALWAYS_REQUIRED') && !empty($this->code_null)) {
172 $s .=
'</strike> '.yn(1, 1, 2).
' ('.$langs->trans(
"ForcedToByAModule", $langs->transnoentities(
"yes")).
')';
181 $s .= $langs->trans(
"AutomaticCode").
': '.
yn($this->code_auto, 1, 2).
'<br>';
185 if (empty($nextval)) {
186 $nextval = $langs->trans(
"Undefined");
188 $s .= $langs->trans(
"NextValue").
': <b>'.$nextval.
'</b><br>';
209 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, $case=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.