Fix: Les stats des types d'adhrents sans adhrents n'aparaissaient pas

L'adhsion se fait aprs validation adhrent
This commit is contained in:
Laurent Destailleur 2007-02-27 21:40:09 +00:00
parent 5d28e3ad48
commit 478a9eb5dc
3 changed files with 16 additions and 10 deletions

View File

@ -69,6 +69,7 @@ if ($_POST["action"] == 'confirm_sendinfo' && $_POST["confirm"] == 'yes')
}
}
/*
if ($_POST["action"] == 'cotisation')
{
$adh->id = $rowid;
@ -137,6 +138,7 @@ if ($_POST["action"] == 'cotisation')
}
}
}
*/
if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"])
{
@ -376,7 +378,8 @@ if ($_POST["action"] == 'add')
{
$db->rollback();
$message='<div class="error">'.$adh->error.'</div>';
if ($adh->error) $errmsg=$adh->error;
else $errmsg=$adh->errors[0];
$action = 'create';
}
@ -786,6 +789,7 @@ if ($action == 'create')
print "</table>\n";
print '<br>';
/*
// Boite cotisations
print '<table class="border" width="100%">';
print "<tr><td>".$langs->trans("DateSubscription")."</td><td>\n";
@ -812,7 +816,8 @@ if ($action == 'create')
print "</table>\n";
print '<br>';
*/
print '<center><input type="submit" class="button" value="'.$langs->trans("AddMember").'"></center>';
print "</form>\n";

View File

@ -67,10 +67,11 @@ $AdherentType=array();
$Cotisants=array();
# Liste les adherents
$sql = "SELECT count(*) as somme , t.rowid, t.libelle, t.cotisation, d.statut";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
$sql .= " WHERE d.fk_adherent_type = t.rowid";
$sql .= " GROUP BY t.rowid, t.libelle, t.cotisation, d.statut";
$sql = "SELECT t.rowid, t.libelle, t.cotisation,";
$sql.= " d.statut, count(d.rowid) as somme";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."adherent as d ON t.rowid = d.fk_adherent_type";
$sql.= " GROUP BY t.rowid, t.libelle, t.cotisation, d.statut";
$result = $db->query($sql);
if ($result)
@ -134,10 +135,10 @@ foreach ($AdherentType as $key => $adhtype)
$var=!$var;
print "<tr $bc[$var]>";
print '<td><a href="type.php?rowid='.$adhtype->id.'">'.img_object($langs->trans("ShowType"),"group").' '.$adhtype->libelle.'</a></td>';
print '<td align="right">'.(isset($AdherentsAValider[$key])?$AdherentsAValider[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).'</td>';
print '<td align="right">'.(isset($AdherentsAValider[$key]) && $AdherentsAValider[$key] > 0?$AdherentsAValider[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).'</td>';
print '<td align="right">'.(isset($Adherents[$key]) && ($Adherents[$key]-$Cotisants[$key] > 0) ? $Adherents[$key]-$Cotisants[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).'</td>';
print '<td align="right">'.(isset($Cotisants[$key])?$Cotisants[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,mktime(),3).'</td>';
print '<td align="right">'.(isset($AdherentsResilies[$key])?$AdherentsResilies[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).'</td>';
print '<td align="right">'.(isset($Cotisants[$key]) && $Cotisants[$key] > 0 ? $Cotisants[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,mktime(),3).'</td>';
print '<td align="right">'.(isset($AdherentsResilies[$key]) && $AdherentsResilies[$key]> 0 ?$AdherentsResilies[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).'</td>';
print "</tr>\n";
$SommeA+=isset($AdherentsAValider[$key])?$AdherentsAValider[$key]:0;
$SommeB+=isset($Adherents[$key])?$Adherents[$key]-$Cotisants[$key]:0;

View File

@ -179,7 +179,7 @@ if ($result)
print '<td align="center">';
if ($objp->datefin < time() && $objp->statut > 0)
{
print dolibarr_print_date($objp->datefin)." - ".$langs->trans("SubscriptionLate")." ".img_warning();
print dolibarr_print_date($objp->datefin)." ".img_warning($langs->trans("SubscriptionLate"));
}
else
{