mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-16 18:25:00 -06:00
Some small fixes.
This commit is contained in:
parent
cbe52b5089
commit
c15c45f765
@ -81,6 +81,7 @@ class GoogleCategoryChartGenerator implements CategoryChartGenerator
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Collection $categories
|
||||
* @param Collection $entries
|
||||
*
|
||||
* @return array
|
||||
|
@ -104,7 +104,8 @@ class FireflyServiceProvider extends ServiceProvider
|
||||
//$this->app->bind('FireflyIII\Generator\Chart\Category\CategoryChartGenerator', 'FireflyIII\Generator\Chart\Category\GoogleCategoryChartGenerator');
|
||||
$this->app->bind('FireflyIII\Generator\Chart\Category\CategoryChartGenerator', 'FireflyIII\Generator\Chart\Category\ChartJsCategoryChartGenerator');
|
||||
|
||||
//$this->app->bind('FireflyIII\Generator\Chart\PiggyBank\PiggyBankChartGenerator', 'FireflyIII\Generator\Chart\PiggyBank\GooglePiggyBankChartGenerator');
|
||||
//$this->app->bind('FireflyIII\Generator\Chart\PiggyBank\PiggyBankChartGenerator',
|
||||
// 'FireflyIII\Generator\Chart\PiggyBank\GooglePiggyBankChartGenerator');
|
||||
$this->app->bind('FireflyIII\Generator\Chart\PiggyBank\PiggyBankChartGenerator', 'FireflyIII\Generator\Chart\PiggyBank\ChartJsPiggyBankChartGenerator');
|
||||
|
||||
//$this->app->bind('FireflyIII\Generator\Chart\Report\ReportChartGenerator', 'FireflyIII\Generator\Chart\Report\GoogleReportChartGenerator');
|
||||
|
@ -528,9 +528,10 @@ class TestDataSeeder extends Seeder
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $tag
|
||||
* @param $tagName
|
||||
*
|
||||
* @return Tag|null
|
||||
* @internal param $tag
|
||||
*/
|
||||
protected function findTag($tagName)
|
||||
{
|
||||
|
@ -3,7 +3,6 @@
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Helpers\Report\ReportQuery;
|
||||
use FireflyIII\Models\AccountMeta;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||
|
||||
/**
|
||||
@ -81,22 +80,20 @@ class ReportQueryTest extends TestCase
|
||||
);
|
||||
|
||||
$amount = 100;
|
||||
if($i == 8) {
|
||||
if ($i == 8) {
|
||||
$amount = 0; // at least one "empty" journal.
|
||||
}
|
||||
|
||||
// update both transactions
|
||||
$journal->transactions[0]->account_id = $account1->id;
|
||||
$journal->transactions[0]->amount = $amount * -1;
|
||||
$journal->transactions[0]->amount = $amount * -1;
|
||||
$journal->transactions[0]->save();
|
||||
|
||||
$journal->transactions[1]->account_id = $account2->id;
|
||||
$journal->transactions[1]->amount = $amount;
|
||||
$journal->transactions[1]->amount = $amount;
|
||||
$journal->transactions[1]->save();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
$this->be($user);
|
||||
|
||||
@ -151,17 +148,17 @@ class ReportQueryTest extends TestCase
|
||||
);
|
||||
|
||||
$amount = 100;
|
||||
if($i == 8) {
|
||||
if ($i == 8) {
|
||||
$amount = 0; // at least one "empty" journal.
|
||||
}
|
||||
|
||||
// update both transactions
|
||||
$journal->transactions[0]->account_id = $account1->id;
|
||||
$journal->transactions[0]->amount = $amount * -1;
|
||||
$journal->transactions[0]->amount = $amount * -1;
|
||||
$journal->transactions[0]->save();
|
||||
|
||||
$journal->transactions[1]->account_id = $account2->id;
|
||||
$journal->transactions[1]->amount = $amount;
|
||||
$journal->transactions[1]->amount = $amount;
|
||||
$journal->transactions[1]->save();
|
||||
|
||||
}
|
||||
@ -271,17 +268,17 @@ class ReportQueryTest extends TestCase
|
||||
);
|
||||
|
||||
$amount = 100;
|
||||
if($i == 8) {
|
||||
if ($i == 8) {
|
||||
$amount = 0; // at least one "empty" journal.
|
||||
}
|
||||
|
||||
// update both transactions
|
||||
$journal->transactions[0]->account_id = $account1->id;
|
||||
$journal->transactions[0]->amount = $amount;
|
||||
$journal->transactions[0]->amount = $amount;
|
||||
$journal->transactions[0]->save();
|
||||
|
||||
$journal->transactions[1]->account_id = $account2->id;
|
||||
$journal->transactions[1]->amount = $amount * -1;
|
||||
$journal->transactions[1]->amount = $amount * -1;
|
||||
$journal->transactions[1]->save();
|
||||
|
||||
}
|
||||
@ -337,17 +334,17 @@ class ReportQueryTest extends TestCase
|
||||
);
|
||||
|
||||
$amount = 100;
|
||||
if($i == 8) {
|
||||
if ($i == 8) {
|
||||
$amount = 0; // at least one "empty" journal.
|
||||
}
|
||||
|
||||
// update both transactions
|
||||
$journal->transactions[0]->account_id = $account1->id;
|
||||
$journal->transactions[0]->amount = $amount * -1;
|
||||
$journal->transactions[0]->amount = $amount * -1;
|
||||
$journal->transactions[0]->save();
|
||||
|
||||
$journal->transactions[1]->account_id = $account2->id;
|
||||
$journal->transactions[1]->amount = $amount;
|
||||
$journal->transactions[1]->amount = $amount;
|
||||
$journal->transactions[1]->save();
|
||||
|
||||
}
|
||||
|
@ -80,20 +80,21 @@ class JournalRepositoryTest extends TestCase
|
||||
$withdrawal = FactoryMuffin::create('FireflyIII\Models\TransactionType'); // withdrawal
|
||||
|
||||
// create five journals with incrementing dates:
|
||||
$today = new Carbon('2015-01-01');
|
||||
for($i=0;$i<5;$i++) {
|
||||
$today = new Carbon('2015-01-01');
|
||||
$journal = null;
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
// create journal:
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal = FactoryMuffin::create('FireflyIII\Models\TransactionJournal');
|
||||
$journal->transaction_type_id = $withdrawal;
|
||||
$journal->date = $today;
|
||||
$journal->date = $today;
|
||||
$journal->save();
|
||||
|
||||
// update transactions:
|
||||
$journal->transactions[0]->amount = -100;
|
||||
$journal->transactions[0]->amount = -100;
|
||||
$journal->transactions[0]->account_id = $asset->id;
|
||||
$journal->transactions[0]->save();
|
||||
|
||||
$journal->transactions[1]->amount = 100;
|
||||
$journal->transactions[1]->amount = 100;
|
||||
$journal->transactions[1]->account_id = $expense->id;
|
||||
$journal->transactions[1]->save();
|
||||
|
||||
@ -102,7 +103,7 @@ class JournalRepositoryTest extends TestCase
|
||||
}
|
||||
|
||||
|
||||
$before = $this->object->getAmountBefore($journal, $journal->transactions[1]);
|
||||
$before = $this->object->getAmountBefore($journal, $journal->transactions[1]);
|
||||
// five transactions, we check the last one, so amount should be 400.
|
||||
$this->assertEquals(400, $before);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user