mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 17:57:09 +00:00
Auto commit for release 'develop' on 2024-03-18
This commit is contained in:
@@ -298,7 +298,7 @@ class BasicController extends Controller
|
||||
app('log')->debug(sprintf('Amount left is %s', $left));
|
||||
|
||||
// how much left per day?
|
||||
$days = (int) $today->diffInDays($end,true) + 1;
|
||||
$days = (int) $today->diffInDays($end, true) + 1;
|
||||
$perDay = '0';
|
||||
$perDayNative = '0';
|
||||
if (0 !== $days && bccomp($left, '0') > -1) {
|
||||
|
@@ -25,7 +25,6 @@ namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Repositories\Attachment\AttachmentRepository;
|
||||
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
|
||||
use Illuminate\Contracts\Support\DeferrableProvider;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
|
@@ -25,7 +25,6 @@ namespace FireflyIII\Providers;
|
||||
|
||||
use FireflyIII\Support\Search\OperatorQuerySearch;
|
||||
use FireflyIII\Support\Search\SearchInterface;
|
||||
use Illuminate\Contracts\Support\DeferrableProvider;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
|
@@ -160,9 +160,9 @@ class Navigation
|
||||
|
||||
public function startOfPeriod(Carbon $theDate, string $repeatFreq): Carbon
|
||||
{
|
||||
$date = clone $theDate;
|
||||
$date = clone $theDate;
|
||||
Log::debug(sprintf('Now in startOfPeriod("%s", "%s")', $date->toIso8601String(), $repeatFreq));
|
||||
$functionMap = [
|
||||
$functionMap = [
|
||||
'1D' => 'startOfDay',
|
||||
'daily' => 'startOfDay',
|
||||
'1W' => 'startOfWeek',
|
||||
@@ -186,15 +186,14 @@ class Navigation
|
||||
if (array_key_exists($repeatFreq, $functionMap)) {
|
||||
$function = $functionMap[$repeatFreq];
|
||||
Log::debug(sprintf('Function is ->%s()', $function));
|
||||
if(array_key_exists($function, $parameterMap)) {
|
||||
Log::debug(sprintf('Parameter map, function becomes ->%s(%s)', $function, join(', ', $parameterMap[$function])));
|
||||
if (array_key_exists($function, $parameterMap)) {
|
||||
Log::debug(sprintf('Parameter map, function becomes ->%s(%s)', $function, implode(', ', $parameterMap[$function])));
|
||||
$date->{$function}($parameterMap[$function][0]);
|
||||
Log::debug(sprintf('Result is "%s"', $date->toIso8601String()));
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
||||
|
||||
$date->{$function}(); // @phpstan-ignore-line
|
||||
Log::debug(sprintf('Result is "%s"', $date->toIso8601String()));
|
||||
|
||||
@@ -209,7 +208,7 @@ class Navigation
|
||||
return $date;
|
||||
}
|
||||
|
||||
$result = match ($repeatFreq) {
|
||||
$result = match ($repeatFreq) {
|
||||
'last7' => $date->subDays(7)->startOfDay(),
|
||||
'last30' => $date->subDays(30)->startOfDay(),
|
||||
'last90' => $date->subDays(90)->startOfDay(),
|
||||
@@ -221,11 +220,13 @@ class Navigation
|
||||
};
|
||||
if (null !== $result) {
|
||||
Log::debug(sprintf('Result is "%s"', $date->toIso8601String()));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
if ('custom' === $repeatFreq) {
|
||||
Log::debug(sprintf('Custom, result is "%s"', $date->toIso8601String()));
|
||||
|
||||
return $date; // the date is already at the start.
|
||||
}
|
||||
Log::error(sprintf('Cannot do startOfPeriod for $repeat_freq "%s"', $repeatFreq));
|
||||
|
Reference in New Issue
Block a user