fix: add missing line_total field during invoice item insertion to prevent General error 1364
This commit is contained in:
@@ -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'
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user