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:
+8
-1
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user