forked from Wavyzz/dolibarr
Fix set a max length for UMR
This commit is contained in:
@@ -1719,8 +1719,11 @@ class BonPrelevement extends CommonObject
|
|||||||
public static function buildRumNumber($row_code_client, $row_datec, $row_drum)
|
public static function buildRumNumber($row_code_client, $row_datec, $row_drum)
|
||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation)
|
$pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation)
|
||||||
return $pre.($row_code_client ? '-'.$row_code_client : '').'-'.$row_drum.'-'.date('U', $row_datec);
|
|
||||||
|
// 3 char + '-' + 12 + '-' + id + '-' + code Must be lower than 32.
|
||||||
|
return $pre.'-'.dol_print_date($row_datec, 'dayhourlogsmall').'-'.dol_trunc($row_drum.($row_code_client ? '-'.$row_code_client : ''), 15, 'right', 'UTF-8', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2632,7 +2632,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
|||||||
$format = '%Y%m%d%H%M%S';
|
$format = '%Y%m%d%H%M%S';
|
||||||
} elseif ($format == 'dayhourlogsmall') {
|
} elseif ($format == 'dayhourlogsmall') {
|
||||||
// Format not sensitive to language
|
// Format not sensitive to language
|
||||||
$format = '%Y%m%d%H%M';
|
$format = '%y%m%d%H%M';
|
||||||
} elseif ($format == 'dayhourldap') {
|
} elseif ($format == 'dayhourldap') {
|
||||||
$format = '%Y%m%d%H%M%SZ';
|
$format = '%Y%m%d%H%M%SZ';
|
||||||
} elseif ($format == 'dayhourxcard') {
|
} elseif ($format == 'dayhourxcard') {
|
||||||
|
|||||||
Reference in New Issue
Block a user