diff --git a/src/new/fixtures/product.yml b/src/new/fixtures/product.yml index 958ea385b..165da6b3f 100755 --- a/src/new/fixtures/product.yml +++ b/src/new/fixtures/product.yml @@ -102,3 +102,33 @@ PSC\Shop\EntityBundle\Entity\Product: + product_6: + uid: 10 + title: XML Calc Test Api Color Size + language: 'de' + url: xml_test_10 + uuid: 01938686-0e4d-7da9-bae3-b2e1b1681f7f + type: 6 + pos: + notEdit: false + private: false + taxClass: 19 + set_config: '{}' + shop: '@shop_1' + calcXml: > + + + + COLORDB Test + 210 mm x 297 mm + + + + + + + + + diff --git a/src/new/tests/Plugins/System/PSC/XmlCalc/Api/CreateOrderColorDBTest.php b/src/new/tests/Plugins/System/PSC/XmlCalc/Api/CreateOrderColorDBTest.php new file mode 100644 index 000000000..71574ac12 --- /dev/null +++ b/src/new/tests/Plugins/System/PSC/XmlCalc/Api/CreateOrderColorDBTest.php @@ -0,0 +1,113 @@ +get(ShopRepository::class); + + $shop = $shopRepository->findOneBy(['title' => 'Printchampion']); + + $shippingRepository = static::getContainer()->get(ShippingRepository::class); + + $paymentRepository = static::getContainer()->get(PaymentRepository::class); + + $client->jsonRequest( + 'POST', + '/api/order/create', + [ + 'shop' => [ + 'uuid' => (string)$shop->getUuid() + ], + 'type' => 2, + 'shipping' => [ + 'uid' => $shippingRepository->findOneBy(['title' => 'Abholung vor Ort'])->getUid() + ], + 'payment' => [ + 'uid' => $paymentRepository->findOneBy(['title' => 'Bar bei Abholung'])->getUid() + ], + 'draft' => false, + 'deliveryAddress' => [ + 'firstname' => 'Thomas', + 'lastname' => 'Peterson', + 'street' => 'Chausseestr.', + 'houseNumber' => '24', + 'zip' => '17506', + 'city' => 'Gribow' + ], + 'invoiceAddress' => [ + 'firstname' => 'Thomas', + 'lastname' => 'Peterson', + 'street' => 'Chausseestr.', + 'houseNumber' => '24', + 'zip' => '17400', + 'city' => 'Berlin' + ], + 'positions' => [ + [ + 'count' => 1, + 'product' => [ + 'title' => 'test XML', + 'specialProductTypeObject' => [ + 'typ' => 6, + 'taxClass' => 1900, + 'xml' => ' + + + COLORDB Test + 210 mm x 297 mm + + + + + + ' + ] + ] + ] + ] + ], + ['HTTP_apiKey' => $shop->getApiKey()] + ); + + self::assertSame(200, $client->getResponse()->getStatusCode()); + + $data = json_decode($client->getResponse()->getContent(), true); + + $client->jsonRequest( + 'POST', + '/api/order/getonebyuuid', + [ + 'uuid' => $data['uuid'], + ], + ['HTTP_apiKey' => $shop->getApiKey()] + ); + + self::assertSame(200, $client->getResponse()->getStatusCode()); + $data = json_decode($client->getResponse()->getContent(), true); + + self::assertSame(44006, strlen($client->getResponse()->getContent())); + } + +} diff --git a/src/new/var/plugins/System/PSC/XmlCalc/Transformer/Position.php b/src/new/var/plugins/System/PSC/XmlCalc/Transformer/Position.php index 022349567..36e7acb5e 100755 --- a/src/new/var/plugins/System/PSC/XmlCalc/Transformer/Position.php +++ b/src/new/var/plugins/System/PSC/XmlCalc/Transformer/Position.php @@ -62,7 +62,7 @@ class Position implements IPositionTransformer } $articleCalc = $engine->getArticle(); - $obj->setEngine($engine); + //$obj->setEngine($engine); if ($articleCalc) { $obj->setOptions($articleCalc->getOptions()); } else {