1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Link project to client so we get some default when adding to an invoice

This commit is contained in:
Troels Liebe Bentsen 2014-10-15 01:50:03 +02:00
parent acd5b7118e
commit 79908e75eb
3 changed files with 11 additions and 0 deletions

View File

@ -16,6 +16,7 @@ class AddTimesheets extends Migration {
$t->increments('id');
$t->unsignedInteger('user_id');
$t->unsignedInteger('account_id')->index();
$t->unsignedInteger('client_id')->nullable();
$t->timestamps();
$t->softDeletes();

View File

@ -31,6 +31,11 @@ class Client extends EntityModel
{
return $this->hasMany('Contact');
}
public function projects()
{
return $this->hasMany('Project');
}
public function country()
{

View File

@ -15,6 +15,11 @@ class Project extends Eloquent
return $this->belongsTo('User');
}
public function client()
{
return $this->belongsTo('Client');
}
public function codes()
{
return $this->hasMany('ProjectCode');