mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Added temporary debug to google chart.
This commit is contained in:
parent
db5d94d956
commit
4a95bdd8ba
@ -19,6 +19,7 @@ use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
||||||
use Grumpydictator\Gchart\GChart;
|
use Grumpydictator\Gchart\GChart;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
use Log;
|
||||||
use Navigation;
|
use Navigation;
|
||||||
use Preferences;
|
use Preferences;
|
||||||
use Response;
|
use Response;
|
||||||
@ -277,6 +278,7 @@ class GoogleChartController extends Controller
|
|||||||
$description = $creditCard->name;
|
$description = $creditCard->name;
|
||||||
$amount = $balance * -1;
|
$amount = $balance * -1;
|
||||||
$fakeBill = $repository->createFakeBill($description, $date, $amount);
|
$fakeBill = $repository->createFakeBill($description, $date, $amount);
|
||||||
|
unset($description, $amount);
|
||||||
$unpaid->push([$fakeBill, $date]);
|
$unpaid->push([$fakeBill, $date]);
|
||||||
}
|
}
|
||||||
if ($balance == 0) {
|
if ($balance == 0) {
|
||||||
@ -294,16 +296,26 @@ class GoogleChartController extends Controller
|
|||||||
|
|
||||||
/** @var TransactionJournal $entry */
|
/** @var TransactionJournal $entry */
|
||||||
foreach ($paid as $entry) {
|
foreach ($paid as $entry) {
|
||||||
|
|
||||||
$paidDescriptions[] = $entry->description;
|
$paidDescriptions[] = $entry->description;
|
||||||
$paidAmount += floatval($entry->amount);
|
$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:
|
// loop unpaid:
|
||||||
/** @var Bill $entry */
|
/** @var Bill $entry */
|
||||||
foreach ($unpaid as $entry) {
|
foreach ($unpaid as $entry) {
|
||||||
$unpaidDescriptions[] = $entry[0]->name . ' (' . $entry[1]->format('jS M Y') . ')';
|
$description = $entry[0]->name . ' (' . $entry[1]->format('jS M Y') . ')';
|
||||||
$unpaidAmount += ($entry[0]->amount_max + $entry[0]->amount_min) / 2;
|
$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('Unpaid: ' . join(', ', $unpaidDescriptions), $unpaidAmount);
|
||||||
$chart->addRow('Paid: ' . join(', ', $paidDescriptions), $paidAmount);
|
$chart->addRow('Paid: ' . join(', ', $paidDescriptions), $paidAmount);
|
||||||
|
Loading…
Reference in New Issue
Block a user