mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-12-28 09:51:21 -06:00
Code cleanup.
This commit is contained in:
parent
8b0f0fb615
commit
f5e5659c1f
@ -23,6 +23,7 @@ use Steam;
|
||||
class BillRepository implements BillRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* @deprecated
|
||||
* Returns the sum of all payments connected to this bill between the dates.
|
||||
*
|
||||
* @param Bill $bill
|
||||
@ -537,20 +538,6 @@ class BillRepository implements BillRepositoryInterface
|
||||
*/
|
||||
public function billsPaidInRange(Carbon $start, Carbon $end)
|
||||
{
|
||||
/*
|
||||
* select bills.*, SUM(transactions.amount) as `paid` from bills
|
||||
|
||||
left join transaction_journals ON transaction_journals.bill_id = bills.id
|
||||
left join transactions ON transactions.transaction_journal_id = transaction_journals.id
|
||||
where
|
||||
|
||||
|
||||
transaction_journals.date >= "2015-12-01"
|
||||
and transaction_journals.date <= "2015-12-31"
|
||||
and bills.active =1
|
||||
and transactions.amount > 0
|
||||
group by bills.id
|
||||
*/
|
||||
$set = Auth::user()->bills()
|
||||
->leftJoin('transaction_journals', 'transaction_journals.bill_id', '=', 'bills.id')
|
||||
->leftJoin(
|
||||
@ -564,6 +551,7 @@ group by bills.id
|
||||
->groupBy('bills.id')->get(
|
||||
['bills.*', DB::Raw('SUM(`transactions`.`amount`) as `paid`')]
|
||||
);
|
||||
|
||||
return $set;
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ interface BillRepositoryInterface
|
||||
public function getBillsForChart(Carbon $start, Carbon $end);
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* Returns the sum of all payments connected to this bill between the dates.
|
||||
*
|
||||
* @param Bill $bill
|
||||
|
Loading…
Reference in New Issue
Block a user