withholding tax

This commit is contained in:
Denis Duliçi
2020-07-22 15:11:31 +03:00
parent 2b0c2e4846
commit 010d0bb3fb
13 changed files with 635 additions and 280 deletions

View File

@ -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.
*