Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Removed logging, found bug.
James Coled8d92f147fb3
diff --git a/app/Http/Controllers/GoogleChartController.php b/app/Http/Controllers/GoogleChartController.phpindex 12586522f4..f8fe729133 100644--- a/app/Http/Controllers/GoogleChartController.php+++ b/app/Http/Controllers/GoogleChartController.php@@ -19,7 +19,6 @@ use FireflyIII\Repositories\Category\CategoryRepositoryInterface;use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;use Grumpydictator\Gchart\GChart;use Illuminate\Support\Collection;-use Log;use Navigation;use Preferences;use Response;@@ -299,10 +298,7 @@ class GoogleChartController extends Controller$paidDescriptions[] = $entry->description;$paidAmount += floatval($entry->amount);- Log::debug('PaidChart: ' . $entry->description . ' with amount ' . floatval($entry->amount));- Log::debug('PaidChart: total amount is now: ' . $paidAmount);}- Log::debug('PaidChart: total amount final: ' . $paidAmount);// loop unpaid:/** @var Bill $entry */@@ -311,11 +307,8 @@ class GoogleChartController extends Controller$amount = ($entry[0]->amount_max + $entry[0]->amount_min) / 2;$unpaidDescriptions[] = $description;$unpaidAmount += $amount;- Log::debug('UnpaidChart: ' . $description . ' with amount ' . $amount);- Log::debug('UnpaidChart: total is now: ' . $unpaidAmount);unset($amount, $description);}- Log::debug('UnpaidChart: total is final: ' . $unpaidAmount);$chart->addRow('Unpaid: ' . join(', ', $unpaidDescriptions), $unpaidAmount);$chart->addRow('Paid: ' . join(', ', $paidDescriptions), $paidAmount);diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.phpindex 1e257eba0d..31bc8ea34c 100644--- a/app/Http/Controllers/JsonController.php+++ b/app/Http/Controllers/JsonController.php@@ -16,7 +16,6 @@ use Preferences;use Response;use Session;use Steam;-use Log;/*** Class JsonController@@ -56,7 +55,6 @@ class JsonController extends Controller$box = 'bills-unpaid';$bills = $repository->getActiveBills();$unpaid = new Collection; // bills- Log::debug('UnpaidBox: Unpaid box');/** @var Bill $bill */foreach ($bills as $bill) {@@ -90,17 +88,13 @@ class JsonController extends Controllerforeach ($unpaid as $entry) {$current = ($entry[0]->amount_max + $entry[0]->amount_min) / 2;$amount += $current;- Log::debug('UnpaidBox: '.$entry[0]->name.': '.$current);- Log::debug('UnpaidBox: Total is now: ' . $amount);}- Log::debug('UnpaidBox: Total is final: ' . $amount);break;case 'bills-paid':$box = 'bills-paid';// these two functions are the same as the chart TODO$bills = Auth::user()->bills()->where('active', 1)->get();- Log::debug('PaidBox: Paid box');/** @var Bill $bill */foreach ($bills as $bill) {@@ -110,17 +104,15 @@ class JsonController extends Controller// paid a bill in this range?$count = $bill->transactionjournals()->before($range['end'])->after($range['start'])->count();if ($count != 0) {+ // TODO this only gets the first match, may be more than one.$journal = $bill->transactionjournals()->with('transactions')->before($range['end'])->after($range['start'])->first();$amount += $journal->amount;- Log::debug('PaidBox: Journal for bill "'.$bill->name.'": ' . $journal->amount);- Log::debug('PaidBox: Total is now: ' . $amount);}}}- Log::debug('PaidBox: Doing ccs now.');/*** Find credit card accounts and possibly unpaid credit card bills.*/@@ -139,7 +131,6 @@ class JsonController extends Controllerforeach ($creditCards as $creditCard) {$balance = Steam::balance($creditCard, null, true);if ($balance == 0) {- Log::debug('PaidBox: Balance for '.$creditCard->name.' is zero.');// find a transfer TO the credit card which should account for// anything paid. If not, the CC is not yet used.$transactions = $creditCard->transactions()@@ -150,16 +141,13 @@ class JsonController extends Controllerforeach ($transactions as $transaction) {$journal = $transaction->transactionJournal;if ($journal->transactionType->type == 'Transfer') {- Log::debug('PaidBox: Found the transfer! Amount: ' . floatval($transaction->amount));$amount += floatval($transaction->amount);- Log::debug('PaidBox: Total is now: ' . $amount);}}}}}- Log::debug('PaidBox: Total is: ' . $amount);- break;+ break;}