deleteRemovedLineItems($record, $lineItems); $this->handleLineItems($record, $lineItems); $totals = $this->updateDocumentTotals($record, $data); $data = array_merge($data, $totals); $record = parent::handleRecordUpdate($record, $data); if (! $record->initialTransaction) { $record->createInitialTransaction(); } else { $record->updateInitialTransaction(); } return $record; } }