|
dolibarr 25.0.0-alpha
|
Class to manage accountancy code of thirdparties with Minga rules. More...


Public Member Functions | |
| __construct () | |
| Constructor. | |
| info ($langs) | |
| Return description of module. | |
| getExample ($langs=null, $objsoc='', $type=-1) | |
| Return an example of result returned by getNextValue. | |
| get_code ($db, $societe, $type='') | |
| Set accountancy account code for a third party into this->code. | |
| getNumberFromCode ($code) | |
| Return the last group of digits of a thirdparty code ('CU2607-0435' gives '435'), limited to its last $this->nbdigits digits if set. | |
Public Member Functions inherited from ModeleAccountancyCode | |
| getToolTip ($langs, $soc, $type) | |
| Return description of module parameters. | |
Public Member Functions inherited from CommonNumRefGenerator | |
| getNom ($langs) | |
| Return model name. | |
| getName ($langs) | |
| Return model name. | |
| isEnabled () | |
| Return if a module can be used or not. | |
| canBeActivated ($object) | |
| Checks if the numbers already in the database do not cause conflicts that would prevent this numbering working. | |
| getVersion () | |
| Returns version of numbering module. | |
Public Attributes | |
| const | RANDOM_TRIES = 50 |
| Max number of random picks before scanning the range for a free number. | |
Private Member Functions | |
| cleanNumber ($value, $default) | |
| Return the number made of the digits of a string, or the default value if there is no digit. | |
| getUsedNumbers ($db, $start, $end) | |
| Load the numbers of the range already used as customer or supplier accountancy code. | |
| findFreeNumber ($used, $min, $max, $from, $step) | |
| Return the first free number of the range, starting at $from and moving in direction $step. | |
Class to manage accountancy code of thirdparties with Minga rules.
Codes are numeric and taken from a range of numbers (one range for customers, one for suppliers), like the debtor (10000-69999) and creditor (70000-99999) accounts of the German charts SKR03/SKR04.
Definition at line 33 of file mod_codecompta_minga.php.
|
private |
Return the number made of the digits of a string, or the default value if there is no digit.
| string | $value | Value to clean |
| int | $default | Default value |
Definition at line 113 of file mod_codecompta_minga.php.
Referenced by __construct().
|
private |
Return the first free number of the range, starting at $from and moving in direction $step.
When a bound of the range is reached, the search continues from the other bound.
| array<int,int> | $used Array with used numbers as keys | |
| int | $min | Start of range |
| int | $max | End of range |
| int | $from | Number to start the search from |
| int<-1,1> | $step 1 to search upward, -1 to search downward |
Definition at line 351 of file mod_codecompta_minga.php.
Referenced by get_code().
| mod_codecompta_minga::get_code | ( | $db, | |
| $societe, | |||
| $type = '' ) |
Set accountancy account code for a third party into this->code.
| DoliDB | $db | Database handler |
| ?Societe | $societe | Third party object |
| 'customer'|'supplier'|'' | $type 'customer' or 'supplier' |
Reimplemented from ModeleAccountancyCode.
Definition at line 208 of file mod_codecompta_minga.php.
References dol_syslog(), findFreeNumber(), getNumberFromCode(), and getUsedNumbers().
| mod_codecompta_minga::getExample | ( | $langs = null, | |
| $objsoc = '', | |||
| $type = -1 ) |
Return an example of result returned by getNextValue.
| ?Translate | $langs | Object langs |
| Societe | string | $objsoc | Object thirdparty |
| int<-1,2> | $type Type of third party (1:customer, 2:supplier, -1:autodetect) |
Reimplemented from ModeleAccountancyCode.
Definition at line 178 of file mod_codecompta_minga.php.
References getNumberFromCode().
| mod_codecompta_minga::getNumberFromCode | ( | $code | ) |
Return the last group of digits of a thirdparty code ('CU2607-0435' gives '435'), limited to its last $this->nbdigits digits if set.
| string | $code | Customer or supplier code |
Definition at line 283 of file mod_codecompta_minga.php.
Referenced by get_code(), and getExample().
|
private |
Load the numbers of the range already used as customer or supplier accountancy code.
Both columns are checked because customer and supplier accounts share the same numbering in accounting software (DATEV, ...).
Definition at line 301 of file mod_codecompta_minga.php.
References getDolGlobalString().
Referenced by get_code().
| mod_codecompta_minga::info | ( | $langs | ) |
Return description of module.
| Translate | $langs | Object langs |
Reimplemented from CommonNumRefGenerator.
Definition at line 126 of file mod_codecompta_minga.php.
References name.