mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +00:00
Remove unused function.
This commit is contained in:
@@ -425,48 +425,6 @@ class BillRepository implements BillRepositoryInterface
|
|||||||
return $journals;
|
return $journals;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Every bill repeats itself weekly, monthly or yearly (or whatever). This method takes a date-range (usually the view-range of Firefly itself)
|
|
||||||
* and returns date ranges that fall within the given range; those ranges are the bills expected. When a bill is due on the 14th of the month and
|
|
||||||
* you give 1st and the 31st of that month as argument, you'll get one response, matching the range of your bill.
|
|
||||||
*
|
|
||||||
* @param Bill $bill
|
|
||||||
* @param Carbon $start
|
|
||||||
* @param Carbon $end
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getRanges(Bill $bill, Carbon $start, Carbon $end): array
|
|
||||||
{
|
|
||||||
$startOfBill = Navigation::startOfPeriod($start, $bill->repeat_freq);
|
|
||||||
|
|
||||||
|
|
||||||
// all periods of this bill up until the current period:
|
|
||||||
$billStarts = [];
|
|
||||||
while ($startOfBill < $end) {
|
|
||||||
|
|
||||||
$endOfBill = Navigation::endOfPeriod($startOfBill, $bill->repeat_freq);
|
|
||||||
|
|
||||||
$billStarts[] = [
|
|
||||||
'start' => clone $startOfBill,
|
|
||||||
'end' => clone $endOfBill,
|
|
||||||
];
|
|
||||||
// actually the next one:
|
|
||||||
$startOfBill = Navigation::addPeriod($startOfBill, $bill->repeat_freq, $bill->skip);
|
|
||||||
|
|
||||||
}
|
|
||||||
// for each
|
|
||||||
$validRanges = [];
|
|
||||||
foreach ($billStarts as $dateEntry) {
|
|
||||||
if ($dateEntry['end'] > $start && $dateEntry['start'] < $end) {
|
|
||||||
// count transactions for bill in this range (not relevant yet!):
|
|
||||||
$validRanges[] = $dateEntry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $validRanges;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Bill $bill
|
* @param Bill $bill
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
|
@@ -149,19 +149,6 @@ interface BillRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function getPossiblyRelatedJournals(Bill $bill): Collection;
|
public function getPossiblyRelatedJournals(Bill $bill): Collection;
|
||||||
|
|
||||||
/**
|
|
||||||
* Every bill repeats itself weekly, monthly or yearly (or whatever). This method takes a date-range (usually the view-range of Firefly itself)
|
|
||||||
* and returns date ranges that fall within the given range; those ranges are the bills expected. When a bill is due on the 14th of the month and
|
|
||||||
* you give 1st and the 31st of that month as argument, you'll get one response, matching the range of your bill (from the 14th to the 31th).
|
|
||||||
*
|
|
||||||
* @param Bill $bill
|
|
||||||
* @param Carbon $start
|
|
||||||
* @param Carbon $end
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getRanges(Bill $bill, Carbon $start, Carbon $end): array;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Bill $bill
|
* @param Bill $bill
|
||||||
* @param Carbon $date
|
* @param Carbon $date
|
||||||
|
Reference in New Issue
Block a user