Build everything to deal with tax rates.

This commit is contained in:
2024-12-11 11:52:14 +01:00
parent 64e11864d2
commit 13c23a076a
11 changed files with 468 additions and 13 deletions

View File

@@ -4,8 +4,28 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Number;
class Taxrate extends Model
{
use SoftDeletes;
protected $fillable = [
'name',
'rate',
'active',
];
/**
* The attributes that are appended with attribute getters.
*
* @var string[]
*/
protected $appends = [
'rate_percentage',
];
public function getRatePercentageAttribute()
{
return Number::percentage($this->rate, 2, 8, 'de');
}
}