PDF: remove part codes; payments: pre-fill amount with balance due

- PDF parts table: removed Cod/article column, widened Denumire column,
  fixed colspan in tfoot from 4 to 3
- PaymentsRelationManager: amount field now defaults to (total - paidAmount)
  so it pre-fills with the remaining balance; always editable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-08 07:23:06 +00:00
parent b0433b66c7
commit 7c0c728347
2 changed files with 11 additions and 6 deletions
@@ -25,7 +25,14 @@ class PaymentsRelationManager extends RelationManager
{
return $schema->components([
Forms\Components\DatePicker::make('paid_at')->label(__('Data'))->default(today())->required(),
Forms\Components\TextInput::make('amount')->label(__('Sumă'))->numeric()->required(),
Forms\Components\TextInput::make('amount')
->label(__('Sumă'))
->numeric()
->required()
->default(function (RelationManager $livewire): float {
$wo = $livewire->getOwnerRecord();
return max(0.0, (float) $wo->total - $wo->paidAmount());
}),
Forms\Components\Select::make('method')
->options(\App\Support\I18n::opts(Payment::METHODS))
->default('cash')