'Pe oră (normă × tarif)', 'fixed' => 'Preț fix', ]; protected $fillable = [ 'company_id', 'category', 'name_ro', 'name_ru', 'code', 'hours', 'pricing_mode', 'fixed_price', 'price', 'is_active', 'notes', ]; protected $casts = [ 'hours' => 'decimal:2', 'fixed_price' => 'decimal:2', 'price' => 'decimal:2', 'is_active' => 'boolean', ]; public function laborParts(): HasMany { return $this->hasMany(LaborPart::class); } /** Effective line total for this labor given the tenant hourly rate. */ public function effectiveTotal(float $hourlyRate): float { if ($this->pricing_mode === 'fixed') { return (float) $this->fixed_price; } return round((float) $this->hours * $hourlyRate, 2); } }