From 860a2f2ffa85620673d916ce0e7e63a2d99971ac Mon Sep 17 00:00:00 2001 From: daraelmin Date: Sun, 21 Mar 2021 11:36:23 +0100 Subject: [PATCH] Fix #16893 picto UpToDate change to Unpaid sometimes #Fix #16893 picto UpToDate change to Unpaid sometimes As $now is set on the start of the script. But, the timestamp may change before LibStatut is called at the end. To avoid this we add 10 second to $now before comparing to dol_now() in LibStatut --- htdocs/adherents/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index b2ef8e8854b..e5d8fe6628e 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -432,7 +432,7 @@ foreach ($AdherentType as $key => $adhtype) { print ''.$adhtype->getNomUrl(1, dol_size(32)).''; print ''.(isset($MemberToValidate[$key]) && $MemberToValidate[$key] > 0 ? $MemberToValidate[$key] : '').' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; print ''.(isset($MembersValidated[$key]) && ($MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) > 0) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; - print ''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key] : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; + print ''.(isset($MemberUpToDate[$key]) && $MemberUpToDate[$key] > 0 ? $MemberUpToDate[$key] : '').' '.$staticmember->LibStatut(1, $adhtype->subscription, $now+10, 3).''; print ''.(isset($MembersResiliated[$key]) && $MembersResiliated[$key] > 0 ? $MembersResiliated[$key] : '').' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; print "\n"; } @@ -440,7 +440,7 @@ print ''; print ''.$langs->trans("Total").''; print ''.$SommeA.' '.$staticmember->LibStatut(-1, $adhtype->subscription, 0, 3).''; print ''.$SommeB.' '.$staticmember->LibStatut(1, $adhtype->subscription, 0, 3).''; -print ''.$SommeC.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now, 3).''; +print ''.$SommeC.' '.$staticmember->LibStatut(1, $adhtype->subscription, $now+10, 3).''; print ''.$SommeD.' '.$staticmember->LibStatut(0, $adhtype->subscription, 0, 3).''; print '';