# MwSt-Änderung wegen Corona

**URL:** <https://forum.shopware.com/t/mwst-aenderung-wegen-corona/67407>\
**Category:** Allgemein\
**Created:** [4. Juni 2020 um 07:18 UTC](https://forum.shopware.com/t/mwst-aenderung-wegen-corona/67407 "2020-06-04T07:18:46Z")\
**Posts on this page:** 1\
**Showing post:** 209

<div class="post-metadata">

**Author:** ![puhas](https://avatars.discourse-cdn.com/v4/letter/p/b38774/32.png) [@puhas](https://forum.shopware.com/u/puhas)\
**Post date:** [25. Juni 2020 um 16:41 UTC](https://forum.shopware.com/t/mwst-aenderung-wegen-corona/67407/209 "2020-06-25T16:41:40Z")

</div>

Für alle die auch die abwegige Vorstellung haben, dass bei „Bruttopreise beibehalten“ auch die Pseudopreise beibehalten werden sollten, hier eine kleine Erweiterung des Plugins:

Zu ändern ist die Datei SwagTax\Components\TaxUpdater.php

Folgende Funktion irgendwo einfügen (Ähnlichkeiten mit&nbsp; recalculateProductPrices sind rein zufällig ![Grin](https://forum.shopware.com/plugins/CKEditor/plugins/smiley/images/grin.png "Grin")) :

```
    private function recalculateProductPseudoPrices($oldTaxId, $newTaxRate, $newTaxId, $customer_group_mapping)
    {
        $oldTaxRate = $this->connection->fetchColumn('SELECT tax FROM s_core_tax WHERE id = ?', [$oldTaxId]);

        $qb = $this->connection->createQueryBuilder();
        $qb->update('s_articles_prices', 'pseudo')
            ->set('pseudoprice', sprintf('pseudoprice/%s*%s', 1 + ($newTaxRate / 100), 1 + ($oldTaxRate / 100)))
            ->where('pseudo.pricegroup IN (:groups)')
            ->andWhere('(SELECT taxID FROM s_articles WHERE id = pseudo.articleID) = :newTaxID')
            ->andWhere('pseudo.pseudoprice > 0');

        $qb->setParameter(':groups', $customer_group_mapping, Connection::PARAM_STR_ARRAY);
        $qb->setParameter(':newTaxID', $newTaxId);

        $qb->execute();
    }

```

Und Zeile 54-56 ersetzen mit:

```
            if ($config['recalculate_prices']) {
                $this->recalculateProductPrices($oldTaxId, $newTaxRate, $newTaxId, $config['customer_group_mapping']);
                $this->recalculateProductPseudoPrices($oldTaxId, $newTaxRate, $newTaxId, $config['customer_group_mapping']);
            }

```

Thats it. Jetzt werden auch die Pseudopreise beibehalten.

Gerade 1x getestet, aber natürlich alles ohne Gewähr. Testumgebung first!

---

_[View the full topic](https://forum.shopware.com/t/mwst-aenderung-wegen-corona/67407)._
