M3 Integration fixes
This commit is contained in:
@@ -134,20 +134,21 @@ class ExecSummaryController extends Controller
|
||||
return null;
|
||||
}
|
||||
|
||||
$range = null;
|
||||
if ($period === 'custom') {
|
||||
return [(clone $from)->modify('first day of this month')->format('Ymd'), (clone $from)->modify('last day of this month')->format('Ymd')];
|
||||
$range = [(clone $from)->modify('first day of this month')->format('Ymd'), (clone $from)->modify('last day of this month')->format('Ymd')];
|
||||
} else {
|
||||
$to = self::monthDate($request->input('TOREPORTDATE'));
|
||||
if ($to !== null) {
|
||||
$range = match ($period) {
|
||||
'year', 'quarter' => [(clone $from)->modify('first day of January')->format('Ymd'), (clone $to)->modify('last day of December')->format('Ymd')],
|
||||
'monthly' => [(clone $from)->modify('first day of this month')->format('Ymd'), (clone $to)->modify('last day of this month')->format('Ymd')],
|
||||
default => null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
$to = self::monthDate($request->input('TOREPORTDATE'));
|
||||
if ($to === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return match ($period) {
|
||||
'year', 'quarter' => [(clone $from)->modify('first day of January')->format('Ymd'), (clone $to)->modify('last day of December')->format('Ymd')],
|
||||
'monthly' => [(clone $from)->modify('first day of this month')->format('Ymd'), (clone $to)->modify('last day of this month')->format('Ymd')],
|
||||
default => null,
|
||||
};
|
||||
return $range;
|
||||
}
|
||||
|
||||
private static function monthDate(mixed $value): ?\DateTime
|
||||
|
||||
Reference in New Issue
Block a user