handleLineItems($record, collect($data['lineItems'] ?? [])); $totals = $this->updateDocumentTotals($record, $data); $record->updateQuietly($totals); if (! $record->initialTransaction) { $record->createInitialTransaction(); } return $record; } }