In DB you can change 'state' Column value to 2 in 'sales_invoice' table.
Gel all invoice state : vendor/magento/module-sales/Model/Order/Invoice.php
const STATE_OPEN = 1;
const STATE_PAID = 2;
const STATE_CANCELED = 3;
For changing the state by coding, looks this model : vendor/magento/module-sales/Model/InvoiceOrder.php
$connection->beginTransaction();
try {
$order = $this->paymentAdapter->pay($order, $invoice, $capture);
$order->setState(
$this->orderStateResolver->getStateForOrder($order, [OrderStateResolverInterface::IN_PROGRESS])
);
$order->setStatus($this->config->getStateDefaultStatus($order->getState()));
$invoice->setState(\Magento\Sales\Model\Order\Invoice::STATE_PAID);
$this->invoiceRepository->save($invoice);
$this->orderRepository->save($order);
$connection->commit();
} catch (\Exception $e) {
$this->logger->critical($e);
$connection->rollBack();
throw new \Magento\Sales\Exception\CouldNotInvoiceException(
__('Could not save an invoice, see error log for details')
);
}