mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some general cleaning up.
This commit is contained in:
parent
1932bf277a
commit
bf354275b3
@ -254,7 +254,6 @@ class ReportQuery implements ReportQueryInterface
|
||||
|
||||
$data->each(
|
||||
function (Model $object) {
|
||||
// $object->description = intval($object->encrypted);
|
||||
$object->name = intval($object->account_encrypted) == 1 ? Crypt::decrypt($object->name) : $object->name;
|
||||
}
|
||||
);
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Crypt;
|
||||
use DB;
|
||||
use Exception;
|
||||
use FireflyIII\Helpers\Report\ReportQueryInterface;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Bill;
|
||||
@ -480,11 +478,7 @@ class GoogleChartController extends Controller
|
||||
*/
|
||||
public function yearInExp($year, GChart $chart, ReportQueryInterface $query)
|
||||
{
|
||||
try {
|
||||
$start = new Carbon('01-01-' . $year);
|
||||
} catch (Exception $e) {
|
||||
return view('error')->with('message', 'Invalid year.');
|
||||
}
|
||||
$start = new Carbon('01-01-' . $year);
|
||||
$chart->addColumn('Month', 'date');
|
||||
$chart->addColumn('Income', 'number');
|
||||
$chart->addColumn('Expenses', 'number');
|
||||
@ -532,11 +526,7 @@ class GoogleChartController extends Controller
|
||||
*/
|
||||
public function yearInExpSum($year, GChart $chart, ReportQueryInterface $query)
|
||||
{
|
||||
try {
|
||||
$start = new Carbon('01-01-' . $year);
|
||||
} catch (Exception $e) {
|
||||
return view('error')->with('message', 'Invalid year.');
|
||||
}
|
||||
$start = new Carbon('01-01-' . $year);
|
||||
$chart->addColumn('Summary', 'string');
|
||||
$chart->addColumn('Income', 'number');
|
||||
$chart->addColumn('Expenses', 'number');
|
||||
|
@ -5,7 +5,7 @@ use ErrorException;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
use Response;
|
||||
use Route;
|
||||
|
||||
use Log;
|
||||
/**
|
||||
* Class HelpController
|
||||
*
|
||||
@ -27,7 +27,7 @@ class HelpController extends Controller
|
||||
];
|
||||
|
||||
if (!Route::has($route)) {
|
||||
\Log::error('No such route: ' . $route);
|
||||
Log::error('No such route: ' . $route);
|
||||
|
||||
return Response::json($content);
|
||||
}
|
||||
@ -75,7 +75,7 @@ class HelpController extends Controller
|
||||
try {
|
||||
$content['text'] = file_get_contents($uri);
|
||||
} catch (ErrorException $e) {
|
||||
\Log::error(trim($e->getMessage()));
|
||||
Log::error(trim($e->getMessage()));
|
||||
}
|
||||
if (strlen(trim($content['text'])) == 0) {
|
||||
$content['text'] = '<p>There is no help for this route.</p>';
|
||||
|
@ -239,6 +239,11 @@ class JsonController extends Controller
|
||||
return Response::json(['value' => $pref->data]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $what
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
public function transactionJournals($what)
|
||||
{
|
||||
$descriptions = [];
|
||||
|
@ -509,7 +509,6 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
protected function updateMetadata(Account $account, array $data)
|
||||
{
|
||||
$validFields = ['accountRole', 'ccMonthlyPaymentDate', 'ccType'];
|
||||
$updated = false;
|
||||
|
||||
foreach ($validFields as $field) {
|
||||
$entry = $account->accountMeta()->where('name', $field)->first();
|
||||
|
@ -81,4 +81,4 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
|
||||
return $currency;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,4 +49,4 @@ interface CurrencyRepositoryInterface
|
||||
*/
|
||||
public function update(TransactionCurrency $currency, array $data);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -426,7 +426,6 @@ class ChangesForV321 extends Migration
|
||||
|
||||
public function moveComponentIdToBudgetId()
|
||||
{
|
||||
//Log::debug('Now in moveComponentIdToBudgetId()');
|
||||
BudgetLimit::get()->each(
|
||||
function (BudgetLimit $bl) {
|
||||
Log::debug('Now at budgetLimit #' . $bl->id . ' with component_id: ' . $bl->component_id);
|
||||
@ -447,7 +446,6 @@ class ChangesForV321 extends Migration
|
||||
}
|
||||
}
|
||||
);
|
||||
//Log::debug('Done with moveComponentIdToBudgetId()');
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
@if(isset($options['helpText']))
|
||||
<p class="help-block">{{$options['helpText']}}</p>
|
||||
@endif
|
||||
@endif
|
||||
|
@ -292,12 +292,47 @@ class GoogleChartControllerTest extends TestCase
|
||||
|
||||
public function testYearInExp()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$preference = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$journal1 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal2 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journals = new Collection([$journal1, $journal2]);
|
||||
$this->be($user);
|
||||
|
||||
|
||||
// mock!
|
||||
$repository = $this->mock('FireflyIII\Helpers\Report\ReportQueryInterface');
|
||||
|
||||
// expect!
|
||||
$repository->shouldReceive('incomeByPeriod')->andReturn($journals);
|
||||
$repository->shouldReceive('journalsByExpenseAccount')->andReturn($journals);
|
||||
Preferences::shouldReceive('get')->withArgs(['showSharedReports',false])->once()->andReturn($preference);
|
||||
|
||||
|
||||
$this->call('GET', '/chart/reports/income-expenses/2015');
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
|
||||
public function testYearInExpSum()
|
||||
{
|
||||
$this->markTestIncomplete();
|
||||
$user = FactoryMuffin::create('FireflyIII\User');
|
||||
$preference = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$journal1 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal2 = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journals = new Collection([$journal1, $journal2]);
|
||||
$this->be($user);
|
||||
|
||||
|
||||
// mock!
|
||||
$repository = $this->mock('FireflyIII\Helpers\Report\ReportQueryInterface');
|
||||
|
||||
// expect!
|
||||
$repository->shouldReceive('incomeByPeriod')->andReturn($journals);
|
||||
$repository->shouldReceive('journalsByExpenseAccount')->andReturn($journals);
|
||||
Preferences::shouldReceive('get')->withArgs(['showSharedReports',false])->once()->andReturn($preference);
|
||||
|
||||
|
||||
$this->call('GET', '/chart/reports/income-expenses-sum/2015');
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user