Document/Calculator/DocumentCalculator.php
protected function calculateGoodLines(Model\DocumentInterface $document): Amount
    {
        $gross = new Amount($document->getCurrency());

        foreach ($document->getLinesByType(Model\DocumentLineTypes::TYPE_GOOD) as $line) {
            if (null !== $result = $this->calculateGoodLine($line)) {
                $gross->merge($result);
            }
        }

        $gross->copyGrossToUnit();

        return $gross;
    }
protected function calculateGoodLines(Model\DocumentInterface $document): Amount
    {
        $gross = new Amount($document->getCurrency());

        foreach ($document->getLinesByType(Model\DocumentLineTypes::TYPE_GOOD) as $line) {
            if (null !== $result = $this->calculateGoodLine($line)) {
                $gross->merge($result);
            }
        }

        $gross->copyGrossToUnit();

        return $gross;
    }
Calculates the good lines.

@param Model\DocumentInterface $document

@return Amount