mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 10:53:37 +00:00
Fix #8099
This commit is contained in:
@@ -357,8 +357,8 @@ class Navigation
|
|||||||
'daily' => 'floatDiffInDays',
|
'daily' => 'floatDiffInDays',
|
||||||
'weekly' => 'floatDiffInWeeks',
|
'weekly' => 'floatDiffInWeeks',
|
||||||
'monthly' => 'floatDiffInMonths',
|
'monthly' => 'floatDiffInMonths',
|
||||||
//'quarterly' => 'floatDiffInMonths',
|
'quarterly' => 'floatDiffInMonths',
|
||||||
//'half-year' => 'floatDiffInQuarters',
|
'half-year' => 'floatDiffInMonths',
|
||||||
'yearly' => 'floatDiffInYears',
|
'yearly' => 'floatDiffInYears',
|
||||||
];
|
];
|
||||||
if (!array_key_exists($period, $map)) {
|
if (!array_key_exists($period, $map)) {
|
||||||
@@ -366,11 +366,23 @@ class Navigation
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
$func = $map[$period];
|
$func = $map[$period];
|
||||||
$diff = ceil($beginning->$func($end));
|
// first do the diff
|
||||||
app('log')->debug(sprintf('Diff is %f (%d)', $beginning->$func($end), $diff));
|
$diff = $beginning->$func($end);
|
||||||
if ('half-year' === $period) {
|
|
||||||
$diff = ceil($diff / 2);
|
// then correct for quarterly or half-year
|
||||||
|
if('quarterly' === $period) {
|
||||||
|
app('log')->debug(sprintf('Q: Corrected %f to %f', $diff, $diff / 3));
|
||||||
|
$diff = $diff / 3;
|
||||||
}
|
}
|
||||||
|
if('half-year' === $period) {
|
||||||
|
app('log')->debug(sprintf('H: Corrected %f to %f', $diff, $diff / 6));
|
||||||
|
$diff = $diff / 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
// then do ceil()
|
||||||
|
$diff = ceil($diff);
|
||||||
|
|
||||||
|
app('log')->debug(sprintf('Diff is %f (%d)', $beginning->$func($end), $diff));
|
||||||
|
|
||||||
if($skip > 0) {
|
if($skip > 0) {
|
||||||
$parameter = $skip + 1;
|
$parameter = $skip + 1;
|
||||||
|
@@ -302,8 +302,10 @@ class BillTransformer extends AbstractTransformer
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
app('log')->debug(sprintf('Next expected match is %s', $nextExpectedMatch->format('Y-m-d')));
|
app('log')->debug(sprintf('Next expected match is %s', $nextExpectedMatch->format('Y-m-d')));
|
||||||
// add to set
|
// add to set, if the date is ON or after the start parameter
|
||||||
|
if($nextExpectedMatch->gte($this->parameters->get('start'))) {
|
||||||
$set->push(clone $nextExpectedMatch);
|
$set->push(clone $nextExpectedMatch);
|
||||||
|
}
|
||||||
|
|
||||||
// 2023-10
|
// 2023-10
|
||||||
// for the next loop, go to end of period, THEN add day.
|
// for the next loop, go to end of period, THEN add day.
|
||||||
|
Reference in New Issue
Block a user