withholding tax
This commit is contained in:
@ -54,6 +54,50 @@ class Tax extends Model
|
||||
return $query->where('rate', '=', $rate);
|
||||
}
|
||||
|
||||
public function scopeNotRate($query, $rate)
|
||||
{
|
||||
return $query->where('rate', '<>', $rate);
|
||||
}
|
||||
|
||||
public function scopeType($query, $types)
|
||||
{
|
||||
if (empty($types)) {
|
||||
return $query;
|
||||
}
|
||||
|
||||
return $query->whereIn($this->table . '.type', (array) $types);
|
||||
}
|
||||
|
||||
public function scopeFixed($query)
|
||||
{
|
||||
return $query->where($this->table . '.type', '=', 'fixed');
|
||||
}
|
||||
|
||||
public function scopeNormal($query)
|
||||
{
|
||||
return $query->where($this->table . '.type', '=', 'normal');
|
||||
}
|
||||
|
||||
public function scopeInclusive($query)
|
||||
{
|
||||
return $query->where($this->table . '.type', '=', 'inclusive');
|
||||
}
|
||||
|
||||
public function scopeCompound($query)
|
||||
{
|
||||
return $query->where($this->table . '.type', '=', 'compound');
|
||||
}
|
||||
|
||||
public function scopeWithholding($query)
|
||||
{
|
||||
return $query->where($this->table . '.type', '=', 'withholding');
|
||||
}
|
||||
|
||||
public function scopeNotWithholding($query)
|
||||
{
|
||||
return $query->where($this->table . '.type', '<>', 'withholding');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert rate to double.
|
||||
*
|
||||
|
Reference in New Issue
Block a user