code: protected function getSaleFromInvoice(InvoiceInterface $invoice)
      {
          if (null === $sale = $invoice->getSale()) {
              $cs = $this->persistenceHelper->getChangeSet($invoice, $this->getSalePropertyPath());
              if (!empty($cs)) {
                  $sale = $cs[0];
              }
          }
  
          if (!$sale instanceof SaleInterface) {
              throw new Exception\RuntimeException("Failed to retrieve invoice's sale.");
          }
  
          return $sale;
      }
docs: Returns the invoice's sale.
  
  @param InvoiceInterface $invoice
  
  @return SaleInterface|InvoiceSubjectInterface