code: 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;
      }
docs: Returns whether the sale supports the given document type.
  
  @param SaleInterface $sale
  @param string        $type
  
  @return bool