# Bestellung per DAL Code wird nicht im Backend angezeigt

**URL:** https://forum.shopware.com/t/bestellung-per-dal-code-wird-nicht-im-backend-angezeigt/105318
**Category:** Programmierung
**Tags:** programming
**Created:** [24. September 2024 um 14:18 UTC](https://forum.shopware.com/t/bestellung-per-dal-code-wird-nicht-im-backend-angezeigt/105318 "2024-09-24T14:18:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![thomas.kipp](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@thomas.kipp](https://forum.shopware.com/u/thomas.kipp)
#### Post date: [24. September 2024 um 14:18 UTC](https://forum.shopware.com/t/bestellung-per-dal-code-wird-nicht-im-backend-angezeigt/105318/1 "2024-09-24T14:18:55Z")

</div>

Hallo,  
nach dem Import folgender Bestellung via DAL, landet dieselbige zwar in die Datenbank, aber sie verursacht im Backend eine Endlosschleife. Was läuft da schief? Wenn ich im Backend eine Bestellung manuell anlege, wird die auch angezeigt, also liegt es am folgenden Code

```auto
          $this->orderRepository->create(
                [
                    [
                        'id' => Uuid::randomHex(),
                        'currencyFactor' => 1,
                        'orderDateTime' => $createdAt,
                        'orderNumber' => $arItems2BeUsedCreatingOrders[$i]['OrderNumber'],
                        'stateId' => $stateID,
                        'currencyId' => $currencyID,
                        'customerId' => $customerID,
                        'salesChannelId' => $salesChannelID,
                        'billingAddressId' => $adressID,
                        'price' => [
                            'netPrice' => 100,
                            'totalPrice' => 150,
                            'calculatedTaxes' => [
                                                   [
                                                       'tax' => 20,
                                                       'taxRate' => 19.0,
                                                       'price' => 100,
                                                   ]
                            ],
                            'taxRules' => [
                                [
                                    'taxRate' => 20,
                                    'percentage' => 100,
                                ],
                            ],
                            'positionPrice' => 100,
                            'rawTotal' => 100,
                            'taxStatus' => 'net'
                        ],
                        'itemRounding' => [
                            'interval' => 0.01,
                            'decimals' => 2,
                            'roundForNet' => true,
                        ],
                        'totalRounding' => [
                            'interval' => 0.01,
                            'roundForNet' => true,
                            'decimals' => 2,
                        ],
                        'shippingCosts' => [
                            'unitPrice' => 5.00,
                            'totalPrice' => 5.00,
                            'quantity' => 1,
                            'calculatedTaxes' => [
                                [
                                    'tax' => 0.95,
                                    'taxRate' => 19.0,
                                    'price' => 5.00,
                                ],
                            ],
                            'taxRules' => [
                                [
                                    'taxRate' => 20,
                                    'percentage' => 100,
                                ],
                            ],
                        ],
                        'lineItems' => [
                            [
                                'identifier' => Uuid::randomHex(),
                                'label' => 'Product Name',
                                'quantity' => 1,
                                'type' => 'product',
                                'priceDefinition' => [
                                    'type' => 'quantity',
                                    'price' => 100,
                                    'quantity' => 1,
                                    'taxRules' => [
                                        [
                                            'taxRate' => 20,
                                            'percentage' => 100,
                                        ],
                                    ],
                                ],
                                'price' => [
                                    'unitPrice' => 100,
                                    'quantity' => 1,
                                    'totalPrice' => 100,
                                    'calculatedTaxes' => [
                                        [
                                            'tax' => 20,
                                            'taxRate' => 19.0,
                                            'price' => 100,
                                        ],
                                    ],
                                    'taxRules' => [
                                        [
                                            'taxRate' => 20,
                                            'percentage' => 100,
                                        ],
                                    ],
                                ],
                            ]
                        ]
                    ]
                ],
                $context
            );

```

---

<div class="post-metadata">

### Author: ![thomas.kipp](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@thomas.kipp](https://forum.shopware.com/u/thomas.kipp)
#### Post date: [24. September 2024 um 14:26 UTC](https://forum.shopware.com/t/bestellung-per-dal-code-wird-nicht-im-backend-angezeigt/105318/2 "2024-09-24T14:26:28Z")

</div>

So klappt es. Ich weiß, da sind vorerst noch zu viele statische Werte, aber zumindest  
a) Wird programmatisch jetzt überhaupt importiert  
b)Führt es im Backend zu keinem JS Error mehr…

