protected function copyVatInfoToChildren(array $parent, array $children)
    {
        static $vatMetaInfoTags = array(
            Meta::VatRateMin,
            Meta::VatRateMax,
            Meta::VatRateLookup,
            Meta::VatRateLookupLabel,
            Meta::VatRateLookupSource,
            Meta::VatRateLookupMatches,
            Meta::VatClassId,
            Meta::VatClassName,
        );

        foreach ($children as &$child) {
            if (isset($parent[Tag::VatRate])) {
                $child[Tag::VatRate] = $parent[Tag::VatRate];
            }
            $child[Meta::VatAmount] = 0;
            foreach ($vatMetaInfoTags as $tag) {
                unset($child[$tag]);
            }

            if (Completor::isCorrectVatRate($parent[Meta::VatRateSource])) {
                $child[Meta::VatRateSource] = Completor::VatRateSource_Copied_From_Parent;
            } else {
                // The parent does not yet have correct vat rate info, so also
                // copy the meta data to the child, so later phases can also
                // correct the children.
                $child[Meta::VatRateSource] = $parent[Meta::VatRateSource];
                foreach ($vatMetaInfoTags as $tag) {
                    if (isset($parent[$tag])) {
                        $child[$tag] = $parent[$tag];
                    }
                }
            }

            $child[Meta::LineVatAmount] = 0;
            unset($child[Meta::LineDiscountVatAmount]);
        }
        return $children;
    }