2
0
forked from Wavyzz/dolibarr

Fix set a max length for UMR

This commit is contained in:
Laurent Destailleur
2023-02-22 01:35:15 +01:00
parent 6c3ddc15f2
commit 00032ac970
2 changed files with 5 additions and 2 deletions

View File

@@ -1719,8 +1719,11 @@ class BonPrelevement extends CommonObject
public static function buildRumNumber($row_code_client, $row_datec, $row_drum)
{
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)
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);
}

View File

@@ -2632,7 +2632,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
$format = '%Y%m%d%H%M%S';
} elseif ($format == 'dayhourlogsmall') {
// Format not sensitive to language
$format = '%Y%m%d%H%M';
$format = '%y%m%d%H%M';
} elseif ($format == 'dayhourldap') {
$format = '%Y%m%d%H%M%SZ';
} elseif ($format == 'dayhourxcard') {