```auto
            $this->orderRepository->create(
                [
                    [
                        'id' => Uuid::randomHex(),
                        'currencyFactor' => 1,
                        'orderDateTime' => $createdAt,
                        'orderNumber' => $arItems2BeUsedCreatingOrders[$i]['OrderNumber'],
                        'stateId' => $stateID,
                        'currencyId' => $currencyID,
                        'customerId' => $customerID,
                        'salesChannelId' => $salesChannelID,
                        'addresses' => [
                            [
                                'id' =>$adressID,
                                'firstName' => 'First',
                                'lastName' => 'Last',
                                'street' => 'Main St',
                                'zipcode' => '12345',
                                'city' => 'City',
                                'countryId' => $countryID
                            ],
                        ],
                        'billingAddressId' => $adressID,
                        'price' => [
                            'netPrice' => 100,
                            'totalPrice' => 150,
                            'calculatedTaxes' => [
                                                   [
                                                       'tax' => 20,
                                                       'taxRate' => 19.0,
                                                       'price' => 100,
                                                   ]
                            ],
                            'taxRules' => [
                                [
                                    'taxRate' => 20,
                                    'percentage' => 100,
                                ],
                            ],
                            'positionPrice' => 100,
                            'rawTotal' => 100,
                            'taxStatus' => 'net'
                        ],
                        'itemRounding' => [
                            'interval' => 0.01,
                            'decimals' => 2,
                            'roundForNet' => true,
                        ],
                        'totalRounding' => [
                            'interval' => 0.01,
                            'roundForNet' => true,
                            'decimals' => 2,
                        ],
                        'shippingCosts' => [
                            'unitPrice' => 5.00,
                            'totalPrice' => 5.00,
                            'quantity' => 1,
                            'calculatedTaxes' => [
                                [
                                    'tax' => 0.95,
                                    'taxRate' => 19.0,
                                    'price' => 5.00,
                                ],
                            ],
                            'taxRules' => [
                                [
                                    'taxRate' => 20,
                                    'percentage' => 100,
                                ],
                            ],
                        ],
                        'lineItems' => [
                            [
                                'identifier' => Uuid::randomHex(),
                                'label' => 'Product Name',
                                'quantity' => 1,
                                'type' => 'product',
                                'priceDefinition' => [
                                    'type' => 'quantity',
                                    'price' => 100,
                                    'quantity' => 1,
                                    'taxRules' => [
                                        [
                                            'taxRate' => 20,
                                            'percentage' => 100,
                                        ],
                                    ],
                                ],
                                'price' => [
                                    'unitPrice' => 100,
                                    'quantity' => 1,
                                    'totalPrice' => 100,
                                    'calculatedTaxes' => [
                                        [
                                            'tax' => 20,
                                            'taxRate' => 19.0,
                                            'price' => 100,
                                        ],
                                    ],
                                    'taxRules' => [
                                        [
                                            'taxRate' => 20,
                                            'percentage' => 100,
                                        ],
                                    ],
                                ],
                            ]
                        ]
                    ]
                ],
                $context
            );

```

---

<div class="post-metadata">

### Author: ![system](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/2/9/29c7587ba660f00e4995d1743162782e5d6d8653.svg) [@system](https://forum.shopware.com/u/system)
#### Post date: [24. Oktober 2024 um 14:26 UTC](https://forum.shopware.com/t/bestellung-per-dal-code-wird-nicht-im-backend-angezeigt/105318/3 "2024-10-24T14:26:59Z")

</div>

Dieses Thema wurde automatisch 30 Tage nach der letzten Antwort geschlossen. Es sind keine neuen Antworten mehr erlaubt.
