categories for invoices/bills
This commit is contained in:
@ -60,6 +60,11 @@ class Bill extends Model
|
||||
*/
|
||||
protected $cloneable_relations = ['items', 'totals'];
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Setting\Category');
|
||||
}
|
||||
|
||||
public function vendor()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Expense\Vendor');
|
||||
|
@ -61,6 +61,11 @@ class Invoice extends Model
|
||||
*/
|
||||
protected $cloneable_relations = ['items', 'totals'];
|
||||
|
||||
public function category()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Setting\Category');
|
||||
}
|
||||
|
||||
public function customer()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Income\Customer');
|
||||
|
@ -22,9 +22,19 @@ class Category extends Model
|
||||
*/
|
||||
public $sortable = ['name', 'type', 'enabled'];
|
||||
|
||||
public function revenues()
|
||||
public function bills()
|
||||
{
|
||||
return $this->hasMany('App\Models\Income\Revenue');
|
||||
return $this->hasMany('App\Models\Expense\Bill');
|
||||
}
|
||||
|
||||
public function invoices()
|
||||
{
|
||||
return $this->hasMany('App\Models\Income\Invoice');
|
||||
}
|
||||
|
||||
public function items()
|
||||
{
|
||||
return $this->hasMany('App\Models\Item\Item');
|
||||
}
|
||||
|
||||
public function payments()
|
||||
@ -32,9 +42,9 @@ class Category extends Model
|
||||
return $this->hasMany('App\Models\Expense\Payment');
|
||||
}
|
||||
|
||||
public function items()
|
||||
public function revenues()
|
||||
{
|
||||
return $this->hasMany('App\Models\Item\Item');
|
||||
return $this->hasMany('App\Models\Income\Revenue');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user