diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php
index 164606431ff..6ba88e7771b 100644
--- a/htdocs/adherents/stats/byproperties.php
+++ b/htdocs/adherents/stats/byproperties.php
@@ -58,15 +58,16 @@ llxHeader('', $langs->trans("MembersStatisticsByProperties"), '', '', 0, 0, arra
$title=$langs->trans("MembersStatisticsByProperties");
-print load_fiche_titre($title, $mesg);
+print load_fiche_titre($title, '');
dol_mkdir($dir);
$tab='byproperties';
$data = array();
-$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, d.morphy as code";
+$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, d.morphy as code";
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
+$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
$sql.=" AND d.statut = 1";
$sql.=" GROUP BY d.morphy";
@@ -87,7 +88,7 @@ if ($resql)
if ($obj->code == 'phy') $foundphy++;
if ($obj->code == 'mor') $foundmor++;
- $data[]=array('label'=>$obj->code, 'nb'=>$obj->nb, 'lastdate'=>$db->jdate($obj->lastdate));
+ $data[]=array('label'=>$obj->code, 'nb'=>$obj->nb, 'lastdate'=>$db->jdate($obj->lastdate), 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate));
$i++;
}
@@ -120,22 +121,21 @@ print '
';
print '';
print '| '.$langs->trans("Nature").' | ';
print ''.$langs->trans("NbOfMembers").' | ';
+print ''.$langs->trans("LastMemberDate").' | ';
print ''.$langs->trans("LatestSubscriptionDate").' | ';
print '
';
-if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'');
-if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>'');
+if (! $foundphy) $data[]=array('label'=>'phy','nb'=>'0','lastdate'=>'', 'lastsubscriptiondate'=>'');
+if (! $foundmor) $data[]=array('label'=>'mor','nb'=>'0','lastdate'=>'', 'lastsubscriptiondate'=>'');
-$oldyear=0;
foreach ($data as $val)
{
- $year = $val['year'];
print '';
print '| '.$memberstatic->getmorphylib($val['label']).' | ';
print ''.$val['nb'].' | ';
print ''.dol_print_date($val['lastdate'], 'dayhour').' | ';
+ print ''.dol_print_date($val['lastsubscriptiondate'], 'dayhour').' | ';
print '
';
- $oldyear=$year;
}
print '
';
diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index f5816f46aca..79aa5ab6a82 100644
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -77,8 +77,10 @@ if ($mode)
$tab='statscountry';
$data = array();
- $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label";
- $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
+ $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label";
+ $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
+ $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
+ $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
$sql.=" AND d.statut = 1";
$sql.=" GROUP BY c.label, c.code";
@@ -92,10 +94,12 @@ if ($mode)
$tab='statsstate';
$data = array();
- $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, co.code, co.label, c.nom as label2"; //
- $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
+ $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, c.nom as label2"; //
+ $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
+ $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
+ $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
$sql.=" AND d.statut = 1";
$sql.=" GROUP BY co.label, co.code, c.nom";
@@ -108,10 +112,12 @@ if ($mode)
$tab='statsregion'; //onglet
$data = array(); //tableau de donnée
- $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, co.code, co.label, r.nom as label2";
- $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
+ $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, co.code, co.label, r.nom as label2";
+ $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
+ $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
+ $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
$sql.=" AND d.statut = 1";
$sql.=" GROUP BY co.label, co.code, r.nom"; //+
@@ -124,9 +130,10 @@ if ($mode)
$tab='statstown';
$data = array();
- $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label, d.town as label2";
+ $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, MAX(s.dateadh) as lastsubscriptiondate, c.code, c.label, d.town as label2";
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
+ $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
$sql.=" WHERE d.entity IN (".getEntity('adherent').")";
$sql.=" AND d.statut = 1";
$sql.=" GROUP BY c.label, c.code, d.town";
@@ -154,7 +161,8 @@ if ($mode)
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'code'=>$obj->code,
'nb'=>$obj->nb,
- 'lastdate'=>$db->jdate($obj->lastdate)
+ 'lastdate'=>$db->jdate($obj->lastdate),
+ 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
);
}
if ($mode == 'memberbyregion') //+
@@ -164,7 +172,8 @@ if ($mode)
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
'nb'=>$obj->nb,
- 'lastdate'=>$db->jdate($obj->lastdate)
+ 'lastdate'=>$db->jdate($obj->lastdate),
+ 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
);
}
if ($mode == 'memberbystate')
@@ -173,7 +182,8 @@ if ($mode)
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
'nb'=>$obj->nb,
- 'lastdate'=>$db->jdate($obj->lastdate)
+ 'lastdate'=>$db->jdate($obj->lastdate),
+ 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
);
}
if ($mode == 'memberbytown')
@@ -182,7 +192,8 @@ if ($mode)
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code)!="Country".$obj->code)?$langsen->transnoentitiesnoconv("Country".$obj->code):($obj->label?$obj->label:$langs->trans("Unknown"))),
'label2'=>($obj->label2?$obj->label2:$langs->trans("Unknown")),
'nb'=>$obj->nb,
- 'lastdate'=>$db->jdate($obj->lastdate)
+ 'lastdate'=>$db->jdate($obj->lastdate),
+ 'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
);
}
@@ -289,9 +300,9 @@ if ($mode)
if ($label2) print ''.$label2.' | ';
print ''.$langs->trans("NbOfMembers").' | ';
print ''.$langs->trans("LastMemberDate").' | ';
+ print ''.$langs->trans("LatestSubscriptionDate").' | ';
print '';
- $oldyear=0;
foreach ($data as $val)
{
$year = $val['year'];
@@ -300,8 +311,8 @@ if ($mode)
if ($label2) print ''.$val['label2'].' | ';
print ''.$val['nb'].' | ';
print ''.dol_print_date($val['lastdate'], 'dayhour').' | ';
+ print ''.dol_print_date($val['lastsubscriptiondate'], 'dayhour').' | ';
print '';
- $oldyear=$year;
}
print '';
diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
index 72330e09b92..19c6d2b386c 100644
--- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
+++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql
@@ -58,6 +58,8 @@ CREATE TABLE llx_pos_cash_fence(
-- For 10.0
+DROP TABLE llx_cotisation;
+
ALTER TABLE llx_loan ADD COLUMN insurance_amount double(24,8) DEFAULT 0;
ALTER TABLE llx_facture DROP INDEX idx_facture_uk_facnumber;
diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang
index 53ac720d862..fb35cb5e112 100644
--- a/htdocs/langs/en_US/users.lang
+++ b/htdocs/langs/en_US/users.lang
@@ -109,4 +109,4 @@ UserLogoff=User logout
UserLogged=User logged
DateEmployment=Employment Start Date
DateEmploymentEnd=Employment End Date
-CantDisableYourself=You can disable your own user record
\ No newline at end of file
+CantDisableYourself=You can't disable your own user record
\ No newline at end of file