mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Fix #10399
This commit is contained in:
@@ -41,15 +41,9 @@ class SelectTransactionsRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
// fixed
|
|
||||||
/** @var Carbon $sessionFirst */
|
|
||||||
$sessionFirst = clone session('first');
|
|
||||||
$first = $sessionFirst->subDay()->format('Y-m-d');
|
|
||||||
$today = today(config('app.timezone'))->addDay()->format('Y-m-d');
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'start' => 'required|date|after:'.$first,
|
'start' => 'required|date|after:1900-01-01|before:2099-12-31|before:end|required_with:end',
|
||||||
'end' => 'required|date|before:'.$today,
|
'end' => 'required|date|after:1900-01-01|before:2099-12-31|after:start|required_with:start',
|
||||||
'accounts' => 'required',
|
'accounts' => 'required',
|
||||||
'accounts.*' => 'required|exists:accounts,id|belongsToUser:accounts',
|
'accounts.*' => 'required|exists:accounts,id|belongsToUser:accounts',
|
||||||
];
|
];
|
||||||
|
@@ -79,12 +79,12 @@ class ExchangeRateConverter
|
|||||||
public function getCurrencyRate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): string
|
public function getCurrencyRate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): string
|
||||||
{
|
{
|
||||||
if (false === $this->enabled()) {
|
if (false === $this->enabled()) {
|
||||||
Log::debug('ExchangeRateConverter: disabled, return "1".');
|
// Log::debug('ExchangeRateConverter: disabled, return "1".');
|
||||||
|
|
||||||
return '1';
|
return '1';
|
||||||
}
|
}
|
||||||
if ($from->id === $to->id) {
|
if ($from->id === $to->id) {
|
||||||
Log::debug('ExchangeRateConverter: From and to are the same, return "1".');
|
// Log::debug('ExchangeRateConverter: From and to are the same, return "1".');
|
||||||
|
|
||||||
return '1';
|
return '1';
|
||||||
}
|
}
|
||||||
|
@@ -35,6 +35,7 @@ use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use FireflyIII\Support\Debug\Timer;
|
use FireflyIII\Support\Debug\Timer;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trait PeriodOverview.
|
* Trait PeriodOverview.
|
||||||
@@ -77,6 +78,7 @@ trait PeriodOverview
|
|||||||
*/
|
*/
|
||||||
protected function getAccountPeriodOverview(Account $account, Carbon $start, Carbon $end): array
|
protected function getAccountPeriodOverview(Account $account, Carbon $start, Carbon $end): array
|
||||||
{
|
{
|
||||||
|
Log::debug('Now in getAccountPeriodOverview()');
|
||||||
Timer::start('account-period-total');
|
Timer::start('account-period-total');
|
||||||
$this->accountRepository = app(AccountRepositoryInterface::class);
|
$this->accountRepository = app(AccountRepositoryInterface::class);
|
||||||
$range = app('navigation')->getViewRange(true);
|
$range = app('navigation')->getViewRange(true);
|
||||||
@@ -100,6 +102,7 @@ trait PeriodOverview
|
|||||||
$transactions = $this->accountRepository->periodCollection($account, $start, $end);
|
$transactions = $this->accountRepository->periodCollection($account, $start, $end);
|
||||||
|
|
||||||
// loop dates
|
// loop dates
|
||||||
|
Log::debug(sprintf('Count of loops: %d', count($dates)));
|
||||||
foreach ($dates as $currentDate) {
|
foreach ($dates as $currentDate) {
|
||||||
$title = app('navigation')->periodShow($currentDate['start'], $currentDate['period']);
|
$title = app('navigation')->periodShow($currentDate['start'], $currentDate['period']);
|
||||||
[$transactions, $spent] = $this->filterTransactionsByType(TransactionTypeEnum::WITHDRAWAL, $transactions, $currentDate['start'], $currentDate['end']);
|
[$transactions, $spent] = $this->filterTransactionsByType(TransactionTypeEnum::WITHDRAWAL, $transactions, $currentDate['start'], $currentDate['end']);
|
||||||
@@ -119,6 +122,7 @@ trait PeriodOverview
|
|||||||
}
|
}
|
||||||
$cache->store($entries);
|
$cache->store($entries);
|
||||||
Timer::stop('account-period-total');
|
Timer::stop('account-period-total');
|
||||||
|
Log::debug('End of getAccountPeriodOverview()');
|
||||||
|
|
||||||
return $entries;
|
return $entries;
|
||||||
}
|
}
|
||||||
|
@@ -163,6 +163,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td style="{{ style|raw }};text-align:right">
|
<td style="{{ style|raw }};text-align:right">
|
||||||
|
|
||||||
{# deposit #}
|
{# deposit #}
|
||||||
{% if transaction.transaction_type_type == 'Deposit' %}
|
{% if transaction.transaction_type_type == 'Deposit' %}
|
||||||
{# amount of deposit #}
|
{# amount of deposit #}
|
||||||
|
Reference in New Issue
Block a user