2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop
This commit is contained in:
Laurent Destailleur
2022-11-11 01:04:59 +01:00
60 changed files with 1891 additions and 1347 deletions

View File

@@ -3844,6 +3844,27 @@ function isValidPhone($phone)
}
/**
* Return first letters of a strings.
* Example with nbofchar=1: 'ghi' will return 'g' but 'abc def' will return 'ad'
* Example with nbofchar=2: 'ghi' will return 'gh' but 'abc def' will return 'abde'
*
* @param string $s String to truncate
* @param int $nbofchar Nb of characters to keep
* @return string Return first chars.
*/
function dolGetFirstLetters($s, $nbofchar = 1)
{
$ret = '';
$tmparray = explode(' ', $s);
foreach ($tmparray as $tmps) {
$ret .= dol_substr($tmps, 0, $nbofchar);
}
return $ret;
}
/**
* Make a strlen call. Works even if mbstring module not enabled
*
@@ -5726,7 +5747,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
if ((string) $forcerounding != '-1') {
if ($forcerounding == 'MU') {
$nbdecimal = $conf->global->MAIN_MAX_DECIMALS_UNIT;
} else if ($forcerounding == 'MT') {
} elseif ($forcerounding == 'MT') {
$nbdecimal = $conf->global->MAIN_MAX_DECIMALS_TOT;
} elseif ($forcerounding >= 0) {
$nbdecimal = $forcerounding;