src/Invoice/FlattenerInvoiceLines.php
protected function keepSeparateLines(array $parent, array $children)
    {
        $invoiceSettings = $this->config->getInvoiceSettings();
        if (!$this->haveSameVatRate($children)) {
            // We MUST keep them separate to retain correct vat info.
            $separateLines = true;
        } elseif (!$invoiceSettings['optionsShow']) {
            // Do not kshow the children info at all, but do collect price info.
            $separateLines = false;
        } elseif (count($children) <= $invoiceSettings['optionsAllOn1Line']) {
            $separateLines = false;
        } elseif (count($children) >= $invoiceSettings['optionsAllOnOwnLine']) {
            $separateLines = true;
        } else {
            $childrenText = $this->getMergedLinesText($parent, $children);
            $separateLines = strlen($childrenText) > $invoiceSettings['optionsMaxLength'];
        }
        return $separateLines;
    }
protected function keepSeparateLines(array $parent, array $children)
    {
        $invoiceSettings = $this->config->getInvoiceSettings();
        if (!$this->haveSameVatRate($children)) {
            // We MUST keep them separate to retain correct vat info.
            $separateLines = true;
        } elseif (!$invoiceSettings['optionsShow']) {
            // Do not kshow the children info at all, but do collect price info.
            $separateLines = false;
        } elseif (count($children) <= $invoiceSettings['optionsAllOn1Line']) {
            $separateLines = false;
        } elseif (count($children) >= $invoiceSettings['optionsAllOnOwnLine']) {
            $separateLines = true;
        } else {
            $childrenText = $this->getMergedLinesText($parent, $children);
            $separateLines = strlen($childrenText) > $invoiceSettings['optionsMaxLength'];
        }
        return $separateLines;
    }
protected function keepSeparateLines ( array $ parent , array $ children ) { $ invoiceSettings = $ this -> config -> getInvoiceSettings ( ) ; if ( ! $ this -> haveSameVatRate ( $ children ) ) { // We MUST keep them separate to retain correct vat info. $ separateLines = true ; } elseif ( ! $ invoiceSettings [ 'optionsShow' ] ) { // Do not kshow the children info at all, but do collect price info. $ separateLines = false ; } elseif ( count ( $ children ) <= $ invoiceSettings [ 'optionsAllOn1Line' ] ) { $ separateLines = false ; } elseif ( count ( $ children ) >= $ invoiceSettings [ 'optionsAllOnOwnLine' ] ) { $ separateLines = true ; } else { $ childrenText = $ this -> getMergedLinesText ( $ parent , $ children ) ; $ separateLines = strlen ( $ childrenText ) > $ invoiceSettings [ 'optionsMaxLength' ] ; } return $ separateLines ; }
Determines whether to keep the children on separate lines.

This base implementation decides based on:
- Whether all lines have the same VAT rate (different VAT rates => keep)
- The settings for:
* optionsShow
* optionsAllOn1Line
* optionsAllOnOwnLine
* optionsMaxLength

Override if you want other logic to decide on.

@param array $parent
The parent invoice line.
@param array[] $children
A flattened array of child invoice lines.

@return bool
True if the lines should remain separate, false otherwise.
Determines whether to keep the children on separate lines .