dolibarr 21.0.0-alpha
|
Parent class of statistics class. More...
Public Member Functions | |
getNbByMonthWithPrevYear ($endyear, $startyear, $cachedelay=0, $format=0, $startmonth=1) | |
Return nb of elements by month for several years. | |
getAmountByMonthWithPrevYear ($endyear, $startyear, $cachedelay=0, $format=0, $startmonth=1) | |
Return amount of elements by month for several years. | |
getAverageByMonthWithPrevYear ($endyear, $startyear) | |
Return average of entity by month for several years. | |
getAllByProductEntry ($year, $cachedelay=0, $limit=10) | |
Return count, and sum of products. | |
getAllByProduct ($year, $limit=0) | |
Return nb, amount of predefined product for year. | |
Protected Member Functions | |
getNbByMonth ($year, $format=0) | |
getAmountByMonth ($year, $format=0) | |
getAverageByMonth ($year) | |
_getNbByYear ($sql) | |
Return nb of elements by year. | |
_getAllByYear ($sql) | |
Return nb of elements, total amount and avg amount each year. | |
_getNbByMonth ($year, $sql, $format=0) | |
Renvoie le nombre de documents par mois pour une annee donnee Return number of documents per month for a given year. | |
_getAmountByMonth ($year, $sql, $format=0) | |
Return the amount per month for a given year. | |
_getAverageByMonth ($year, $sql, $format=0) | |
Return the amount average par month for a given year. | |
_getAllByProduct ($sql, $limit=10) | |
Return number or total of product refs. | |
_getAmountByYear ($sql) | |
Returns the summed amounts per year for a given number of past years ending now. | |
Parent class of statistics class.
Definition at line 32 of file stats.class.php.
|
protected |
Return number or total of product refs.
string | $sql | SQL |
int | $limit | Limit |
Definition at line 665 of file stats.class.php.
References dol_print_error(), and dol_syslog().
Referenced by CommandeStats\getAllByProduct(), FactureStats\getAllByProduct(), FichinterStats\getAllByProduct(), and PropaleStats\getAllByProduct().
|
protected |
Return nb of elements, total amount and avg amount each year.
string | $sql | SQL request |
Definition at line 437 of file stats.class.php.
References dol_print_error(), and dol_syslog().
Referenced by AdherentStats\getAllByYear(), CommandeStats\getAllByYear(), DeplacementStats\getAllByYear(), DonationStats\getAllByYear(), ExpeditionStats\getAllByYear(), ExpenseReportStats\getAllByYear(), FactureStats\getAllByYear(), FichinterStats\getAllByYear(), ProjectStats\getAllByYear(), PropaleStats\getAllByYear(), ReceptionStats\getAllByYear(), SalariesStats\getAllByYear(), TaskStats\getAllByYear(), and TicketStats\getAllByYear().
|
protected |
Return the amount per month for a given year.
int | $year | Year |
string | $sql | SQL |
int<0,2> | $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month |
Definition at line 551 of file stats.class.php.
References dol_print_error(), and dol_syslog().
Referenced by AdherentStats\getAmountByMonth(), CommandeStats\getAmountByMonth(), DeplacementStats\getAmountByMonth(), DonationStats\getAmountByMonth(), ExpeditionStats\getAmountByMonth(), ExpenseReportStats\getAmountByMonth(), FactureStats\getAmountByMonth(), FichinterStats\getAmountByMonth(), ProjectStats\getAmountByMonth(), PropaleStats\getAmountByMonth(), ReceptionStats\getAmountByMonth(), SalariesStats\getAmountByMonth(), TicketStats\getAmountByMonth(), and ProjectStats\getWeightedAmountByMonth().
|
protected |
Returns the summed amounts per year for a given number of past years ending now.
string | $sql | SQL |
Definition at line 704 of file stats.class.php.
Referenced by FactureStats\getAmountByYear().
|
protected |
Return the amount average par month for a given year.
int | $year | Year |
string | $sql | SQL |
int<0,2> | $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month |
Definition at line 608 of file stats.class.php.
References dol_print_error(), and dol_syslog().
Referenced by AdherentStats\getAverageByMonth(), CommandeStats\getAverageByMonth(), DeplacementStats\getAverageByMonth(), DonationStats\getAverageByMonth(), ExpeditionStats\getAverageByMonth(), ExpenseReportStats\getAverageByMonth(), FactureStats\getAverageByMonth(), FichinterStats\getAverageByMonth(), ProjectStats\getAverageByMonth(), PropaleStats\getAverageByMonth(), ReceptionStats\getAverageByMonth(), SalariesStats\getAverageByMonth(), TaskStats\getAverageByMonth(), and TicketStats\getAverageByMonth().
|
protected |
Renvoie le nombre de documents par mois pour une annee donnee Return number of documents per month for a given year.
int | $year | Year |
string | $sql | SQL |
int<0,2> | $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month |
Definition at line 494 of file stats.class.php.
References dol_print_error(), and dol_syslog().
Referenced by AdherentStats\getNbByMonth(), CommandeStats\getNbByMonth(), DeplacementStats\getNbByMonth(), DonationStats\getNbByMonth(), ExpeditionStats\getNbByMonth(), ExpenseReportStats\getNbByMonth(), FactureStats\getNbByMonth(), FichinterStats\getNbByMonth(), ProjectStats\getNbByMonth(), PropaleStats\getNbByMonth(), ReceptionStats\getNbByMonth(), SalariesStats\getNbByMonth(), TaskStats\getNbByMonth(), TicketStats\getNbByMonth(), and ProjectStats\getTransformRateByMonth().
|
protected |
Return nb of elements by year.
string | $sql | SQL request |
Definition at line 408 of file stats.class.php.
References dol_print_error(), and dol_syslog().
Referenced by AdherentStats\getNbByYear(), CommandeStats\getNbByYear(), DeplacementStats\getNbByYear(), DonationStats\getNbByYear(), ExpeditionStats\getNbByYear(), ExpenseReportStats\getNbByYear(), FactureStats\getNbByYear(), FichinterStats\getNbByYear(), PropaleStats\getNbByYear(), ReceptionStats\getNbByYear(), SalariesStats\getNbByYear(), and TicketStats\getNbByYear().
Stats::getAllByProduct | ( | $year, | |
$limit = 0 ) |
Return nb, amount of predefined product for year.
int | $year | Year to scan |
int | $limit | Limit |
Reimplemented in CommandeStats, FactureStats, FichinterStats, and PropaleStats.
Definition at line 732 of file stats.class.php.
References dol_syslog().
Referenced by getAllByProductEntry().
Stats::getAllByProductEntry | ( | $year, | |
$cachedelay = 0, | |||
$limit = 10 ) |
Return count, and sum of products.
int | $year | Year |
int | $cachedelay | Delay we accept for cache file (0=No read, no save of cache, -1=No read but save) |
int | $limit | Limit |
Definition at line 338 of file stats.class.php.
References dol_filemtime(), dol_is_dir(), dol_mkdir(), dol_now(), dol_syslog(), dolChmod(), and getAllByProduct().
|
abstractprotected |
int | $year | year number |
int | $format | 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month |
Reimplemented in AdherentStats, CommandeStats, DeplacementStats, DonationStats, ExpeditionStats, ExpenseReportStats, FactureStats, FichinterStats, ProjectStats, PropaleStats, ReceptionStats, SalariesStats, TaskStats, and TicketStats.
Referenced by getAmountByMonthWithPrevYear().
Stats::getAmountByMonthWithPrevYear | ( | $endyear, | |
$startyear, | |||
$cachedelay = 0, | |||
$format = 0, | |||
$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.
int | $endyear | Start year |
int | $startyear | End year |
int | $cachedelay | Delay we accept for cache file (0=No read, no save of cache, -1=No read but save) |
int | $format | 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month |
int | $startmonth | month of the fiscal year start min 1 max 12 ; if 1 = january |
Definition at line 208 of file stats.class.php.
References dol_filemtime(), dol_is_dir(), dol_mkdir(), dol_now(), dol_syslog(), dolChmod(), and getAmountByMonth().
|
abstractprotected |
int | $year | year number |
Reimplemented in AdherentStats, CommandeStats, DeplacementStats, DonationStats, ExpeditionStats, ExpenseReportStats, FactureStats, FichinterStats, ProjectStats, PropaleStats, ReceptionStats, SalariesStats, TaskStats, and TicketStats.
Referenced by getAverageByMonthWithPrevYear().
Stats::getAverageByMonthWithPrevYear | ( | $endyear, | |
$startyear ) |
Return average of entity by month for several years.
int | $endyear | Start year |
int | $startyear | End year |
Definition at line 303 of file stats.class.php.
References getAverageByMonth().
|
abstractprotected |
int | $year | number |
int | $format | 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month |
Reimplemented in AdherentStats, CommandeStats, DeplacementStats, DonationStats, ExpeditionStats, ExpenseReportStats, FactureStats, FichinterStats, ProjectStats, PropaleStats, ReceptionStats, SalariesStats, TaskStats, and TicketStats.
Referenced by getNbByMonthWithPrevYear().
Stats::getNbByMonthWithPrevYear | ( | $endyear, | |
$startyear, | |||
$cachedelay = 0, | |||
$format = 0, | |||
$startmonth = 1 ) |
Return nb of elements by month for several years.
int | $endyear | Start year |
int | $startyear | End year |
int | $cachedelay | Delay we accept for cache file (0=No read, no save of cache, -1=No read but save) |
int | $format | 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month |
int | $startmonth | month of the fiscal year start min 1 max 12 ; if 1 = january |
Definition at line 106 of file stats.class.php.
References dol_filemtime(), dol_is_dir(), dol_mkdir(), dol_now(), dol_syslog(), dolChmod(), and getNbByMonth().