mirror of
https://github.com/crater-invoice/crater.git
synced 2025-12-15 09:52:55 -05:00
v5.0.0 update
This commit is contained in:
@@ -20,6 +20,7 @@ class TaxType extends Model
|
||||
|
||||
protected $casts = [
|
||||
'percent' => 'float',
|
||||
'compound_tax' => 'boolean'
|
||||
];
|
||||
|
||||
public function taxes()
|
||||
@@ -27,9 +28,14 @@ class TaxType extends Model
|
||||
return $this->hasMany(Tax::class);
|
||||
}
|
||||
|
||||
public function scopeWhereCompany($query, $company_id)
|
||||
public function company()
|
||||
{
|
||||
$query->where('company_id', $company_id);
|
||||
return $this->belongsTo(Company::class);
|
||||
}
|
||||
|
||||
public function scopeWhereCompany($query)
|
||||
{
|
||||
$query->where('company_id', request()->header('company'));
|
||||
}
|
||||
|
||||
public function scopeWhereTaxType($query, $tax_type_id)
|
||||
@@ -73,7 +79,7 @@ class TaxType extends Model
|
||||
public function scopePaginateData($query, $limit)
|
||||
{
|
||||
if ($limit == 'all') {
|
||||
return collect(['data' => $query->get()]);
|
||||
return $query->get();
|
||||
}
|
||||
|
||||
return $query->paginate($limit);
|
||||
|
||||
Reference in New Issue
Block a user