I have no idea what's happening!

This commit is contained in:
Sander Dorigo 2014-11-10 18:38:58 +01:00
parent 754336b3cf
commit a3f8841ec3
25 changed files with 358 additions and 244 deletions

View File

@ -1,10 +1,6 @@
<?php <?php
use Carbon\Carbon;
use Firefly\Exception\FireflyException; use Firefly\Exception\FireflyException;
use Firefly\Helper\Controllers\BudgetInterface as BI;
use Firefly\Storage\Budget\BudgetRepositoryInterface as BRI;
use FireflyIII\Exception\NotImplementedException;
use Illuminate\Support\MessageBag; use Illuminate\Support\MessageBag;

View File

@ -10,18 +10,9 @@ use Firefly\Storage\Category\CategoryRepositoryInterface as CRI;
*/ */
class CategoryController extends BaseController class CategoryController extends BaseController
{ {
protected $_repository; public function __construct()
protected $_category;
/**
* @param CRI $repository
* @param CI $category
*/
public function __construct(CRI $repository, CI $category)
{ {
$this->_repository = $repository; View::share('title', 'Categories');
$this->_category = $category;
View::share('title','Categories');
View::share('mainTitleIcon', 'fa-bar-chart'); View::share('mainTitleIcon', 'fa-bar-chart');
} }
@ -41,7 +32,7 @@ class CategoryController extends BaseController
public function delete(Category $category) public function delete(Category $category)
{ {
return View::make('categories.delete')->with('category', $category) return View::make('categories.delete')->with('category', $category)
->with('subTitle', 'Delete category "' . $category->name . '"'); ->with('subTitle', 'Delete category "' . $category->name . '"');
} }
/** /**
@ -64,7 +55,7 @@ class CategoryController extends BaseController
public function edit(Category $category) public function edit(Category $category)
{ {
return View::make('categories.edit')->with('category', $category) return View::make('categories.edit')->with('category', $category)
->with('subTitle', 'Edit category "' . $category->name . '"'); ->with('subTitle', 'Edit category "' . $category->name . '"');
} }
/** /**
@ -75,7 +66,7 @@ class CategoryController extends BaseController
$categories = $this->_repository->get(); $categories = $this->_repository->get();
return View::make('categories.index')->with('categories', $categories) return View::make('categories.index')->with('categories', $categories)
->with('subTitle', 'All your categories'); ->with('subTitle', 'All your categories');
} }
/** /**

View File

@ -3,40 +3,41 @@
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
class CreateImportentriesTable extends Migration { class CreateImportentriesTable extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
* *
* @return void * @return void
*/ */
public function up() public function up()
{ {
Schema::create('importentries', function(Blueprint $table) Schema::create(
{ 'importentries', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->timestamps(); $table->timestamps();
$table->string('class',200); $table->string('class', 200);
$table->integer('importmap_id')->unsigned(); $table->integer('importmap_id')->unsigned();
$table->integer('old')->unsigned(); $table->integer('old')->unsigned();
$table->integer('new')->unsigned(); $table->integer('new')->unsigned();
// map import entries to import map. // connect import map.
// connect accounts to account_types $table->foreign('importmap_id')
$table->foreign('importmap_id') ->references('id')->on('importmaps')
->references('id')->on('importmaps') ->onDelete('cascade');
->onDelete('cascade'); }
}); );
} }
/** /**
* Reverse the migrations. * Reverse the migrations.
* *
* @return void * @return void
*/ */
public function down() public function down()
{ {
Schema::drop('importentries'); Schema::drop('importentries');
} }
} }

View File

@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAccountMeta extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::create(
'account_meta', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->integer('account_id')->unsigned();
$table->string('name');
$table->text('data');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
Schema::drop('account_meta');
}
}

View File

