Merge pull request #20347 from hregis/fix_avoid_php_warning

FIX avoid php warning
This commit is contained in:
Laurent Destailleur 2022-03-15 19:27:33 +01:00 committed by GitHub
commit 6ec272ef36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -321,28 +321,28 @@ class pdf_strato extends ModelePDFContract
// Description of product line
if ($objectligne->date_ouverture_prevue) {
$datei = dol_print_date($objectligne->date_ouverture_prevue, 'day', false, $outputlangs, true);
if (!empty($objectligne->date_start)) {
$datei = dol_print_date((int) $objectligne->date_start, 'day', false, $outputlangs, true);
} else {
$datei = $langs->trans("Unknown");
}
if ($objectligne->date_fin_validite) {
$durationi = convertSecondToTime($objectligne->date_fin_validite - $objectligne->date_ouverture_prevue, 'allwithouthour');
$datee = dol_print_date($objectligne->date_fin_validite, 'day', false, $outputlangs, true);
if (!empty($objectligne->date_end)) {
$durationi = convertSecondToTime((int) $objectligne->date_end - (int) $objectligne->date_start, 'allwithouthour');
$datee = dol_print_date($objectligne->date_end, 'day', false, $outputlangs, true);
} else {
$durationi = $langs->trans("Unknown");
$datee = $langs->trans("Unknown");
}
if ($objectligne->date_ouverture) {
$daters = dol_print_date($objectligne->date_ouverture, 'day', false, $outputlangs, true);
if (!empty($objectligne->date_start_real)) {
$daters = dol_print_date((int) $objectligne->date_start_real, 'day', false, $outputlangs, true);
} else {
$daters = $langs->trans("Unknown");
}
if ($objectligne->date_cloture) {
$datere = dol_print_date($objectligne->date_cloture, 'day', false, $outputlangs, true);
if (!empty($objectligne->date_end_real)) {
$datere = dol_print_date((int) $objectligne->date_end_real, 'day', false, $outputlangs, true);
} else {
$datere = $langs->trans("Unknown");
}
@ -363,7 +363,7 @@ class pdf_strato extends ModelePDFContract
if (empty($conf->global->CONTRACT_HIDE_REAL_DATE_ON_PDF)) {
$txt .= '<br>';
$txt .= $outputlangs->transnoentities("DateStartRealShort")." : <strong>".$daters.'</strong>';
if ($objectligne->date_cloture) {
if (!empty($objectligne->date_end_real)) {
$txt .= " - ".$outputlangs->transnoentities("DateEndRealShort")." : '<strong>'".$datere.'</strong>';
}
}