class mod_barcode_thirdparty_standard extends ModeleNumRefBarCode (View source)

Class to manage barcode with standard rule

Properties

$name
string $version

Dolibarr version of the loaded document

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

Name for the GeneratorModel

from  ModeleNumRefBarCode
string $searchcode
int<0, max> $numbitcounter

Number of digits for the counter (not bits, but digits)

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)

Return description of module

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 $objthirdparty = null)

Return an example of result returned by getNextValue

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

Return next value

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

Return description of module parameters

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

Check validity of code according to its rules

__construct()

Constructor

literalBarcodeType(DoliDB $db, $type = 0)

Return literal barcode type code from numerical rowid type of barcode

int
verif_dispo(DoliDB $db, string $code, Societe $thirdparty)

Return if a code is used (by other element)

int
verif_syntax(string $codefortest, $typefortest)

Return if a barcode value match syntax

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)

Return description of module

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

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

Return an example of result returned by getNextValue

Parameters

Translate $langs

Object langs

CommonObject $objthirdparty

Object third-party / Societe

Return Value

string Example

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

Return next value

Parameters

CommonObject $objthirdparty

Object third-party

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

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

Check validity of code according to its rules

Parameters

DoliDB $db

Database handler

string $code

Code to check/correct

Societe|Product $thirdparty

Object third party @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 -7 ErrorBadClass

$thirdparty_type
$type

__construct()

Constructor

literalBarcodeType(DoliDB $db, $type = 0)

Return literal barcode type code from numerical rowid type of barcode

Parameters

DoliDB $db

Database @param int $type Type of barcode (EAN, ISBN, ...) as rowid @return string

$type

int verif_dispo(DoliDB $db, string $code, Societe $thirdparty)

Return if a code is used (by other element)

Parameters

DoliDB $db

Handler access base

string $code

Code to check

Societe $thirdparty

Object third-party

Return Value

int

0 if available, <0 if KO

int verif_syntax(string $codefortest, $typefortest)

Return if a barcode value match syntax

Parameters

string $codefortest

Code to check syntax @param string $typefortest Type of barcode (ISBN, EAN, ...)

$typefortest

Return Value

int

0 if OK, <0 if KO