mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 00:20:03 +00:00
Corrected some charts [skip ci]
This commit is contained in:
@@ -138,7 +138,7 @@ class BudgetController extends Controller
|
|||||||
function (Budget $budget) use ($repository) {
|
function (Budget $budget) use ($repository) {
|
||||||
$date = Session::get('start', Carbon::now()->startOfMonth());
|
$date = Session::get('start', Carbon::now()->startOfMonth());
|
||||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||||
$budget->spent = $repository->spentInPeriod($budget, $date, $end);
|
$budget->spent = $repository->spentInPeriodCorrected($budget, $date, $end);
|
||||||
$budget->currentRep = $repository->getCurrentRepetition($budget, $date);
|
$budget->currentRep = $repository->getCurrentRepetition($budget, $date);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -122,7 +122,12 @@ class JsonController extends Controller
|
|||||||
{
|
{
|
||||||
$start = Session::get('start', Carbon::now()->startOfMonth());
|
$start = Session::get('start', Carbon::now()->startOfMonth());
|
||||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||||
$amount = $reportQuery->incomeInPeriod($start, $end, true)->sum('queryAmount');
|
$amount = $reportQuery->incomeInPeriodCorrected($start, $end, true)->sum('amount');
|
||||||
|
// $amount = 0;
|
||||||
|
// foreach($set as $entry) {
|
||||||
|
// //echo $entry->description.' ('.$entry->tags->count().'): ' . $entry->amount."\n";
|
||||||
|
// $amount += $entry->amount;
|
||||||
|
// }
|
||||||
|
|
||||||
return Response::json(['box' => 'in', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]);
|
return Response::json(['box' => 'in', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]);
|
||||||
}
|
}
|
||||||
@@ -136,7 +141,7 @@ class JsonController extends Controller
|
|||||||
{
|
{
|
||||||
$start = Session::get('start', Carbon::now()->startOfMonth());
|
$start = Session::get('start', Carbon::now()->startOfMonth());
|
||||||
$end = Session::get('end', Carbon::now()->endOfMonth());
|
$end = Session::get('end', Carbon::now()->endOfMonth());
|
||||||
$amount = $reportQuery->expenseInPeriod($start, $end, true)->sum('queryAmount') * -1;
|
$amount = $reportQuery->expenseInPeriodCorrected($start, $end, true)->sum('amount');
|
||||||
|
|
||||||
return Response::json(['box' => 'out', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]);
|
return Response::json(['box' => 'out', 'amount' => Amount::format($amount, false), 'amount_raw' => $amount]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ class TransactionController extends Controller
|
|||||||
$preFilled['piggy_bank_id'] = $journal->piggyBankEvents()->orderBy('date', 'DESC')->first()->piggy_bank_id;
|
$preFilled['piggy_bank_id'] = $journal->piggyBankEvents()->orderBy('date', 'DESC')->first()->piggy_bank_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$preFilled['amount'] = $journal->amount;
|
$preFilled['amount'] = $journal->actualAmount;
|
||||||
$preFilled['account_id'] = $journal->assetAccount->id;
|
$preFilled['account_id'] = $journal->assetAccount->id;
|
||||||
$preFilled['expense_account'] = $transactions[0]->account->name;
|
$preFilled['expense_account'] = $transactions[0]->account->name;
|
||||||
$preFilled['revenue_account'] = $transactions[1]->account->name;
|
$preFilled['revenue_account'] = $transactions[1]->account->name;
|
||||||
|
|||||||
Reference in New Issue
Block a user