mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Fix #4169
This commit is contained in:
@@ -73,6 +73,7 @@ class BudgetController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Partial used in the budget report.
|
* Partial used in the budget report.
|
||||||
|
*
|
||||||
* @param Collection $accounts
|
* @param Collection $accounts
|
||||||
* @param Collection $budgets
|
* @param Collection $budgets
|
||||||
* @param Carbon $start
|
* @param Carbon $start
|
||||||
@@ -93,6 +94,7 @@ class BudgetController extends Controller
|
|||||||
|
|
||||||
$generator->accountPerBudget();
|
$generator->accountPerBudget();
|
||||||
$report = $generator->getReport();
|
$report = $generator->getReport();
|
||||||
|
|
||||||
return view('reports.budget.partials.account-per-budget', compact('report', 'budgets'));
|
return view('reports.budget.partials.account-per-budget', compact('report', 'budgets'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,8 +185,8 @@ class BudgetController extends Controller
|
|||||||
];
|
];
|
||||||
$result[$key]['transactions']++;
|
$result[$key]['transactions']++;
|
||||||
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
||||||
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']);
|
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string)$result[$key]['transactions']);
|
||||||
$result[$key]['avg_float'] = (float) $result[$key]['avg'];
|
$result[$key]['avg_float'] = (float)$result[$key]['avg'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -268,6 +270,7 @@ class BudgetController extends Controller
|
|||||||
$report[$budgetId]['currencies'][$currencyId]['sum_pct'] = $pct;
|
$report[$budgetId]['currencies'][$currencyId]['sum_pct'] = $pct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('reports.budget.partials.budgets', compact('sums', 'report'));
|
return view('reports.budget.partials.budgets', compact('sums', 'report'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +348,7 @@ class BudgetController extends Controller
|
|||||||
$report[$key]['entries'][$dateKey] = $report[$key] ['entries'][$dateKey] ?? '0';
|
$report[$key]['entries'][$dateKey] = $report[$key] ['entries'][$dateKey] ?? '0';
|
||||||
$report[$key]['entries'][$dateKey] = bcadd($journal['amount'], $report[$key] ['entries'][$dateKey]);
|
$report[$key]['entries'][$dateKey] = bcadd($journal['amount'], $report[$key] ['entries'][$dateKey]);
|
||||||
$report[$key]['sum'] = bcadd($report[$key] ['sum'], $journal['amount']);
|
$report[$key]['sum'] = bcadd($report[$key] ['sum'], $journal['amount']);
|
||||||
$report[$key]['avg'] = bcdiv($report[$key]['sum'], (string) count($periods));
|
$report[$key]['avg'] = bcdiv($report[$key]['sum'], (string)count($periods));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -380,9 +383,10 @@ class BudgetController extends Controller
|
|||||||
$result[] = [
|
$result[] = [
|
||||||
'description' => $journal['description'],
|
'description' => $journal['description'],
|
||||||
'transaction_group_id' => $journal['transaction_group_id'],
|
'transaction_group_id' => $journal['transaction_group_id'],
|
||||||
'amount_float' => (float) $journal['amount'],
|
'amount_float' => (float)$journal['amount'],
|
||||||
'amount' => $journal['amount'],
|
'amount' => $journal['amount'],
|
||||||
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
||||||
|
'date_sort' => $journal['date']->format('Y-m-d'),
|
||||||
'destination_account_name' => $journal['destination_account_name'],
|
'destination_account_name' => $journal['destination_account_name'],
|
||||||
'destination_account_id' => $journal['destination_account_id'],
|
'destination_account_id' => $journal['destination_account_id'],
|
||||||
'currency_id' => $currency['currency_id'],
|
'currency_id' => $currency['currency_id'],
|
||||||
|
@@ -59,6 +59,7 @@ class CategoryController extends Controller
|
|||||||
function ($request, $next) {
|
function ($request, $next) {
|
||||||
$this->opsRepository = app(OperationsRepositoryInterface::class);
|
$this->opsRepository = app(OperationsRepositoryInterface::class);
|
||||||
$this->noCatRepository = app(NoCategoryRepositoryInterface::class);
|
$this->noCatRepository = app(NoCategoryRepositoryInterface::class);
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -302,8 +303,8 @@ class CategoryController extends Controller
|
|||||||
];
|
];
|
||||||
$result[$key]['transactions']++;
|
$result[$key]['transactions']++;
|
||||||
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
||||||
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']);
|
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string)$result[$key]['transactions']);
|
||||||
$result[$key]['avg_float'] = (float) $result[$key]['avg'];
|
$result[$key]['avg_float'] = (float)$result[$key]['avg'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -354,8 +355,8 @@ class CategoryController extends Controller
|
|||||||
];
|
];
|
||||||
$result[$key]['transactions']++;
|
$result[$key]['transactions']++;
|
||||||
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
||||||
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']);
|
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string)$result[$key]['transactions']);
|
||||||
$result[$key]['avg_float'] = (float) $result[$key]['avg'];
|
$result[$key]['avg_float'] = (float)$result[$key]['avg'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -703,9 +704,10 @@ class CategoryController extends Controller
|
|||||||
$result[] = [
|
$result[] = [
|
||||||
'description' => $journal['description'],
|
'description' => $journal['description'],
|
||||||
'transaction_group_id' => $journal['transaction_group_id'],
|
'transaction_group_id' => $journal['transaction_group_id'],
|
||||||
'amount_float' => (float) $journal['amount'],
|
'amount_float' => (float)$journal['amount'],
|
||||||
'amount' => $journal['amount'],
|
'amount' => $journal['amount'],
|
||||||
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
||||||
|
'date_sort' => $journal['date']->format('Y-m-d'),
|
||||||
'destination_account_name' => $journal['destination_account_name'],
|
'destination_account_name' => $journal['destination_account_name'],
|
||||||
'destination_account_id' => $journal['destination_account_id'],
|
'destination_account_id' => $journal['destination_account_id'],
|
||||||
'currency_id' => $currency['currency_id'],
|
'currency_id' => $currency['currency_id'],
|
||||||
@@ -752,9 +754,10 @@ class CategoryController extends Controller
|
|||||||
$result[] = [
|
$result[] = [
|
||||||
'description' => $journal['description'],
|
'description' => $journal['description'],
|
||||||
'transaction_group_id' => $journal['transaction_group_id'],
|
'transaction_group_id' => $journal['transaction_group_id'],
|
||||||
'amount_float' => (float) $journal['amount'],
|
'amount_float' => (float)$journal['amount'],
|
||||||
'amount' => $journal['amount'],
|
'amount' => $journal['amount'],
|
||||||
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
||||||
|
'date_sort' => $journal['date']->format('Y-m-d'),
|
||||||
'source_account_name' => $journal['source_account_name'],
|
'source_account_name' => $journal['source_account_name'],
|
||||||
'source_account_id' => $journal['source_account_id'],
|
'source_account_id' => $journal['source_account_id'],
|
||||||
'currency_id' => $currency['currency_id'],
|
'currency_id' => $currency['currency_id'],
|
||||||
|
@@ -100,8 +100,8 @@ class DoubleController extends Controller
|
|||||||
];
|
];
|
||||||
$result[$key]['transactions']++;
|
$result[$key]['transactions']++;
|
||||||
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
||||||
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']);
|
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string)$result[$key]['transactions']);
|
||||||
$result[$key]['avg_float'] = (float) $result[$key]['avg'];
|
$result[$key]['avg_float'] = (float)$result[$key]['avg'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// sort by amount_float
|
// sort by amount_float
|
||||||
@@ -152,8 +152,8 @@ class DoubleController extends Controller
|
|||||||
];
|
];
|
||||||
$result[$key]['transactions']++;
|
$result[$key]['transactions']++;
|
||||||
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
||||||
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']);
|
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string)$result[$key]['transactions']);
|
||||||
$result[$key]['avg_float'] = (float) $result[$key]['avg'];
|
$result[$key]['avg_float'] = (float)$result[$key]['avg'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// sort by amount_float
|
// sort by amount_float
|
||||||
@@ -410,9 +410,10 @@ class DoubleController extends Controller
|
|||||||
$result[] = [
|
$result[] = [
|
||||||
'description' => $journal['description'],
|
'description' => $journal['description'],
|
||||||
'transaction_group_id' => $journal['transaction_group_id'],
|
'transaction_group_id' => $journal['transaction_group_id'],
|
||||||
'amount_float' => (float) $journal['amount'],
|
'amount_float' => (float)$journal['amount'],
|
||||||
'amount' => $journal['amount'],
|
'amount' => $journal['amount'],
|
||||||
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
||||||
|
'date_sort' => $journal['date']->format('Y-m-d'),
|
||||||
'destination_account_name' => $journal['destination_account_name'],
|
'destination_account_name' => $journal['destination_account_name'],
|
||||||
'destination_account_id' => $journal['destination_account_id'],
|
'destination_account_id' => $journal['destination_account_id'],
|
||||||
'currency_id' => $currency['currency_id'],
|
'currency_id' => $currency['currency_id'],
|
||||||
@@ -459,9 +460,10 @@ class DoubleController extends Controller
|
|||||||
$result[] = [
|
$result[] = [
|
||||||
'description' => $journal['description'],
|
'description' => $journal['description'],
|
||||||
'transaction_group_id' => $journal['transaction_group_id'],
|
'transaction_group_id' => $journal['transaction_group_id'],
|
||||||
'amount_float' => (float) $journal['amount'],
|
'amount_float' => (float)$journal['amount'],
|
||||||
'amount' => $journal['amount'],
|
'amount' => $journal['amount'],
|
||||||
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
||||||
|
'date_sort' => $journal['date']->format('Y-m-d'),
|
||||||
'destination_account_name' => $journal['destination_account_name'],
|
'destination_account_name' => $journal['destination_account_name'],
|
||||||
'destination_account_id' => $journal['destination_account_id'],
|
'destination_account_id' => $journal['destination_account_id'],
|
||||||
'currency_id' => $currency['currency_id'],
|
'currency_id' => $currency['currency_id'],
|
||||||
|
@@ -297,8 +297,8 @@ class TagController extends Controller
|
|||||||
];
|
];
|
||||||
$result[$key]['transactions']++;
|
$result[$key]['transactions']++;
|
||||||
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
||||||
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']);
|
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string)$result[$key]['transactions']);
|
||||||
$result[$key]['avg_float'] = (float) $result[$key]['avg'];
|
$result[$key]['avg_float'] = (float)$result[$key]['avg'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -349,8 +349,8 @@ class TagController extends Controller
|
|||||||
];
|
];
|
||||||
$result[$key]['transactions']++;
|
$result[$key]['transactions']++;
|
||||||
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
$result[$key]['sum'] = bcadd($journal['amount'], $result[$key]['sum']);
|
||||||
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string) $result[$key]['transactions']);
|
$result[$key]['avg'] = bcdiv($result[$key]['sum'], (string)$result[$key]['transactions']);
|
||||||
$result[$key]['avg_float'] = (float) $result[$key]['avg'];
|
$result[$key]['avg_float'] = (float)$result[$key]['avg'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -496,9 +496,10 @@ class TagController extends Controller
|
|||||||
$result[] = [
|
$result[] = [
|
||||||
'description' => $journal['description'],
|
'description' => $journal['description'],
|
||||||
'transaction_group_id' => $journal['transaction_group_id'],
|
'transaction_group_id' => $journal['transaction_group_id'],
|
||||||
'amount_float' => (float) $journal['amount'],
|
'amount_float' => (float)$journal['amount'],
|
||||||
'amount' => $journal['amount'],
|
'amount' => $journal['amount'],
|
||||||
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
||||||
|
'date_sort' => $journal['date']->format('Y-m-d'),
|
||||||
'destination_account_name' => $journal['destination_account_name'],
|
'destination_account_name' => $journal['destination_account_name'],
|
||||||
'destination_account_id' => $journal['destination_account_id'],
|
'destination_account_id' => $journal['destination_account_id'],
|
||||||
'currency_id' => $currency['currency_id'],
|
'currency_id' => $currency['currency_id'],
|
||||||
@@ -545,9 +546,10 @@ class TagController extends Controller
|
|||||||
$result[] = [
|
$result[] = [
|
||||||
'description' => $journal['description'],
|
'description' => $journal['description'],
|
||||||
'transaction_group_id' => $journal['transaction_group_id'],
|
'transaction_group_id' => $journal['transaction_group_id'],
|
||||||
'amount_float' => (float) $journal['amount'],
|
'amount_float' => (float)$journal['amount'],
|
||||||
'amount' => $journal['amount'],
|
'amount' => $journal['amount'],
|
||||||
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
'date' => $journal['date']->formatLocalized($this->monthAndDayFormat),
|
||||||
|
'date_sort' => $journal['date']->format('Y-m-d'),
|
||||||
'source_account_name' => $journal['source_account_name'],
|
'source_account_name' => $journal['source_account_name'],
|
||||||
'source_account_id' => $journal['source_account_id'],
|
'source_account_id' => $journal['source_account_id'],
|
||||||
'currency_id' => $currency['currency_id'],
|
'currency_id' => $currency['currency_id'],
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
{{ row.description }}
|
{{ row.description }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td data-sortable="false">
|
<td data-value="{{ row.date_sort }}">
|
||||||
{{ row.date }}
|
{{ row.date }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
{{ row.description }}
|
{{ row.description }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td data-sortable="false">
|
<td data-value="{{ row.date_sort }}">
|
||||||
{{ row.date }}
|
{{ row.date }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
{{ row.description }}
|
{{ row.description }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td data-sortable="false">
|
<td data-value="{{ row.date_sort }}">
|
||||||
{{ row.date }}
|
{{ row.date }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
{{ row.description }}
|
{{ row.description }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td data-sortable="false">
|
<td data-value="{{ row.date_sort }}">
|
||||||
{{ row.date }}
|
{{ row.date }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
{{ row.description }}
|
{{ row.description }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td data-sortable="false">
|
<td data-value="{{ row.date_sort }}">
|
||||||
{{ row.date }}
|
{{ row.date }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
{{ row.description }}
|
{{ row.description }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td data-sortable="false">
|
<td data-value="{{ row.date_sort }}">
|
||||||
{{ row.date }}
|
{{ row.date }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
{{ row.description }}
|
{{ row.description }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td data-sortable="false">
|
<td data-value="{{ row.date_sort }}">
|
||||||
{{ row.date }}
|
{{ row.date }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user