TaskStats
class TaskStats extends Stats (View source)
Class to manage statistics on project tasks
Properties
| protected DoliDB | $db | from Stats | |
| protected array<string, int> | $lastfetchdate | from Stats | |
| string | $cachefilesuffix | from Stats | |
| string | $from | from Stats | |
| string | $where | from Stats | |
| string | $from_line | from Stats | |
| string | $field_date | from Stats | |
| string | $field | from Stats | |
| string | $field_line | from Stats | |
| string | $error | from Stats | |
| int | $year | from Stats | |
| int | $month | from Stats | |
| int | $userid | ||
| int | $socid | ||
| int | $priority |
Methods
Return Task number by month for a year
Return nb of elements by month for several years
Return the Task amount by month for a year
Return amount of elements by month for several years.
Return average of entity by month
Return average of entity by month for several years
Return count, and sum of products
Renvoie le nombre de documents par mois pour une annee donnee Return number of documents per month for a given year
Return the amount per month for a given year
Return the amount average par month for a given year
Return number or total of product refs
Returns the summed amounts per year for a given number of past years ending now
Return nb, amount of predefined product for year
Return all tasks grouped by status.
Return count, and sum of products
Build the where part
Details
array<int<0, 11>, array{0: int<1, 12>, 1: int}>
getNbByMonth(int $year, int $format = 0)
Return Task number by month for a year
in
Stats at line 106
array<int<0, 11>, array{0: int<1, 12>, 1: int}>
getNbByMonthWithPrevYear(int $endyear, int $startyear, int $cachedelay = 0, int $format = 0, int $startmonth = 1)
Return nb of elements by month for several years
array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAmountByMonth(int $year, int $format = 0)
Return the Task amount by month for a year
in
Stats at line 208
array<int<0, 11>, array<string|int|float>>
getAmountByMonthWithPrevYear(int $endyear, int $startyear, int $cachedelay = 0, int $format = 0, int $startmonth = 1)
Return amount of elements by month for several years.
Criteria 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.
protected array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAverageByMonth(int $year)
Return average of entity by month
in
Stats at line 303
array<array<int|float>>
getAverageByMonthWithPrevYear(int $endyear, int $startyear)
Return average of entity by month for several years
in
Stats at line 338
array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAllByProductEntry(int $year, int $cachedelay = 0, int $limit = 10)
Return count, and sum of products
in
Stats at line 408
protected array<array{0: int, 1: int}>
_getNbByYear(string $sql)
Return nb of elements by year
in
Stats at line 437
protected
_getAllByYear(string $sql)
Return nb of elements, total amount and avg amount each year
in
Stats at line 494
protected array<int<0, 11>, array{0: int<1, 12>, 1: int}>
_getNbByMonth(int $year, string $sql, int<0, 2> $format = 0)
Renvoie le nombre de documents par mois pour une annee donnee Return number of documents per month for a given year
in
Stats at line 551
protected array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
_getAmountByMonth(int $year, string $sql, int<0, 2> $format = 0)
Return the amount per month for a given year
in
Stats at line 608
protected array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
_getAverageByMonth($year, string $sql, $format = 0)
Return the amount average par month for a given year
@param int $year Year
in
Stats at line 665
protected array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
_getAllByProduct($sql, int $limit = 10)
Return number or total of product refs
@param string $sql SQL
in
Stats at line 704
protected array<int, array{0: int, 1: int}>
_getAmountByYear($sql)
Returns the summed amounts per year for a given number of past years ending now
@param string $sql SQL
in
Stats at line 732
array<int<0, 11>, array{0: int<1, 12>, 1: int|float}>
getAllByProduct(int $year, $limit = 0)
Return nb, amount of predefined product for year
__construct(DoliDB $db)
Constructor of the class
array<int, array{0: int|string, 1: int}>|int<-1, -1>
getAllTaskByStatus(int $limit = 5)
Return all tasks grouped by status.
getAllByYear()
Return count, and sum of products
@return array<array{year:string,nb:string,nb_diff:float,total?:float,avg?:float,weighted?:float,total_diff?:float,avg_diff?:float,avg_weighted?:float}> Array of values
string
buildWhere()
Build the where part