Invoice/EventListener/AbstractInvoiceListener.php
protected function updateTotals(InvoiceInterface $invoice)
    {
        $changed = $this->invoiceCalculator->calculate($invoice);

        if ($changed) {
            foreach ($invoice->getLines() as $line) {
                $this->persistenceHelper->persistAndRecompute($line, false);
            }
        }

        return $changed;
    }
protected function updateTotals(InvoiceInterface $invoice)
    {
        $changed = $this->invoiceCalculator->calculate($invoice);

        if ($changed) {
            foreach ($invoice->getLines() as $line) {
                $this->persistenceHelper->persistAndRecompute($line, false);
            }
        }

        return $changed;
    }
Updates the invoice totals.

@param InvoiceInterface $invoice

@return bool