mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-10 19:41:26 +01:00
New: Add statistics report for supplier invoices
This commit is contained in:
@@ -6,6 +6,8 @@ For users:
|
|||||||
- Support bookmark add of product cards.
|
- Support bookmark add of product cards.
|
||||||
- New view in ecm module.
|
- New view in ecm module.
|
||||||
- Look enhancements for graphics (add transparency).
|
- Look enhancements for graphics (add transparency).
|
||||||
|
- Added statistics report for supplier invoices
|
||||||
|
- Added average amount in invoices statistics reports.
|
||||||
|
|
||||||
For translators:
|
For translators:
|
||||||
- The errors language file contains only error or warning messages with
|
- The errors language file contains only error or warning messages with
|
||||||
|
|||||||
@@ -160,9 +160,7 @@ $oldyear=0;
|
|||||||
foreach ($data as $val)
|
foreach ($data as $val)
|
||||||
{
|
{
|
||||||
$year = $val['year'];
|
$year = $val['year'];
|
||||||
$nbproduct = $val['nb'];
|
print $avg;
|
||||||
$total = price($val['total']);
|
|
||||||
$avg = price($val['avg']);
|
|
||||||
while ($oldyear > $year+1)
|
while ($oldyear > $year+1)
|
||||||
{ // If we have empty year
|
{ // If we have empty year
|
||||||
$oldyear--;
|
$oldyear--;
|
||||||
@@ -175,9 +173,9 @@ foreach ($data as $val)
|
|||||||
}
|
}
|
||||||
print '<tr height="24">';
|
print '<tr height="24">';
|
||||||
print '<td align="center"><a href="month.php?year='.$year.'&mode='.$mode.'">'.$year.'</a></td>';
|
print '<td align="center"><a href="month.php?year='.$year.'&mode='.$mode.'">'.$year.'</a></td>';
|
||||||
print '<td align="right">'.$nbproduct.'</td>';
|
print '<td align="right">'.$val['nb'].'</td>';
|
||||||
print '<td align="right">'.$total.'</td>';
|
print '<td align="right">'.price(price2num($val['total'],'MT'),1).'</td>';
|
||||||
print '<td align="right">'.$avg.'</td>';
|
print '<td align="right">'.price(price2num($val['avg'],'MT'),1).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$oldyear=$year;
|
$oldyear=$year;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1994,7 +1994,7 @@ function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=2)
|
|||||||
// Output separators by default (french)
|
// Output separators by default (french)
|
||||||
$dec=','; $thousand=' ';
|
$dec=','; $thousand=' ';
|
||||||
|
|
||||||
// Si $outlangs non force, on prend langue utilisateur
|
// If $outlangs not forced, we use use language
|
||||||
if (! is_object($outlangs)) $outlangs=$langs;
|
if (! is_object($outlangs)) $outlangs=$langs;
|
||||||
|
|
||||||
if ($outlangs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$outlangs->trans("SeparatorDecimal");
|
if ($outlangs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$outlangs->trans("SeparatorDecimal");
|
||||||
@@ -2010,7 +2010,7 @@ function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=2)
|
|||||||
//print "decpart=".$decpart."<br>";
|
//print "decpart=".$decpart."<br>";
|
||||||
$end='';
|
$end='';
|
||||||
|
|
||||||
// On augmente nbdecimal au besoin si il y a plus de decimales que nbdecimal
|
// We increase nbdecimal if there is more decimal than asked (to not loose information)
|
||||||
if (strlen($decpart) > $nbdecimal) $nbdecimal=strlen($decpart);
|
if (strlen($decpart) > $nbdecimal) $nbdecimal=strlen($decpart);
|
||||||
// Si on depasse max
|
// Si on depasse max
|
||||||
if ($trunc && $nbdecimal > $conf->global->MAIN_MAX_DECIMALS_SHOWN)
|
if ($trunc && $nbdecimal > $conf->global->MAIN_MAX_DECIMALS_SHOWN)
|
||||||
@@ -2023,7 +2023,7 @@ function price($amount, $html=0, $outlangs='', $trunc=1, $rounding=2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Formate nombre
|
// Format number
|
||||||
if ($html)
|
if ($html)
|
||||||
{
|
{
|
||||||
$output=ereg_replace(' ',' ',number_format($amount, $nbdecimal, $dec, $thousand));
|
$output=ereg_replace(' ',' ',number_format($amount, $nbdecimal, $dec, $thousand));
|
||||||
|
|||||||
Reference in New Issue
Block a user