mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Fix: Bad count of subscription to receive
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -417,6 +417,8 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'cotisatio
|
|||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
llxHeader('',$langs->trans("Subscriptions"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
llxHeader('',$langs->trans("Subscriptions"),'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');
|
||||||
|
|
||||||
if ($rowid)
|
if ($rowid)
|
||||||
@@ -466,15 +468,8 @@ if ($rowid)
|
|||||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
||||||
if ($adh->datefin)
|
if ($adh->datefin)
|
||||||
{
|
{
|
||||||
if ($adh->datefin < time())
|
print dol_print_date($adh->datefin,'day');
|
||||||
{
|
if ($adh->datefin < ($now - $conf->adherent->cotisation->warning_delay) && $adh->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie
|
||||||
print dol_print_date($adh->datefin,'day');
|
|
||||||
if ($adh->statut > 0) print " ".img_warning($langs->trans("Late")); // Affiche picto retard uniquement si non brouillon et non resilie
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print dol_print_date($adh->datefin,'day');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1870,7 +1870,7 @@ class Adherent extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$now=gmmktime();
|
$now=dol_now();
|
||||||
|
|
||||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||||
|
|
||||||
@@ -1880,6 +1880,7 @@ class Adherent extends CommonObject
|
|||||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||||
$sql.= " WHERE a.statut = 1";
|
$sql.= " WHERE a.statut = 1";
|
||||||
$sql.= " AND a.entity = ".$conf->entity;
|
$sql.= " AND a.entity = ".$conf->entity;
|
||||||
|
$sql.= " AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')";
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
@@ -291,18 +291,12 @@ if ($resql)
|
|||||||
print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
|
print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Date fin cotisation
|
// End of subscription date
|
||||||
if ($datefin)
|
if ($datefin)
|
||||||
{
|
{
|
||||||
print '<td align="center" nowrap="nowrap">';
|
print '<td align="center" nowrap="nowrap">';
|
||||||
if ($datefin < time() && $objp->statut > 0)
|
print dol_print_date($datefin,'day');
|
||||||
{
|
if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate"));
|
||||||
print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print dol_print_date($datefin,'day');
|
|
||||||
}
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user