mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-13 16:00:13 +00:00
Fix nulls.
This commit is contained in:
@@ -74,8 +74,8 @@ class BudgetLimitEnrichment implements EnrichmentInterface
|
|||||||
|
|
||||||
private function collectIds(): void
|
private function collectIds(): void
|
||||||
{
|
{
|
||||||
$this->start = $this->collection->min('start_date');
|
$this->start = $this->collection->min('start_date') ?? Carbon::now()->startOfMonth();
|
||||||
$this->end = $this->collection->max('end_date');
|
$this->end = $this->collection->max('end_date') ?? Carbon::now()->endOfMonth();
|
||||||
|
|
||||||
/** @var BudgetLimit $limit */
|
/** @var BudgetLimit $limit */
|
||||||
foreach ($this->collection as $limit) {
|
foreach ($this->collection as $limit) {
|
||||||
|
@@ -79,8 +79,11 @@ class CategoryTransformer extends AbstractTransformer
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function beautify(array $array): array
|
private function beautify(?array $array): ?array
|
||||||
{
|
{
|
||||||
|
if(null === $array) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
$return = [];
|
$return = [];
|
||||||
foreach ($array as $data) {
|
foreach ($array as $data) {
|
||||||
$data['sum'] = Steam::bcround($data['sum'], (int)$data['currency_decimal_places']);
|
$data['sum'] = Steam::bcround($data['sum'], (int)$data['currency_decimal_places']);
|
||||||
|
Reference in New Issue
Block a user