diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 13f894d078a..2709d08d4be 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -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='
'.$adh->error.'
'; + if ($adh->error) $errmsg=$adh->error; + else $errmsg=$adh->errors[0]; $action = 'create'; } @@ -786,6 +789,7 @@ if ($action == 'create') print "\n"; print '
'; +/* // Boite cotisations print ''; print "
".$langs->trans("DateSubscription")."\n"; @@ -812,7 +816,8 @@ if ($action == 'create') print "
\n"; print '
'; - +*/ + print '
'; print "\n"; diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 85e8bf12bd9..9e9d48e3d2f 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -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 ""; print ''.img_object($langs->trans("ShowType"),"group").' '.$adhtype->libelle.''; - print ''.(isset($AdherentsAValider[$key])?$AdherentsAValider[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).''; + print ''.(isset($AdherentsAValider[$key]) && $AdherentsAValider[$key] > 0?$AdherentsAValider[$key]:'').' '.$staticmember->LibStatut(-1,$adhtype->cotisation,0,3).''; print ''.(isset($Adherents[$key]) && ($Adherents[$key]-$Cotisants[$key] > 0) ? $Adherents[$key]-$Cotisants[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,0,3).''; - print ''.(isset($Cotisants[$key])?$Cotisants[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,mktime(),3).''; - print ''.(isset($AdherentsResilies[$key])?$AdherentsResilies[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).''; + print ''.(isset($Cotisants[$key]) && $Cotisants[$key] > 0 ? $Cotisants[$key]:'').' '.$staticmember->LibStatut(1,$adhtype->cotisation,mktime(),3).''; + print ''.(isset($AdherentsResilies[$key]) && $AdherentsResilies[$key]> 0 ?$AdherentsResilies[$key]:'').' '.$staticmember->LibStatut(0,$adhtype->cotisation,0,3).''; print "\n"; $SommeA+=isset($AdherentsAValider[$key])?$AdherentsAValider[$key]:0; $SommeB+=isset($Adherents[$key])?$Adherents[$key]-$Cotisants[$key]:0; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index f8ce3256eee..3051f8ee3f0 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -179,7 +179,7 @@ if ($result) print ''; 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 {