diff --git a/src/QUI/ERP/Accounting/Invoice/Handler.php b/src/QUI/ERP/Accounting/Invoice/Handler.php
index 8821f2336abc8ec5166be76d470216472a45829a..684e7031a674831adcedfe2e16521c9167c84712 100644
--- a/src/QUI/ERP/Accounting/Invoice/Handler.php
+++ b/src/QUI/ERP/Accounting/Invoice/Handler.php
@@ -340,13 +340,15 @@ public function getInvoice($id): Invoice
      * Return an Invoice by hash
      *
      * @param string $hash - Hash of the Invoice
-     * @return Invoice
+     * @return Invoice|InvoiceTemporary
      *
      * @throws Exception
      * @throws QUI\Exception
      */
-    public function getInvoiceByHash(string $hash): Invoice
+    public function getInvoiceByHash(string $hash)
     {
+        $hash = QUI\Utils\Security\Orthos::clear($hash);
+
         $result = QUI::getDataBase()->fetch([
             'select' => 'id',
             'from'   => self::invoiceTable(),
@@ -356,16 +358,27 @@ public function getInvoiceByHash(string $hash): Invoice
             'limit'  => 1
         ]);
 
-        $hash = QUI\Utils\Security\Orthos::clear($hash);
+        if (!empty($result)) {
+            return $this->getInvoice($result[0]['id']);
+        }
 
-        if (!isset($result[0])) {
-            throw new Exception(
-                ['quiqqer/invoice', 'exception.invoice.not.found', ['id' => $hash]],
-                404
-            );
+        $result = QUI::getDataBase()->fetch([
+            'select' => 'id',
+            'from'   => self::temporaryInvoiceTable(),
+            'where'  => [
+                'hash' => $hash
+            ],
+            'limit'  => 1
+        ]);
+
+        if (!empty($result)) {
+            return $this->getTemporaryInvoice($result[0]['id']);
         }
 
-        return $this->getInvoice($result[0]['id']);
+        throw new Exception(
+            ['quiqqer/invoice', 'exception.invoice.not.found', ['id' => $hash]],
+            404
+        );
     }
 
     /**
diff --git a/src/QUI/ERP/Accounting/Invoice/Invoice.php b/src/QUI/ERP/Accounting/Invoice/Invoice.php
index a8dd1fc135adb60e6435e5e376e95e849af33dc8..622c2240a6ee5cd4ead74c858a9ba870e077e9ea 100644
--- a/src/QUI/ERP/Accounting/Invoice/Invoice.php
+++ b/src/QUI/ERP/Accounting/Invoice/Invoice.php
@@ -769,7 +769,6 @@ public function copy($PermissionUser = null, $globalProcessId = false): InvoiceT
             $globalProcessId = $this->getHash();
         }
 
-
         // Invoice Address
         $invoiceAddressId = '';
         $invoiceAddress   = '';