mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Some fixes for bills.
This commit is contained in:
@@ -326,11 +326,11 @@ class BillRepository implements BillRepositoryInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $bill
|
||||
* @param Bill $bill
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getOverallAverage($bill): string
|
||||
public function getOverallAverage(Bill $bill): string
|
||||
{
|
||||
$journals = $bill->transactionJournals()->get();
|
||||
$sum = '0';
|
||||
@@ -347,6 +347,21 @@ class BillRepository implements BillRepositoryInterface
|
||||
return $avg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Bill $bill
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getPaidDatesInRange(Bill $bill, Carbon $start, Carbon $end): Collection
|
||||
{
|
||||
$dates = $bill->transactionJournals()->before($end)->after($start)->get(['transaction_journals.date'])->pluck('date');
|
||||
|
||||
return $dates;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Between start and end, tells you on which date(s) the bill is expected to hit.
|
||||
*
|
||||
|
Reference in New Issue
Block a user