@ -16,14 +16,14 @@ use LaravelBook\Ardent\Builder;
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions * @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \Illuminate\Database\Eloquent\Collection|\Piggybank[] $piggybanks * @property-read \Illuminate\Database\Eloquent\Collection|\Piggybank[] $piggybanks
* @property-read \User $user * @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Account whereId($value) * @method static \Illuminate\Database\Query\Builder|\Account whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Account whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Account whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\Account whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereAccountTypeId($value) * @method static \Illuminate\Database\Query\Builder|\Account whereAccountTypeId($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereName($value) * @method static \Illuminate\Database\Query\Builder|\Account whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Account whereActive($value) * @method static \Illuminate\Database\Query\Builder|\Account whereActive($value)
* @method static \Account accountTypeIn($types) * @method static \Account accountTypeIn($types)
*/ */
class Account extends Ardent class Account extends Ardent
{ {
@ -42,17 +42,7 @@ class Account extends Ardent
]; ];
protected $fillable = ['name','user_id','account_type_id','active']; protected $fillable = ['name', 'user_id', 'account_type_id', 'active'];
/**
* Account type.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function accountType()
{
return $this->belongsTo('AccountType');
}
/** /**
* Get an accounts current balance. * Get an accounts current balance.
@ -68,26 +58,41 @@ class Account extends Ardent
return floatval( return floatval(
$this->transactions() $this->transactions()
->leftJoin( ->leftJoin(
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id' 'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
) )
->where('transaction_journals.date', '<=', $date->format('Y-m-d'))->sum('transactions.amount') ->where('transaction_journals.date', '<=', $date->format('Y-m-d'))->sum('transactions.amount')
); );
} }
/**
* @param TransactionJournal $journal
*
* @return float
*/
public function balanceBeforeJournal(TransactionJournal $journal) public function balanceBeforeJournal(TransactionJournal $journal)
{ {
return floatval( return floatval(
$this->transactions() $this->transactions()
->leftJoin( ->leftJoin(
'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id' 'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id'
) )
->where('transaction_journals.date', '<=', $journal->date->format('Y-m-d')) ->where('transaction_journals.date', '<=', $journal->date->format('Y-m-d'))
->where('transaction_journals.created_at', '<=', $journal->created_at->format('Y-m-d H:i:s')) ->where('transaction_journals.created_at', '<=', $journal->created_at->format('Y-m-d H:i:s'))
->where('transaction_journals.id','!=',$journal->id) ->where('transaction_journals.id', '!=', $journal->id)
->sum('transactions.amount') ->sum('transactions.amount')
); );
} }
/**
* Account type.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function accountType()
{
return $this->belongsTo('AccountType');
}
/** /**
* Transactions. * Transactions.
* *
@ -114,8 +119,7 @@ class Account extends Ardent
public function predict( public function predict(
/** @noinspection PhpUnusedParameterInspection */ /** @noinspection PhpUnusedParameterInspection */
\Carbon\Carbon $date \Carbon\Carbon $date
) ) {
{
return null; return null;
} }
@ -129,12 +133,17 @@ class Account extends Ardent
return $this->belongsTo('User'); return $this->belongsTo('User');
} }
public function scopeAccountTypeIn(Builder $query, array $types) { /**
if(is_null($this->joinedAccountTypes)) { * @param Builder $query
$query->leftJoin('account_types','account_types.id','=','accounts.account_type_id'); * @param array $types
*/
public function scopeAccountTypeIn(Builder $query, array $types)
{
if (is_null($this->joinedAccountTypes)) {
$query->leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id');
$this->joinedAccountTypes = true; $this->joinedAccountTypes = true;
} }
$query->whereIn('account_types.type',$types); $query->whereIn('account_types.type', $types);
} }

View File

@ -0,0 +1,35 @@
<?php
use LaravelBook\Ardent\Ardent as Ardent;
/**
* AccountMeta
*
* @property-read \Account $account
*/
class AccountMeta extends Ardent
{
/**
* @var array
*/
public static $rules
= [
'account_id' => 'numeric|required|exists:accounts,id',
'name' => 'required|between:1,250',
'data' => 'required'
];
/**
* @var array
*/
protected $fillable = ['account_id', 'name', 'date'];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function account()
{
return $this->belongsTo('Account');
}
}

View File

