diff --git a/bin/backend/download.php b/bin/backend/download.php
index 408f23571e0d145ae6759f0e8dc5ca332003859f..99a7cd6ce942a22ff781db3a2ff5f0808f255e69 100644
--- a/bin/backend/download.php
+++ b/bin/backend/download.php
@@ -14,15 +14,30 @@
 
 $User = QUI::getUserBySession();
 
+$jsClose = '
+<script>
+console.log(1);
+    if (window.parent) {
+        console.log(2);
+        window.parent.require(["qui/QUI"], function(QUI) {
+            console.log("fire");
+            QUI.fireEvent("quiqqerInvoiceDownloadDone");
+        });
+    }
+</script>';
+
 if (!$User->canUseBackend()) {
+    echo $jsClose;
     exit;
 }
 
 if (empty($_REQUEST['invoice'])) {
+    echo $jsClose;
     exit;
 }
 
 if (empty($_REQUEST['type'])) {
+    echo $jsClose;
     exit;
 }
 
@@ -83,3 +98,6 @@
 } catch (Exception $e) {
     Log::writeException($e);
 }
+
+echo $jsClose;
+exit;
diff --git a/bin/backend/utils/Dialogs.js b/bin/backend/utils/Dialogs.js
index e9dca7c85abe69f4050a06cd689f1c41e41b21aa..668fe1db64ad417175d331dbb24942ea6154597e 100644
--- a/bin/backend/utils/Dialogs.js
+++ b/bin/backend/utils/Dialogs.js
@@ -361,8 +361,8 @@ define('package/quiqqer/invoice/bin/backend/utils/Dialogs', [
                 maxWidth: 600,
                 autoclose: false,
                 ok_button: {
-                   text: QUILocale.get(lg, 'dialog.invoice.download.button'),
-                   textimage: 'fa fa-download'
+                    text: QUILocale.get(lg, 'dialog.invoice.download.button'),
+                    textimage: 'fa fa-download'
                 },
                 events: {
                     onOpen: function (Win) {
@@ -390,27 +390,42 @@ define('package/quiqqer/invoice/bin/backend/utils/Dialogs', [
                     },
 
                     onSubmit: function (Win) {
+                        Win.Loader.show();
+
                         const Select = Win.getElm().querySelector('select');
-                        const id = 'download-invoice-' + hash + '-' + Select.value;
-
-                        new Element('iframe', {
-                            src: URL_OPT_DIR + 'quiqqer/invoice/bin/backend/download.php?' + Object.toQueryString({
-                                invoice: hash,
-                                type: Button.value
-                            }),
-                            id: id,
-                            styles: {
-                                position: 'absolute',
-                                top: -200,
-                                left: -200,
-                                width: 50,
-                                height: 50
-                            }
-                        }).inject(document.body);
 
-                        (function () {
-                            document.getElements('#' + id).destroy();
-                        }).delay(10000, this);
+                        require([
+                            URL_OPT_DIR + 'bin/quiqqer-asset/downloadjs/downloadjs/download.js'
+                        ], function (download) {
+                            const url = URL_OPT_DIR + 'quiqqer/invoice/bin/backend/download.php?' +
+                                new URLSearchParams({
+                                    invoice: hash,
+                                    type: Select.value
+                                }).toString();
+
+                            fetch(url).then(response => {
+                                if (!response.ok) {
+                                    throw new Error("Fehler beim Download: " + response.statusText);
+                                }
+
+                                let filename = "invoice.pdf"; // Fallback-Dateiname
+                                const contentDisposition = response.headers.get("Content-Disposition");
+
+                                if (contentDisposition) {
+                                    const match = contentDisposition.match(/filename="?([^"]+)"?/);
+                                    if (match) {
+                                        filename = match[1];
+                                    }
+                                }
+
+                                return response.blob().then(blob => ({blob, filename}));
+                            }).then(({blob, filename}) => {
+                                download(blob, filename);
+                                Win.Loader.hide();
+                            }).catch(error => {
+                                Win.Loader.hide();
+                            });
+                        });
                     }
                 }
             }).open();
diff --git a/src/QUI/ERP/Accounting/Invoice/Utils/Invoice.php b/src/QUI/ERP/Accounting/Invoice/Utils/Invoice.php
index b925673afcd25a9432b9df1dea46da0cbd8c138d..0b131daf22c8fc779c00628cbb0f6db74ea9b4d1 100644
--- a/src/QUI/ERP/Accounting/Invoice/Utils/Invoice.php
+++ b/src/QUI/ERP/Accounting/Invoice/Utils/Invoice.php
@@ -663,11 +663,17 @@ public static function addressRequirementThreshold(): float
         return floatval($threshold);
     }
 
+    /**
+     * @throws QUI\ERP\Exception
+     * @throws QUI\Exception
+     * @throws QUI\Users\Exception
+     */
     public static function getElectronicInvoice(
         InvoiceTemporary | QUI\ERP\Accounting\Invoice\Invoice $Invoice,
         $type = ZugferdProfiles::PROFILE_EN16931
     ): ZugferdDocumentBuilder {
         $document = ZugferdDocumentBuilder::CreateNew($type);
+        $Articles = $Invoice->getArticles();
 
         $date = $Invoice->getAttribute('date');
         $date = strtotime($date);
@@ -814,6 +820,12 @@ public static function getElectronicInvoice(
             $vatTotal = $vatTotal + $vat->value();
         }
 
+        $isNetInvoice = false;
+
+        if ($Customer->getAttribute('isNetto') || $Articles->getCalculations()['isNetto']) {
+            $isNetInvoice = true;
+        }
+
         $document->setDocumentSummation(
             $priceCalculation->getSum()->value(),
             $priceCalculation->getSum()->value(),
@@ -821,16 +833,24 @@ public static function getElectronicInvoice(
             0.0, // zuschläge
             0.0, // rabatte
             $priceCalculation->getNettoSum()->value(), // Steuerbarer Betrag (BT-109)
-            $vatTotal, // Steuerbetrag
+            $isNetInvoice ? $vatTotal : 0, // ausgewiesene steuer
             null, // Rundungsbetrag
             0.0 // Vorauszahlungen
         );
 
         // products
-        foreach ($Invoice->getArticles() as $Article) {
-            /* @var $Article QUI\ERP\Accounting\Article */
+        foreach ($Articles as $Article) {
             $article = $Article->toArray();
 
+            $nettoPreis = $article['calculated']['nettoPrice']; // Netto-Einzelpreis
+            $vatSum = $article['calculated']['vatArray']['sum'];
+            $bruttoPreis = $nettoPreis;
+
+            if ($vatSum) {
+                $bruttoPreis = $nettoPreis + ($vatSum / $article['quantity']);
+            }
+
+
             $document
                 ->addNewPosition($article['position'])
                 ->setDocumentPositionProductDetails(
@@ -841,9 +861,10 @@ public static function getElectronicInvoice(
                     null,
                     null
                 )
-                ->setDocumentPositionNetPrice($article['calculated']['nettoPrice'])
+                ->setDocumentPositionNetPrice($article['calculated']['nettoPrice'], 1, "C62") // C62 = Stück
+                ->setDocumentPositionGrossPrice($bruttoPreis, 1, "C62") // C62 = Stück
                 ->setDocumentPositionQuantity($article['quantity'], "H87")
-                ->addDocumentPositionTax('S', 'VAT', $article['vat'])
+                ->addDocumentPositionTax('S', 'VAT', $article['vat'], $article['calculated']['vatArray']['sum'])
                 ->setDocumentPositionLineSummation($article['sum']);
         }