mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-01-05 21:53:08 -06:00
Made a negative amount a positive as per #129
This commit is contained in:
parent
e332bfef7c
commit
a0972d99fb
@ -190,10 +190,7 @@ class ReportQuery implements ReportQueryInterface
|
|||||||
public function spentInBudgetCorrected(Account $account, Budget $budget, Carbon $start, Carbon $end)
|
public function spentInBudgetCorrected(Account $account, Budget $budget, Carbon $start, Carbon $end)
|
||||||
{
|
{
|
||||||
|
|
||||||
bcscale(2);
|
return Auth::user()->transactionjournals()
|
||||||
|
|
||||||
return bcmul(
|
|
||||||
Auth::user()->transactionjournals()
|
|
||||||
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||||
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id')
|
||||||
->transactionTypes([TransactionType::WITHDRAWAL])
|
->transactionTypes([TransactionType::WITHDRAWAL])
|
||||||
@ -201,8 +198,7 @@ class ReportQuery implements ReportQueryInterface
|
|||||||
->before($end)
|
->before($end)
|
||||||
->after($start)
|
->after($start)
|
||||||
->where('budget_transaction_journal.budget_id', $budget->id)
|
->where('budget_transaction_journal.budget_id', $budget->id)
|
||||||
->get(['transaction_journals.*'])->sum('amount'), -1
|
->get(['transaction_journals.*'])->sum('amount');
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user