This commit is contained in:
Sevan Nerse 2021-03-12 13:17:47 +03:00
parent a9532893a5
commit 035bd5beef

View File

@ -369,15 +369,17 @@ abstract class Report
public function getFormattedDate($date) public function getFormattedDate($date)
{ {
$formatted_date = null;
switch ($this->getSetting('period')) { switch ($this->getSetting('period')) {
case 'yearly': case 'yearly':
$financial_year = $this->getFinancialYear($this->year); $financial_year = $this->getFinancialYear($this->year);
if ($date->greaterThanOrEqualTo($financial_year->getStartDate()) && $date->lessThanOrEqualTo($financial_year->getEndDate())) { if ($date->greaterThanOrEqualTo($financial_year->getStartDate()) && $date->lessThanOrEqualTo($financial_year->getEndDate())) {
if (setting('localisation.financial_denote') == 'begins') { if (setting('localisation.financial_denote') == 'begins') {
$i = $financial_year->getStartDate()->copy()->format($this->getYearlyDateFormat()); $formatted_date = $financial_year->getStartDate()->copy()->format($this->getYearlyDateFormat());
} else { } else {
$i = $financial_year->getEndDate()->copy()->format($this->getYearlyDateFormat()); $formatted_date = $financial_year->getEndDate()->copy()->format($this->getYearlyDateFormat());
} }
} }
@ -392,18 +394,18 @@ abstract class Report
$start = $quarter->getStartDate()->format($this->getQuarterlyDateFormat($this->year)); $start = $quarter->getStartDate()->format($this->getQuarterlyDateFormat($this->year));
$end = $quarter->getEndDate()->format($this->getQuarterlyDateFormat($this->year)); $end = $quarter->getEndDate()->format($this->getQuarterlyDateFormat($this->year));
$formatted_date = $start . '-' . $end;
} }
$i = $start . '-' . $end;
break; break;
default: default:
$i = $date->copy()->format($this->getMonthlyDateFormat($this->year)); $formatted_date = $date->copy()->format($this->getMonthlyDateFormat($this->year));
break; break;
} }
return $i; return $formatted_date;
} }
public function getUrl($action = 'print') public function getUrl($action = 'print')