Remove unused function.

This commit is contained in:
James Cole 2016-10-21 13:22:45 +02:00
parent a95a4e783a
commit 801c7c0ab6
2 changed files with 0 additions and 55 deletions

View File

@ -425,48 +425,6 @@ class BillRepository implements BillRepositoryInterface
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 Carbon $date

View File

@ -149,19 +149,6 @@ interface BillRepositoryInterface
*/
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 Carbon $date