dolibarr  7.0.0-beta
Public Member Functions | List of all members
Stats Class Reference

Parent class of statistics class. More...

+ Inheritance diagram for Stats:

Public Member Functions

 getNbByMonthWithPrevYear ($endyear, $startyear, $cachedelay=0, $format=0)
 Return nb of elements by month for several years. More...
 
 getAmountByMonthWithPrevYear ($endyear, $startyear, $cachedelay=0, $format=0)
 Return amount of elements by month for several years. More...
 
 getAverageByMonthWithPrevYear ($endyear, $startyear)
 Return average of entity by month for several years. More...
 
 getAllByProductEntry ($year, $cachedelay=0)
 Return count, and sum of products. More...
 
 _getNbByYear ($sql)
 Return nb of elements by year. More...
 
 _getAllByYear ($sql)
 Return nb of elements, total amount and avg amount each year. More...
 
 _getNbByMonth ($year, $sql, $format=0)
 Renvoie le nombre de proposition par mois pour une annee donnee. More...
 
 _getAmountByMonth ($year, $sql, $format=0)
 Renvoie le nombre d'element par mois pour une annee donnee. More...
 
 _getAverageByMonth ($year, $sql, $format=0)
 Renvoie le montant moyen par mois pour une annee donnee. More...
 
 _getAllByProduct ($sql, $limit=10)
 Return number or total of product refs. More...
 

Detailed Description

Parent class of statistics class.

Definition at line 30 of file stats.class.php.

Member Function Documentation

Stats::_getAllByProduct (   $sql,
  $limit = 10 
)

Return number or total of product refs.

Parameters
string$sqlSQL
int$limitLimit
Returns
array

Definition at line 580 of file stats.class.php.

References $resql, dol_print_error(), and dol_syslog().

Referenced by FichinterStats\getAllByProduct(), CommandeStats\getAllByProduct(), FactureStats\getAllByProduct(), and PropaleStats\getAllByProduct().

Stats::_getAllByYear (   $sql)

Return nb of elements, total amount and avg amount each year.

Parameters
string$sqlSQL request
Returns
array Array with nb, total amount, average for each year

Definition at line 372 of file stats.class.php.

References $resql, dol_print_error(), dol_syslog(), and if.

Referenced by TaskStats\getAllByYear(), ProjectStats\getAllByYear(), DonationStats\getAllByYear(), ExpeditionStats\getAllByYear(), DeplacementStats\getAllByYear(), ExpenseReportStats\getAllByYear(), AdherentStats\getAllByYear(), FichinterStats\getAllByYear(), CommandeStats\getAllByYear(), FactureStats\getAllByYear(), and PropaleStats\getAllByYear().

Stats::_getAmountByMonth (   $year,
  $sql,
  $format = 0 
)

Renvoie le nombre d'element par mois pour une annee donnee.

Parameters
int$yearYear
string$sqlSQL
int$format0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
Returns
array

Definition at line 473 of file stats.class.php.

References $resql, dol_print_error(), and dol_syslog().

Referenced by DeplacementStats\getAmountByMonth(), AdherentStats\getAmountByMonth(), ExpenseReportStats\getAmountByMonth(), FichinterStats\getAmountByMonth(), FactureStats\getAmountByMonth(), CommandeStats\getAmountByMonth(), PropaleStats\getAmountByMonth(), ProjectStats\getAmountByMonth(), and ProjectStats\getWeightedAmountByMonth().

Stats::_getAverageByMonth (   $year,
  $sql,
  $format = 0 
)

Renvoie le montant moyen par mois pour une annee donnee.

Parameters
int$yearYear
string$sqlSQL
int$format0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
Returns
array

Definition at line 527 of file stats.class.php.

References $resql, dol_print_error(), and dol_syslog().

Referenced by DeplacementStats\getAverageByMonth(), AdherentStats\getAverageByMonth(), ExpenseReportStats\getAverageByMonth(), FichinterStats\getAverageByMonth(), CommandeStats\getAverageByMonth(), FactureStats\getAverageByMonth(), and PropaleStats\getAverageByMonth().

Stats::_getNbByMonth (   $year,
  $sql,
  $format = 0 
)

Renvoie le nombre de proposition par mois pour une annee donnee.

Parameters
int$yearYear
string$sqlSQL
int$format0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
Returns
array Array of nb each month

Definition at line 416 of file stats.class.php.

References $resql, dol_print_error(), and dol_syslog().

Referenced by DonationStats\getNbByMonth(), AdherentStats\getNbByMonth(), ExpeditionStats\getNbByMonth(), FichinterStats\getNbByMonth(), DeplacementStats\getNbByMonth(), FactureStats\getNbByMonth(), CommandeStats\getNbByMonth(), PropaleStats\getNbByMonth(), ExpenseReportStats\getNbByMonth(), TaskStats\getNbByMonth(), ProjectStats\getNbByMonth(), and ProjectStats\getTransformRateByMonth().

Stats::_getNbByYear (   $sql)
Stats::getAllByProductEntry (   $year,
  $cachedelay = 0 
)

Return count, and sum of products.

Parameters
int$yearYear
int$cachedelayDelay we accept for cache file (0=No read, no save of cache, -1=No read but save)
Returns
array Array of values

Definition at line 267 of file stats.class.php.

References dol_filemtime(), dol_is_dir(), dol_mkdir(), dol_now(), and dol_syslog().

Stats::getAmountByMonthWithPrevYear (   $endyear,
  $startyear,
  $cachedelay = 0,
  $format = 0 
)

Return amount of elements by month for several years.

Criterias used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php The caller of class can add more filters into sql request by adding criteris into the $stats->where property just after calling constructor.

Parameters
int$endyearStart year
int$startyearEnd year
int$cachedelayDelay we accept for cache file (0=No read, no save of cache, -1=No read but save)
int$format0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
Returns
array Array of values

Definition at line 139 of file stats.class.php.

References dol_filemtime(), dol_is_dir(), dol_mkdir(), dol_now(), and dol_syslog().

Stats::getAverageByMonthWithPrevYear (   $endyear,
  $startyear 
)

Return average of entity by month for several years.

Parameters
int$endyearStart year
int$startyearEnd year
Returns
array Array of values

Definition at line 231 of file stats.class.php.

Stats::getNbByMonthWithPrevYear (   $endyear,
  $startyear,
  $cachedelay = 0,
  $format = 0 
)

Return nb of elements by month for several years.

Parameters
int$endyearStart year
int$startyearEnd year
int$cachedelayDelay we accept for cache file (0=No read, no save of cache, -1=No read but save)
int$format0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
Returns
array Array of values

Definition at line 45 of file stats.class.php.

References dol_filemtime(), dol_is_dir(), dol_mkdir(), dol_now(), and dol_syslog().


The documentation for this class was generated from the following file: