abstract class ModeleNumRefBarCode extends CommonNumRefGenerator (View source)

Parent class for barcode numbering models

Properties

string $name from  CommonNumRefGenerator
string $version from  CommonNumRefGenerator
string $error from  CommonNumRefGenerator
string[] $errors from  CommonNumRefGenerator
protected DoliDB $db from  CommonNumRefGenerator
int<0, 1> $code_null
int<0, 1> $code_modifiable from  CommonNumRefGenerator
int<0, 1> $code_modifiable_invalide from  CommonNumRefGenerator
int<0, 1> $code_modifiable_null from  CommonNumRefGenerator
int<0, 1> $code_auto from  CommonNumRefGenerator
int<0, 1> $prefixIsRequired from  CommonNumRefGenerator
string $nom

Name for the GeneratorModel

Methods

string
getNom($langs)

Return model name

string
getName($langs)

Return model name

bool
isEnabled()

Return if a module can be used or not

string
info(Translate $langs)

Returns the default description of the numbering template

bool
canBeActivated(CommonObject $object)

Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working.

string
getVersion()

Returns version of numbering module

string
getExample(Translate $langs = null, CommonObject $object = null)

Return an example of result returned by getNextValue

getNextValue(CommonObject $objcommon = null, string $type = '')

Return next value available

getToolTip($langs, Societe $soc, $type)

Return description of module parameters

verif(DoliDB $db, string $code, Product|Societe $object, $thirdparty_type, $type)

Check validity of code according to its rules

Details

string getNom($langs)

Return model name

@param Translate $langs Object langs

Parameters

$langs

Return Value

string

Model name @deprecated Use getName() instead getName()

string getName($langs)

Return model name

@param Translate $langs Object langs

Parameters

$langs

Return Value

string

Model name

bool isEnabled()

Return if a module can be used or not

Return Value

bool

true if module can be used

string info(Translate $langs)

Returns the default description of the numbering template

Parameters

Translate $langs Language

Return Value

string

Descriptive text

bool canBeActivated(CommonObject $object)

Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working.

Parameters

CommonObject $object

Object we need next value for

Return Value

bool

false if conflict, true if ok

string getVersion()

Returns version of numbering module

Return Value

string Valeur

abstract string getExample(Translate $langs = null, CommonObject $object = null)

Return an example of result returned by getNextValue

Parameters

Translate $langs

Object langs

CommonObject $object

Object product

Return Value

string Example

getNextValue(CommonObject $objcommon = null, string $type = '')

Return next value available

Parameters

CommonObject $objcommon

Object Product, Thirdparty

string $type

Type of barcode (EAN, ISBN, ...) @return string Value

getToolTip($langs, Societe $soc, $type)

Return description of module parameters

@param Translate $langs Output language

Parameters

$langs
Societe $soc

Third party object @param int $type -1=Nothing, 0=Product, 1=Service @return string HTML translated description

$type

abstract verif(DoliDB $db, string $code, Product|Societe $object, $thirdparty_type, $type)

Check validity of code according to its rules

Parameters

DoliDB $db

Database handler

string $code

Code to check/correct

Product|Societe $object

Object product or ThirdParty @param int<0,1> $thirdparty_type 0 = customer/prospect , 1 = supplier @param string $type type of barcode (EAN, ISBN, ...) @return int<-7,0> 0 if OK -1 ErrorBadCustomerCodeSyntax -2 ErrorCustomerCodeRequired -3 ErrorCustomerCodeAlreadyUsed -4 ErrorPrefixRequired -7 ErrorBadClass

$thirdparty_type
$type