New: Can add tabs on statistics views.
This commit is contained in:
parent
ca727ca18e
commit
cfaf1f0813
@ -66,6 +66,7 @@ For developers:
|
|||||||
- New: Removed artichow deprecated libraries.
|
- New: Removed artichow deprecated libraries.
|
||||||
- New: A page can force reload of css style sheet
|
- New: A page can force reload of css style sheet
|
||||||
- New: A module can add import description for import wizard, even for tables with foreign keys.
|
- New: A module can add import description for import wizard, even for tables with foreign keys.
|
||||||
|
- New: Can add tabs on statistics views.
|
||||||
- Qual: Add a lot of more PHPUnit tests.
|
- Qual: Add a lot of more PHPUnit tests.
|
||||||
- Qual: Data structure for supplier prices is simpler.
|
- Qual: Data structure for supplier prices is simpler.
|
||||||
- Qual: Removed no more used external libraries.
|
- Qual: Removed no more used external libraries.
|
||||||
|
|||||||
@ -216,6 +216,8 @@ $head[$h][1] = $langs->trans("ByMonthYear");
|
|||||||
$head[$h][2] = 'byyear';
|
$head[$h][2] = 'byyear';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
complete_head_from_modules($conf,$langs,$object,$head,$h,'propal_stats');
|
||||||
|
|
||||||
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -225,13 +225,19 @@ foreach($data as $val) {
|
|||||||
}
|
}
|
||||||
if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
||||||
|
|
||||||
|
|
||||||
$h=0;
|
$h=0;
|
||||||
$head = array();
|
$head = array();
|
||||||
$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php';
|
$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php?mode='.$mode;
|
||||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||||
$head[$h][2] = 'byyear';
|
$head[$h][2] = 'byyear';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
if ($mode == 'customer') $type='order_stats';
|
||||||
|
if ($mode == 'supplier') $type='supplier_order_stats';
|
||||||
|
|
||||||
|
complete_head_from_modules($conf,$langs,$object,$head,$h,$type);
|
||||||
|
|
||||||
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
||||||
|
|
||||||
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
||||||
|
|||||||
@ -196,11 +196,13 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
|||||||
|
|
||||||
$h=0;
|
$h=0;
|
||||||
$head = array();
|
$head = array();
|
||||||
$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php';
|
$head[$h][0] = DOL_URL_ROOT . '/compta/deplacement/stats/index.php';
|
||||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||||
$head[$h][2] = 'byyear';
|
$head[$h][2] = 'byyear';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
complete_head_from_modules($conf,$langs,$object,$head,$h,'trip_stats');
|
||||||
|
|
||||||
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
||||||
|
|
||||||
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
||||||
|
|||||||
@ -207,11 +207,16 @@ if (! count($arrayyears)) $arrayyears[$nowyear]=$nowyear;
|
|||||||
|
|
||||||
$h=0;
|
$h=0;
|
||||||
$head = array();
|
$head = array();
|
||||||
$head[$h][0] = DOL_URL_ROOT . '/commande/stats/index.php';
|
$head[$h][0] = DOL_URL_ROOT . '/compta/facture/stats/index.php?mode='.$mode;
|
||||||
$head[$h][1] = $langs->trans("ByMonthYear");
|
$head[$h][1] = $langs->trans("ByMonthYear");
|
||||||
$head[$h][2] = 'byyear';
|
$head[$h][2] = 'byyear';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
if ($mode == 'customer') $type='invoice_stats';
|
||||||
|
if ($mode == 'supplier') $type='supplier_invoice_stats';
|
||||||
|
|
||||||
|
complete_head_from_modules($conf,$langs,$object,$head,$h,$type);
|
||||||
|
|
||||||
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
dol_fiche_head($head,'byyear',$langs->trans("Statistics"));
|
||||||
|
|
||||||
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
print '<table class="notopnoleftnopadd" width="100%"><tr>';
|
||||||
|
|||||||
@ -26,7 +26,7 @@ require('../../main.inc.php');
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/report.lib.php");
|
require_once(DOL_DOCUMENT_ROOT."/core/lib/report.lib.php");
|
||||||
|
|
||||||
|
|
||||||
$year_start=isset($_GET["year_start"])?$_GET["year_start"]:$_POST["year_start"];
|
$year_start=GETPOST("year_start");
|
||||||
$year_current = strftime("%Y",time());
|
$year_current = strftime("%Y",time());
|
||||||
$nbofyear=4;
|
$nbofyear=4;
|
||||||
if (! $year_start) {
|
if (! $year_start) {
|
||||||
|
|||||||
@ -37,15 +37,17 @@ llxHeader();
|
|||||||
|
|
||||||
print_fiche_titre($langs->trans("StatisticsOfSendings"), $mesg);
|
print_fiche_titre($langs->trans("StatisticsOfSendings"), $mesg);
|
||||||
|
|
||||||
|
// TODO USe code similar to commande/stats/index.php instead of this one.
|
||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
print '<tr><td align="center">'.$langs->trans("Year").'</td>';
|
print '<tr><td align="center">'.$langs->trans("Year").'</td>';
|
||||||
print '<td width="40%" align="center">'.$langs->trans("NbOfSendings").'</td></tr>';
|
print '<td width="40%" align="center">'.$langs->trans("NbOfSendings").'</td></tr>';
|
||||||
|
|
||||||
$sql = "SELECT count(*), date_format(date_expedition,'%Y') as dm";
|
$sql = "SELECT count(*) as nb, date_format(date_expedition,'%Y') as dm";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."expedition";
|
$sql.= " FROM ".MAIN_DB_PREFIX."expedition";
|
||||||
$sql.= " WHERE fk_statut > 0";
|
$sql.= " WHERE fk_statut > 0";
|
||||||
$sql.= " AND entity = ".$conf->entity;
|
$sql.= " AND entity = ".$conf->entity;
|
||||||
$sql.= " GROUP BY dm DESC ";
|
$sql.= " GROUP BY dm DESC";
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -62,7 +64,7 @@ if ($resql)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$db->free();
|
$db->free($resql);
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user