fix: remove redundant Achitat field when pay_status != partial

The read-only Achitat (MDL) display is unnecessary — the Total field
already shows the amount. Only show the editable Sumă achitată field
when partial is selected; rest de achitat remains always visible.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-08 12:16:44 +00:00
parent 2e5955beea
commit 8eb9d43525
@@ -184,12 +184,6 @@ class WorkOrderResource extends Resource
->default(fn ($record) => $record ? $record->paidAmount() : 0) ->default(fn ($record) => $record ? $record->paidAmount() : 0)
->visible(fn (Get $get) => $get('pay_status') === 'partial') ->visible(fn (Get $get) => $get('pay_status') === 'partial')
->helperText(__('Introduceți suma achitată — se înregistrează automat ca plată la salvare')), ->helperText(__('Introduceți suma achitată — se înregistrează automat ca plată la salvare')),
Forms\Components\TextInput::make('_achitat')
->label(__('Achitat (MDL)'))
->readOnly()->dehydrated(false)
->default(fn ($record) => $record ? number_format($record->paidAmount(), 2, '.', '') : '0.00')
->visible(fn (Get $get) => $get('pay_status') !== 'partial')
->extraAttributes(['style' => 'color:#16a34a;font-weight:600']),
Forms\Components\TextInput::make('_rest') Forms\Components\TextInput::make('_rest')
->label(__('Rest de achitat (MDL)')) ->label(__('Rest de achitat (MDL)'))
->readOnly()->dehydrated(false) ->readOnly()->dehydrated(false)