2017-09-14 22:21:00 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models\Setting;
|
|
|
|
|
|
|
|
use App\Models\Model;
|
|
|
|
|
|
|
|
class Tax extends Model
|
|
|
|
{
|
|
|
|
|
|
|
|
protected $table = 'taxes';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attributes that should be mass-assignable.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $fillable = ['company_id', 'name', 'rate', 'enabled'];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sortable columns.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
public $sortable = ['name', 'rate', 'enabled'];
|
|
|
|
|
|
|
|
public function items()
|
|
|
|
{
|
|
|
|
return $this->hasMany('App\Models\Item\Item');
|
|
|
|
}
|
|
|
|
|
2017-10-16 01:06:49 +03:00
|
|
|
public function bill_items()
|
2017-09-14 22:21:00 +03:00
|
|
|
{
|
2017-10-16 01:06:49 +03:00
|
|
|
return $this->hasMany('App\Models\Expense\BillItem');
|
2017-09-14 22:21:00 +03:00
|
|
|
}
|
|
|
|
|
2017-10-16 01:06:49 +03:00
|
|
|
public function invoice_items()
|
2017-09-14 22:21:00 +03:00
|
|
|
{
|
2017-10-16 01:06:49 +03:00
|
|
|
return $this->hasMany('App\Models\Income\InvoiceItem');
|
2017-09-14 22:21:00 +03:00
|
|
|
}
|
|
|
|
}
|