Skip to content

Commit

Permalink
#34 [RecurringInvoice] fix: fatal on recurring invoice stats
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Nov 3, 2022
1 parent a2a4400 commit b3a1a5e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions class/dolisirhstats.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public function getAverageByMonthWithPrevYear(int $endyear, int $startyear, int
* @return array
* @throws Exception
*/
protected function getNbByYear(string $sql): array
protected function _getNbByYear(string $sql): array
{
// phpcs:enable
$result = array();
Expand Down Expand Up @@ -362,7 +362,7 @@ protected function getNbByYear(string $sql): array
* @return array Array with nb, total amount, average for each year
* @throws Exception
*/
protected function getAllByYear(string $sql): array
protected function _getAllByYear(string $sql): array
{
// phpcs:enable
$result = array();
Expand Down Expand Up @@ -411,7 +411,7 @@ protected function getAllByYear(string $sql): array
* @return array Array of nb each month
* @throws Exception
*/
protected function getNbByMonth(string $sql, int $format = 0): array
protected function _getNbByMonth(string $sql, int $format = 0): array
{
// phpcs:enable
global $langs;
Expand Down Expand Up @@ -464,7 +464,7 @@ protected function getNbByMonth(string $sql, int $format = 0): array
* @return array Array of amount each month
* @throws Exception
*/
protected function getAmountByMonth(string $sql, int $format = 0): array
protected function _getAmountByMonth(string $sql, int $format = 0): array
{
// phpcs:enable
global $langs;
Expand Down Expand Up @@ -518,7 +518,7 @@ protected function getAmountByMonth(string $sql, int $format = 0): array
* @return array
* @throws Exception
*/
protected function getAverageByMonth(string $sql, int $format = 0): array
protected function _getAverageByMonth(string $sql, int $format = 0): array
{
// phpcs:enable
global $langs;
Expand Down Expand Up @@ -569,7 +569,7 @@ protected function getAverageByMonth(string $sql, int $format = 0): array
* @param string $sql SQL
* @return array
*/
protected function getAmountByYear(string $sql): array
protected function _getAmountByYear(string $sql): array
{
$result = array();
$resql = $this->db->query($sql);
Expand Down
8 changes: 4 additions & 4 deletions class/facturerecstats.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function getNbByYear(): array
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');

return $this->getNbByYear($sql);
return $this->_getNbByYear($sql);
}


Expand Down Expand Up @@ -254,7 +254,7 @@ public function getAverageByMonth(int $year, int $format = 0): array
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');

return $this->getAverageByMonth($sql, $format);
return $this->_getAverageByMonth($sql, $format);
}

/**
Expand All @@ -277,7 +277,7 @@ public function getAllByYear(): array
$sql .= " GROUP BY year";
$sql .= $this->db->order('year', 'DESC');

return $this->getAllByYear($sql);
return $this->_getAllByYear($sql);
}

/**
Expand All @@ -303,6 +303,6 @@ public function getAmountByYear(int $numberYears): array
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'ASC');

return $this->getAmountByYear($sql);
return $this->_getAmountByYear($sql);
}
}
2 changes: 1 addition & 1 deletion core/modules/modDolisirh.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function __construct($db)

// Dependencies
$this->hidden = false;
$this->depends = array('modProjet', 'modBookmark', 'modHoliday', 'modFckeditor', 'modSalaries', 'modProduct', 'modService', 'modSociete', 'modECM');
$this->depends = array('modProjet', 'modBookmark', 'modHoliday', 'modFckeditor', 'modSalaries', 'modProduct', 'modService', 'modSociete', 'modECM', 'modCategorie');
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
$this->langfiles = array("dolisirh@dolisirh");
Expand Down

0 comments on commit b3a1a5e

Please sign in to comment.