From 2d81aa2fb0699c325fd4a5be39c1973d5c3264f3 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sat, 16 May 2026 00:01:12 +0300 Subject: [PATCH] fix: add missing line_total field during invoice item insertion to prevent General error 1364 --- app/Services/InvoiceProcessor.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Services/InvoiceProcessor.php b/app/Services/InvoiceProcessor.php index 86c2336..86e12aa 100644 --- a/app/Services/InvoiceProcessor.php +++ b/app/Services/InvoiceProcessor.php @@ -125,8 +125,8 @@ class InvoiceProcessor INSERT INTO invoice_lines ( id, invoice_id, line_number, description, quantity, unit_price, tax_rate, tax_amount, - discount_amount, net_total, tax_category - ) VALUES (?,?,?,?,?,?,?,?,?,?,?) + discount_amount, net_total, line_total, tax_category + ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?) "); foreach ($extracted['lines'] as $idx => $line) { $quantity = (float)($line['quantity'] ?? 1); @@ -148,6 +148,7 @@ class InvoiceProcessor $taxAmount, $discount, $netTotal, + $netTotal, // line_total $line['tax_category'] ?? 'standard' ]); }