Document/Util/SaleDocumentUtil.php
static public function isSaleSupportsDocumentType(SaleInterface $sale, $type)
    {
        if (!DocumentTypes::isValidType($type)) {
            return false;
        }

        if (empty($classes = DocumentTypes::getClasses($type))) {
            return false;
        }

        foreach ($classes as $class) {
            if (is_subclass_of($sale, $class)) {
                return true;
            }
        }

        return false;
    }
static public function isSaleSupportsDocumentType(SaleInterface $sale, $type)
    {
        if (!DocumentTypes::isValidType($type)) {
            return false;
        }

        if (empty($classes = DocumentTypes::getClasses($type))) {
            return false;
        }

        foreach ($classes as $class) {
            if (is_subclass_of($sale, $class)) {
                return true;
            }
        }

        return false;
    }
Returns whether the sale supports the given document type.

@param SaleInterface $sale
@param string        $type

@return bool