Fix: Bad count of subscription to receive

This commit is contained in:
Laurent Destailleur
2011-01-15 02:39:31 +00:00
parent 15cad39815
commit 59fa268fd9
3 changed files with 10 additions and 20 deletions

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.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
* 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);
$now=dol_now();
llxHeader('',$langs->trans("Subscriptions"),'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
if ($rowid)
@@ -466,15 +468,8 @@ if ($rowid)
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
if ($adh->datefin)
{
if ($adh->datefin < time())
{
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');
}
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
}
else
{

View File

@@ -1870,7 +1870,7 @@ class Adherent extends CommonObject
{
global $conf;
$now=gmmktime();
$now=dol_now();
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.= " WHERE a.statut = 1";
$sql.= " AND a.entity = ".$conf->entity;
$sql.= " AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')";
$resql=$this->db->query($sql);
if ($resql)

View File

@@ -291,18 +291,12 @@ if ($resql)
print $adh->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print "</td>";
// Date fin cotisation
// End of subscription date
if ($datefin)
{
print '<td align="center" nowrap="nowrap">';
if ($datefin < time() && $objp->statut > 0)
{
print dol_print_date($datefin,'day')." ".img_warning($langs->trans("SubscriptionLate"));
}
else
{
print dol_print_date($datefin,'day');
}
print dol_print_date($datefin,'day');
if ($datefin < ($now - $conf->adherent->cotisation->warning_delay) && $objp->statut > 0) print " ".img_warning($langs->trans("SubscriptionLate"));
print '</td>';
}
else