# Stornorechnung mit oder ohne Versandkosten

**URL:** <https://forum.shopware.com/t/stornorechnung-mit-oder-ohne-versandkosten/91444>\
**Category:** Allgemein\
**Created:** [12. November 2021 um 09:38 UTC](https://forum.shopware.com/t/stornorechnung-mit-oder-ohne-versandkosten/91444 "2021-11-12T09:38:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Netwerk](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@Netwerk](https://forum.shopware.com/u/Netwerk)\
**Post date:** [12. November 2021 um 09:38 UTC](https://forum.shopware.com/t/stornorechnung-mit-oder-ohne-versandkosten/91444/1 "2021-11-12T09:38:12Z")

</div>

Hallo Shopware Community,

ist es möglich Stornorechnungen mit oder ohne Versandkosten zu erstellen? Je nach Grund der Stornierung müsste ich individuell entscheiden können, ob die Versandkosten auf der Stornorechnung sind oder nicht.  
Wenn ich die Versandkosten vorher händisch auf 0 setze, dann bekomm ich eine Fehlermeldung

```auto
Bei der Preisberechnung ist ein Fehler aufgetreten:
An exception occurred while executing 'UPDATE `order_line_item` SET `version_id` = ?, `order_id` = ?, `order_version_id` = ?, `product_id` = ?, `product_version_id` = ?, `parent_version_id` = ?, `identifier` = ?, `referenced_id` = ?, `quantity` = ?, `label` = ?, `payload` = ?, `good` = ?, `removable` = ?, `stackable` = ?, `position` = ?, `price` = ?, `price_definition` = ?, `type` = ?, `updated_at` = ? WHERE id = ? AND version_id = ?' with params ["\xb2\x91\x40\x4b\xe2\x4b\x41\x74\x8e\xfa\xd9\xda\x4c\x22\xb3\x14", "\xd8\x9f\xa4\x2c\x2b\x08\x4f\x22\xb9\x6d\xf6\xf7\x3a\xb7\x1f\x23", "\xb2\x91\x40\x4b\xe2\x4b\x41\x74\x8e\xfa\xd9\xda\x4c\x22\xb3\x14", "\x7d\x01\x77\x9a\x63\x94\x40\x59\x8e\xaa\x4e\x5f\xc9\x8a\xf3\x05", "\x0f\xa9\x1c\xe3\xe9\x6a\x4b\xc2\xbe\x4b\xd9\xce\x75\x2c\x34\x25", "\x0f\xa9\x1c\xe3\xe9\x6a\x4b\xc2\xbe\x4b\xd9\xce\x75\x2c\x34\x25", "7d01779a639440598eaa4e5fc98af305", "7d01779a639440598eaa4e5fc98af305", 1, "Zillertal Klassik braun", "{\"isNew\":false,\"taxId\":\"7b5f959c9d8549669c8ce1e5a87f025e\",\"tagIds\":[\"52712e6938994c3ba93f5fefcd9e9997\"],\"options\":[{\"group\":\"Gr\u00f6\u00dfe\",\"option\":\"43\"},{\"group\":\"Sohle\",\"option\":\"Gummimilch\"}],\"features\":[{\"type\":\"property\",\"label\":\"Farbe\",\"value\":{\"6c52f21065794dab8718f3405db93bc3\":{\"id\":\"6c52f21065794dab8718f3405db93bc3\",\"name\":\"Braun\",\"mediaId\":\"a217e6ffacab474ca16659e5db882634\",\"colorHexCode\":\"#8f807d\"}}},{\"type\":\"customField\",\"label\":\"Information\",\"value\":{\"id\":\"cd19188fdcc04c269615c99a0b99bef2\",\"type\":\"text\",\"content\":\"Der Doggl wirkt am Anfang steif. Nach 2 bis 3 Tagen hat er sich perfekt dem Fu\u00df angepasst.\"}}],\"createdAt\":\"2021-09-28 11:37:10.272\",\"optionIds\":[\"2d3a31539e0548518a41fff9355ed15a\",\"967ba348b952448a8c550f46850ea425\"],\"isCloseout\":false,\"categoryIds\":[\"9ffd512b50a543bebe49bf81f3b1864c\",\"fbf42e7d73ce467086b4e0181ef845e1\",\"4a36cfaa309c46f1844a6f9bb1b2b7da\",\"3d2349e27ca347779b99d0c42f55a1c3\",\"dd00b9652cad4f7087ad280f2d7cebc9\"],\"propertyIds\":[\"6c52f21065794dab8718f3405db93bc3\"],\"releaseDate\":null,\"customFields\":{\"custom_information_text\":\"Der Doggl wirkt am Anfang steif. Nach 2 bis 3 Tagen hat er sich perfekt dem Fu\u00df angepasst.\"},\"productNumber\":\"HD10024.53\",\"manufacturerId\":\"69caa4d7be3c4d0092858bc97f3e907f\",\"purchasePrices\":null,\"markAsTopseller\":null}", 1, 1, 1, 1, "{\"unitPrice\":125.0,\"totalPrice\":125.0,\"quantity\":1,\"calculatedTaxes\":[{\"tax\":20.83,\"taxRate\":20.0,\"price\":125.0,\"extensions\":[]}],\"taxRules\":[{\"taxRate\":20.0,\"percentage\":100.0,\"extensions\":[]}],\"referencePrice\":null,\"listPrice\":null}", "{\"price\":125.0,\"taxRules\":[{\"taxRate\":20.0,\"percentage\":100.0,\"extensions\":[]}],\"quantity\":1,\"isCalculated\":true,\"referencePriceDefinition\":null,\"listPrice\":null,\"type\":\"quantity\"}", "product", "2021-11-12 09:12:55.984", "\xbb\x8c\x95\x63\xcd\x63\x4a\xae\xb1\xac\x60\x54\x18\xe7\x10\x79", "\xb2\x91\x40\x4b\xe2\x4b\x41\x74\x8e\xfa\xd9\xda\x4c\x22\xb3\x14"]: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`zilleo_db1`.`order_line_item`, CONSTRAINT `order_line_item_ibfk_1` FOREIGN KEY (`product_id`, `product_version_id`) REFERENCES `product` (`id`, `version_id`) ON DELETE SET NULL ON UPDATE CASC)
`

```

Meine zweite Frage ist:  
Manchmal ist der Zahlungsstatus der Bestellung in der Detailseite und Übersicht unterschiedlich, wenn die die Zahlung beim ersten Versuch Fehlgeschlagen ist. Auch das Aktualisieren bringt hier nichts.

---

<div class="post-metadata">

**Author:** ![varia](https://avatars.discourse-cdn.com/v4/letter/v/b9e5f3/32.png) [@varia](https://forum.shopware.com/u/varia)\
**Post date:** [25. November 2023 um 08:03 UTC](https://forum.shopware.com/t/stornorechnung-mit-oder-ohne-versandkosten/91444/2 "2023-11-25T08:03:27Z")

</div>

Ich bekomme eine ähnliche Fehlermeldung nach dem Update auf Shopware 6.5.7.2, wenn ich eine Bestellung in der Administration aufrufen möchte:

```auto
Uncaught PHP Exception Doctrine\DBAL\Exception\ForeignKeyConstraintViolationException: "An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`XXX`.`order_line_item`, CONSTRAINT `order_line_item_ibfk_1` FOREIGN KEY (`product_id`, `product_version_id`) REFERENCES `product` (`id`, `version_id`) ON DELETE SET NULL ON UPDATE)"
at /var/www/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php line 56
 {"exception":"[object] (Doctrine\\DBAL\\Exception\\ForeignKeyConstraintViolationException(code: 1452): An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`XXX`.`order_line_item`, CONSTRAINT `order_line_item_ibfk_1` FOREIGN KEY (`product_id`, `product_version_id`) REFERENCES `product` (`id`, `version_id`) ON DELETE SET NULL ON UPDATE)
at /var/www/vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:56)\n[previous exception] [object] (Doctrine\\DBAL\\Driver\\PDO\\Exception(code: 1452): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`XXX`.`order_line_item`, CONSTRAINT `order_line_item_ibfk_1` FOREIGN KEY (`product_id`, `product_version_id`) REFERENCES `product` (`id`, `version_id`) ON DELETE SET NULL ON UPDATE) at /var/www/vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28)\n[previous exception] [object] (PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`XXX`.`order_line_item`, CONSTRAINT `order_line_item_ibfk_1` FOREIGN KEY (`product_id`, `product_version_id`) REFERENCES `product` (`id`, `version_id`) ON DELETE SET NULL ON UPDATE) at /var/www/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:33)

```

Es scheint als würde der Fehler passieren, wenn eine Bestellung ein Produkt enthält, welches nicht mehr existiert.