@ -11,11 +11,11 @@ use Illuminate\Database\Eloquent\Model as Eloquent;
* @property string $type * @property string $type
* @property boolean $editable * @property boolean $editable
* @property-read \Illuminate\Database\Eloquent\Collection|\Account[] $accounts * @property-read \Illuminate\Database\Eloquent\Collection|\Account[] $accounts
* @method static \Illuminate\Database\Query\Builder|\AccountType whereId($value) * @method static \Illuminate\Database\Query\Builder|\AccountType whereId($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\AccountType whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\AccountType whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereType($value) * @method static \Illuminate\Database\Query\Builder|\AccountType whereType($value)
* @method static \Illuminate\Database\Query\Builder|\AccountType whereEditable($value) * @method static \Illuminate\Database\Query\Builder|\AccountType whereEditable($value)
*/ */
class AccountType extends Eloquent class AccountType extends Eloquent
{ {

View File

@ -13,12 +13,12 @@
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals * @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions * @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \User $user * @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Budget whereId($value) * @method static \Illuminate\Database\Query\Builder|\Budget whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Budget whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Budget whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereName($value) * @method static \Illuminate\Database\Query\Builder|\Budget whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\Budget whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Budget whereClass($value) * @method static \Illuminate\Database\Query\Builder|\Budget whereClass($value)
*/ */
class Budget extends Component class Budget extends Component
{ {

View File

@ -13,12 +13,12 @@
* @property-read \Illuminate\Database\Eloquent\Collection|\Limit[] $limits * @property-read \Illuminate\Database\Eloquent\Collection|\Limit[] $limits
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions * @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \User $user * @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Category whereId($value) * @method static \Illuminate\Database\Query\Builder|\Category whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Category whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Category whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereName($value) * @method static \Illuminate\Database\Query\Builder|\Category whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\Category whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Category whereClass($value) * @method static \Illuminate\Database\Query\Builder|\Category whereClass($value)
*/ */
class Category extends Component class Category extends Component
{ {

View File

@ -14,12 +14,12 @@ use Firefly\Database\SingleTableInheritanceEntity;
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals * @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions * @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \User $user * @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Component whereId($value) * @method static \Illuminate\Database\Query\Builder|\Component whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Component whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Component whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereName($value) * @method static \Illuminate\Database\Query\Builder|\Component whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\Component whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Component whereClass($value) * @method static \Illuminate\Database\Query\Builder|\Component whereClass($value)
*/ */
class Component extends SingleTableInheritanceEntity class Component extends SingleTableInheritanceEntity
{ {

View File

@ -1,9 +1,9 @@
<?php <?php
use Illuminate\Database\Eloquent\Model as Eloquent; use Illuminate\Database\Eloquent\Model as Eloquent;
/** /**
* Importentry * Importentry
* *
* @property-read \Importmap $importmap
* @property integer $id * @property integer $id
* @property \Carbon\Carbon $created_at * @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $updated_at
@ -11,15 +11,17 @@ use Illuminate\Database\Eloquent\Model as Eloquent;
* @property integer $importmap_id * @property integer $importmap_id
* @property integer $old * @property integer $old
* @property integer $new * @property integer $new
* @method static \Illuminate\Database\Query\Builder|\Importentry whereId($value) * @property-read \Importmap $importmap
* @method static \Illuminate\Database\Query\Builder|\Importentry whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Importentry whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Importentry whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereClass($value) * @method static \Illuminate\Database\Query\Builder|\Importentry whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereImportmapId($value) * @method static \Illuminate\Database\Query\Builder|\Importentry whereClass($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereOld($value) * @method static \Illuminate\Database\Query\Builder|\Importentry whereImportmapId($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereNew($value) * @method static \Illuminate\Database\Query\Builder|\Importentry whereOld($value)
* @method static \Illuminate\Database\Query\Builder|\Importentry whereNew($value)
*/ */
class Importentry extends Eloquent { class Importentry extends Eloquent
{
public function importmap() public function importmap()
{ {
return $this->belongsTo('Importmap'); return $this->belongsTo('Importmap');

View File

@ -2,23 +2,23 @@
use LaravelBook\Ardent\Ardent as Ardent; use LaravelBook\Ardent\Ardent as Ardent;
/** /**
* Class Importmap * Importmap
* *
* @property-read \User $user * @property integer $id
* @property integer $id
* @property \Carbon\Carbon $created_at * @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $updated_at
* @property integer $user_id * @property integer $user_id
* @property string $file * @property string $file
* @method static \Illuminate\Database\Query\Builder|\Importmap whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereFile($value)
* @property integer $totaljobs * @property integer $totaljobs
* @property integer $jobsdone * @property integer $jobsdone
* @method static \Illuminate\Database\Query\Builder|\Importmap whereTotaljobs($value) * @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Importmap whereJobsdone($value) * @method static \Illuminate\Database\Query\Builder|\Importmap whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereFile($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereTotaljobs($value)
* @method static \Illuminate\Database\Query\Builder|\Importmap whereJobsdone($value)
*/ */
class Importmap extends Ardent class Importmap extends Ardent
{ {

View File

@ -18,14 +18,14 @@ use LaravelBook\Ardent\Ardent as Ardent;
* @property-read \Budget $budget * @property-read \Budget $budget
* @property-read \Component $component * @property-read \Component $component
* @property-read \Illuminate\Database\Eloquent\Collection|\LimitRepetition[] $limitrepetitions * @property-read \Illuminate\Database\Eloquent\Collection|\LimitRepetition[] $limitrepetitions
* @method static \Illuminate\Database\Query\Builder|\Limit whereId($value) * @method static \Illuminate\Database\Query\Builder|\Limit whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Limit whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Limit whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereComponentId($value) * @method static \Illuminate\Database\Query\Builder|\Limit whereComponentId($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereStartdate($value) * @method static \Illuminate\Database\Query\Builder|\Limit whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereAmount($value) * @method static \Illuminate\Database\Query\Builder|\Limit whereAmount($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereRepeats($value) * @method static \Illuminate\Database\Query\Builder|\Limit whereRepeats($value)
* @method static \Illuminate\Database\Query\Builder|\Limit whereRepeatFreq($value) * @method static \Illuminate\Database\Query\Builder|\Limit whereRepeatFreq($value)
*/ */
class Limit extends Ardent class Limit extends Ardent
{ {

View File

@ -5,21 +5,21 @@ use LaravelBook\Ardent\Ardent as Ardent;
/** /**
* LimitRepetition * LimitRepetition
* *
* @property integer $id * @property integer $id
* @property \Carbon\Carbon $created_at * @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $updated_at
* @property integer $limit_id * @property integer $limit_id
* @property \Carbon\Carbon $startdate * @property \Carbon\Carbon $startdate
* @property \Carbon\Carbon $enddate * @property \Carbon\Carbon $enddate
* @property float $amount * @property float $amount
* @property-read \Limit $limit * @property-read \Limit $limit
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereId($value) * @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereId($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereLimitId($value) * @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereLimitId($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereStartdate($value) * @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereEnddate($value) * @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereEnddate($value)
* @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereAmount($value) * @method static \Illuminate\Database\Query\Builder|\LimitRepetition whereAmount($value)
*/ */
class LimitRepetition extends Ardent class LimitRepetition extends Ardent
{ {

View File

@ -19,27 +19,28 @@ use LaravelBook\Ardent\Ardent as Ardent;
* @property integer $rep_times * @property integer $rep_times
* @property string $reminder * @property string $reminder
* @property integer $reminder_skip * @property integer $reminder_skip
* @property boolean $remind_me
* @property integer $order * @property integer $order
* @property-read \Account $account * @property-read \Account $account
* @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankRepetition[] $piggybankrepetitions * @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankRepetition[] $piggybankrepetitions
* @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankEvent[] $piggybankevents * @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankEvent[] $piggybankevents
* @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankReminder[] $piggybankreminders
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions * @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereId($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereAccountId($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereAccountId($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereName($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetamount($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetamount($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereStartdate($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetdate($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereTargetdate($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepeats($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepeats($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepLength($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepLength($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepEvery($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepEvery($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepTimes($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereRepTimes($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminder($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminder($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminderSkip($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereReminderSkip($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereOrder($value) * @method static \Illuminate\Database\Query\Builder|\Piggybank whereRemindMe($value)
* @method static \Illuminate\Database\Query\Builder|\Piggybank whereOrder($value)
*/ */
class Piggybank extends Ardent class Piggybank extends Ardent
{ {

View File

@ -12,12 +12,12 @@ use LaravelBook\Ardent\Ardent as Ardent;
* @property \Carbon\Carbon $date * @property \Carbon\Carbon $date
* @property float $amount * @property float $amount
* @property-read \Piggybank $piggybank * @property-read \Piggybank $piggybank
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereId($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent wherePiggybankId($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankEvent wherePiggybankId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereDate($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereDate($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereAmount($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankEvent whereAmount($value)
*/ */
class PiggybankEvent extends Ardent class PiggybankEvent extends Ardent
{ {

View File

@ -12,13 +12,13 @@ use LaravelBook\Ardent\Ardent as Ardent;
* @property \Carbon\Carbon $targetdate * @property \Carbon\Carbon $targetdate
* @property float $currentamount * @property float $currentamount
* @property-read \Piggybank $piggybank * @property-read \Piggybank $piggybank
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereId($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition wherePiggybankId($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition wherePiggybankId($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereStartdate($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereTargetdate($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereTargetdate($value)
* @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCurrentamount($value) * @method static \Illuminate\Database\Query\Builder|\PiggybankRepetition whereCurrentamount($value)
*/ */
class PiggybankRepetition extends Ardent class PiggybankRepetition extends Ardent
{ {

View File

@ -12,12 +12,12 @@ use LaravelBook\Ardent\Ardent;
* @property string $name * @property string $name
* @property string $data * @property string $data
* @property-read \User $user * @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\Preference whereId($value) * @method static \Illuminate\Database\Query\Builder|\Preference whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Preference whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Preference whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\Preference whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereName($value) * @method static \Illuminate\Database\Query\Builder|\Preference whereName($value)
* @method static \Illuminate\Database\Query\Builder|\Preference whereData($value) * @method static \Illuminate\Database\Query\Builder|\Preference whereData($value)
*/ */
class Preference extends Ardent class Preference extends Ardent
{ {

View File

@ -18,21 +18,20 @@ use LaravelBook\Ardent\Ardent;
* @property boolean $automatch * @property boolean $automatch
* @property string $repeat_freq * @property string $repeat_freq
* @property integer $skip * @property integer $skip
* @property-read \Illuminate\Database\Eloquent\Collection|\RecurringTransactionReminder[] $reminders
* @property-read \User $user * @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereId($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereId($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereName($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereName($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereMatch($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereMatch($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAmountMax($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAmountMax($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAmountMin($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAmountMin($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereDate($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereDate($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereActive($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereActive($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAutomatch($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereAutomatch($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereRepeatFreq($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereRepeatFreq($value)
* @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereSkip($value) * @method static \Illuminate\Database\Query\Builder|\RecurringTransaction whereSkip($value)
*/ */
class RecurringTransaction extends Ardent class RecurringTransaction extends Ardent
{ {

View File

@ -11,7 +11,6 @@ use LaravelBook\Ardent\Ardent;
* @property integer $id * @property integer $id
* @property \Carbon\Carbon $created_at * @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $updated_at
* @property string $class
* @property integer $user_id * @property integer $user_id
* @property \Carbon\Carbon $startdate * @property \Carbon\Carbon $startdate
* @property \Carbon\Carbon $enddate * @property \Carbon\Carbon $enddate
@ -20,7 +19,6 @@ use LaravelBook\Ardent\Ardent;
* @method static \Illuminate\Database\Query\Builder|\Reminder whereId($value) * @method static \Illuminate\Database\Query\Builder|\Reminder whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Reminder whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Reminder whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereClass($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereUserId($value) * @method static \Illuminate\Database\Query\Builder|\Reminder whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereStartdate($value) * @method static \Illuminate\Database\Query\Builder|\Reminder whereStartdate($value)
* @method static \Illuminate\Database\Query\Builder|\Reminder whereEnddate($value) * @method static \Illuminate\Database\Query\Builder|\Reminder whereEnddate($value)

View File

@ -8,34 +8,34 @@ use LaravelBook\Ardent\Builder;
/** /**
* Transaction * Transaction
* *
* @property integer $id * @property integer $id
* @property \Carbon\Carbon $created_at * @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $updated_at
* @property integer $account_id * @property integer $account_id
* @property integer $piggybank_id * @property integer $piggybank_id
* @property integer $transaction_journal_id * @property integer $transaction_journal_id
* @property string $description * @property string $description
* @property float $amount * @property float $amount
* @property-read \Account $account * @property-read \Account $account
* @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets * @property-read \Piggybank $piggybank
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories * @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components * @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
* @property-read \Piggybank $piggybank * @property-read \TransactionJournal $transactionJournal
* @property-read \TransactionJournal $transactionJournal * @method static \Illuminate\Database\Query\Builder|\Transaction whereId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereId($value) * @method static \Illuminate\Database\Query\Builder|\Transaction whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Transaction whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\Transaction whereAccountId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereAccountId($value) * @method static \Illuminate\Database\Query\Builder|\Transaction wherePiggybankId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction wherePiggybankId($value) * @method static \Illuminate\Database\Query\Builder|\Transaction whereTransactionJournalId($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereTransactionJournalId($value) * @method static \Illuminate\Database\Query\Builder|\Transaction whereDescription($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereDescription($value) * @method static \Illuminate\Database\Query\Builder|\Transaction whereAmount($value)
* @method static \Illuminate\Database\Query\Builder|\Transaction whereAmount($value) * @method static \Transaction accountIs($account)
* @method static \Transaction accountIs($account) * @method static \Transaction after($date)
* @method static \Transaction after($date) * @method static \Transaction before($date)
* @method static \Transaction before($date) * @method static \Transaction lessThan($amount)
* @method static \Transaction lessThan($amount) * @method static \Transaction moreThan($amount)
* @method static \Transaction moreThan($amount) * @method static \Transaction transactionTypes($types)
* @method static \Transaction transactionTypes($types)
*/ */
class Transaction extends Ardent class Transaction extends Ardent
{ {

View File

@ -1,5 +1,6 @@
<?php <?php
use Illuminate\Database\Eloquent\Model as Eloquent; use Illuminate\Database\Eloquent\Model as Eloquent;
/** /**
* TransactionCurrency * TransactionCurrency
* *
@ -8,10 +9,10 @@ use Illuminate\Database\Eloquent\Model as Eloquent;
* @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $updated_at
* @property string $code * @property string $code
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals * @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereId($value) * @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereCode($value) * @method static \Illuminate\Database\Query\Builder|\TransactionCurrency whereCode($value)
*/ */
class TransactionCurrency extends Eloquent class TransactionCurrency extends Eloquent
{ {

View File

@ -4,6 +4,49 @@ use Carbon\Carbon;
use LaravelBook\Ardent\Ardent; use LaravelBook\Ardent\Ardent;
use LaravelBook\Ardent\Builder; use LaravelBook\Ardent\Builder;
/**
* TransactionJournal
*
* @property integer $id
* @property \Carbon\Carbon $created_at
* @property \Carbon\Carbon $updated_at
* @property integer $user_id
* @property integer $transaction_type_id
* @property integer $recurring_transaction_id
* @property integer $transaction_currency_id
* @property string $description
* @property boolean $completed
* @property \Carbon\Carbon $date
* @property-read \Illuminate\Database\Eloquent\Collection|\
* 'Budget[] $budgets
* @property-read \Illuminate\Database\Eloquent\Collection|\
* 'Category[] $categories
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
* @property-read \RecurringTransaction $recurringTransaction
* @property-read \TransactionCurrency $transactionCurrency
* @property-read \TransactionType $transactionType
* @property-read \Illuminate\Database\Eloquent\Collection|\Transaction[] $transactions
* @property-read \User $user
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereUserId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereTransactionTypeId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereRecurringTransactionId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereTransactionCurrencyId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereDescription($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereCompleted($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionJournal whereDate($value)
* @method static \TransactionJournal accountIs($account)
* @method static \TransactionJournal after($date)
* @method static \TransactionJournal before($date)
* @method static \TransactionJournal defaultSorting()
* @method static \TransactionJournal moreThan($amount)
* @method static \TransactionJournal lessThan($amount)
* @method static \TransactionJournal onDate($date)
* @method static \TransactionJournal transactionTypes($types)
* @method static \TransactionJournal withRelevantData()
*/
class TransactionJournal extends Ardent class TransactionJournal extends Ardent
{ {

View File

@ -10,10 +10,10 @@ use LaravelBook\Ardent\Ardent;
* @property \Carbon\Carbon $updated_at * @property \Carbon\Carbon $updated_at
* @property string $type * @property string $type
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionJournals * @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionJournals
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereId($value) * @method static \Illuminate\Database\Query\Builder|\TransactionType whereId($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\TransactionType whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\TransactionType whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\TransactionType whereType($value) * @method static \Illuminate\Database\Query\Builder|\TransactionType whereType($value)
*/ */
class TransactionType extends Ardent class TransactionType extends Ardent
{ {

View File

@ -6,7 +6,6 @@ use Illuminate\Auth\UserInterface;
use Illuminate\Auth\UserTrait; use Illuminate\Auth\UserTrait;
use LaravelBook\Ardent\Ardent; use LaravelBook\Ardent\Ardent;
/** /**
* User * User
* *
@ -20,21 +19,19 @@ use LaravelBook\Ardent\Ardent;
* @property boolean $migrated * @property boolean $migrated
* @property-read \Illuminate\Database\Eloquent\Collection|\Account[] $accounts * @property-read \Illuminate\Database\Eloquent\Collection|\Account[] $accounts
* @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets * @property-read \Illuminate\Database\Eloquent\Collection|\Budget[] $budgets
* @property-read \Illuminate\Database\Eloquent\Collection|\Reminder[] $reminders
* @property-read \Illuminate\Database\Eloquent\Collection|\PiggybankReminder[] $piggybankreminders
* @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories * @property-read \Illuminate\Database\Eloquent\Collection|\Category[] $categories
* @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components * @property-read \Illuminate\Database\Eloquent\Collection|\Component[] $components
* @property-read \Illuminate\Database\Eloquent\Collection|\Preference[] $preferences * @property-read \Illuminate\Database\Eloquent\Collection|\Preference[] $preferences
* @property-read \Illuminate\Database\Eloquent\Collection|\RecurringTransaction[] $recurringtransactions * @property-read \Illuminate\Database\Eloquent\Collection|\RecurringTransaction[] $recurringtransactions
* @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals * @property-read \Illuminate\Database\Eloquent\Collection|\TransactionJournal[] $transactionjournals
* @method static \Illuminate\Database\Query\Builder|\User whereId($value) * @method static \Illuminate\Database\Query\Builder|\User whereId($value)
* @method static \Illuminate\Database\Query\Builder|\User whereCreatedAt($value) * @method static \Illuminate\Database\Query\Builder|\User whereCreatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\User whereUpdatedAt($value) * @method static \Illuminate\Database\Query\Builder|\User whereUpdatedAt($value)
* @method static \Illuminate\Database\Query\Builder|\User whereEmail($value) * @method static \Illuminate\Database\Query\Builder|\User whereEmail($value)
* @method static \Illuminate\Database\Query\Builder|\User wherePassword($value) * @method static \Illuminate\Database\Query\Builder|\User wherePassword($value)
* @method static \Illuminate\Database\Query\Builder|\User whereReset($value) * @method static \Illuminate\Database\Query\Builder|\User whereReset($value)
* @method static \Illuminate\Database\Query\Builder|\User whereRememberToken($value) * @method static \Illuminate\Database\Query\Builder|\User whereRememberToken($value)
* @method static \Illuminate\Database\Query\Builder|\User whereMigrated($value) * @method static \Illuminate\Database\Query\Builder|\User whereMigrated($value)
*/ */
class User extends Ardent implements UserInterface, RemindableInterface class User extends Ardent implements UserInterface, RemindableInterface
{ {