Fix total readOnly, label pay_status/discount, add RU/EN translations

- pay_status: add label Statut plată (was showing English auto-label)
- discount_pct: rename label to Reducere % (standard RO terminology)
- total: disabled() → readOnly() so field looks active (not grayed out)
  while still preventing manual editing; $set() from discount live works
- Add ru/en translations: Statut plată, Reducere %

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-08 07:43:51 +00:00
parent 116495ce0b
commit 1215bc8be2
3 changed files with 7 additions and 3 deletions
@@ -148,9 +148,9 @@ class WorkOrderResource extends Resource
Schemas\Components\Section::make(__('Plată & total'))
->columns(3)->collapsible()->collapsed()->compact()
->schema([
Forms\Components\Select::make('pay_status')->options(\App\Support\I18n::opts(WorkOrder::PAY_STATUSES))->default('unpaid')->required(),
Forms\Components\Select::make('pay_status')->label(__('Statut plată'))->options(\App\Support\I18n::opts(WorkOrder::PAY_STATUSES))->default('unpaid')->required(),
Forms\Components\TextInput::make('discount_pct')
->label(__('Discount %'))
->label(__('Reducere %'))
->numeric()
->default(0)
->live(onBlur: true)
@@ -173,7 +173,7 @@ class WorkOrderResource extends Resource
->placeholder(__('Ex: 25'))
->helperText(__('Doar pentru cazuri speciale. Lasă gol → folosește marja mecanicului.'))
->visible(fn () => auth()->user()?->canDo(\App\Auth\Permissions::FINANCE_VIEW_INTERNAL_MARGIN) ?? false),
Forms\Components\TextInput::make('total')->label(__('Total'))->numeric()->disabled()->dehydrated(false),
Forms\Components\TextInput::make('total')->label(__('Total'))->numeric()->readOnly()->dehydrated(false),
Forms\Components\Toggle::make('approved')->label(__('Aprobat de client')),
Forms\Components\DatePicker::make('closed_at')->label(__('Închis')),
]),