From e41ee8083d0a1df89ea9fb029ba79e7399d6e772 Mon Sep 17 00:00:00 2001 From: Darko Gjorgjijoski <5760249+gdarko@users.noreply.github.com> Date: Fri, 12 Jun 2026 11:27:56 +0200 Subject: [PATCH] fix(documents): preserve edited line-item description (#658) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The per-line item description typed into the row's textarea was never saved. BaseItemSelect's description field pushes edits out only via an `update:description` emit, but DocumentItemRow (the single shared row used by invoices, estimates, and recurring invoices) wired only `@search` and `@select` — so the emit was dropped and `form.items[index].description` never updated. On submit the field was lost; a catalog item's description also reverted on the next re-render. Capture the event and route it through the existing `updateItemAttribute` store updater, mirroring how name/quantity/price/discount already sync. One fix covers all three document types since they share the row. Also add the missing `items.*.description` nullable rule to RecurringInvoiceRequest for parity with the invoice/estimate requests. The backend already persisted and returned description correctly; this was purely a dropped frontend event. --- app/Http/Requests/RecurringInvoiceRequest.php | 3 +++ .../scripts/features/shared/document-form/DocumentItemRow.vue | 1 + 2 files changed, 4 insertions(+) diff --git a/app/Http/Requests/RecurringInvoiceRequest.php b/app/Http/Requests/RecurringInvoiceRequest.php index e5cd7d08..ebb025d6 100644 --- a/app/Http/Requests/RecurringInvoiceRequest.php +++ b/app/Http/Requests/RecurringInvoiceRequest.php @@ -83,6 +83,9 @@ class RecurringInvoiceRequest extends FormRequest 'items.*' => [ 'required', ], + 'items.*.description' => [ + 'nullable', + ], ]; $customer = Customer::find($this->customer_id); diff --git a/resources/scripts/features/shared/document-form/DocumentItemRow.vue b/resources/scripts/features/shared/document-form/DocumentItemRow.vue index f5137665..827e5ccd 100644 --- a/resources/scripts/features/shared/document-form/DocumentItemRow.vue +++ b/resources/scripts/features/shared/document-form/DocumentItemRow.vue @@ -33,6 +33,7 @@ :store="store" @search="searchVal" @select="onSelectItem" + @update:description="updateItemAttribute('description', $event)" />