first commit
This commit is contained in:
135
bundles/KupShop/PohodaBundle/Tests/Coupons/CouponsTest.json
Normal file
135
bundles/KupShop/PohodaBundle/Tests/Coupons/CouponsTest.json
Normal file
@@ -0,0 +1,135 @@
|
||||
{
|
||||
"products" : [
|
||||
{
|
||||
"id": 5644,
|
||||
"title": "Dárkový poukaz v hodnotě 500 Kč",
|
||||
"code": null,
|
||||
"ean": null,
|
||||
"short_descr": ".",
|
||||
"long_descr": ".",
|
||||
"parameters": "",
|
||||
"price": 413.2231,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"id_cn": null,
|
||||
"discount": 0.00000000,
|
||||
"producer": null,
|
||||
"guarantee": 24,
|
||||
"in_store": 73,
|
||||
"pieces_sold": 238,
|
||||
"delivery_time": 0,
|
||||
"campaign": "O",
|
||||
"updated": "2023-10-14 18:03:34",
|
||||
"date_added": "2020-04-27 14:45:00",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": null,
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"data": "{\"generate_coupon\":\"Y\",\"generate_coupon_discount\":\"75\"}",
|
||||
"weight": null,
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null,
|
||||
"note": null,
|
||||
"pohoda_sync_date": null,
|
||||
"price_buy": null
|
||||
}
|
||||
],
|
||||
"orders":[
|
||||
{
|
||||
"id": 4047,
|
||||
"source": "shop",
|
||||
"order_no": "0194047",
|
||||
"currency_rate": 1,
|
||||
"id_user": null,
|
||||
"date_created": "2019-06-04 06:42:02",
|
||||
"date_accept": null,
|
||||
"date_handle": null,
|
||||
"date_updated": "2019-06-04 06:42:02",
|
||||
"date_due": null,
|
||||
"status": 0,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 121,
|
||||
"invoice_name": "Jan",
|
||||
"invoice_surname": "Prokop",
|
||||
"invoice_firm": "WPJ s.r.o.",
|
||||
"invoice_ico": "123456789",
|
||||
"invoice_dic": "CZ123456789",
|
||||
"invoice_street": "Dlouha 123",
|
||||
"invoice_city": "Vrchlabí",
|
||||
"invoice_zip": 54301,
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+773568922",
|
||||
"invoice_email": "prokop@wpj.cz",
|
||||
"delivery_name": "Jan",
|
||||
"delivery_surname": "Prokop",
|
||||
"delivery_firm": "WPJ s.r.o.",
|
||||
"delivery_street": "Dlouha 123",
|
||||
"delivery_city": "Vrchlabí",
|
||||
"delivery_zip": 54301,
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Dobírka - PPL",
|
||||
"id_delivery": 3,
|
||||
"delivery_complete": "N",
|
||||
"note_user": null,
|
||||
"note_admin": "null",
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": ""
|
||||
}
|
||||
],
|
||||
"order_items" : [
|
||||
{
|
||||
"id": 31012,
|
||||
"id_order": 4047,
|
||||
"id_product": 5644,
|
||||
"id_variation": null,
|
||||
"pieces": 2,
|
||||
"pieces_reserved": 2,
|
||||
"piece_price": 413.2231,
|
||||
"total_price": 826.44628,
|
||||
"descr": "Dárkový poukaz 500 Kč",
|
||||
"tax": 21,
|
||||
"date": "2019-06-04 06:42:02",
|
||||
"note": "",
|
||||
"discount": 0
|
||||
}
|
||||
],
|
||||
"discounts" :
|
||||
[
|
||||
{
|
||||
"id": 75,
|
||||
"descr": "* Dárkový poukaz 500 Kč",
|
||||
"apply": "order",
|
||||
"condition_type": "generate_coupon",
|
||||
"compare_sign": "=",
|
||||
"condition_value": "OVECZ",
|
||||
"discount": "500",
|
||||
"unit": "price",
|
||||
"compatible": "Y",
|
||||
"to_who": "user,reg",
|
||||
"date_from": null,
|
||||
"date_to": null,
|
||||
"uses_count": 210,
|
||||
"uses_max": 296,
|
||||
"min_price": 500,
|
||||
"languages": "[\"cs\"]",
|
||||
"data": "{\"valid_months\":\"\",\"currency\":\"CZK\",\"bg_img\":{\"path\":\"data\\/coupon\\/\",\"original\":\"75.pdf\",\"size\":{\"width\":794,\"height\":374},\"png\":\"75.png?1666012297\"},\"JSON\":{\"version\":\"2.4.3\",\"objects\":[{\"type\":\"PlaceholderText\",\"version\":\"2.4.3\",\"originX\":\"left\",\"originY\":\"top\",\"left\":522,\"top\":211,\"width\":130,\"height\":18.08,\"fill\":\"#000000\",\"stroke\":null,\"strokeWidth\":1,\"strokeDashArray\":null,\"strokeLineCap\":\"butt\",\"strokeLineJoin\":\"miter\",\"strokeMiterLimit\":4,\"scaleX\":1.5,\"scaleY\":1.5,\"angle\":0,\"flipX\":false,\"flipY\":false,\"opacity\":1,\"shadow\":null,\"visible\":true,\"clipTo\":null,\"backgroundColor\":\"\",\"fillRule\":\"nonzero\",\"paintFirst\":\"fill\",\"globalCompositeOperation\":\"source-over\",\"transformMatrix\":null,\"skewX\":0,\"skewY\":0,\"text\":\"{KOD}\",\"fontSize\":16,\"fontWeight\":\"normal\",\"fontFamily\":\"Proxima-Nova\",\"fontStyle\":\"normal\",\"lineHeight\":1.16,\"underline\":false,\"overline\":false,\"linethrough\":false,\"textAlign\":\"left\",\"textBackgroundColor\":\"\",\"charSpacing\":0,\"minWidth\":20,\"styles\":[],\"textAnchor\":\"start\"},{\"type\":\"PlaceholderText\",\"version\":\"2.4.3\",\"originX\":\"left\",\"originY\":\"top\",\"left\":517,\"top\":107,\"width\":130,\"height\":18.08,\"fill\":\"#000000\",\"stroke\":null,\"strokeWidth\":1,\"strokeDashArray\":null,\"strokeLineCap\":\"butt\",\"strokeLineJoin\":\"miter\",\"strokeMiterLimit\":4,\"scaleX\":1.5,\"scaleY\":1.5,\"angle\":0,\"flipX\":false,\"flipY\":false,\"opacity\":1,\"shadow\":null,\"visible\":true,\"clipTo\":null,\"backgroundColor\":\"\",\"fillRule\":\"nonzero\",\"paintFirst\":\"fill\",\"globalCompositeOperation\":\"source-over\",\"transformMatrix\":null,\"skewX\":0,\"skewY\":0,\"text\":\"{PLATNOST}\",\"fontSize\":16,\"fontWeight\":\"normal\",\"fontFamily\":\"Proxima-Nova\",\"fontStyle\":\"normal\",\"lineHeight\":1.16,\"underline\":false,\"overline\":false,\"linethrough\":false,\"textAlign\":\"left\",\"textBackgroundColor\":\"\",\"charSpacing\":0,\"minWidth\":20,\"styles\":[],\"textAnchor\":\"start\"}]},\"SVG\":\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?><!DOCTYPE svg PUBLIC \\\"-\\/\\/W3C\\/\\/DTD SVG 1.1\\/\\/EN\\\" \\\"http:\\/\\/www.w3.org\\/Graphics\\/SVG\\/1.1\\/DTD\\/svg11.dtd\\\"><svg xmlns=\\\"http:\\/\\/www.w3.org\\/2000\\/svg\\\" xmlns:xlink=\\\"http:\\/\\/www.w3.org\\/1999\\/xlink\\\" version=\\\"1.1\\\" width=\\\"794\\\" height=\\\"374\\\" viewBox=\\\"0 0 794 374\\\" xml:space=\\\"preserve\\\"><desc>Created with Fabric.js 2.4.3<\\/desc><defs><\\/defs><g transform=\\\"matrix(1.5 0 0 1.5 620.25 225.31)\\\" style=\\\"\\\" >\\t\\t<text xml:space=\\\"preserve\\\" font-family=\\\"Proxima-Nova\\\" font-size=\\\"16\\\" font-style=\\\"normal\\\" font-weight=\\\"normal\\\" style=\\\"stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;\\\" ><tspan x=\\\"-65\\\" y=\\\"5.03\\\" >{KOD}<\\/tspan><\\/text><\\/g><g transform=\\\"matrix(1.5 0 0 1.5 615.25 121.31)\\\" style=\\\"\\\" >\\t\\t<text xml:space=\\\"preserve\\\" font-family=\\\"Proxima-Nova\\\" font-size=\\\"16\\\" font-style=\\\"normal\\\" font-weight=\\\"normal\\\" style=\\\"stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1; white-space: pre;\\\" ><tspan x=\\\"-65\\\" y=\\\"5.03\\\" >{PLATNOST}<\\/tspan><\\/text><\\/g><\\/svg>\",\"valid_days\":\"365\"}",
|
||||
"date_added": "2000-01-01 00:00:00"
|
||||
}
|
||||
],
|
||||
"discounts_coupons" : [ ]
|
||||
}
|
||||
130
bundles/KupShop/PohodaBundle/Tests/Coupons/CouponsTest_.php
Normal file
130
bundles/KupShop/PohodaBundle/Tests/Coupons/CouponsTest_.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\Coupons;
|
||||
|
||||
use KupShop\DevelopmentBundle\Util\Tests\CartTestTrait;
|
||||
use KupShop\DevelopmentBundle\Util\Tests\LoggerTestTrait;
|
||||
use KupShop\PohodaBundle\Messenger\OrderMessage;
|
||||
use KupShop\PohodaBundle\Tests\TestUtilHelper;
|
||||
use KupShop\PohodaBundle\Utils\Exporters\CouponExporter;
|
||||
use KupShop\PohodaBundle\Utils\PohodaConnector;
|
||||
use KupShop\PohodaBundle\Utils\TransformHelper;
|
||||
use Symfony\Component\Messenger\Envelope;
|
||||
use Symfony\Component\Messenger\MessageBus;
|
||||
use Symfony\Component\Messenger\Stamp\HandledStamp;
|
||||
|
||||
class CouponsTest extends \DatabaseTestCase
|
||||
{
|
||||
use LoggerTestTrait;
|
||||
use TestUtilHelper;
|
||||
use CartTestTrait;
|
||||
|
||||
/**
|
||||
* @var MessageBus
|
||||
*/
|
||||
private $asyncBus;
|
||||
|
||||
/** @var PohodaConnector */
|
||||
private $pohodaConnector;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->asyncBus = $this->get('async_bus');
|
||||
}
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
protected $PohodaConnector;
|
||||
/**
|
||||
* @var TransformHelper
|
||||
*/
|
||||
protected $transformHelper;
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$this->PohodaConnector = $this->get(PohodaConnector::class);
|
||||
$this->transformHelper = $this->get(TransformHelper::class);
|
||||
$this->getLogger();
|
||||
}
|
||||
|
||||
public function testAsyncExportOrder()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
$couponMock = $this->autowire(CouponExporterMock::class);
|
||||
$this->set(CouponExporter::class, $couponMock);
|
||||
|
||||
$instance = $this->autowire(\KupShop\PohodaBundle\Tests\Coupons\PohodaConnectorMock::class);
|
||||
$this->set(PohodaConnector::class, $instance);
|
||||
|
||||
$this->prepareMServer();
|
||||
|
||||
$asyncMessage = new OrderMessage();
|
||||
$asyncMessage->setIdOrder(4047);
|
||||
|
||||
$result = $this->getHandledResult($this->asyncBus->dispatch($asyncMessage));
|
||||
|
||||
$this->assertNotEmpty($couponMock->couponXml, '');
|
||||
}
|
||||
|
||||
public function testCreateCoupons()
|
||||
{
|
||||
$couponMock = $this->autowire(CouponExporterMock::class);
|
||||
$this->set(CouponExporter::class, $couponMock);
|
||||
|
||||
$instance = $this->autowire(\KupShop\PohodaBundle\Tests\Coupons\PohodaConnectorMock::class);
|
||||
$this->set(PohodaConnector::class, $instance);
|
||||
|
||||
$this->prepareMServer();
|
||||
|
||||
$this->prepareCart();
|
||||
|
||||
$count = sqlQueryBuilder()->select('COUNT(*)')->from('discounts_coupons')->execute()->fetchOne();
|
||||
$this->assertEquals($count, 0, 'Nesmi tam byt zadny poukaz!');
|
||||
|
||||
$this->insertProduct(5644, null, 2);
|
||||
|
||||
$order = $this->submitOrder();
|
||||
|
||||
$count = sqlQueryBuilder()->select('COUNT(*)')->from('discounts_coupons')->execute()->fetchOne();
|
||||
$this->assertEquals(2, $count, 'Musi tam byt vygenerovany 2x poukaz!');
|
||||
$this->assertEquals(2, count($order->fetchItems()), 'Musi tam byt dve polozky, pro kazdy poukaz jedna!');
|
||||
|
||||
$asyncMessage = new OrderMessage();
|
||||
$asyncMessage->setIdOrder($order->id);
|
||||
|
||||
$result = $this->getHandledResult($this->asyncBus->dispatch($asyncMessage));
|
||||
|
||||
$this->assertNotEmpty($couponMock->couponXml, '');
|
||||
}
|
||||
|
||||
public function getHandledResult(Envelope $envelope)
|
||||
{
|
||||
$stamp = $envelope->last(HandledStamp::class);
|
||||
|
||||
return $stamp->getResult();
|
||||
}
|
||||
}
|
||||
|
||||
class CouponExporterMock extends CouponExporter
|
||||
{
|
||||
public $couponXml;
|
||||
|
||||
public function transformToRequest(mixed $xml)
|
||||
{
|
||||
$this->couponXml = parent::transformToRequest($xml);
|
||||
|
||||
return $this->couponXml;
|
||||
}
|
||||
}
|
||||
|
||||
class PohodaConnectorMock extends PohodaConnector
|
||||
{
|
||||
public function sendRequest($XmlBodyRequest)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
{
|
||||
"users" : [
|
||||
{
|
||||
"id" : 88586,
|
||||
"id_language" : "cs",
|
||||
"passw" : "$2y$10$yUy3TD7eyApI8NCMysqFc.bxLAjBIbkO9i6x2r2MxgoDpdNTgOkHm",
|
||||
"user_key" : "2681cdba44ec11ef9b23525402f665f6",
|
||||
"figure" : "Y",
|
||||
"name" : "Eliška",
|
||||
"surname" : "Vaňoučková",
|
||||
"firm" : "",
|
||||
"street" : "Chotyně 39",
|
||||
"city" : "Chotyně",
|
||||
"zip" : "46434",
|
||||
"country" : "CZ",
|
||||
"currency" : "CZK",
|
||||
"email" : "eliskavanouckova@seznam.cz",
|
||||
"ico" : "",
|
||||
"dic" : "",
|
||||
"phone" : "+420722178099",
|
||||
"mobile" : "",
|
||||
"fax" : "",
|
||||
"gender" : null,
|
||||
"delivery_name" : "",
|
||||
"delivery_surname" : "",
|
||||
"delivery_firm" : "",
|
||||
"delivery_street" : "",
|
||||
"delivery_city" : "",
|
||||
"delivery_zip" : "",
|
||||
"delivery_country" : "CZ",
|
||||
"account_no" : "",
|
||||
"account_bank" : "",
|
||||
"account_symbol" : "",
|
||||
"get_news" : "N",
|
||||
"prefer_transport" : null,
|
||||
"date_reg" : "2024-07-18 11:57:00",
|
||||
"date_updated" : "2025-04-23 13:57:20",
|
||||
"date_logged" : "2025-04-23 11:28:01",
|
||||
"custom_address" : "",
|
||||
"state" : "",
|
||||
"delivery_custom_address" : "",
|
||||
"delivery_state" : "",
|
||||
"date_subscribe" : null,
|
||||
"date_unsubscribe" : "2024-07-18 11:57:32",
|
||||
"note" : null,
|
||||
"custom_data" : "{\"isic\":{\"number\":\"\",\"holder\":\"\"}}",
|
||||
"delivery_phone" : "",
|
||||
"delivery_email" : null,
|
||||
"due_days" : null,
|
||||
"birthdate" : null,
|
||||
"pohoda_id" : 658977,
|
||||
"pohoda_sync_date" : "2025-01-29 14:34:35",
|
||||
"pohoda_id_address" : null,
|
||||
"copy_email" : null
|
||||
}
|
||||
],
|
||||
"orders" : [
|
||||
{
|
||||
"id" : 528141,
|
||||
"source" : "shop",
|
||||
"order_no" : "252771649",
|
||||
"order_no_reverse" : "946177252",
|
||||
"id_language" : "cs",
|
||||
"currency_rate" : 1.00000000,
|
||||
"currency" : "CZK",
|
||||
"id_user" : 88586,
|
||||
"date_created" : "2025-04-11 18:52:43",
|
||||
"date_accept" : "2025-04-11 19:05:08",
|
||||
"date_handle" : "2025-04-15 11:35:09",
|
||||
"date_delivered" : null,
|
||||
"date_updated" : "2025-04-23 13:57:20",
|
||||
"date_due" : null,
|
||||
"status" : 3,
|
||||
"status_payed" : 0,
|
||||
"status_dispatch" : 0,
|
||||
"status_storno" : 0,
|
||||
"total_price" : 608.0000,
|
||||
"total_price_without_vat" : 502.4800,
|
||||
"invoice_name" : "Eliška",
|
||||
"invoice_surname" : "Vaňoučková",
|
||||
"invoice_firm" : "",
|
||||
"invoice_ico" : "",
|
||||
"invoice_dic" : "",
|
||||
"invoice_street" : "Chotyně 39",
|
||||
"invoice_city" : "Chotyně",
|
||||
"invoice_zip" : "464 34",
|
||||
"invoice_country" : "CZ",
|
||||
"invoice_phone" : "+420722178099",
|
||||
"invoice_email" : "eliskavanouckova@seznam.cz",
|
||||
"delivery_name" : "Eliška",
|
||||
"delivery_surname" : "Vaňoučková",
|
||||
"delivery_firm" : "",
|
||||
"delivery_street" : "Chotyně 39",
|
||||
"delivery_city" : "Chotyně",
|
||||
"delivery_zip" : "464 34",
|
||||
"delivery_country" : "CZ",
|
||||
"delivery_type" : "Hotově (kartou) na prodejně - Osobní odběr - Liberec - OC Nisa",
|
||||
"id_delivery" : null,
|
||||
"delivery_complete" : "",
|
||||
"note_user" : "",
|
||||
"note_admin" : "{\"ip_address\":\"89.24.41.149\",\"remote_port\":\"24778\",\"user_agent\":\"Mozilla\\/5.0 (iPhone; CPU iPhone OS 18_1_1 like Mac OS X) AppleWebKit\\/605.1.15 (KHTML, like Gecko) Mobile\\/22B91 [FBAN\\/FBIOS;FBAV\\/507.0.0.58.94;FBBV\\/716584418;FBDV\\/iPhone16,1;FBMD\\/iPhone;FBSN\\/iOS;FBSV\\/18.1.1;FBSS\\/3;FBID\\/phone;FBLC\\/cs_CZ;FBOP\\/5;FBRV\\/720448143;IABMV\\/1]\",\"referer\":\"http:\\/\\/m.facebook.com\",\"cart_id\":\"2681cdba44ec11ef9b23525402f665f6\",\"client_id\":\"1445882247.1730310948\",\"utm_source\":\"facebook\",\"utm_medium\":\"cpc\",\"utm_campaign\":\"[FB]_[DPA]_MEATFLY_2022_05_19_VYKON_PREZENTACE\",\"mServerIndex\":\"0\",\"deliveryDate\":\"2025-04-15T18:52:43+02:00\",\"discounts\":{\"email\":\"eliskavanouckova@seznam.cz\",\"rounding_balance\":\"\",\"isic\":[]},\"payment_data\":[],\"heurekaDisagree\":\"on\",\"consents\":{\"\":0},\"conversion_sent\":1}",
|
||||
"flags" : "PRO",
|
||||
"admin" : null,
|
||||
"note_invoice" : null,
|
||||
"package_id" : null,
|
||||
"invoice_state" : "",
|
||||
"invoice_custom_address" : "",
|
||||
"delivery_state" : "",
|
||||
"delivery_custom_address" : "",
|
||||
"delivery_phone" : "+420722178099",
|
||||
"delivery_email" : null,
|
||||
"pohoda_sync_date" : "2025-04-18 09:25:06",
|
||||
"pohoda_id" : "0_318320",
|
||||
"user_order_no" : null,
|
||||
"total_weight" : 0.000000,
|
||||
"invoice_copy_email" : null
|
||||
}
|
||||
],
|
||||
"bonus_points" : [
|
||||
{
|
||||
"id" : 47746,
|
||||
"id_user" : 88586,
|
||||
"points" : -400,
|
||||
"date_created" : "2025-04-11 18:52:43",
|
||||
"note" : "Uplatněno na objednávce č. 252771649",
|
||||
"status" : "active",
|
||||
"id_order" : 528141,
|
||||
"data" : null
|
||||
},
|
||||
{
|
||||
"id" : 47745,
|
||||
"id_user" : 88586,
|
||||
"points" : 97,
|
||||
"date_created" : "2025-04-11 18:52:43",
|
||||
"note" : "Objednávka č. 252771649",
|
||||
"status" : "inactive",
|
||||
"id_order" : 528141,
|
||||
"data" : null
|
||||
},
|
||||
{
|
||||
"id" : 41429,
|
||||
"id_user" : 88586,
|
||||
"points" : 168,
|
||||
"date_created" : "2024-12-15 22:47:32",
|
||||
"note" : "Objednávka č. 252749130",
|
||||
"status" : "active",
|
||||
"id_order" : null,
|
||||
"data" : null
|
||||
}
|
||||
],
|
||||
"order_items" : [],
|
||||
"orders_pohoda_invoices" : []
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\Documents\Import;
|
||||
|
||||
use KupShop\PohodaBundle\Tests\TestUtilHelper;
|
||||
use KupShop\PohodaBundle\Utils\Tools\ProdejkaInvoicesImporter;
|
||||
use KupShop\PohodaBundle\Utils\Tools\TransformHelper;
|
||||
use Query\Operator;
|
||||
|
||||
class TestProdejkaImport extends \DatabaseTestCase
|
||||
{
|
||||
use TestUtilHelper;
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* @var TransformHelper
|
||||
*/
|
||||
protected $transformHelper;
|
||||
|
||||
/**
|
||||
* @var ProdejkaInvoicesImporter
|
||||
*/
|
||||
protected $pohodaInvoicesImporter;
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$this->pohodaInvoicesImporter = $this->get(ProdejkaInvoicesImporter::class);
|
||||
$this->transformHelper = $this->get(TransformHelper::class);
|
||||
$this->prepareMServer();
|
||||
}
|
||||
|
||||
public function testTransformProdejkaIn()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
$xmlResponse = file_get_contents(__DIR__.'/prodejkaInResponse.xml');
|
||||
$transformedXML = $this->transformHelper->baseTransform($xmlResponse, $this->transformHelper->loadXslt('prodejkaIn.xsl'));
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/prodejkaInResult.xml', $transformedXML);
|
||||
}
|
||||
|
||||
public function testInsertProdejkaIn()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$orderCode = sqlQueryBuilder()
|
||||
->select('order_no')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['pohoda_id' => 227511]))
|
||||
->execute()
|
||||
->fetchColumn();
|
||||
$this->assertEquals(null, $orderCode);
|
||||
|
||||
$beforeCountItems = sqlQueryBuilder()
|
||||
->select('COUNT(id)')
|
||||
->from('order_items')
|
||||
->execute()
|
||||
->fetchColumn();
|
||||
$this->assertEquals(0, $beforeCountItems);
|
||||
|
||||
// INSERT
|
||||
$xml = file_get_contents(__DIR__.'/prodejkaInResult.xml');
|
||||
$this->pohodaInvoicesImporter->importOrders($xml, false);
|
||||
|
||||
$orderCode = sqlQueryBuilder()
|
||||
->select('order_no')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['pohoda_id' => 227511]))
|
||||
->execute()
|
||||
->fetchColumn();
|
||||
|
||||
$afterCountItems = sqlQueryBuilder()
|
||||
->select('COUNT(id)')
|
||||
->from('order_items')
|
||||
->execute()
|
||||
->fetchColumn();
|
||||
|
||||
$invoice = sqlQueryBuilder()
|
||||
->select('id_pohoda_invoice')
|
||||
->from('orders_pohoda_invoices')
|
||||
->andWhere(Operator::equals(['number_requested' => '20SPH07090']))
|
||||
->execute()
|
||||
->fetchColumn();
|
||||
|
||||
$this->assertEquals('20SPH07090', $orderCode);
|
||||
$this->assertEquals('4', $afterCountItems);
|
||||
$this->assertEquals('227511', $invoice);
|
||||
}
|
||||
|
||||
public function testProcessBonusPoints()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$xml = file_get_contents(__DIR__.'/prodejkaInResultBonusPoints.xml');
|
||||
$this->pohodaInvoicesImporter->importOrders($xml, false);
|
||||
|
||||
$prodejkaOrderId = sqlQueryBuilder()->select('id')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['order_no' => '25E6200481']))
|
||||
->execute()->fetchOne();
|
||||
|
||||
$prodejkaBonusPoints = sqlQueryBuilder()->select('SUM(points) as points')
|
||||
->from('bonus_points')
|
||||
->andWhere(Operator::equals([
|
||||
'id_order' => $prodejkaOrderId,
|
||||
'status' => 'active',
|
||||
]))
|
||||
->andWhere(Operator::like(['note' => 'Uplatněno%']))
|
||||
->execute()->fetchOne();
|
||||
|
||||
$origOrderUsedBonusPoints = -400;
|
||||
|
||||
$this->assertEquals($origOrderUsedBonusPoints, (float) $prodejkaBonusPoints, 'Počet bodů uplatněných na původní objednávce se musí rovnat počtu bodů uplatněných na prodejce.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
<?xml version="1.0" encoding="Windows-1250"?>
|
||||
<rsp:responsePack version="2.0" id="001" state="ok" programVersion="12502.14 SQL (30.6.2020)" ico="04535510"
|
||||
key="4ba37787-5455-4689-bdcc-c519e4375dda" note="Požadavek na export prodejek"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd"
|
||||
xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd"
|
||||
xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd"
|
||||
xmlns:lCen="http://www.stormware.cz/schema/version_2/list_centre.xsd"
|
||||
xmlns:lAcv="http://www.stormware.cz/schema/version_2/list_activity.xsd"
|
||||
xmlns:acu="http://www.stormware.cz/schema/version_2/accountingunit.xsd"
|
||||
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
|
||||
xmlns:vch="http://www.stormware.cz/schema/version_2/voucher.xsd"
|
||||
xmlns:int="http://www.stormware.cz/schema/version_2/intDoc.xsd"
|
||||
xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd"
|
||||
xmlns:ofr="http://www.stormware.cz/schema/version_2/offer.xsd"
|
||||
xmlns:enq="http://www.stormware.cz/schema/version_2/enquiry.xsd"
|
||||
xmlns:vyd="http://www.stormware.cz/schema/version_2/vydejka.xsd"
|
||||
xmlns:pri="http://www.stormware.cz/schema/version_2/prijemka.xsd"
|
||||
xmlns:bal="http://www.stormware.cz/schema/version_2/balance.xsd"
|
||||
xmlns:pre="http://www.stormware.cz/schema/version_2/prevodka.xsd"
|
||||
xmlns:vyr="http://www.stormware.cz/schema/version_2/vyroba.xsd"
|
||||
xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd"
|
||||
xmlns:con="http://www.stormware.cz/schema/version_2/contract.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd"
|
||||
xmlns:prm="http://www.stormware.cz/schema/version_2/parameter.xsd"
|
||||
xmlns:lCon="http://www.stormware.cz/schema/version_2/list_contract.xsd"
|
||||
xmlns:ctg="http://www.stormware.cz/schema/version_2/category.xsd"
|
||||
xmlns:ipm="http://www.stormware.cz/schema/version_2/intParam.xsd"
|
||||
xmlns:str="http://www.stormware.cz/schema/version_2/storage.xsd"
|
||||
xmlns:idp="http://www.stormware.cz/schema/version_2/individualPrice.xsd"
|
||||
xmlns:sup="http://www.stormware.cz/schema/version_2/supplier.xsd"
|
||||
xmlns:prn="http://www.stormware.cz/schema/version_2/print.xsd"
|
||||
xmlns:sEET="http://www.stormware.cz/schema/version_2/sendEET.xsd"
|
||||
xmlns:act="http://www.stormware.cz/schema/version_2/accountancy.xsd"
|
||||
xmlns:bnk="http://www.stormware.cz/schema/version_2/bank.xsd"
|
||||
xmlns:sto="http://www.stormware.cz/schema/version_2/store.xsd"
|
||||
xmlns:grs="http://www.stormware.cz/schema/version_2/groupStocks.xsd"
|
||||
xmlns:acp="http://www.stormware.cz/schema/version_2/actionPrice.xsd"
|
||||
xmlns:csh="http://www.stormware.cz/schema/version_2/cashRegister.xsd"
|
||||
xmlns:bka="http://www.stormware.cz/schema/version_2/bankAccount.xsd"
|
||||
xmlns:ilt="http://www.stormware.cz/schema/version_2/inventoryLists.xsd"
|
||||
xmlns:nms="http://www.stormware.cz/schema/version_2/numericalSeries.xsd"
|
||||
xmlns:pay="http://www.stormware.cz/schema/version_2/payment.xsd"
|
||||
xmlns:mKasa="http://www.stormware.cz/schema/version_2/mKasa.xsd"
|
||||
xmlns:gdp="http://www.stormware.cz/schema/version_2/GDPR.xsd"
|
||||
xmlns:est="http://www.stormware.cz/schema/version_2/establishment.xsd"
|
||||
xmlns:cen="http://www.stormware.cz/schema/version_2/centre.xsd"
|
||||
xmlns:acv="http://www.stormware.cz/schema/version_2/activity.xsd"
|
||||
xmlns:afp="http://www.stormware.cz/schema/version_2/accountingFormOfPayment.xsd"
|
||||
xmlns:vat="http://www.stormware.cz/schema/version_2/classificationVAT.xsd"
|
||||
xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd"
|
||||
xmlns:asv="http://www.stormware.cz/schema/version_2/accountingSalesVouchers.xsd"
|
||||
xmlns:arch="http://www.stormware.cz/schema/version_2/archive.xsd">
|
||||
<rsp:responsePackItem version="2.0" id="pro_01" state="ok">
|
||||
<lst:listProdejka version="2.0" dateTimeStamp="2020-08-19T09:54:27" dateValidFrom="2020-08-19" state="ok">
|
||||
<lst:prodejka version="2.0">
|
||||
<pro:prodejkaHeader>
|
||||
<pro:id>227511</pro:id>
|
||||
<pro:prodejkaType>saleVoucher</pro:prodejkaType>
|
||||
<pro:number>
|
||||
<typ:id>1144</typ:id>
|
||||
<typ:ids>20SPH</typ:ids>
|
||||
<typ:numberRequested>20SPH07090</typ:numberRequested>
|
||||
</pro:number>
|
||||
<pro:date>2020-07-22</pro:date>
|
||||
<pro:accounting>
|
||||
<typ:id>222</typ:id>
|
||||
<typ:ids>1Op</typ:ids>
|
||||
</pro:accounting>
|
||||
<pro:partnerIdentity>
|
||||
<typ:id>51517</typ:id>
|
||||
<typ:address>
|
||||
<typ:name>Matìj Eberle</typ:name>
|
||||
<typ:city>Velká Dobrá</typ:city>
|
||||
<typ:street>U Køížku 325</typ:street>
|
||||
<typ:zip>27361</typ:zip>
|
||||
<typ:country>
|
||||
<typ:id>48</typ:id>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
</typ:address>
|
||||
</pro:partnerIdentity>
|
||||
<pro:paymentType>
|
||||
<typ:id>5</typ:id>
|
||||
<typ:ids>plat.kartou</typ:ids>
|
||||
<typ:paymentType>creditcard</typ:paymentType>
|
||||
</pro:paymentType>
|
||||
<pro:priceLevel>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>Prodejní</typ:ids>
|
||||
</pro:priceLevel>
|
||||
<pro:centre>
|
||||
<typ:id>12</typ:id>
|
||||
<typ:ids>SENO</typ:ids>
|
||||
</pro:centre>
|
||||
<pro:markRecord>false</pro:markRecord>
|
||||
<pro:parameters/>
|
||||
</pro:prodejkaHeader>
|
||||
<pro:prodejkaDetail>
|
||||
<pro:prodejkaItem>
|
||||
<pro:text>Beal reep 2mm</pro:text>
|
||||
<pro:quantity>10.0</pro:quantity>
|
||||
<pro:unit>m</pro:unit>
|
||||
<pro:coefficient>1.0</pro:coefficient>
|
||||
<pro:payVAT>true</pro:payVAT>
|
||||
<pro:rateVAT>high</pro:rateVAT>
|
||||
<pro:discountPercentage>0.0</pro:discountPercentage>
|
||||
<pro:homeCurrency>
|
||||
<typ:unitPrice>6</typ:unitPrice>
|
||||
<typ:price>49.59</typ:price>
|
||||
<typ:priceVAT>10.41</typ:priceVAT>
|
||||
<typ:priceSum>60</typ:priceSum>
|
||||
</pro:homeCurrency>
|
||||
<pro:code>BEA002</pro:code>
|
||||
<pro:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>10</typ:id>
|
||||
<typ:ids>02</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>32008</typ:id>
|
||||
<typ:ids>BEA002</typ:ids>
|
||||
<typ:EAN>3700288250490</typ:EAN>
|
||||
</typ:stockItem>
|
||||
</pro:stockItem>
|
||||
</pro:prodejkaItem>
|
||||
<pro:prodejkaItem>
|
||||
<pro:text>Kouba š<>áradlo Otvírák</pro:text>
|
||||
<pro:quantity>1.0</pro:quantity>
|
||||
<pro:unit>ks</pro:unit>
|
||||
<pro:coefficient>1.0</pro:coefficient>
|
||||
<pro:payVAT>true</pro:payVAT>
|
||||
<pro:rateVAT>high</pro:rateVAT>
|
||||
<pro:discountPercentage>0.0</pro:discountPercentage>
|
||||
<pro:homeCurrency>
|
||||
<typ:unitPrice>159</typ:unitPrice>
|
||||
<typ:price>131.4</typ:price>
|
||||
<typ:priceVAT>27.6</typ:priceVAT>
|
||||
<typ:priceSum>159</typ:priceSum>
|
||||
</pro:homeCurrency>
|
||||
<pro:code>KOU030</pro:code>
|
||||
<pro:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>10</typ:id>
|
||||
<typ:ids>02</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>35574</typ:id>
|
||||
<typ:ids>KOU030</typ:ids>
|
||||
<typ:EAN>6966611923420</typ:EAN>
|
||||
</typ:stockItem>
|
||||
</pro:stockItem>
|
||||
</pro:prodejkaItem>
|
||||
<pro:prodejkaItem>
|
||||
<pro:text>Ocun rukavice Crackgloves 2016 ::-::L</pro:text>
|
||||
<pro:quantity>1.0</pro:quantity>
|
||||
<pro:unit>ks</pro:unit>
|
||||
<pro:coefficient>1.0</pro:coefficient>
|
||||
<pro:payVAT>true</pro:payVAT>
|
||||
<pro:rateVAT>high</pro:rateVAT>
|
||||
<pro:discountPercentage>0.0</pro:discountPercentage>
|
||||
<pro:homeCurrency>
|
||||
<typ:unitPrice>585</typ:unitPrice>
|
||||
<typ:price>483.47</typ:price>
|
||||
<typ:priceVAT>101.53</typ:priceVAT>
|
||||
<typ:priceSum>585</typ:priceSum>
|
||||
</pro:homeCurrency>
|
||||
<pro:code>OCU223S004</pro:code>
|
||||
<pro:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>10</typ:id>
|
||||
<typ:ids>02</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>107307</typ:id>
|
||||
<typ:ids>OCU223S004</typ:ids>
|
||||
<typ:EAN>8591804624728</typ:EAN>
|
||||
</typ:stockItem>
|
||||
</pro:stockItem>
|
||||
</pro:prodejkaItem>
|
||||
<pro:prodejkaItem>
|
||||
<pro:text>Ocun karabina Kestrel ::mix barev::-</pro:text>
|
||||
<pro:quantity>1.0</pro:quantity>
|
||||
<pro:unit>ks</pro:unit>
|
||||
<pro:coefficient>1.0</pro:coefficient>
|
||||
<pro:payVAT>true</pro:payVAT>
|
||||
<pro:rateVAT>high</pro:rateVAT>
|
||||
<pro:discountPercentage>0.0</pro:discountPercentage>
|
||||
<pro:homeCurrency>
|
||||
<typ:unitPrice>135</typ:unitPrice>
|
||||
<typ:price>111.57</typ:price>
|
||||
<typ:priceVAT>23.43</typ:priceVAT>
|
||||
<typ:priceSum>135</typ:priceSum>
|
||||
</pro:homeCurrency>
|
||||
<pro:note>V Dose je 60 ks</pro:note>
|
||||
<pro:code>OCU147S001</pro:code>
|
||||
<pro:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>10</typ:id>
|
||||
<typ:ids>02</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>75540</typ:id>
|
||||
<typ:ids>OCU147S001</typ:ids>
|
||||
<typ:EAN>8591804612343</typ:EAN>
|
||||
<typ:PLU>123456</typ:PLU>
|
||||
</typ:stockItem>
|
||||
</pro:stockItem>
|
||||
</pro:prodejkaItem>
|
||||
</pro:prodejkaDetail>
|
||||
<pro:prodejkaSummary>
|
||||
<pro:roundingDocument>none</pro:roundingDocument>
|
||||
<pro:roundingVAT>none</pro:roundingVAT>
|
||||
<pro:typeCalculateVATInclusivePrice>VATNewMethod</pro:typeCalculateVATInclusivePrice>
|
||||
<pro:homeCurrency>
|
||||
<typ:priceNone>0</typ:priceNone>
|
||||
<typ:priceLow>0</typ:priceLow>
|
||||
<typ:priceLowVAT>0</typ:priceLowVAT>
|
||||
<typ:priceLowSum>0</typ:priceLowSum>
|
||||
<typ:priceHigh>776.03</typ:priceHigh>
|
||||
<typ:priceHighVAT>162.97</typ:priceHighVAT>
|
||||
<typ:priceHighSum>939</typ:priceHighSum>
|
||||
<typ:price3>0</typ:price3>
|
||||
<typ:price3VAT>0</typ:price3VAT>
|
||||
<typ:price3Sum>0</typ:price3Sum>
|
||||
<typ:round>
|
||||
<typ:priceRound>0</typ:priceRound>
|
||||
</typ:round>
|
||||
</pro:homeCurrency>
|
||||
</pro:prodejkaSummary>
|
||||
<pro:EET>
|
||||
<typ:stateEET>notEnter</typ:stateEET>
|
||||
</pro:EET>
|
||||
</lst:prodejka>
|
||||
</lst:listProdejka>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ORDERS xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd" xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd" xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd">
|
||||
<ORDER>
|
||||
<ORDER_POHODA_ID>227511</ORDER_POHODA_ID>
|
||||
<ORDER_NO>20SPH07090</ORDER_NO>
|
||||
<DATE_CREATED>2020-07-22</DATE_CREATED>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<CURRENCY_RATE>1</CURRENCY_RATE>
|
||||
<EMAIL/>
|
||||
<INVOICE_PREFIX>1144</INVOICE_PREFIX>
|
||||
<PHONE/>
|
||||
<PAYMENT>PlatebniKarta</PAYMENT>
|
||||
<USER>
|
||||
<POHODA_ID>51517</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>Matěj</NAME>
|
||||
<SURNAME>Eberle</SURNAME>
|
||||
<FIRM/>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>U Křížku 325</STREET>
|
||||
<CITY>Velká Dobrá</CITY>
|
||||
<ZIP>27361</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE/>
|
||||
<EMAIL/>
|
||||
</INVOICE_ADDRESS>
|
||||
<STATUSES>
|
||||
<STATUS>3</STATUS>
|
||||
</STATUSES>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID/>
|
||||
<CODE>BEA002</CODE>
|
||||
<NAME>Beal reep 2mm</NAME>
|
||||
<PIECE_PRICE>4.959000000000001</PIECE_PRICE>
|
||||
<TOTAL_PRICE>60</TOTAL_PRICE>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID/>
|
||||
<CODE>KOU030</CODE>
|
||||
<NAME>Kouba šťáradlo Otvírák</NAME>
|
||||
<PIECE_PRICE>131.4</PIECE_PRICE>
|
||||
<TOTAL_PRICE>159</TOTAL_PRICE>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID/>
|
||||
<CODE>OCU223S004</CODE>
|
||||
<NAME>Ocun rukavice Crackgloves 2016 ::-::L</NAME>
|
||||
<PIECE_PRICE>483.47</PIECE_PRICE>
|
||||
<TOTAL_PRICE>585</TOTAL_PRICE>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID/>
|
||||
<CODE>OCU147S001</CODE>
|
||||
<NAME>Ocun karabina Kestrel ::mix barev::-</NAME>
|
||||
<PIECE_PRICE>111.57</PIECE_PRICE>
|
||||
<TOTAL_PRICE>135</TOTAL_PRICE>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
</ORDERS>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ORDERS xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd" xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd" xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd">
|
||||
<ORDER>
|
||||
<ORDER_POHODA_ID>P1321544</ORDER_POHODA_ID>
|
||||
<ORDER_NO>25E6200481</ORDER_NO>
|
||||
<DATE_CREATED>2025-04-18</DATE_CREATED>
|
||||
<DATE_UPDATE>2025-04-18</DATE_UPDATE>
|
||||
<DATE_HANDLE>2025-04-18</DATE_HANDLE>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<CURRENCY_RATE>1</CURRENCY_RATE>
|
||||
<EMAIL>eliskavanouckova@seznam.cz</EMAIL>
|
||||
<INVOICE_PREFIX>25E62</INVOICE_PREFIX>
|
||||
<PHONE>+420722178099</PHONE>
|
||||
<FLAGS>POS</FLAGS>
|
||||
<PAYMENT>Eshop kartou</PAYMENT>
|
||||
<USER>
|
||||
<POHODA_ID>658977</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>Eliška</NAME>
|
||||
<SURNAME>Vaňoučková</SURNAME>
|
||||
<FIRM/>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>Chotyně 39</STREET>
|
||||
<CITY>Chotyně</CITY>
|
||||
<ZIP>464 34</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE>+420722178099</PHONE>
|
||||
<EMAIL>eliskavanouckova@seznam.cz</EMAIL>
|
||||
</INVOICE_ADDRESS>
|
||||
<STATUSES>
|
||||
<STATUS>2</STATUS>
|
||||
</STATUSES>
|
||||
<ORIG_ORDER_ID>252771649</ORIG_ORDER_ID>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID/>
|
||||
<CODE>MF-24000170</CODE>
|
||||
<EAN>8590202085469</EAN>
|
||||
<NAME>LUNA T-SHIRT, Sea Green, XS 2/1/55</NAME>
|
||||
<PIECES>1.0</PIECES>
|
||||
<PIECE_PRICE>346.2809917355372</PIECE_PRICE>
|
||||
<TOTAL_PRICE>346.2809917355372</TOTAL_PRICE>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID/>
|
||||
<CODE/>
|
||||
<EAN/>
|
||||
<NAME>Věrnostní sleva, body (400)</NAME>
|
||||
<PIECES>1.0</PIECES>
|
||||
<PIECE_PRICE>-330.57851239669424</PIECE_PRICE>
|
||||
<TOTAL_PRICE>-330.57851239669424</TOTAL_PRICE>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID/>
|
||||
<CODE>MF-23000552</CODE>
|
||||
<EAN>8590202076030</EAN>
|
||||
<NAME>Osobní odběr – hotově nebo kartou na prodejně</NAME>
|
||||
<PIECES>1.0</PIECES>
|
||||
<PIECE_PRICE>32.231404958677686</PIECE_PRICE>
|
||||
<TOTAL_PRICE>32.231404958677686</TOTAL_PRICE>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
</ORDERS>
|
||||
58
bundles/KupShop/PohodaBundle/Tests/ExportBaseOrder.xml
Normal file
58
bundles/KupShop/PohodaBundle/Tests/ExportBaseOrder.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ORDERS>
|
||||
<ORDER>
|
||||
<ORDER_ID>4047</ORDER_ID>
|
||||
<ORDER_NO>0194047</ORDER_NO>
|
||||
<DATE_CREATED>2019-06-04 06:42:02</DATE_CREATED>
|
||||
<STATUS_PAYED>0</STATUS_PAYED>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<CURRENCY_RATE>1.00000000</CURRENCY_RATE>
|
||||
<TOTAL_PRICE>121</TOTAL_PRICE>
|
||||
<EMAIL>prokop@wpj.cz</EMAIL>
|
||||
<PHONE>+773568922</PHONE>
|
||||
<NOTE/>
|
||||
<SOURCE>shop</SOURCE>
|
||||
<USER_ORDER_NO/>
|
||||
<DELIVERY id="2">DPD</DELIVERY>
|
||||
<PAYMENT class="Dobirka" id="2" method="">Dobírkou</PAYMENT>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>Jan</NAME>
|
||||
<SURNAME>Prokop</SURNAME>
|
||||
<FIRM>WPJ s.r.o.</FIRM>
|
||||
<ICO>123456789</ICO>
|
||||
<DIC>CZ123456789</DIC>
|
||||
<STREET>Dlouha 123</STREET>
|
||||
<CITY>Vrchlabí</CITY>
|
||||
<ZIP>54301</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<ADDITIONAL_ADDRESS/>
|
||||
<REGION/>
|
||||
</INVOICE_ADDRESS>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>Jan</NAME>
|
||||
<SURNAME>Prokop</SURNAME>
|
||||
<FIRM>WPJ s.r.o.</FIRM>
|
||||
<STREET>Dlouha 123</STREET>
|
||||
<CITY>Vrchlabí</CITY>
|
||||
<ZIP>54301</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE/>
|
||||
<ADDITIONAL_ADDRESS/>
|
||||
<REGION/>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM id="31011" type="product">
|
||||
<CODE>QO591</CODE>
|
||||
<NAME>Jebao JPL3 halogenové světlo 20 W - světlo pro zahradní jezírka</NAME>
|
||||
<VARIATION_NAME/>
|
||||
<PIECE_PRICE>121</PIECE_PRICE>
|
||||
<PIECE_PRICE_WITHOUT_VAT>100</PIECE_PRICE_WITHOUT_VAT>
|
||||
<PIECES>1</PIECES>
|
||||
<TOTAL_PRICE>121</TOTAL_PRICE>
|
||||
<TOTAL_PRICE_WITHOUT_VAT>100</TOTAL_PRICE_WITHOUT_VAT>
|
||||
<VAT>21</VAT>
|
||||
<GUARANTEE>24</GUARANTEE>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
</ORDERS>
|
||||
80
bundles/KupShop/PohodaBundle/Tests/ExportOrders.xml
Normal file
80
bundles/KupShop/PohodaBundle/Tests/ExportOrders.xml
Normal file
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0"?>
|
||||
<dat:dataPack xmlns:dat="http://www.stormware.cz/schema/version_2/data.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd" version="2.0" id="1" application="Pohoda"
|
||||
note="KupshopSync" ico="{KUPSHOP_ICO}">
|
||||
<dat:dataPackItem id="4047" version="2.0">
|
||||
<ord:order version="2.0">
|
||||
<ord:orderHeader>
|
||||
<ord:orderType>receivedOrder</ord:orderType>
|
||||
<ord:number>
|
||||
<typ:numberRequested checkDuplicity="true">0194047</typ:numberRequested>
|
||||
</ord:number>
|
||||
<ord:numberOrder>0194047</ord:numberOrder>
|
||||
<ord:date>2019-06-04</ord:date>
|
||||
<ord:note/>
|
||||
<ord:partnerIdentity>
|
||||
<typ:address>
|
||||
<typ:company>WPJ s.r.o.</typ:company>
|
||||
<typ:name>Jan Prokop</typ:name>
|
||||
<typ:city>Vrchlabí</typ:city>
|
||||
<typ:street>Dlouha 123</typ:street>
|
||||
<typ:zip>54301</typ:zip>
|
||||
<typ:ico>123456789</typ:ico>
|
||||
<typ:dic>CZ123456789</typ:dic>
|
||||
<typ:phone>+773568922</typ:phone>
|
||||
<typ:mobilPhone>+773568922</typ:mobilPhone>
|
||||
<typ:email>prokop@wpj.cz</typ:email>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:company>WPJ s.r.o.</typ:company>
|
||||
<typ:name>Jan Prokop</typ:name>
|
||||
<typ:city>Vrchlabí</typ:city>
|
||||
<typ:street>Dlouha 123</typ:street>
|
||||
<typ:zip>54301</typ:zip>
|
||||
<typ:phone/>
|
||||
<typ:email/>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
</typ:shipToAddress>
|
||||
</ord:partnerIdentity>
|
||||
<ord:paymentType>
|
||||
<typ:ids>Dobírkou</typ:ids>
|
||||
</ord:paymentType>
|
||||
<ord:carrier>
|
||||
<typ:ids>DPD</typ:ids>
|
||||
</ord:carrier>
|
||||
</ord:orderHeader>
|
||||
<ord:orderDetail>
|
||||
<ord:orderItem>
|
||||
<ord:text>Jebao JPL3 halogenové světlo 20 W - světlo pro zahradní jezírka</ord:text>
|
||||
<ord:quantity>1</ord:quantity>
|
||||
<ord:payVAT>true</ord:payVAT>
|
||||
<ord:rateVAT>high</ord:rateVAT>
|
||||
<ord:homeCurrency>
|
||||
<typ:unitPrice>121</typ:unitPrice>
|
||||
<typ:price>121</typ:price>
|
||||
</ord:homeCurrency>
|
||||
<ord:note/>
|
||||
<ord:code>QO591</ord:code>
|
||||
<ord:stockItem>
|
||||
<typ:stockItem applyUserSettingsFilterOnTheStore="false">
|
||||
<typ:ids>QO591</typ:ids>
|
||||
</typ:stockItem>
|
||||
</ord:stockItem>
|
||||
</ord:orderItem>
|
||||
</ord:orderDetail>
|
||||
<ord:orderSummary>
|
||||
<ord:homeCurrency>
|
||||
<typ:round>
|
||||
<typ:priceRound>1</typ:priceRound>
|
||||
</typ:round>
|
||||
</ord:homeCurrency>
|
||||
</ord:orderSummary>
|
||||
</ord:order>
|
||||
</dat:dataPackItem>
|
||||
</dat:dataPack>
|
||||
88
bundles/KupShop/PohodaBundle/Tests/ExportOrdersResponse.xml
Normal file
88
bundles/KupShop/PohodaBundle/Tests/ExportOrdersResponse.xml
Normal file
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="Windows-1250"?>
|
||||
<rsp:responsePack version="2.0" id="1" state="ok" programVersion="13106.4 SQL (11.7.2022)" ico="25596543"
|
||||
key="76aeac20-fbf0-4519-8c30-518c62193b3d" note="KupshopSync"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd"
|
||||
xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd"
|
||||
xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd"
|
||||
xmlns:lCen="http://www.stormware.cz/schema/version_2/list_centre.xsd"
|
||||
xmlns:lAcv="http://www.stormware.cz/schema/version_2/list_activity.xsd"
|
||||
xmlns:acu="http://www.stormware.cz/schema/version_2/accountingunit.xsd"
|
||||
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
|
||||
xmlns:vch="http://www.stormware.cz/schema/version_2/voucher.xsd"
|
||||
xmlns:int="http://www.stormware.cz/schema/version_2/intDoc.xsd"
|
||||
xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd"
|
||||
xmlns:ofr="http://www.stormware.cz/schema/version_2/offer.xsd"
|
||||
xmlns:enq="http://www.stormware.cz/schema/version_2/enquiry.xsd"
|
||||
xmlns:vyd="http://www.stormware.cz/schema/version_2/vydejka.xsd"
|
||||
xmlns:pri="http://www.stormware.cz/schema/version_2/prijemka.xsd"
|
||||
xmlns:bal="http://www.stormware.cz/schema/version_2/balance.xsd"
|
||||
xmlns:pre="http://www.stormware.cz/schema/version_2/prevodka.xsd"
|
||||
xmlns:vyr="http://www.stormware.cz/schema/version_2/vyroba.xsd"
|
||||
xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd"
|
||||
xmlns:con="http://www.stormware.cz/schema/version_2/contract.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd"
|
||||
xmlns:prm="http://www.stormware.cz/schema/version_2/parameter.xsd"
|
||||
xmlns:lCon="http://www.stormware.cz/schema/version_2/list_contract.xsd"
|
||||
xmlns:ctg="http://www.stormware.cz/schema/version_2/category.xsd"
|
||||
xmlns:ipm="http://www.stormware.cz/schema/version_2/intParam.xsd"
|
||||
xmlns:str="http://www.stormware.cz/schema/version_2/storage.xsd"
|
||||
xmlns:idp="http://www.stormware.cz/schema/version_2/individualPrice.xsd"
|
||||
xmlns:sup="http://www.stormware.cz/schema/version_2/supplier.xsd"
|
||||
xmlns:prn="http://www.stormware.cz/schema/version_2/print.xsd"
|
||||
xmlns:isd="http://www.stormware.cz/schema/version_2/isdoc.xsd"
|
||||
xmlns:sEET="http://www.stormware.cz/schema/version_2/sendEET.xsd"
|
||||
xmlns:act="http://www.stormware.cz/schema/version_2/accountancy.xsd"
|
||||
xmlns:bnk="http://www.stormware.cz/schema/version_2/bank.xsd"
|
||||
xmlns:sto="http://www.stormware.cz/schema/version_2/store.xsd"
|
||||
xmlns:grs="http://www.stormware.cz/schema/version_2/groupStocks.xsd"
|
||||
xmlns:acp="http://www.stormware.cz/schema/version_2/actionPrice.xsd"
|
||||
xmlns:csh="http://www.stormware.cz/schema/version_2/cashRegister.xsd"
|
||||
xmlns:bka="http://www.stormware.cz/schema/version_2/bankAccount.xsd"
|
||||
xmlns:ilt="http://www.stormware.cz/schema/version_2/inventoryLists.xsd"
|
||||
xmlns:nms="http://www.stormware.cz/schema/version_2/numericalSeries.xsd"
|
||||
xmlns:pay="http://www.stormware.cz/schema/version_2/payment.xsd"
|
||||
xmlns:mKasa="http://www.stormware.cz/schema/version_2/mKasa.xsd"
|
||||
xmlns:gdp="http://www.stormware.cz/schema/version_2/GDPR.xsd"
|
||||
xmlns:est="http://www.stormware.cz/schema/version_2/establishment.xsd"
|
||||
xmlns:cen="http://www.stormware.cz/schema/version_2/centre.xsd"
|
||||
xmlns:acv="http://www.stormware.cz/schema/version_2/activity.xsd"
|
||||
xmlns:afp="http://www.stormware.cz/schema/version_2/accountingFormOfPayment.xsd"
|
||||
xmlns:vat="http://www.stormware.cz/schema/version_2/classificationVAT.xsd"
|
||||
xmlns:rgn="http://www.stormware.cz/schema/version_2/registrationNumber.xsd"
|
||||
xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd"
|
||||
xmlns:asv="http://www.stormware.cz/schema/version_2/accountingSalesVouchers.xsd"
|
||||
xmlns:arch="http://www.stormware.cz/schema/version_2/archive.xsd"
|
||||
xmlns:req="http://www.stormware.cz/schema/version_2/productRequirement.xsd"
|
||||
xmlns:mov="http://www.stormware.cz/schema/version_2/movement.xsd"
|
||||
xmlns:rec="http://www.stormware.cz/schema/version_2/recyclingContrib.xsd"
|
||||
xmlns:srv="http://www.stormware.cz/schema/version_2/service.xsd">
|
||||
<rsp:responsePackItem version="2.0" id="4047" state="ok">
|
||||
<ord:orderResponse version="2.0" state="ok">
|
||||
<rdc:producedDetails>
|
||||
<rdc:id>272935</rdc:id>
|
||||
<rdc:number>0194047</rdc:number>
|
||||
<rdc:actionType>add</rdc:actionType>
|
||||
<rdc:itemDetails type="OBJpol">
|
||||
<rdc:item>
|
||||
<rdc:actionType>add</rdc:actionType>
|
||||
<rdc:extId>31011</rdc:extId>
|
||||
<rdc:producedItem>
|
||||
<rdc:id>965136</rdc:id>
|
||||
</rdc:producedItem>
|
||||
</rdc:item>
|
||||
<rdc:item>
|
||||
<rdc:actionType>add</rdc:actionType>
|
||||
<rdc:extId>31012</rdc:extId>
|
||||
<rdc:producedItem>
|
||||
<rdc:id>965137</rdc:id>
|
||||
</rdc:producedItem>
|
||||
</rdc:item>
|
||||
</rdc:itemDetails>
|
||||
</rdc:producedDetails>
|
||||
</ord:orderResponse>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>
|
||||
119
bundles/KupShop/PohodaBundle/Tests/ExportOrdersTest.json
Normal file
119
bundles/KupShop/PohodaBundle/Tests/ExportOrdersTest.json
Normal file
@@ -0,0 +1,119 @@
|
||||
{
|
||||
"orders":[
|
||||
{
|
||||
"id": 4047,
|
||||
"source": "shop",
|
||||
"order_no": "0194047",
|
||||
"currency_rate": 1,
|
||||
"id_user": null,
|
||||
"date_created": "2019-06-04 06:42:02",
|
||||
"date_accept": null,
|
||||
"date_handle": null,
|
||||
"date_updated": "2019-06-04 06:42:02",
|
||||
"date_due": null,
|
||||
"status": 0,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 121,
|
||||
"invoice_name": "Jan",
|
||||
"invoice_surname": "Prokop",
|
||||
"invoice_firm": "WPJ s.r.o.",
|
||||
"invoice_ico": "123456789",
|
||||
"invoice_dic": "CZ123456789",
|
||||
"invoice_street": "Dlouha 123",
|
||||
"invoice_city": "Vrchlabí",
|
||||
"invoice_zip": 54301,
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+773568922",
|
||||
"invoice_email": "prokop@wpj.cz",
|
||||
"delivery_name": "Jan",
|
||||
"delivery_surname": "Prokop",
|
||||
"delivery_firm": "WPJ s.r.o.",
|
||||
"delivery_street": "Dlouha 123",
|
||||
"delivery_city": "Vrchlabí",
|
||||
"delivery_zip": 54301,
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Dobírka - PPL",
|
||||
"id_delivery": 3,
|
||||
"delivery_complete": "N",
|
||||
"note_user": null,
|
||||
"note_admin": null,
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"pohoda_id": "654897"
|
||||
},
|
||||
{
|
||||
"id": 4048,
|
||||
"source": "returns",
|
||||
"order_no": "0194048",
|
||||
"currency_rate": 1,
|
||||
"id_user": null,
|
||||
"date_created": "2019-06-04 06:42:02",
|
||||
"date_accept": null,
|
||||
"date_handle": null,
|
||||
"date_updated": "2019-06-04 06:42:02",
|
||||
"date_due": null,
|
||||
"status": 0,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 121,
|
||||
"invoice_name": "Jan",
|
||||
"invoice_surname": "Prokop",
|
||||
"invoice_firm": "WPJ s.r.o.",
|
||||
"invoice_ico": "123456789",
|
||||
"invoice_dic": "CZ123456789",
|
||||
"invoice_street": "Dlouha 123",
|
||||
"invoice_city": "Vrchlabí",
|
||||
"invoice_zip": 54301,
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+773568922",
|
||||
"invoice_email": "prokop@wpj.cz",
|
||||
"delivery_name": "Jan",
|
||||
"delivery_surname": "Prokop",
|
||||
"delivery_firm": "WPJ s.r.o.",
|
||||
"delivery_street": "Dlouha 123",
|
||||
"delivery_city": "Vrchlabí",
|
||||
"delivery_zip": 54301,
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Dobírka - PPL",
|
||||
"id_delivery": 3,
|
||||
"delivery_complete": "N",
|
||||
"note_user": null,
|
||||
"note_admin": null,
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": ""
|
||||
}
|
||||
|
||||
],
|
||||
"order_items" : [
|
||||
{
|
||||
"id": 31011,
|
||||
"id_order": 4047,
|
||||
"id_product": 1,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 1,
|
||||
"piece_price": 100,
|
||||
"total_price": 100,
|
||||
"descr": "Jebao JPL3 halogenové světlo 20 W - světlo pro zahradní jezírka",
|
||||
"tax": 21,
|
||||
"date": "2019-06-04 06:42:02",
|
||||
"note": "",
|
||||
"discount": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
216
bundles/KupShop/PohodaBundle/Tests/ExportOrdersTest.php
Normal file
216
bundles/KupShop/PohodaBundle/Tests/ExportOrdersTest.php
Normal file
@@ -0,0 +1,216 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests;
|
||||
|
||||
use KupShop\DevelopmentBundle\Util\Tests\LoggerTestTrait;
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
use KupShop\OrderingBundle\Util\Order\OrderExporter;
|
||||
use KupShop\PohodaBundle\Messenger\OrderMessage;
|
||||
use KupShop\PohodaBundle\Utils\Exporters\OrdersExporter;
|
||||
use KupShop\PohodaBundle\Utils\PohodaConnector;
|
||||
use KupShop\PohodaBundle\Utils\Tools\PohodaOrderExporter;
|
||||
use KupShop\PohodaBundle\Utils\Tools\TransformHelper;
|
||||
use Query\Operator;
|
||||
use Symfony\Component\Messenger\Envelope;
|
||||
use Symfony\Component\Messenger\Stamp\HandledStamp;
|
||||
|
||||
class ExportOrdersTest extends \DatabaseTestCase
|
||||
{
|
||||
use LoggerTestTrait;
|
||||
use TestUtilHelper;
|
||||
|
||||
/**
|
||||
* @var MessageBus
|
||||
*/
|
||||
private $asyncBus;
|
||||
|
||||
/** @var PohodaConnector */
|
||||
private $pohodaConnector;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->asyncBus = $this->get('async_bus');
|
||||
}
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
protected $PohodaConnector;
|
||||
/**
|
||||
* @var TransformHelper
|
||||
*/
|
||||
protected $transformHelper;
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$this->PohodaConnector = ServiceContainer::getService(PohodaConnector::class);
|
||||
$this->transformHelper = ServiceContainer::getService(TransformHelper::class);
|
||||
$this->getLogger();
|
||||
$this->prepareMServer();
|
||||
}
|
||||
|
||||
public function testGetBaseOrdersXML()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
$ordersOut = $this->get(OrderExporter::class);
|
||||
|
||||
$ordersOutXML = $ordersOut->getXML([4047]);
|
||||
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/ExportBaseOrder.xml', $ordersOutXML);
|
||||
}
|
||||
|
||||
public function testGetPohodaBaseOrdersXML()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
$ordersOut = $this->get(PohodaOrderExporter::class);
|
||||
|
||||
$ordersOutXML = $ordersOut->getXML([4047]);
|
||||
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/ExportPohodaBaseOrder.xml', $ordersOutXML);
|
||||
}
|
||||
|
||||
public function testTransformShopOrder()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$ordersOut = $this->get(PohodaOrderExporter::class);
|
||||
|
||||
$ordersOutXML = $ordersOut->getXML([4047]);
|
||||
|
||||
$ordersOutXML = $this->transformHelper->baseTransform($ordersOutXML, $this->transformHelper->loadXslt('ordersOut.xsl'));
|
||||
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/ExportOrders.xml', $ordersOutXML->saveXML());
|
||||
}
|
||||
|
||||
public function testOrderExportResponse()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$this->ordersOut = $this->get(OrdersExporter::class);
|
||||
$xml = file_get_contents(__DIR__.'/ExportOrdersResponse.xml');
|
||||
$this->ordersOut->processResponse($xml);
|
||||
|
||||
$response = simplexml_load_string($xml);
|
||||
$logData = null;
|
||||
foreach ($response->xpath('rsp:responsePackItem') as $responsePackItem) {
|
||||
$logData = $responsePackItem->asXML();
|
||||
}
|
||||
$testHandler = $this->getTestHandler();
|
||||
$this->assertEquals(true, $testHandler->hasNoticeThatContains('POHODA RESPONSE: Order Export'));
|
||||
foreach ($testHandler->getRecords() as $record) {
|
||||
if ($record['message'] == 'POHODA RESPONSE: Order Export') {
|
||||
$this->assertEquals($logData, $record['context']['data']);
|
||||
}
|
||||
}
|
||||
|
||||
$qb = sqlQueryBuilder()
|
||||
->select('*')
|
||||
->from('order_items')
|
||||
->andWhere(Operator::equals(['id' => '31011']))
|
||||
->execute()
|
||||
->fetch();
|
||||
|
||||
$this->assertEquals('965136', $qb['pohoda_id']);
|
||||
}
|
||||
|
||||
public function testAsyncExportOrder()
|
||||
{
|
||||
$instance = $this->autowire(PohodaConnectorMock::class);
|
||||
$this->set(PohodaConnector::class, $instance);
|
||||
|
||||
$cfg = \KupShop\KupShopBundle\Config::get();
|
||||
$cfg['Modules']['pohoda']['create_corrective_invoice_from_returns'] = true;
|
||||
$cfg['Modules']['pohoda']['instant_order_upload'] = true;
|
||||
|
||||
$this->prepareMServer();
|
||||
|
||||
$asyncMessage = new OrderMessage();
|
||||
$asyncMessage->setIdOrder(4048);
|
||||
|
||||
$result = $this->getHandledResult($this->asyncBus->dispatch($asyncMessage));
|
||||
$qb = sqlQueryBuilder()
|
||||
->select('*')
|
||||
->from('orders_pohoda_invoices')
|
||||
->andWhere(Operator::equals(['id_order' => '4048']))
|
||||
->sendToMaster()
|
||||
->execute()
|
||||
->fetchAssociative();
|
||||
$this->assertEquals('62910', $qb['id_pohoda_invoice']);
|
||||
$this->assertTrue($result['status']);
|
||||
}
|
||||
|
||||
public function getHandledResult(Envelope $envelope)
|
||||
{
|
||||
$stamp = $envelope->last(HandledStamp::class);
|
||||
|
||||
return $stamp->getResult();
|
||||
}
|
||||
}
|
||||
|
||||
class PohodaConnectorMock extends PohodaConnector
|
||||
{
|
||||
public function sendRequest($XmlBodyRequest)
|
||||
{
|
||||
$request = new \SimpleXMLElement($XmlBodyRequest);
|
||||
$request->registerXPathNamespace('ord', 'ord:order');
|
||||
$request->registerXPathNamespace('inv', 'inv:invoice');
|
||||
|
||||
if (!empty($request->xpath('dat:dataPackItem/ord:order/ord:orderHeader/ord:orderType'))) {
|
||||
return '<?xml version="1.0" encoding="Windows-1250"?>
|
||||
<rsp:responsePack version="2.0" id="1" state="ok" programVersion="13106.4 SQL (11.7.2022)" ico="0123456789"
|
||||
key="76aeac20-fbf0-4519-8c30-518c62193b3d" note="KupshopSync"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd">
|
||||
<rsp:responsePackItem version="2.0" id="4048" state="ok">
|
||||
<ord:orderResponse version="2.0" state="ok">
|
||||
<rdc:producedDetails>
|
||||
<rdc:id>272939</rdc:id>
|
||||
<rdc:number>0194048</rdc:number>
|
||||
<rdc:actionType>add</rdc:actionType>
|
||||
<rdc:itemDetails type="OBJpol">
|
||||
<rdc:item>
|
||||
<rdc:actionType>add</rdc:actionType>
|
||||
<rdc:extId>31011</rdc:extId>
|
||||
<rdc:producedItem>
|
||||
<rdc:id>965136</rdc:id>
|
||||
</rdc:producedItem>
|
||||
</rdc:item>
|
||||
<rdc:item>
|
||||
<rdc:actionType>add</rdc:actionType>
|
||||
<rdc:extId>31012</rdc:extId>
|
||||
<rdc:producedItem>
|
||||
<rdc:id>965137</rdc:id>
|
||||
</rdc:producedItem>
|
||||
</rdc:item>
|
||||
</rdc:itemDetails>
|
||||
</rdc:producedDetails>
|
||||
</ord:orderResponse>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>';
|
||||
}
|
||||
|
||||
if (!empty($request->xpath('dat:dataPackItem/inv:invoice/inv:invoiceHeader/inv:invoiceType'))) {
|
||||
return '<?xml version="1.0" encoding="WINDOWS-1250"?>
|
||||
<rsp:responsePack
|
||||
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd" note="Invoices request"
|
||||
key="0cf0e9cd-23ce-498c-8f2d-2b2149efa343" ico="0123456789" programVersion="13304.1 SQL (2.2.2023)"
|
||||
state="ok" id="1" version="2.0">
|
||||
<rsp:responsePackItem state="ok" id="4048" version="2.0">
|
||||
<inv:invoiceResponse state="ok" version="2.0">
|
||||
<rdc:producedDetails>
|
||||
<rdc:id>62910</rdc:id>
|
||||
<rdc:number>2300104752</rdc:number>
|
||||
<rdc:actionType>link</rdc:actionType>
|
||||
</rdc:producedDetails>
|
||||
</inv:invoiceResponse>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><dat:dataPack xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd" xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd" xmlns:dat="http://www.stormware.cz/schema/version_2/data.xsd" version="2.0">
|
||||
<dat:dataPackItem id="" version="2.0">
|
||||
<ord:order version="2.0">
|
||||
<ord:orderHeader>
|
||||
<ord:orderType>receivedOrder</ord:orderType>
|
||||
<ord:number>
|
||||
<typ:numberRequested checkDuplicity=" true ">0194047</typ:numberRequested>
|
||||
</ord:number>
|
||||
<ord:numberOrder>0194047</ord:numberOrder>
|
||||
<ord:date>2019-06-04</ord:date>
|
||||
<ord:text/>
|
||||
<ord:partnerIdentity>
|
||||
<typ:address>
|
||||
<typ:company>WPJ s.r.o.</typ:company>
|
||||
<typ:name>Jan Prokop</typ:name>
|
||||
<typ:city>Vrchlabí dfgbnd</typ:city>
|
||||
<typ:street>Dlouha 123</typ:street>
|
||||
<typ:zip>54301</typ:zip>
|
||||
<typ:ico>123456789</typ:ico>
|
||||
<typ:dic>CZ123456789</typ:dic>
|
||||
<typ:phone>+773568922</typ:phone>
|
||||
<typ:mobilPhone>+773568922</typ:mobilPhone>
|
||||
<typ:email>prokop@wpj.cz</typ:email>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:company>WPJ s.r.o.</typ:company>
|
||||
<typ:name>Jan Prokop</typ:name>
|
||||
<typ:city>Vrchlabí dgdg</typ:city>
|
||||
<typ:street>Dlouha 123</typ:street>
|
||||
<typ:zip>54301</typ:zip>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
</typ:shipToAddress>
|
||||
</ord:partnerIdentity>
|
||||
<ord:paymentType>
|
||||
<typ:ids>dobírkou</typ:ids>
|
||||
</ord:paymentType>
|
||||
<ord:carrier>
|
||||
<typ:ids>
|
||||
<typ:text>DPD</typ:text>
|
||||
</typ:ids>
|
||||
</ord:carrier>
|
||||
</ord:orderHeader>
|
||||
<ord:orderDetail>
|
||||
<ord:orderItem>
|
||||
<ord:extId>31011</ord:extId>
|
||||
<ord:text>Jebao JPL3 halogenové světlo 20 W - světlo pro zahradní jezírka</ord:text>
|
||||
<ord:quantity>1</ord:quantity>
|
||||
<ord:payVAT>true</ord:payVAT>
|
||||
<ord:rateVAT>21</ord:rateVAT>
|
||||
<ord:homeCurrency>
|
||||
<typ:unitPrice>121</typ:unitPrice>
|
||||
<typ:price>121</typ:price>
|
||||
</ord:homeCurrency>
|
||||
<ord:note/>
|
||||
<ord:code>QO591</ord:code>
|
||||
<ord:stockItem>
|
||||
<typ:stockItem>
|
||||
<typ:ids>QO591</typ:ids>
|
||||
</typ:stockItem>
|
||||
</ord:stockItem>
|
||||
</ord:orderItem>
|
||||
<ord:orderItem>
|
||||
<ord:extId>31012</ord:extId>
|
||||
<ord:text>Dobírkou - DPD</ord:text>
|
||||
<ord:quantity>1</ord:quantity>
|
||||
<ord:unit>ks</ord:unit>
|
||||
<ord:payVAT>true</ord:payVAT>
|
||||
<ord:rateVAT>high</ord:rateVAT>
|
||||
<ord:discountPercentage>0</ord:discountPercentage>
|
||||
<ord:homeCurrency>
|
||||
<typ:unitPrice>0</typ:unitPrice>
|
||||
<typ:price>0</typ:price>
|
||||
</ord:homeCurrency>
|
||||
<ord:note/>
|
||||
<ord:code/>
|
||||
</ord:orderItem>
|
||||
</ord:orderDetail>
|
||||
<ord:orderSummary>
|
||||
<ord:homeCurrency>
|
||||
<typ:round/>
|
||||
</ord:homeCurrency>
|
||||
</ord:orderSummary>
|
||||
</ord:order>
|
||||
</dat:dataPackItem>
|
||||
</dat:dataPack>
|
||||
75
bundles/KupShop/PohodaBundle/Tests/ExportPohodaBaseOrder.xml
Normal file
75
bundles/KupShop/PohodaBundle/Tests/ExportPohodaBaseOrder.xml
Normal file
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ORDERS>
|
||||
<ORDER>
|
||||
<ORDER_ID>4047</ORDER_ID>
|
||||
<ORDER_NO>0194047</ORDER_NO>
|
||||
<DATE_CREATED>2019-06-04 06:42:02</DATE_CREATED>
|
||||
<STATUS_PAYED>0</STATUS_PAYED>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<CURRENCY_RATE>1.00000000</CURRENCY_RATE>
|
||||
<TOTAL_PRICE>121</TOTAL_PRICE>
|
||||
<EMAIL>prokop@wpj.cz</EMAIL>
|
||||
<PHONE>+773568922</PHONE>
|
||||
<NOTE/>
|
||||
<SOURCE>shop</SOURCE>
|
||||
<USER_ORDER_NO/>
|
||||
<DELIVERY class="DPD" id="2" name="DPD">DPD</DELIVERY>
|
||||
<PAYMENT class="Dobirka" id="2" method="" name="Dobírkou">Dobírkou</PAYMENT>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>Jan</NAME>
|
||||
<SURNAME>Prokop</SURNAME>
|
||||
<FIRM>WPJ s.r.o.</FIRM>
|
||||
<ICO>123456789</ICO>
|
||||
<DIC>CZ123456789</DIC>
|
||||
<STREET>Dlouha 123</STREET>
|
||||
<CITY>Vrchlabí</CITY>
|
||||
<ZIP>54301</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<ADDITIONAL_ADDRESS/>
|
||||
<REGION/>
|
||||
</INVOICE_ADDRESS>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>Jan</NAME>
|
||||
<SURNAME>Prokop</SURNAME>
|
||||
<FIRM>WPJ s.r.o.</FIRM>
|
||||
<STREET>Dlouha 123</STREET>
|
||||
<CITY>Vrchlabí</CITY>
|
||||
<ZIP>54301</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE/>
|
||||
<ADDITIONAL_ADDRESS/>
|
||||
<REGION/>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM id="31011" type="product">
|
||||
<CODE>QO591</CODE>
|
||||
<NAME>Jebao JPL3 halogenové světlo 20 W - světlo pro zahradní jezírka</NAME>
|
||||
<VARIATION_NAME/>
|
||||
<PIECE_PRICE>121</PIECE_PRICE>
|
||||
<PIECE_PRICE_WITHOUT_VAT>100</PIECE_PRICE_WITHOUT_VAT>
|
||||
<PIECES>1</PIECES>
|
||||
<TOTAL_PRICE>121</TOTAL_PRICE>
|
||||
<TOTAL_PRICE_WITHOUT_VAT>100</TOTAL_PRICE_WITHOUT_VAT>
|
||||
<VAT>21</VAT>
|
||||
<GUARANTEE>24</GUARANTEE>
|
||||
<RATEVAT>high</RATEVAT>
|
||||
<EAN>1001</EAN>
|
||||
<DISCOUNTS/>
|
||||
<PIECE_PRICE_ROUNDED>121</PIECE_PRICE_ROUNDED>
|
||||
<PIECE_PRICE_WITHOUT_VAT_ROUNDED>100</PIECE_PRICE_WITHOUT_VAT_ROUNDED>
|
||||
<TOTAL_PRICE_ROUNDED>121</TOTAL_PRICE_ROUNDED>
|
||||
<TOTAL_PRICE_WITHOUT_VAT_ROUNDED>100</TOTAL_PRICE_WITHOUT_VAT_ROUNDED>
|
||||
<PIECE_VAT_ROUNDED>21</PIECE_VAT_ROUNDED>
|
||||
<TOTAL_VAT_ROUNDED>21</TOTAL_VAT_ROUNDED>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
<POHODA_ID>654897</POHODA_ID>
|
||||
<INVOICE_NO>0194047</INVOICE_NO>
|
||||
<SAME_ADDRESS/>
|
||||
<OSS>false</OSS>
|
||||
<EU_OSS_COUNTRY_CODE>CZ</EU_OSS_COUNTRY_CODE>
|
||||
<POHODA_USER_ID/>
|
||||
<DELIVERY_STOCK_CODE/>
|
||||
<CENTRE/>
|
||||
</ORDER>
|
||||
</ORDERS>
|
||||
116
bundles/KupShop/PohodaBundle/Tests/ImportProductsTest.json
Normal file
116
bundles/KupShop/PohodaBundle/Tests/ImportProductsTest.json
Normal file
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"settings": [
|
||||
{
|
||||
"key_name": "pohoda",
|
||||
"value": "{\"mservers\":[{\"active\":\"Y\",\"url\":\"https:\\/\\/Mserver.atp-technology.cz\",\"username\":\"wpj\",\"password\":\"Start12345.\",\"ico\":\"25596543\",\"server_name\":\"mServerFMtest\"},{\"active\":\"N\",\"url\":\"https:\\/\\/Mserver.atp-technology.cz\",\"username\":\"wpj\",\"password\":\"Start12345.\",\"ico\":\"25596543\",\"server_name\":\"mServerSMtest\"},{\"active\":\"N\",\"url\":\"sdivadivni\",\"username\":\"\",\"password\":\"\",\"ico\":\"\",\"server_name\":\"\"}],\"maintenanceFrom\":\"0:00\",\"maintenanceTo\":\"5:00\",\"productsIn\":{\"last_sync\":\"25.8.2022 09:33:48\",\"internet\":\"Y\"},\"ordersIn\":{\"last_sync\":\"25.8.2022 09:30:26\",\"last_sync_diff\":\"10\"},\"ordersOut\":{\"last_sync\":\"25.8.2022 09:30:26\",\"last_sync_diff\":\"6\"},\"usersIn\":{\"last_sync\":\"25.8.2022 09:30:20\"},\"usersOut\":{\"last_sync\":\"25.8.2022 09:30:24\"}}",
|
||||
"date_update": "2022-08-25 12:52:18",
|
||||
"autoload": 1
|
||||
}
|
||||
],
|
||||
"products": [
|
||||
{
|
||||
"id": 1000,
|
||||
"title": "Brzdové lanko Shimano DURA-ACE, SIL-TEC, 1,6 x 2050 mm",
|
||||
"code": "B00536",
|
||||
"ean": null,
|
||||
"short_descr": "",
|
||||
"long_descr": "<p>Brzdové lanko <strong>Shimano DURA-ACE SIL-TEC</strong></p>\r\n\r\n<ul>\r\n\t<li><strong>povlak SIL-TEC</strong> zaručuje dlouhodobé zachování vlastností řazení</li>\r\n\t<li>délka: 2050mm</li>\r\n\t<li>průměr: 1,6mm</li>\r\n</ul>\r\n\r\n<p>baleno po 1 kuse</p>",
|
||||
"parameters": "",
|
||||
"price": 139.6694,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 5.32499981,
|
||||
"producer": 15,
|
||||
"guarantee": 0,
|
||||
"in_store": 0,
|
||||
"pieces_sold": 39,
|
||||
"delivery_time": -2,
|
||||
"campaign": "",
|
||||
"updated": "2018-08-26 21:30:50",
|
||||
"date_added": "2013-03-02 11:56:46",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "Y",
|
||||
"note": "A1",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": null,
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0.0,
|
||||
"weight": 0.0100,
|
||||
"data": null
|
||||
},
|
||||
{
|
||||
"id": 2000,
|
||||
"title": "Test",
|
||||
"code": "43010040",
|
||||
"ean": 32165498712,
|
||||
"short_descr": "",
|
||||
"long_descr": "<p>Brzdové lanko <strong>Shimano DURA-ACE SIL-TEC</strong></p>\r\n\r\n<ul>\r\n\t<li><strong>povlak SIL-TEC</strong> zaručuje dlouhodobé zachování vlastností řazení</li>\r\n\t<li>délka: 2050mm</li>\r\n\t<li>průměr: 1,6mm</li>\r\n</ul>\r\n\r\n<p>baleno po 1 kuse</p>",
|
||||
"parameters": "",
|
||||
"price": 139.6694,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 5.32499981,
|
||||
"producer": 15,
|
||||
"guarantee": 0,
|
||||
"in_store": 0,
|
||||
"pieces_sold": 39,
|
||||
"delivery_time": -2,
|
||||
"campaign": "",
|
||||
"updated": "2018-08-26 21:30:50",
|
||||
"date_added": "2013-03-02 11:56:46",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "Y",
|
||||
"note": "A1",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": null,
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0.0,
|
||||
"weight": 0.0100,
|
||||
"data": null
|
||||
}
|
||||
],
|
||||
"products_variations": [
|
||||
{
|
||||
"id": 10,
|
||||
"id_product": 1000,
|
||||
"code": "SH-RT400MM45",
|
||||
"ean": 1234567891234,
|
||||
"title": "Velikost: 45",
|
||||
"in_store": 0,
|
||||
"delivery_time": -2,
|
||||
"price": null,
|
||||
"note": "K",
|
||||
"figure": "Y",
|
||||
"updated": "2018-08-27 08:59:05",
|
||||
"date_added": "2018-08-27 08:59:05",
|
||||
"weight": null
|
||||
}
|
||||
],
|
||||
"parameter_groups": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "Elektropohon"
|
||||
}
|
||||
],
|
||||
"parameter_groups_items" : [
|
||||
{
|
||||
"id" : 2,
|
||||
"id_parameter_group" : 2,
|
||||
"name" : "Elektropohon"
|
||||
}
|
||||
],
|
||||
"parameter_groups_items_parameters" : [
|
||||
{
|
||||
"id_parameter_group_item" : 2,
|
||||
"id_parameter" : 14
|
||||
},
|
||||
{
|
||||
"id_parameter_group_item" : 2,
|
||||
"id_parameter" : 17
|
||||
}
|
||||
]
|
||||
}
|
||||
117
bundles/KupShop/PohodaBundle/Tests/ImportProductsTest.php
Normal file
117
bundles/KupShop/PohodaBundle/Tests/ImportProductsTest.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests;
|
||||
|
||||
use KupShop\DevelopmentBundle\Util\Tests\LoggerTestTrait;
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
use KupShop\PohodaBundle\Utils\Importers\ProductsImporter;
|
||||
use KupShop\PohodaBundle\Utils\Tools\TransformHelper;
|
||||
|
||||
class ImportProductsTest extends \DatabaseTestCase
|
||||
{
|
||||
use LoggerTestTrait;
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* @var TransformHelper
|
||||
*/
|
||||
protected $transformHelper;
|
||||
/**
|
||||
* @var ProductsImporter
|
||||
*/
|
||||
protected $productsImporter;
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$this->productsImporter = ServiceContainer::getService(ProductsImporter::class);
|
||||
$this->transformHelper = ServiceContainer::getService(TransformHelper::class);
|
||||
$this->getLogger();
|
||||
}
|
||||
|
||||
public function testTransformProductsIn()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$xmlResponse = file_get_contents(__DIR__.'/productsInResponse.xml');
|
||||
|
||||
$resultXML = $this->transformHelper->baseTransform($xmlResponse, $this->transformHelper->loadXslt('productsIn.xsl'));
|
||||
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/productsInResult.xml', $resultXML);
|
||||
}
|
||||
|
||||
public function testImportProducts()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$xmlResponse = file_get_contents(__DIR__.'/productsInResponse.xml');
|
||||
|
||||
$resultXML = $this->transformHelper->baseTransform($xmlResponse, $this->transformHelper->loadXslt('productsIn.xsl'));
|
||||
|
||||
$this->productsImporter->xml = $resultXML;
|
||||
|
||||
if ($this->productsImporter->parseProducts()) {
|
||||
$result = $this->productsImporter->importProducts();
|
||||
}
|
||||
|
||||
$testHandler = $this->getTestHandler();
|
||||
$this->assertEquals(true, $testHandler->hasNoticeThatContains('POHODA RESPONSE: Product Import'));
|
||||
|
||||
$this->assertTrue($result);
|
||||
|
||||
$product = sqlQueryBuilder()->select('id, title, code, price')->from('products')->where('id = 1000')->execute()->fetch();
|
||||
|
||||
$this->assertEquals([
|
||||
'id' => 1000,
|
||||
'price' => 487.6033,
|
||||
'title' => 'Brzdové lanko Shimano DURA-ACE, SIL-TEC, 1,6 x 2050 mm',
|
||||
'code' => 'B00536',
|
||||
], $product);
|
||||
}
|
||||
|
||||
public function testImportProductsStores()
|
||||
{
|
||||
$this->insertSQL('stores', ['name' => 'Prvni sklad', 'id' => 2]);
|
||||
$this->insertSQL('stores', ['name' => 'Druhy sklad', 'id' => 3]);
|
||||
|
||||
$this->setEnvironment();
|
||||
|
||||
$this->productsImporter->xml = $xmlDOMResponse = new \DOMDocument();
|
||||
$xmlDOMResponse->loadXML(file_get_contents(__DIR__.'/ShopItems_withStores.xml'));
|
||||
|
||||
if ($this->productsImporter->parseProducts()) {
|
||||
$result = $this->productsImporter->importProducts();
|
||||
}
|
||||
|
||||
$this->assertTrue($result);
|
||||
|
||||
$store1 = sqlQueryBuilder()->select('*')->from('stores_items')->where('id_product = 1000 and id_store = 2')->execute()->fetch();
|
||||
$this->assertEquals(2, $store1['quantity']);
|
||||
|
||||
$store1 = sqlQueryBuilder()->select('*')->from('stores_items')->where('id_product = 1000 and id_store = 3')->execute()->fetch();
|
||||
$this->assertEquals(3, $store1['quantity']);
|
||||
|
||||
/* Je to naschval v jednom testu, protože transakce maže sklady, ale nenastavi autoincrement, takze pak jsou jiny ID */
|
||||
|
||||
$this->productsImporter->xml = $xmlDOMResponse = new \DOMDocument();
|
||||
$xmlDOMResponse->loadXML(file_get_contents(__DIR__.'/ShopItems_withStores.xml'));
|
||||
|
||||
if ($this->productsImporter->parseProducts()) {
|
||||
$result = $this->productsImporter->importProducts();
|
||||
}
|
||||
|
||||
$this->productsImporter->xml = $xmlDOMResponse = new \DOMDocument();
|
||||
$xmlDOMResponse->loadXML(file_get_contents(__DIR__.'/ShopItems_withStores.xml'));
|
||||
|
||||
if ($this->productsImporter->parseProducts()) {
|
||||
$result = $this->productsImporter->importProducts();
|
||||
}
|
||||
|
||||
$store1 = sqlFetchAll($this->selectSQL('stores_items', []));
|
||||
|
||||
$this->assertEquals(2, count($store1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,667 @@
|
||||
{
|
||||
"products": [
|
||||
{
|
||||
"id": 12186,
|
||||
"title": "Sea to Summit Ultra-Sil Dry Sack 2L",
|
||||
"code": "SEA184",
|
||||
"ean": 9327868010356,
|
||||
"short_descr": "Neskutečně lehký voděodolný obal s rolovacím zavíráním z Hypalonu.",
|
||||
"long_descr": "<p><em>Novinka pro rok 2012.</em> Cestovat ve vlhku nemusí nutně znamenat mít vlhké věci! Pořiďte si nový lehký vak s rolovacím zavíráním z Hypalonu vyrobený ze silikonizované Cordury a nemusí Vás trápit ani pořádný déšť nebo procházka brodem. Je vhodný pro skladování nejrůznějších věcí a oproti svému předchůdci mají všechny velikosti zakulacené dno, takže vnitřní prostor lze lépe využít. Vaky jsou vyráběny ve čtyřech nových barevných variantách a s velkým nápisem po straně.</p>\r\n\r\n<ul>\r\n\t<li>Voděodolné podlepené dvojité švy.</li>\r\n\t<li>Voděodolné rolovací zavírání z Hypalonu.</li>\r\n\t<li>Unikátní materiál Ultra-Sil® pro maximální odolnost.</li>\r\n\t<li>PU zátěr zaručující nepromokavost.</li>\r\n\t<li>Neskutečně kompaktní a lehký.</li>\r\n\t<li>Velikost: 20×32cm</li>\r\n\t<li>Hmotnost: 23g</li>\r\n\t<li>Dostupné ve velikostech 1, 2, 4, 8, 13, 20 a 35 litrů.</li>\r\n\t<li><a href=\"http://www.svetoutdooru.cz/clanek/?107886-obaly-sea-to-summit-ultra-sil-dry-sack\">Recenze starší varianty Ultra-Sil Dry Sack na SvetOutdooru.cz</a></li>\r\n</ul>",
|
||||
"parameters": "",
|
||||
"price": 263.6364,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 9.40440000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 2,
|
||||
|
||||
"pieces_sold": 106,
|
||||
"delivery_time": 4,
|
||||
"campaign": "",
|
||||
"updated": "2021-01-19 23:31:29",
|
||||
"date_added": "2016-05-09 14:57:34",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:31:29",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 12187,
|
||||
"title": "Sea to Summit Ultra-Sil Dry Sack 4L",
|
||||
"code": "SEA185",
|
||||
"ean": 9327868010363,
|
||||
"short_descr": "Neskutečně lehký voděodolný obal s rolovacím zavíráním z Hypalonu.",
|
||||
"long_descr": "<p><em>Novinka pro rok 2012.</em> Cestovat ve vlhku nemusí nutně znamenat mít vlhké věci! Pořiďte si nový lehký vak s rolovacím zavíráním z Hypalonu vyrobený ze silikonizované Cordury a nemusí Vás trápit ani pořádný déšť nebo procházka brodem. Je vhodný pro skladování nejrůznějších věcí a oproti svému předchůdci mají všechny velikosti zakulacené dno, takže vnitřní prostor lze lépe využít. Vaky jsou vyráběny ve čtyřech nových barevných variantách a s velkým nápisem po straně.</p>\r\n\r\n<ul>\r\n\t<li>Voděodolné podlepené dvojité švy.</li>\r\n\t<li>Voděodolné rolovací zavírání z Hypalonu.</li>\r\n\t<li>Unikátní materiál Ultra-Sil® pro maximální odolnost.</li>\r\n\t<li>PU zátěr zaručující nepromokavost.</li>\r\n\t<li>Neskutečně kompaktní a lehký.</li>\r\n\t<li>Velikost: 15 x 33 cm</li>\r\n\t<li>Hmotnost: 26g</li>\r\n\t<li>Dostupné ve velikostech 1, 2, 4, 8, 13, 20 a 35 litrů.</li>\r\n\t<li><a href=\"http://www.svetoutdooru.cz/clanek/?107886-obaly-sea-to-summit-ultra-sil-dry-sack\">Recenze starší varianty Ultra-Sil Dry Sack na SvetOutdooru.cz</a></li>\r\n</ul>",
|
||||
"parameters": "",
|
||||
"price": 304.9587,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 8.13010000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 4,
|
||||
|
||||
"pieces_sold": 174,
|
||||
"delivery_time": 4,
|
||||
"campaign": "",
|
||||
"updated": "2021-01-19 23:31:29",
|
||||
"date_added": "2016-05-09 14:57:34",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:31:29",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 20978,
|
||||
"title": "Sensor Merino Wool Air dlouhý rukáv dámské",
|
||||
"code": "SEN297",
|
||||
"ean": 8592837046563,
|
||||
"short_descr": "Univerzální tričko pro široké použití vyrobené z merino vlny a polymidového hedvábí.",
|
||||
"long_descr": "<p>Univerzální tričko dámského střihu pro široké použití, které je vyrobené z kombinace dvou doplňujících se materiálů.</p>\r\n\r\n<p>Je z velmi jemného a lehkého úpletu, je pružné a materiál rychle schne, navíc je zkrášleno barevnými plochými švy na přední i zadní straně. Vyrobené je z merino vlny s příměsí polyamidu, který zlepšuje termoregulaci úpletu, zvyšuje jeho elastišnost, prodlužuje životnost a drží původní tvar i po nošení a praní.</p>\r\n\r\n<p>Díky tomu, že materiál je rychleschnoucí hodí se především na sporty s velkou pohybovou zátěží, sálové sporty, ale i na outdoorové sporty.</p>\r\n\r\n<p><strong>Složení materiálu</strong>: 90% Merino vlna, 10% polyamidové hedvábí (120 g/m<sup>2</sup>)</p>\r\n\r\n<p>Merino je významné plemeno ovce, které pochází ze severní Afriky. Dnes jsou hlavní producenti chovatelé v Austrálii, odkud pochází přes 80 % světové produkce. Přírodní vlákno Merino má <strong>mnoho předností.</strong> Vlna těchto ovcí je <strong>prodyšná</strong>, <strong>nezapáchá</strong>, <strong>neškrábe</strong> na těle a její <strong>údržba je snadná</strong>. Na rozdíl od umělých vláken je <strong>biologicky rozložiteln</strong>é a rozloží během několika let.</p>",
|
||||
"parameters": "",
|
||||
"price": 1318.1818,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 20.37850000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 28,
|
||||
|
||||
"pieces_sold": 165,
|
||||
"delivery_time": 3,
|
||||
"campaign": "D,CA,DIS",
|
||||
"updated": "2021-01-19 23:32:31",
|
||||
"date_added": "2018-01-22 15:46:50",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": "Sensor prádlo Merino Wool Air DR 2017 dámské",
|
||||
"meta_description": "Sensor prádlo Merino Wool Air DR 2017 dámské",
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:32:31",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 20979,
|
||||
"title": "Sensor Merino Wool Air dlouhý rukáv pánské",
|
||||
"code": "SEN296",
|
||||
"ean": 8592837046204,
|
||||
"short_descr": "Slabší pánské vlněné triko s dlouhým rukávem s univerzálním použitím během celého roku.",
|
||||
"long_descr": "<p>Pánské merino triko s dlouhým rukávem, které využijete jak během chladnějších letních dnů, tak jako nejspodnější vrstvu v zimním období.</p>\r\n\r\n<p>Do merino vlny je přidán polyamid, který zvyšuje životnost materiálu, jeho elasticitu a bude lépe držet tvar i po jeho nošení a praní.</p>\r\n\r\n<p> </p>\r\n\r\n<p>- výborné termoregulační a antibakteriální vlastnosti</p>\r\n\r\n<p>- velmi lehký materiál, který je pružný, dobře prodyšný a rychleschnoucí</p>\r\n\r\n<p>- ploché barevné švy</p>\r\n\r\n<p>- vyrobeno z obnovitelných zdrojů z vysoce kvalitní vlny z Nového Zélandu</p>\r\n\r\n<p>- široké využití (např. na běh, lezení, turistiku, lyžování, jízdu na kole)</p>\r\n\r\n<p><strong>Složení materiálu</strong>: 90% Merino vlna, 10% polyamidové hedvábí (120 g/m<sup>2</sup>)</p>\r\n\r\n<p>Merino je významné plemeno ovce, které pochází ze severní Afriky. Dnes jsou hlavní producenti chovatelé v Austrálii, odkud pochází přes 80 % světové produkce. Přírodní vlákno Merino má <strong>mnoho předností.</strong> Vlna těchto ovcí je <strong>prodyšná</strong>, <strong>nezapáchá</strong>, <strong>neškrábe</strong> na těle a její <strong>údržba je snadná</strong>. Na rozdíl od umělých vláken je <strong>biologicky rozložiteln</strong>é a rozloží během několika let.</p>\r\n\r\n<p> </p>",
|
||||
"parameters": "",
|
||||
"price": 1318.1818,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 20.37850000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 20,
|
||||
|
||||
"pieces_sold": 171,
|
||||
"delivery_time": 3,
|
||||
"campaign": "D,HCA,CA,DIS",
|
||||
"updated": "2021-01-19 23:32:31",
|
||||
"date_added": "2018-01-22 15:47:58",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": "Sensor prádlo Merino Wool Air DR 2017 pánské",
|
||||
"meta_description": "Sensor prádlo Merino Wool Air DR 2017 pánské",
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:32:31",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 23298,
|
||||
"title": "Rab Forge 160 Glove",
|
||||
"code": "RAB024",
|
||||
"short_descr": "Tenké merinové rukavice ideální jako vložka do dalších teplejších rukavice.",
|
||||
"long_descr": "<p>Tyto merinové rukavice budou ideální pro použití s dalšími rukavicemi. Oceníte je například jako <strong>vložku do palčáků nebo i prstových rukavic.</strong> Merinová složka<strong> hřeje a eliminuje pachy</strong> a díky polyesteru rukavice <strong>rychle schnou a mají delší životnost.</strong> </p>\r\n\r\n<h4>Specifikace:</h4>\r\n\r\n<ul>\r\n\t<li>Hmotnost: <strong>30 g</strong></li>\r\n\t<li>Materiál: 54% Polyester, 46% Merino vlna</li>\r\n</ul>",
|
||||
"parameters": "",
|
||||
"price": 363.6364,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 9.54550000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 7,
|
||||
|
||||
"pieces_sold": 105,
|
||||
"delivery_time": 2,
|
||||
"campaign": "",
|
||||
"updated": "2021-01-20 05:53:15",
|
||||
"date_added": "2019-10-03 16:26:43",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": "Rab rukavice Forge 160 Glove",
|
||||
"meta_description": "Lehké vlněné rukavice vhodné jako první vrstva do silnějších rukavic či do spacáku.",
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 06:53:15",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 23301,
|
||||
"title": "Sensor Merino Air Long trenky",
|
||||
"code": "SEN324",
|
||||
"ean": 8592837060583,
|
||||
"short_descr": "Prodloužené trenky z lehké vlněné směsi Merino Air na pohybově náročné aktivity.",
|
||||
"long_descr": "<p><span>Prodloužené trenky z lehké vlněné směsi Merino Air jsou vhodné na <strong>pohybově náročné aktivity v chladnějším počasí</strong> jako je běh, turistika či běžkování, ale chybu s nimi neuděláte ani v tělocvičně při florbalu.</span></p>\r\n<p><span>Merino Air je jednolící úplet z jemné novozélandské <strong>merino vlny a polyamidového hedvábí,</strong> které vylepšuje termoregulaci tkaniny, zvyšuje pružnost a tvarovou stálost a prodlužuje životnost materiálu.</span></p>\r\n<h3><span>Specifikace</span></h3>\r\n<ul>\r\n<li>Merino vlna hřeje i vlhká, je prodyšná a antibakteriální, dlouhodobě odolává zápachu</li>\r\n<li>Polyamidové hedvábí vylepšuje životnost, pružnost a tvarovou stálost příze</li>\r\n<li>Barevné ploché švy</li>\r\n<li>Ochrana před sluncem UPF 25+</li>\r\n<li>Materiál: 90 % merino vlna, 10 % polyamid</li>\r\n</ul>",
|
||||
"parameters": "",
|
||||
"price": 789.2562,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 20.41730000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 3,
|
||||
|
||||
"pieces_sold": 68,
|
||||
"delivery_time": 3,
|
||||
"campaign": "D,DIS",
|
||||
"updated": "2021-01-19 23:34:40",
|
||||
"date_added": "2019-10-04 23:19:47",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": "Sensor Merino Air KN Long pánské",
|
||||
"meta_description": "Sensor Merino Air KN Long pánské",
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:34:40",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 30870,
|
||||
"title": "Woolpower Zip Turtleneck 400 DR",
|
||||
"code": "WOO063",
|
||||
"ean": null,
|
||||
"short_descr": "Mikina z tlustší vlněné směsi Ullfrotté spletené ve švédském Östersundu.",
|
||||
"long_descr": "<p><span>Mikina od švédské značky Woolpower je vyrobena z<strong> kruhové pleteniny Ullfrotté, která kombinuje merino vlnu</strong>, polyamid a také nechává místo pro vzduch, jenž izoluje tělem vytvořené teplo.</span></p>\r\n\r\n<p><span>Umělé materiály činí směs odolnější a díky merino vlně je mikina <strong>antibakteriální, dlouhodobě odolává proti zápachu</strong>, dokáže absorbovat až 30 % své vlastní váhy vodou, aniž byste vlhkost pocítili, a i v případě že navlhne hodně, hřát bude stále.</span></p>\r\n\r\n<p><span>400gramovou verzi můžete nosit buď<strong> jako hřejivou střední vrstvu pod nepromokavé oblečení</strong> (nejlépe s jedním z kousků 200g verze či řady LITE) nebo jako cardigan / bundu přes běžné oblečení. Je vhodná do chladnějších podmínek nebo pokud neplánujete vysokou aerobní zátěž.</span></p>\r\n\r\n<p><span>Pokud ji navíc věnujete jako dárek a dotyčné/mu se nebude líbit (což je téměř nepravděpodobné), můžete jimi obdarovat naprosto kohokoliv se stejnou velikostí, <strong>je totiž unisex.</strong></span></p>\r\n\r\n<h3><span>Specifikace</span></h3>\r\n\r\n<ul>\r\n\t<li>Rolák se zipem</li>\r\n\t<li>Prodloužený zadní díl</li>\r\n\t<li>Bez podélných švů</li>\r\n\t<li>Pružné manžety vpletené do tkaniny</li>\r\n\t<li>Neškrábavý materiál</li>\r\n\t<li>Možné prát na 60 °C</li>\r\n\t<li>Materiál: 70 % merino vlna, 28 % polyamid, 2 % elastan</li>\r\n</ul>\r\n\r\n<p><em>Merino vlna v oblečení Woolpower pochází z ovcí pasoucích se v argentinské části Patagonie nebo Uruguaye a oblečení z ní je vyráběno ve švédském Östersundu od příze až po konečný produkt. Švadleny šijí jednotlivý kousek od začátku až do konce a oblečení poté opatří svou jmenovkou.</em></p>",
|
||||
"parameters": "",
|
||||
"price": 3156.1983,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 0.00000000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 4,
|
||||
|
||||
"pieces_sold": 4,
|
||||
"delivery_time": 8,
|
||||
"campaign": "",
|
||||
"updated": "2021-01-19 23:36:04",
|
||||
"date_added": "2020-10-22 15:46:43",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": "Mikina od švédské značky Woolpower je vyrobena z kruhové pleteniny Ullfrotté, která kombinuje merino vlnu, polyamid a také nechává místo pro vzduch, jenž izoluje tělem vytvořené teplo.",
|
||||
"meta_keywords": null,
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:36:04",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"id": 21392,
|
||||
"title": "Petzl Boreo",
|
||||
"code": "PET509",
|
||||
"ean": 3342540820029,
|
||||
"short_descr": "Univerzální bezpečná přilba s kombinovanou konstrukcí",
|
||||
"long_descr": "<p>Kvalitní přilba Boreo od světoznámé značky Petzl vám poskytne <strong>dokonalou ochranu při celé řadě outdoorových aktivit.</strong> Hodí se na <span>horolezectví, alpinismus, speleologii, ferraty, canyoning, lanové parky, atd. </span></p>\r\n\r\n<p><span>Díky speciální hybridní konstrukci TOP AND SIDE PROTECTION <strong>kryje přilba celou hlavu </strong>a zároveň je kompaktní. Vnější materiál snadno odolá<strong> poškrábání</strong>, vnitřní část <strong>velmi</strong> <strong>účinně tlumí nárazy ze všech stran</strong> a měkká výstelka z ESP pěny se postará o <strong>pohodlí a bezpečí horní části</strong> vaší hlavy. </span></p>\r\n\r\n<p><span>Prodloužení přilby v zadní části zaručuje větší bezpečnost a <strong>řada širokých větracích otvorů</strong> vám poskytne komfort i při větší námaze.</span></p>\r\n\r\n<p><span>Velmi <strong>jednoduché je nastavení a zapínání</strong>. Měkký, hladký pásek v zadní části hlavy je doplněn propracovaným posunovatelným systémem. <strong>Čtyři klipy</strong> udrží čelovku na svém místě. Přilba je také kompatibilní s ochranným štítem Vizion.</span></p>\r\n\r\n<p><span>Univerzální helma Boreo se stane vaším nepostradatelným pomocníkem při cestách za dobrodružstvím.</span></p>\r\n\r\n<p> </p>\r\n\r\n<p><strong>Materiál:</strong> ABS skořepina, EPP expanovaná polypropylenová pěna, ESP expandovaná polystyrenová pěna</p>\r\n\r\n<p><strong>Certifikace:</strong> CE EN 12492, UIAA<br />\r\n<br />\r\n<strong>Varianty:</strong> </p>\r\n\r\n<p> </p>\r\n\r\n<ul>\r\n\t<li>vel. S/M 48-58 cm, 285 g </li>\r\n\t<li>vel. M/L 53-61 cm, 295 g</li>\r\n</ul>\r\n\r\n<p> </p>\r\n\r\n<p> </p>",
|
||||
"parameters": "",
|
||||
"price": 1165.2893,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 10.00000000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 9,
|
||||
"unit": 1,
|
||||
"pieces_sold": 169,
|
||||
"delivery_time": 2,
|
||||
"campaign": "",
|
||||
"updated": "2021-03-10 08:03:31",
|
||||
"date_added": "2018-02-23 14:11:02",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": "Petzl přilba Boreo",
|
||||
"meta_description": "Kvalitní přilba Boreo od světoznámé značky Petzl vám poskytne dokonalou ochranu při celé řadě outdoorových aktivit. Hodí se na horolezectví, alpinismus, speleologii, ferraty, canyoning, lanové parky, atd.",
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.4080,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-03-10 09:03:31",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
"products_variations": [
|
||||
{
|
||||
"id": 1281,
|
||||
"id_product": 12186,
|
||||
"code": "SEA184S006",
|
||||
"ean": 9327868080977,
|
||||
"title": "Barva: grey",
|
||||
"in_store": 1,
|
||||
"delivery_time": 4,
|
||||
"price": 263.6364,
|
||||
"figure": "Y",
|
||||
"updated": "2021-01-19 23:31:29",
|
||||
"date_added": "2021-01-19 23:31:29",
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:31:29",
|
||||
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 1282,
|
||||
"id_product": 12187,
|
||||
"code": "SEA185S004",
|
||||
"ean": 9327868010431,
|
||||
"title": "Barva: orange",
|
||||
"in_store": 0,
|
||||
"delivery_time": 4,
|
||||
"price": 304.9587,
|
||||
"figure": "Y",
|
||||
"updated": "2021-01-19 23:31:29",
|
||||
"date_added": "2021-01-19 23:31:29",
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:31:29",
|
||||
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 5533,
|
||||
"id_product": 20978,
|
||||
"code": "SEN297S002",
|
||||
"ean": 8592837046570,
|
||||
"title": "Velikost: M, Barva: magenta",
|
||||
"in_store": 2,
|
||||
"delivery_time": 3,
|
||||
"price": 1318.1818,
|
||||
"figure": "Y",
|
||||
"updated": "2021-01-19 23:32:31",
|
||||
"date_added": "2021-01-19 23:31:29",
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:32:31",
|
||||
"campaign": "D",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 5551,
|
||||
"id_product": 20979,
|
||||
"code": "SEN296S003",
|
||||
"ean": 8592837046228,
|
||||
"title": "Velikost: L, Barva: černá",
|
||||
"in_store": 4,
|
||||
"delivery_time": 3,
|
||||
"price": 1318.1818,
|
||||
"figure": "Y",
|
||||
"updated": "2021-01-19 23:32:31",
|
||||
"date_added": "2021-01-19 23:31:29",
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:32:31",
|
||||
"campaign": "D",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 10231,
|
||||
"id_product": 23298,
|
||||
"code": "RAB024S001",
|
||||
"title": "Velikost: S, Barva: ebony",
|
||||
"in_store": 0,
|
||||
"delivery_time": 2,
|
||||
"price": 363.6364,
|
||||
"figure": "Y",
|
||||
"updated": "2021-01-20 05:53:15",
|
||||
"date_added": "2021-01-19 23:31:29",
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 06:53:15",
|
||||
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 10232,
|
||||
"id_product": 23298,
|
||||
"code": "RAB024S003",
|
||||
"ean": 821468891876,
|
||||
"title": "Velikost: L, Barva: ebony",
|
||||
"in_store": 5,
|
||||
"delivery_time": 2,
|
||||
"price": 363.6364,
|
||||
"figure": "Y",
|
||||
"updated": "2021-01-20 05:53:15",
|
||||
"date_added": "2021-01-19 23:31:29",
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 06:53:15",
|
||||
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 10250,
|
||||
"id_product": 23301,
|
||||
"code": "SEN324S002",
|
||||
"ean": 8592837060590,
|
||||
"title": "Velikost: M, Barva: černá",
|
||||
"in_store": 1,
|
||||
"delivery_time": 3,
|
||||
"price": 789.2562,
|
||||
"figure": "Y",
|
||||
"updated": "2021-01-19 23:34:40",
|
||||
"date_added": "2021-01-19 23:31:29",
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:34:40",
|
||||
"campaign": "D",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 23301,
|
||||
"id_product": 30870,
|
||||
"code": "WOO063S014",
|
||||
"ean": 7317430024579,
|
||||
"title": "Velikost: XL, Barva: dark navy",
|
||||
"in_store": 0,
|
||||
"delivery_time": 8,
|
||||
"price": 3156.1983,
|
||||
"figure": "Y",
|
||||
"updated": "2021-01-19 23:36:04",
|
||||
"date_added": "2021-01-19 23:31:29",
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:36:04",
|
||||
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
"id": 6014,
|
||||
"id_product": 21392,
|
||||
"code": "PET509S012",
|
||||
"ean": 3342540830882,
|
||||
"title": "Velikost: M-L, Barva: orange",
|
||||
"in_store": 1,
|
||||
"delivery_time": 2,
|
||||
"price": 1165.2893,
|
||||
"figure": "Y",
|
||||
"updated": "2021-03-10 08:03:31",
|
||||
"date_added": "2021-03-10 08:03:31",
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-03-10 09:03:31",
|
||||
"campaign": "",
|
||||
"width": 21.0000,
|
||||
"height": 26.0000,
|
||||
"depth": 16.0000
|
||||
}
|
||||
|
||||
|
||||
],
|
||||
|
||||
"users": [
|
||||
{
|
||||
"id": 774696,
|
||||
"id_language": "cs",
|
||||
"passw": "$2y$10$qyolYwNIflZpsBezjsx.2OQkiBSOOmHSDhYTDfQ67DpETMPEm0U8q",
|
||||
"user_key": "f931a6982b7111eb9ab89af5008926fb",
|
||||
"figure": "Y",
|
||||
"name": "Marcel",
|
||||
"surname": "Nazad - ELEKTROSMS",
|
||||
"firm": "-",
|
||||
"street": "Chrudichromská 7",
|
||||
"city": "Boskovice",
|
||||
"zip": "68001",
|
||||
"country": "CZ",
|
||||
"currency": "CZK",
|
||||
"email": "nazad.marcel@gmail.com",
|
||||
"ico": "",
|
||||
"dic": "",
|
||||
"phone": "+420736411413",
|
||||
"mobile": "",
|
||||
"fax": "",
|
||||
"gender": "M",
|
||||
"delivery_name": "Marcel",
|
||||
"delivery_surname": "Nazad - ELEKTROSMS",
|
||||
"delivery_firm": "Marcel Nazad - ELEKTROSMS",
|
||||
"delivery_street": "Chrudichromská 7",
|
||||
"delivery_city": "Boskovice",
|
||||
"delivery_zip": "68001",
|
||||
"delivery_country": "CZ",
|
||||
"account_no": "",
|
||||
"account_bank": "",
|
||||
"account_symbol": "",
|
||||
"get_news": "Y",
|
||||
"prefer_transport": null,
|
||||
"date_reg": "2020-12-01 21:30:24",
|
||||
"date_updated": "2020-12-15 00:00:00",
|
||||
"date_logged": "2021-01-13 17:01:13",
|
||||
"custom_address": "",
|
||||
"state": "",
|
||||
"delivery_custom_address": "true",
|
||||
"delivery_state": "",
|
||||
"date_subscribe": null,
|
||||
"date_unsubscribe": null,
|
||||
"note": null,
|
||||
"custom_data": null,
|
||||
"delivery_phone": "",
|
||||
"pohoda_id": 81544,
|
||||
"pohoda_sync_date": "2020-12-01 21:30:24",
|
||||
"pohoda_id_address": 52340
|
||||
}
|
||||
],
|
||||
"orders": [
|
||||
{
|
||||
"id": 254247,
|
||||
"order_no": "164001",
|
||||
"id_language": "cs",
|
||||
"currency_rate": 1.0000,
|
||||
"currency": "CZK",
|
||||
"id_user": null,
|
||||
"date_created": "2021-02-23 12:19:36",
|
||||
"date_accept": "2021-02-23 12:19:40",
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-02-23 12:19:40",
|
||||
"date_due": null,
|
||||
"status": 1,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 1337.9900,
|
||||
"invoice_name": "Filip",
|
||||
"invoice_surname": "Chalupka",
|
||||
"invoice_firm": "AOPK ČR",
|
||||
"invoice_ico": "62933591",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "Kaplanova 1931/1",
|
||||
"invoice_city": "Praha",
|
||||
"invoice_zip": "14000",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420774356967",
|
||||
"invoice_email": "filip.chalupka@nature.cz",
|
||||
"delivery_name": "Filip",
|
||||
"delivery_surname": "Chalupka",
|
||||
"delivery_firm": "Julie's - kavárna a obchůdek bez obalu",
|
||||
"delivery_street": "Rožmitálova 2511/15",
|
||||
"delivery_city": "Blansko",
|
||||
"delivery_zip": "67801",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Bankovním převodem - Zásilkovna",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"193.179.186.2\",\"remote_port\":\"28310\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/88.0.4324.182 Safari\\/537.36\",\"delivery_data\":{\"zip\":\"67801\",\"labelRouting\":\"C56-152-4496\",\"idZ\":\"4496\"},\"heurekaDisagree\":\"on\",\"send_store_id\":5,\"delivery_date\":\"2021-02-25T12:19:36+01:00\",\"discounts\":{\"email\":\"filip.chalupka@nature.cz\"},\"payment_data\":[],\"conversion_sent\":1}",
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": "",
|
||||
"pohoda_sync_date": "2021-03-10 10:02:56",
|
||||
"pohoda_id": "331251"
|
||||
}
|
||||
],
|
||||
"order_items": [
|
||||
{
|
||||
"id": 3472390,
|
||||
"id_order": 254247,
|
||||
"id_product": 21392,
|
||||
"id_variation": 6014,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 1,
|
||||
"piece_price": 1048.7600,
|
||||
"total_price": 1048.7600,
|
||||
"descr": "Petzl Boreo (Velikost: M-L, Barva: orange) (Kód: PET509)",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"stores\":{\"5\":\"0\",\"2\":\"0\",\"3\":\"0\",\"4\":\"1\",\"1\":\"0\"}}",
|
||||
"discount": 0.0000,
|
||||
"pohoda_id": 846486
|
||||
},
|
||||
{
|
||||
"id": 3472391,
|
||||
"id_order": 254247,
|
||||
"id_product": null,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 57.0200,
|
||||
"total_price": 57.0200,
|
||||
"descr": "Bankovním převodem - Zásilkovna",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000,
|
||||
"pohoda_id": 846487
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\Invoices\Import;
|
||||
|
||||
use KupShop\PohodaBundle\Tests\TestUtilHelper;
|
||||
use KupShop\PohodaBundle\Utils\Importers\InvoicesDownloader;
|
||||
use KupShop\PohodaBundle\Utils\Importers\InvoicesImporter;
|
||||
use KupShop\PohodaBundle\Utils\Tools\TransformHelper;
|
||||
use Query\Operator;
|
||||
|
||||
class ImportInvoiceTest extends \DatabaseTestCase
|
||||
{
|
||||
use TestUtilHelper;
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* @var TransformHelper
|
||||
*/
|
||||
protected $transformHelper;
|
||||
|
||||
/**
|
||||
* @var InvoicesImporter
|
||||
*/
|
||||
protected $invoicesImporter;
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$this->transformHelper = $this->get(TransformHelper::class);
|
||||
$this->prepareMServer();
|
||||
}
|
||||
|
||||
public function testTransformInvoicesIn()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
$xmlResponse = file_get_contents(__DIR__.'/invoicesInResponse.xml');
|
||||
$transformedXML = $this->transformHelper->baseTransform($xmlResponse, $this->transformHelper->loadXslt('invoicesIn.xsl'));
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/invoicesInResult.xml', $transformedXML);
|
||||
}
|
||||
|
||||
public function testImportInsertInvoice()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$downloader = $this->getMockBuilder(InvoicesDownloader::class)
|
||||
->setMethods(['checkInvoicePrefix'])
|
||||
->getMock();
|
||||
$downloader->method('checkInvoicePrefix')->willReturn(3128);
|
||||
|
||||
// check number of orders
|
||||
$this->assertEquals(1, sqlQueryBuilder()
|
||||
->select('COUNT(id)')
|
||||
->from('orders')
|
||||
->execute()
|
||||
->fetchColumn());
|
||||
|
||||
$this->set(InvoicesDownloader::class, $downloader);
|
||||
$this->invoicesImporter = $this->get(InvoicesImporter::class);
|
||||
$xml = file_get_contents(__DIR__.'/invoicesInResponse.xml');
|
||||
$this->invoicesImporter->processData($xml, true);
|
||||
|
||||
// ORDER - issuedCorrectiveTax
|
||||
$qb = sqlQueryBuilder()
|
||||
->select('*')
|
||||
->from('orders_pohoda_invoices')
|
||||
->andWhere(Operator::equals(['number_requested' => '201501736']))
|
||||
->execute()
|
||||
->fetch();
|
||||
|
||||
$this->assertEquals('201501736', $qb['number_requested']);
|
||||
$this->assertEquals('2015', $qb['invoice_prefix']);
|
||||
$this->assertEquals('IC227192', $qb['id_pohoda_invoice']);
|
||||
|
||||
$qb = sqlQueryBuilder()
|
||||
->select('*')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['id' => $qb['id_order']]))
|
||||
->execute()
|
||||
->fetch();
|
||||
|
||||
$note_admin = json_decode($qb['note_admin'], true);
|
||||
$this->assertEquals('web128453', $note_admin['ODD_ORDER_NO']);
|
||||
$this->assertEquals('774696', $qb['id_user']);
|
||||
|
||||
// ORDER - issuedInvoice
|
||||
$qb = sqlQueryBuilder()
|
||||
->select('*')
|
||||
->from('orders_pohoda_invoices')
|
||||
->andWhere(Operator::equals(['number_requested' => '210507247']))
|
||||
->execute()
|
||||
->fetch();
|
||||
|
||||
$this->assertEquals('210507247', $qb['number_requested']);
|
||||
$this->assertEquals('2105', $qb['invoice_prefix']);
|
||||
$this->assertEquals('241497', $qb['id_pohoda_invoice']);
|
||||
|
||||
// check number of orders
|
||||
$this->assertEquals(2, sqlQueryBuilder()
|
||||
->select('COUNT(id)')
|
||||
->from('orders')
|
||||
->execute()
|
||||
->fetchColumn());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,575 @@
|
||||
{
|
||||
"products": [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "Coupon 1",
|
||||
"code": "SEA184",
|
||||
"ean": 9327868010356,
|
||||
"short_descr": "Neskutečně lehký voděodolný obal s rolovacím zavíráním z Hypalonu.",
|
||||
"long_descr": "<p><em>Novinka pro rok 2012.</em> Cestovat ve vlhku nemusí nutně znamenat mít vlhké věci! Pořiďte si nový lehký vak s rolovacím zavíráním z Hypalonu vyrobený ze silikonizované Cordury a nemusí Vás trápit ani pořádný déšť nebo procházka brodem. Je vhodný pro skladování nejrůznějších věcí a oproti svému předchůdci mají všechny velikosti zakulacené dno, takže vnitřní prostor lze lépe využít. Vaky jsou vyráběny ve čtyřech nových barevných variantách a s velkým nápisem po straně.</p>\r\n\r\n<ul>\r\n\t<li>Voděodolné podlepené dvojité švy.</li>\r\n\t<li>Voděodolné rolovací zavírání z Hypalonu.</li>\r\n\t<li>Unikátní materiál Ultra-Sil® pro maximální odolnost.</li>\r\n\t<li>PU zátěr zaručující nepromokavost.</li>\r\n\t<li>Neskutečně kompaktní a lehký.</li>\r\n\t<li>Velikost: 20×32cm</li>\r\n\t<li>Hmotnost: 23g</li>\r\n\t<li>Dostupné ve velikostech 1, 2, 4, 8, 13, 20 a 35 litrů.</li>\r\n\t<li><a href=\"http://www.svetoutdooru.cz/clanek/?107886-obaly-sea-to-summit-ultra-sil-dry-sack\">Recenze starší varianty Ultra-Sil Dry Sack na SvetOutdooru.cz</a></li>\r\n</ul>",
|
||||
"parameters": "",
|
||||
"price": 263.6364,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 9.40440000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 2,
|
||||
"pieces_sold": 106,
|
||||
"delivery_time": 4,
|
||||
"campaign": "",
|
||||
"updated": "2021-01-19 23:31:29",
|
||||
"date_added": "2016-05-09 14:57:34",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "{\"generate_coupon\":\"Y\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:31:29",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "Coupon 2",
|
||||
"code": "SEA185",
|
||||
"ean": 9327868010363,
|
||||
"short_descr": "Neskutečně lehký voděodolný obal s rolovacím zavíráním z Hypalonu.",
|
||||
"long_descr": "<p><em>Novinka pro rok 2012.</em> Cestovat ve vlhku nemusí nutně znamenat mít vlhké věci! Pořiďte si nový lehký vak s rolovacím zavíráním z Hypalonu vyrobený ze silikonizované Cordury a nemusí Vás trápit ani pořádný déšť nebo procházka brodem. Je vhodný pro skladování nejrůznějších věcí a oproti svému předchůdci mají všechny velikosti zakulacené dno, takže vnitřní prostor lze lépe využít. Vaky jsou vyráběny ve čtyřech nových barevných variantách a s velkým nápisem po straně.</p>\r\n\r\n<ul>\r\n\t<li>Voděodolné podlepené dvojité švy.</li>\r\n\t<li>Voděodolné rolovací zavírání z Hypalonu.</li>\r\n\t<li>Unikátní materiál Ultra-Sil® pro maximální odolnost.</li>\r\n\t<li>PU zátěr zaručující nepromokavost.</li>\r\n\t<li>Neskutečně kompaktní a lehký.</li>\r\n\t<li>Velikost: 15 x 33 cm</li>\r\n\t<li>Hmotnost: 26g</li>\r\n\t<li>Dostupné ve velikostech 1, 2, 4, 8, 13, 20 a 35 litrů.</li>\r\n\t<li><a href=\"http://www.svetoutdooru.cz/clanek/?107886-obaly-sea-to-summit-ultra-sil-dry-sack\">Recenze starší varianty Ultra-Sil Dry Sack na SvetOutdooru.cz</a></li>\r\n</ul>",
|
||||
"parameters": "",
|
||||
"price": 304.9587,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 8.13010000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 4,
|
||||
"pieces_sold": 174,
|
||||
"delivery_time": 4,
|
||||
"campaign": "",
|
||||
"updated": "2021-01-19 23:31:29",
|
||||
"date_added": "2016-05-09 14:57:34",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "{\"generate_coupon\":\"Y\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:31:29",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "No Coupon 1",
|
||||
"code": "SEN297",
|
||||
"ean": 8592837046563,
|
||||
"short_descr": "Univerzální tričko pro široké použití vyrobené z merino vlny a polymidového hedvábí.",
|
||||
"long_descr": "<p>Univerzální tričko dámského střihu pro široké použití, které je vyrobené z kombinace dvou doplňujících se materiálů.</p>\r\n\r\n<p>Je z velmi jemného a lehkého úpletu, je pružné a materiál rychle schne, navíc je zkrášleno barevnými plochými švy na přední i zadní straně. Vyrobené je z merino vlny s příměsí polyamidu, který zlepšuje termoregulaci úpletu, zvyšuje jeho elastišnost, prodlužuje životnost a drží původní tvar i po nošení a praní.</p>\r\n\r\n<p>Díky tomu, že materiál je rychleschnoucí hodí se především na sporty s velkou pohybovou zátěží, sálové sporty, ale i na outdoorové sporty.</p>\r\n\r\n<p><strong>Složení materiálu</strong>: 90% Merino vlna, 10% polyamidové hedvábí (120 g/m<sup>2</sup>)</p>\r\n\r\n<p>Merino je významné plemeno ovce, které pochází ze severní Afriky. Dnes jsou hlavní producenti chovatelé v Austrálii, odkud pochází přes 80 % světové produkce. Přírodní vlákno Merino má <strong>mnoho předností.</strong> Vlna těchto ovcí je <strong>prodyšná</strong>, <strong>nezapáchá</strong>, <strong>neškrábe</strong> na těle a její <strong>údržba je snadná</strong>. Na rozdíl od umělých vláken je <strong>biologicky rozložiteln</strong>é a rozloží během několika let.</p>",
|
||||
"parameters": "",
|
||||
"price": 1318.1818,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 20.37850000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 28,
|
||||
|
||||
"pieces_sold": 165,
|
||||
"delivery_time": 3,
|
||||
"campaign": "D,CA,DIS",
|
||||
"updated": "2021-01-19 23:32:31",
|
||||
"date_added": "2018-01-22 15:46:50",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": "Sensor prádlo Merino Wool Air DR 2017 dámské",
|
||||
"meta_description": "Sensor prádlo Merino Wool Air DR 2017 dámské",
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"2\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:32:31",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"title": "No Coupon with invalid JSON data",
|
||||
"code": "SEN296",
|
||||
"ean": 8592837046204,
|
||||
"short_descr": "Slabší pánské vlněné triko s dlouhým rukávem s univerzálním použitím během celého roku.",
|
||||
"long_descr": "<p>Pánské merino triko s dlouhým rukávem, které využijete jak během chladnějších letních dnů, tak jako nejspodnější vrstvu v zimním období.</p>\r\n\r\n<p>Do merino vlny je přidán polyamid, který zvyšuje životnost materiálu, jeho elasticitu a bude lépe držet tvar i po jeho nošení a praní.</p>\r\n\r\n<p> </p>\r\n\r\n<p>- výborné termoregulační a antibakteriální vlastnosti</p>\r\n\r\n<p>- velmi lehký materiál, který je pružný, dobře prodyšný a rychleschnoucí</p>\r\n\r\n<p>- ploché barevné švy</p>\r\n\r\n<p>- vyrobeno z obnovitelných zdrojů z vysoce kvalitní vlny z Nového Zélandu</p>\r\n\r\n<p>- široké využití (např. na běh, lezení, turistiku, lyžování, jízdu na kole)</p>\r\n\r\n<p><strong>Složení materiálu</strong>: 90% Merino vlna, 10% polyamidové hedvábí (120 g/m<sup>2</sup>)</p>\r\n\r\n<p>Merino je významné plemeno ovce, které pochází ze severní Afriky. Dnes jsou hlavní producenti chovatelé v Austrálii, odkud pochází přes 80 % světové produkce. Přírodní vlákno Merino má <strong>mnoho předností.</strong> Vlna těchto ovcí je <strong>prodyšná</strong>, <strong>nezapáchá</strong>, <strong>neškrábe</strong> na těle a její <strong>údržba je snadná</strong>. Na rozdíl od umělých vláken je <strong>biologicky rozložiteln</strong>é a rozloží během několika let.</p>\r\n\r\n<p> </p>",
|
||||
"parameters": "",
|
||||
"price": 1318.1818,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 20.37850000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 20,
|
||||
|
||||
"pieces_sold": 171,
|
||||
"delivery_time": 3,
|
||||
"campaign": "D,HCA,CA,DIS",
|
||||
"updated": "2021-01-19 23:32:31",
|
||||
"date_added": "2018-01-22 15:47:58",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": "Sensor prádlo Merino Wool Air DR 2017 pánské",
|
||||
"meta_description": "Sensor prádlo Merino Wool Air DR 2017 pánské",
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "{\"",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 00:32:31",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"title": "No coupon with no data",
|
||||
"code": "RAB024",
|
||||
"short_descr": "Tenké merinové rukavice ideální jako vložka do dalších teplejších rukavice.",
|
||||
"long_descr": "<p>Tyto merinové rukavice budou ideální pro použití s dalšími rukavicemi. Oceníte je například jako <strong>vložku do palčáků nebo i prstových rukavic.</strong> Merinová složka<strong> hřeje a eliminuje pachy</strong> a díky polyesteru rukavice <strong>rychle schnou a mají delší životnost.</strong> </p>\r\n\r\n<h4>Specifikace:</h4>\r\n\r\n<ul>\r\n\t<li>Hmotnost: <strong>30 g</strong></li>\r\n\t<li>Materiál: 54% Polyester, 46% Merino vlna</li>\r\n</ul>",
|
||||
"parameters": "",
|
||||
"price": 363.6364,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 9.54550000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 7,
|
||||
|
||||
"pieces_sold": 105,
|
||||
"delivery_time": 2,
|
||||
"campaign": "",
|
||||
"updated": "2021-01-20 05:53:15",
|
||||
"date_added": "2019-10-03 16:26:43",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": "Rab rukavice Forge 160 Glove",
|
||||
"meta_description": "Lehké vlněné rukavice vhodné jako první vrstva do silnějších rukavic či do spacáku.",
|
||||
"meta_keywords": "",
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.0000,
|
||||
"data": "",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2021-01-20 06:53:15",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
}
|
||||
],
|
||||
"orders": [
|
||||
{
|
||||
"id": 1,
|
||||
"order_no": "Coupons Only",
|
||||
"id_language": "cs",
|
||||
"currency_rate": 1.0000,
|
||||
"currency": "CZK",
|
||||
"id_user": null,
|
||||
"date_created": "2021-02-23 12:19:36",
|
||||
"date_accept": "2021-02-23 12:19:40",
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-02-23 12:19:40",
|
||||
"date_due": null,
|
||||
"status": 1,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 1337.9900,
|
||||
"invoice_name": "Filip",
|
||||
"invoice_surname": "Chalupka",
|
||||
"invoice_firm": "AOPK ČR",
|
||||
"invoice_ico": "62933591",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "Kaplanova 1931/1",
|
||||
"invoice_city": "Praha",
|
||||
"invoice_zip": "14000",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420774356967",
|
||||
"invoice_email": "filip.chalupka@nature.cz",
|
||||
"delivery_name": "Filip",
|
||||
"delivery_surname": "Chalupka",
|
||||
"delivery_firm": "Julie's - kavárna a obchůdek bez obalu",
|
||||
"delivery_street": "Rožmitálova 2511/15",
|
||||
"delivery_city": "Blansko",
|
||||
"delivery_zip": "67801",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Bankovním převodem - Zásilkovna",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"193.179.186.2\",\"remote_port\":\"28310\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/88.0.4324.182 Safari\\/537.36\",\"delivery_data\":{\"zip\":\"67801\",\"labelRouting\":\"C56-152-4496\",\"idZ\":\"4496\"},\"heurekaDisagree\":\"on\",\"send_store_id\":5,\"delivery_date\":\"2021-02-25T12:19:36+01:00\",\"discounts\":{\"email\":\"filip.chalupka@nature.cz\"},\"payment_data\":[],\"conversion_sent\":1}",
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"order_no": "No items",
|
||||
"id_language": "cs",
|
||||
"currency_rate": 1.0000,
|
||||
"currency": "CZK",
|
||||
"id_user": null,
|
||||
"date_created": "2021-02-23 12:19:36",
|
||||
"date_accept": "2021-02-23 12:19:40",
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-02-23 12:19:40",
|
||||
"date_due": null,
|
||||
"status": 1,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 1337.9900,
|
||||
"invoice_name": "Filip",
|
||||
"invoice_surname": "Chalupka",
|
||||
"invoice_firm": "AOPK ČR",
|
||||
"invoice_ico": "62933591",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "Kaplanova 1931/1",
|
||||
"invoice_city": "Praha",
|
||||
"invoice_zip": "14000",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420774356967",
|
||||
"invoice_email": "filip.chalupka@nature.cz",
|
||||
"delivery_name": "Filip",
|
||||
"delivery_surname": "Chalupka",
|
||||
"delivery_firm": "Julie's - kavárna a obchůdek bez obalu",
|
||||
"delivery_street": "Rožmitálova 2511/15",
|
||||
"delivery_city": "Blansko",
|
||||
"delivery_zip": "67801",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Bankovním převodem - Zásilkovna",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"193.179.186.2\",\"remote_port\":\"28310\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/88.0.4324.182 Safari\\/537.36\",\"delivery_data\":{\"zip\":\"67801\",\"labelRouting\":\"C56-152-4496\",\"idZ\":\"4496\"},\"heurekaDisagree\":\"on\",\"send_store_id\":5,\"delivery_date\":\"2021-02-25T12:19:36+01:00\",\"discounts\":{\"email\":\"filip.chalupka@nature.cz\"},\"payment_data\":[],\"conversion_sent\":1}",
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"order_no": "Some non-coupons 1",
|
||||
"id_language": "cs",
|
||||
"currency_rate": 1.0000,
|
||||
"currency": "CZK",
|
||||
"id_user": null,
|
||||
"date_created": "2021-02-23 12:19:36",
|
||||
"date_accept": "2021-02-23 12:19:40",
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-02-23 12:19:40",
|
||||
"date_due": null,
|
||||
"status": 1,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 1337.9900,
|
||||
"invoice_name": "Filip",
|
||||
"invoice_surname": "Chalupka",
|
||||
"invoice_firm": "AOPK ČR",
|
||||
"invoice_ico": "62933591",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "Kaplanova 1931/1",
|
||||
"invoice_city": "Praha",
|
||||
"invoice_zip": "14000",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420774356967",
|
||||
"invoice_email": "filip.chalupka@nature.cz",
|
||||
"delivery_name": "Filip",
|
||||
"delivery_surname": "Chalupka",
|
||||
"delivery_firm": "Julie's - kavárna a obchůdek bez obalu",
|
||||
"delivery_street": "Rožmitálova 2511/15",
|
||||
"delivery_city": "Blansko",
|
||||
"delivery_zip": "67801",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Bankovním převodem - Zásilkovna",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"193.179.186.2\",\"remote_port\":\"28310\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/88.0.4324.182 Safari\\/537.36\",\"delivery_data\":{\"zip\":\"67801\",\"labelRouting\":\"C56-152-4496\",\"idZ\":\"4496\"},\"heurekaDisagree\":\"on\",\"send_store_id\":5,\"delivery_date\":\"2021-02-25T12:19:36+01:00\",\"discounts\":{\"email\":\"filip.chalupka@nature.cz\"},\"payment_data\":[],\"conversion_sent\":1}",
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"order_no": "Some non-coupons 2",
|
||||
"id_language": "cs",
|
||||
"currency_rate": 1.0000,
|
||||
"currency": "CZK",
|
||||
"id_user": null,
|
||||
"date_created": "2021-02-23 12:19:36",
|
||||
"date_accept": "2021-02-23 12:19:40",
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-02-23 12:19:40",
|
||||
"date_due": null,
|
||||
"status": 1,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 1337.9900,
|
||||
"invoice_name": "Filip",
|
||||
"invoice_surname": "Chalupka",
|
||||
"invoice_firm": "AOPK ČR",
|
||||
"invoice_ico": "62933591",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "Kaplanova 1931/1",
|
||||
"invoice_city": "Praha",
|
||||
"invoice_zip": "14000",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420774356967",
|
||||
"invoice_email": "filip.chalupka@nature.cz",
|
||||
"delivery_name": "Filip",
|
||||
"delivery_surname": "Chalupka",
|
||||
"delivery_firm": "Julie's - kavárna a obchůdek bez obalu",
|
||||
"delivery_street": "Rožmitálova 2511/15",
|
||||
"delivery_city": "Blansko",
|
||||
"delivery_zip": "67801",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Bankovním převodem - Zásilkovna",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"193.179.186.2\",\"remote_port\":\"28310\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/88.0.4324.182 Safari\\/537.36\",\"delivery_data\":{\"zip\":\"67801\",\"labelRouting\":\"C56-152-4496\",\"idZ\":\"4496\"},\"heurekaDisagree\":\"on\",\"send_store_id\":5,\"delivery_date\":\"2021-02-25T12:19:36+01:00\",\"discounts\":{\"email\":\"filip.chalupka@nature.cz\"},\"payment_data\":[],\"conversion_sent\":1}",
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"order_no": "Some non-coupons 3",
|
||||
"id_language": "cs",
|
||||
"currency_rate": 1.0000,
|
||||
"currency": "CZK",
|
||||
"id_user": null,
|
||||
"date_created": "2021-02-23 12:19:36",
|
||||
"date_accept": "2021-02-23 12:19:40",
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-02-23 12:19:40",
|
||||
"date_due": null,
|
||||
"status": 1,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 1337.9900,
|
||||
"invoice_name": "Filip",
|
||||
"invoice_surname": "Chalupka",
|
||||
"invoice_firm": "AOPK ČR",
|
||||
"invoice_ico": "62933591",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "Kaplanova 1931/1",
|
||||
"invoice_city": "Praha",
|
||||
"invoice_zip": "14000",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420774356967",
|
||||
"invoice_email": "filip.chalupka@nature.cz",
|
||||
"delivery_name": "Filip",
|
||||
"delivery_surname": "Chalupka",
|
||||
"delivery_firm": "Julie's - kavárna a obchůdek bez obalu",
|
||||
"delivery_street": "Rožmitálova 2511/15",
|
||||
"delivery_city": "Blansko",
|
||||
"delivery_zip": "67801",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Bankovním převodem - Zásilkovna",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"193.179.186.2\",\"remote_port\":\"28310\",\"user_agent\":\"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/88.0.4324.182 Safari\\/537.36\",\"delivery_data\":{\"zip\":\"67801\",\"labelRouting\":\"C56-152-4496\",\"idZ\":\"4496\"},\"heurekaDisagree\":\"on\",\"send_store_id\":5,\"delivery_date\":\"2021-02-25T12:19:36+01:00\",\"discounts\":{\"email\":\"filip.chalupka@nature.cz\"},\"payment_data\":[],\"conversion_sent\":1}",
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": ""
|
||||
}
|
||||
],
|
||||
"order_items": [
|
||||
{
|
||||
"id": 1,
|
||||
"id_order": 1,
|
||||
"id_product": 1,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 1,
|
||||
"piece_price": 1048.7600,
|
||||
"total_price": 1048.7600,
|
||||
"descr": "Petzl Boreo (Velikost: M-L, Barva: orange) (Kód: PET509)",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"stores\":{\"5\":\"0\",\"2\":\"0\",\"3\":\"0\",\"4\":\"1\",\"1\":\"0\"}}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"id_order": 1,
|
||||
"id_product": 2,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 57.0200,
|
||||
"total_price": 57.0200,
|
||||
"descr": "Bankovním převodem - Zásilkovna",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"id_order": 3,
|
||||
"id_product": 1,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 57.0200,
|
||||
"total_price": 57.0200,
|
||||
"descr": "Bankovním převodem - Zásilkovna",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"id_order": 3,
|
||||
"id_product": 3,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 57.0200,
|
||||
"total_price": 57.0200,
|
||||
"descr": "Bankovním převodem - Zásilkovna",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"id_order": 4,
|
||||
"id_product": 1,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 57.0200,
|
||||
"total_price": 57.0200,
|
||||
"descr": "Bankovním převodem - Zásilkovna",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"id_order": 4,
|
||||
"id_product": 4,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 57.0200,
|
||||
"total_price": 57.0200,
|
||||
"descr": "Bankovním převodem - Zásilkovna",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"id_order": 5,
|
||||
"id_product": 1,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 57.0200,
|
||||
"total_price": 57.0200,
|
||||
"descr": "Bankovním převodem - Zásilkovna",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"id_order": 5,
|
||||
"id_product": 5,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 57.0200,
|
||||
"total_price": 57.0200,
|
||||
"descr": "Bankovním převodem - Zásilkovna",
|
||||
"tax": 21,
|
||||
"date": "2021-02-23 11:19:36",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\Invoices\Import;
|
||||
|
||||
use KupShop\PohodaBundle\Utils\Exporters\InvoiceFromOrderExporter;
|
||||
|
||||
class InvoiceFromOrderExporterTest extends \DatabaseTestCase
|
||||
{
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
public function testDetectCouponsOnlyOrder()
|
||||
{
|
||||
$exporter = $this->get(InvoiceFromOrderExporter::class);
|
||||
$this->assertEquals([1], $exporter->filterCouponsOrdersIds([1, 2, 3]));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,494 @@
|
||||
<?xml version="1.0" encoding="Windows-1250"?>
|
||||
<rsp:responsePack version="2.0" id="001" state="ok" programVersion="12602.6 SQL (5.11.2020)" ico="04535910"
|
||||
key="4ba37787-5455-4689-bdcc-c519e4375dda" note="Po?adavek na export v?b?ru faktur"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd"
|
||||
xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd"
|
||||
xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd"
|
||||
xmlns:lCen="http://www.stormware.cz/schema/version_2/list_centre.xsd"
|
||||
xmlns:lAcv="http://www.stormware.cz/schema/version_2/list_activity.xsd"
|
||||
xmlns:acu="http://www.stormware.cz/schema/version_2/accountingunit.xsd"
|
||||
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
|
||||
xmlns:vch="http://www.stormware.cz/schema/version_2/voucher.xsd"
|
||||
xmlns:int="http://www.stormware.cz/schema/version_2/intDoc.xsd"
|
||||
xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd"
|
||||
xmlns:ofr="http://www.stormware.cz/schema/version_2/offer.xsd"
|
||||
xmlns:enq="http://www.stormware.cz/schema/version_2/enquiry.xsd"
|
||||
xmlns:vyd="http://www.stormware.cz/schema/version_2/vydejka.xsd"
|
||||
xmlns:pri="http://www.stormware.cz/schema/version_2/prijemka.xsd"
|
||||
xmlns:bal="http://www.stormware.cz/schema/version_2/balance.xsd"
|
||||
xmlns:pre="http://www.stormware.cz/schema/version_2/prevodka.xsd"
|
||||
xmlns:vyr="http://www.stormware.cz/schema/version_2/vyroba.xsd"
|
||||
xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd"
|
||||
xmlns:con="http://www.stormware.cz/schema/version_2/contract.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd"
|
||||
xmlns:prm="http://www.stormware.cz/schema/version_2/parameter.xsd"
|
||||
xmlns:lCon="http://www.stormware.cz/schema/version_2/list_contract.xsd"
|
||||
xmlns:ctg="http://www.stormware.cz/schema/version_2/category.xsd"
|
||||
xmlns:ipm="http://www.stormware.cz/schema/version_2/intParam.xsd"
|
||||
xmlns:str="http://www.stormware.cz/schema/version_2/storage.xsd"
|
||||
xmlns:idp="http://www.stormware.cz/schema/version_2/individualPrice.xsd"
|
||||
xmlns:sup="http://www.stormware.cz/schema/version_2/supplier.xsd"
|
||||
xmlns:prn="http://www.stormware.cz/schema/version_2/print.xsd"
|
||||
xmlns:sEET="http://www.stormware.cz/schema/version_2/sendEET.xsd"
|
||||
xmlns:act="http://www.stormware.cz/schema/version_2/accountancy.xsd"
|
||||
xmlns:bnk="http://www.stormware.cz/schema/version_2/bank.xsd"
|
||||
xmlns:sto="http://www.stormware.cz/schema/version_2/store.xsd"
|
||||
xmlns:grs="http://www.stormware.cz/schema/version_2/groupStocks.xsd"
|
||||
xmlns:acp="http://www.stormware.cz/schema/version_2/actionPrice.xsd"
|
||||
xmlns:csh="http://www.stormware.cz/schema/version_2/cashRegister.xsd"
|
||||
xmlns:bka="http://www.stormware.cz/schema/version_2/bankAccount.xsd"
|
||||
xmlns:ilt="http://www.stormware.cz/schema/version_2/inventoryLists.xsd"
|
||||
xmlns:nms="http://www.stormware.cz/schema/version_2/numericalSeries.xsd"
|
||||
xmlns:pay="http://www.stormware.cz/schema/version_2/payment.xsd"
|
||||
xmlns:mKasa="http://www.stormware.cz/schema/version_2/mKasa.xsd"
|
||||
xmlns:gdp="http://www.stormware.cz/schema/version_2/GDPR.xsd"
|
||||
xmlns:est="http://www.stormware.cz/schema/version_2/establishment.xsd"
|
||||
xmlns:cen="http://www.stormware.cz/schema/version_2/centre.xsd"
|
||||
xmlns:acv="http://www.stormware.cz/schema/version_2/activity.xsd"
|
||||
xmlns:afp="http://www.stormware.cz/schema/version_2/accountingFormOfPayment.xsd"
|
||||
xmlns:vat="http://www.stormware.cz/schema/version_2/classificationVAT.xsd"
|
||||
xmlns:rgn="http://www.stormware.cz/schema/version_2/registrationNumber.xsd"
|
||||
xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd"
|
||||
xmlns:asv="http://www.stormware.cz/schema/version_2/accountingSalesVouchers.xsd"
|
||||
xmlns:arch="http://www.stormware.cz/schema/version_2/archive.xsd"
|
||||
xmlns:req="http://www.stormware.cz/schema/version_2/productRequirement.xsd">
|
||||
<rsp:responsePackItem version="2.0" id="li1" state="ok">
|
||||
<lst:listInvoice version="2.0" dateTimeStamp="2021-03-18T16:04:15" dateValidFrom="2021-03-18" state="ok">
|
||||
<lst:invoice version="2.0">
|
||||
<inv:invoiceHeader>
|
||||
<inv:id>227192</inv:id>
|
||||
<inv:invoiceType>issuedCorrectiveTax</inv:invoiceType>
|
||||
<inv:number>
|
||||
<typ:id>1136</typ:id>
|
||||
<typ:ids>2015</typ:ids>
|
||||
<typ:numberRequested>201501736</typ:numberRequested>
|
||||
</inv:number>
|
||||
<inv:symVar>201501736</inv:symVar>
|
||||
<inv:date>2020-12-09</inv:date>
|
||||
<inv:dateTax>2020-12-09</inv:dateTax>
|
||||
<inv:dateAccounting>2020-12-09</inv:dateAccounting>
|
||||
<inv:dateDue>2020-12-09</inv:dateDue>
|
||||
<inv:dateApplicationVAT>2020-12-09</inv:dateApplicationVAT>
|
||||
<inv:accounting>
|
||||
<typ:id>17</typ:id>
|
||||
<typ:ids>604</typ:ids>
|
||||
</inv:accounting>
|
||||
<inv:classificationVAT>
|
||||
<typ:id>342</typ:id>
|
||||
<typ:ids>UDA5</typ:ids>
|
||||
</inv:classificationVAT>
|
||||
<inv:text>Opravný daòový doklad k daòovému dokladu è. 200524183
|
||||
Dùvod opravy:
|
||||
</inv:text>
|
||||
<inv:partnerIdentity>
|
||||
<typ:id>81544</typ:id>
|
||||
<typ:address>
|
||||
<typ:name>Marcel Nazad - ELEKTROSMS</typ:name>
|
||||
<typ:city>Boskovice</typ:city>
|
||||
<typ:street>Chrudichromská 7</typ:street>
|
||||
<typ:zip>68001</typ:zip>
|
||||
<typ:country>
|
||||
<typ:id>48</typ:id>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>+420736411413</typ:phone>
|
||||
<typ:mobilPhone>+420736411413</typ:mobilPhone>
|
||||
<typ:email>nazad.marcel@gmail.com</typ:email>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:name>Marcel Nazad - ELEKTROSMS</typ:name>
|
||||
<typ:city>Boskovice</typ:city>
|
||||
<typ:street>Chrudichromská 7</typ:street>
|
||||
<typ:zip>68001</typ:zip>
|
||||
<typ:country>
|
||||
<typ:id>48</typ:id>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>+420736411413</typ:phone>
|
||||
</typ:shipToAddress>
|
||||
</inv:partnerIdentity>
|
||||
<inv:myIdentity>
|
||||
<typ:address>
|
||||
<typ:company>Hanibal sport s.r.o.</typ:company>
|
||||
<typ:city>Praha 2</typ:city>
|
||||
<typ:street>Korunní 732/16</typ:street>
|
||||
<typ:zip>120 00</typ:zip>
|
||||
<typ:ico>04535910</typ:ico>
|
||||
<typ:dic>CZ04535910</typ:dic>
|
||||
<typ:mobilPhone>720984344</typ:mobilPhone>
|
||||
<typ:email>info@hanibal.cz</typ:email>
|
||||
<typ:www>www.hanibal.cz</typ:www>
|
||||
</typ:address>
|
||||
<typ:establishment>
|
||||
<typ:company>Hanibal sport</typ:company>
|
||||
<typ:city>Praha 2</typ:city>
|
||||
<typ:street>Korunní 16</typ:street>
|
||||
<typ:zip>120 00</typ:zip>
|
||||
</typ:establishment>
|
||||
</inv:myIdentity>
|
||||
<inv:numberOrder>web128453</inv:numberOrder>
|
||||
<inv:dateOrder>2020-11-20</inv:dateOrder>
|
||||
<inv:paymentType>
|
||||
<typ:id>15</typ:id>
|
||||
<typ:ids>Kartou online</typ:ids>
|
||||
</inv:paymentType>
|
||||
<inv:account>
|
||||
<typ:id>10</typ:id>
|
||||
<typ:ids>FIO2</typ:ids>
|
||||
<typ:accountNo>2900330821</typ:accountNo>
|
||||
</inv:account>
|
||||
<inv:symConst>0008</inv:symConst>
|
||||
<inv:centre>
|
||||
<typ:id>5</typ:id>
|
||||
<typ:ids>ESHOP</typ:ids>
|
||||
</inv:centre>
|
||||
<inv:liquidation>
|
||||
<typ:amountHome>-1668</typ:amountHome>
|
||||
</inv:liquidation>
|
||||
<inv:markRecord>true</inv:markRecord>
|
||||
<inv:parameters>
|
||||
<typ:parameter>
|
||||
<typ:name>RefVPrDoprava</typ:name>
|
||||
<typ:listValueRef>
|
||||
<typ:id>15</typ:id>
|
||||
<typ:ids>PPL</typ:ids>
|
||||
</typ:listValueRef>
|
||||
<typ:list>
|
||||
<typ:id>802</typ:id>
|
||||
<typ:ids>Doprava</typ:ids>
|
||||
</typ:list>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrZapl</typ:name>
|
||||
<typ:booleanValue>false</typ:booleanValue>
|
||||
</typ:parameter>
|
||||
</inv:parameters>
|
||||
</inv:invoiceHeader>
|
||||
<inv:invoiceDetail>
|
||||
<inv:invoiceItem>
|
||||
<inv:id>963928</inv:id>
|
||||
<inv:text>Sensor prádlo Merino Wool Air DR 2017 dámské ::magenta::M</inv:text>
|
||||
<inv:quantity>-1.0</inv:quantity>
|
||||
<inv:unit>ks</inv:unit>
|
||||
<inv:coefficient>1.0</inv:coefficient>
|
||||
<inv:payVAT>true</inv:payVAT>
|
||||
<inv:rateVAT value="21">high</inv:rateVAT>
|
||||
<inv:discountPercentage>0.0</inv:discountPercentage>
|
||||
<inv:homeCurrency>
|
||||
<typ:unitPrice>1270</typ:unitPrice>
|
||||
<typ:price>-1049.59</typ:price>
|
||||
<typ:priceVAT>-220.41</typ:priceVAT>
|
||||
<typ:priceSum>-1270</typ:priceSum>
|
||||
</inv:homeCurrency>
|
||||
<inv:note>Sleva 20 %</inv:note>
|
||||
<inv:code>SEN297S002</inv:code>
|
||||
<inv:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>17</typ:id>
|
||||
<typ:ids>04</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>206441</typ:id>
|
||||
<typ:ids>SEN297S002</typ:ids>
|
||||
<typ:EAN>8592837046570</typ:EAN>
|
||||
</typ:stockItem>
|
||||
</inv:stockItem>
|
||||
<inv:PDP>false</inv:PDP>
|
||||
</inv:invoiceItem>
|
||||
<inv:invoiceItem>
|
||||
<inv:id>963930</inv:id>
|
||||
<inv:text>Rab rukavice Forge 160 Glove ::ebony::S</inv:text>
|
||||
<inv:quantity>-1.0</inv:quantity>
|
||||
<inv:unit>ks</inv:unit>
|
||||
<inv:coefficient>1.0</inv:coefficient>
|
||||
<inv:payVAT>true</inv:payVAT>
|
||||
<inv:rateVAT value="21">high</inv:rateVAT>
|
||||
<inv:discountPercentage>0.0</inv:discountPercentage>
|
||||
<inv:homeCurrency>
|
||||
<typ:unitPrice>398</typ:unitPrice>
|
||||
<typ:price>-328.93</typ:price>
|
||||
<typ:priceVAT>-69.07</typ:priceVAT>
|
||||
<typ:priceSum>-398</typ:priceSum>
|
||||
</inv:homeCurrency>
|
||||
<inv:code>RAB024S001</inv:code>
|
||||
<inv:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>17</typ:id>
|
||||
<typ:ids>04</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>266079</typ:id>
|
||||
<typ:ids>RAB024S001</typ:ids>
|
||||
</typ:stockItem>
|
||||
</inv:stockItem>
|
||||
<inv:PDP>false</inv:PDP>
|
||||
</inv:invoiceItem>
|
||||
</inv:invoiceDetail>
|
||||
<inv:invoiceSummary>
|
||||
<inv:roundingDocument>none</inv:roundingDocument>
|
||||
<inv:roundingVAT>none</inv:roundingVAT>
|
||||
<inv:typeCalculateVATInclusivePrice>VATNewMethod</inv:typeCalculateVATInclusivePrice>
|
||||
<inv:homeCurrency>
|
||||
<typ:priceNone>0</typ:priceNone>
|
||||
<typ:priceLow>0</typ:priceLow>
|
||||
<typ:priceLowVAT>0</typ:priceLowVAT>
|
||||
<typ:priceLowSum>0</typ:priceLowSum>
|
||||
<typ:priceHigh>-1378.52</typ:priceHigh>
|
||||
<typ:priceHighVAT>-289.48</typ:priceHighVAT>
|
||||
<typ:priceHighSum>-1668</typ:priceHighSum>
|
||||
<typ:price3>0</typ:price3>
|
||||
<typ:price3VAT>0</typ:price3VAT>
|
||||
<typ:price3Sum>0</typ:price3Sum>
|
||||
<typ:round>
|
||||
<typ:priceRound>0</typ:priceRound>
|
||||
</typ:round>
|
||||
</inv:homeCurrency>
|
||||
</inv:invoiceSummary>
|
||||
<inv:EET>
|
||||
<typ:stateEET>notEnter</typ:stateEET>
|
||||
</inv:EET>
|
||||
</lst:invoice>
|
||||
<lst:invoice version="2.0">
|
||||
<inv:invoiceHeader>
|
||||
<inv:id>241497</inv:id>
|
||||
<inv:invoiceType>issuedInvoice</inv:invoiceType>
|
||||
<inv:number>
|
||||
<typ:id>1268</typ:id>
|
||||
<typ:ids>2105</typ:ids>
|
||||
<typ:numberRequested>210507247</typ:numberRequested>
|
||||
</inv:number>
|
||||
<inv:symVar>164001</inv:symVar>
|
||||
<inv:date>2021-03-10</inv:date>
|
||||
<inv:dateTax>2021-03-10</inv:dateTax>
|
||||
<inv:dateAccounting>2021-03-10</inv:dateAccounting>
|
||||
<inv:dateDue>2021-03-24</inv:dateDue>
|
||||
<inv:accounting>
|
||||
<typ:id>17</typ:id>
|
||||
<typ:ids>604</typ:ids>
|
||||
</inv:accounting>
|
||||
<inv:classificationVAT>
|
||||
<typ:id>342</typ:id>
|
||||
<typ:ids>UDA5</typ:ids>
|
||||
</inv:classificationVAT>
|
||||
<inv:text>Fakturujeme Vám zboží dle Vaší objednávky:</inv:text>
|
||||
<inv:partnerIdentity>
|
||||
<typ:address>
|
||||
<typ:company>AOPK ÈR</typ:company>
|
||||
<typ:name>Filip Chalupka</typ:name>
|
||||
<typ:city>Praha</typ:city>
|
||||
<typ:street>Kaplanova 1931/1</typ:street>
|
||||
<typ:zip>14000</typ:zip>
|
||||
<typ:ico>62933591</typ:ico>
|
||||
<typ:country>
|
||||
<typ:id>48</typ:id>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>+420774356967</typ:phone>
|
||||
<typ:mobilPhone>+420774356967</typ:mobilPhone>
|
||||
<typ:email>filip.chalupka@nature.cz</typ:email>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:company>Julie's - kavárna a obchùdek bez obalu</typ:company>
|
||||
<typ:name>Filip Chalupka</typ:name>
|
||||
<typ:city>Blansko</typ:city>
|
||||
<typ:street>Rožmitálova 2511/15</typ:street>
|
||||
<typ:zip>67801</typ:zip>
|
||||
<typ:country>
|
||||
<typ:id>48</typ:id>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
</typ:shipToAddress>
|
||||
</inv:partnerIdentity>
|
||||
<inv:myIdentity>
|
||||
<typ:address>
|
||||
<typ:company>Hanibal sport s.r.o.</typ:company>
|
||||
<typ:city>Praha 2</typ:city>
|
||||
<typ:street>Korunní 732/16</typ:street>
|
||||
<typ:zip>120 00</typ:zip>
|
||||
<typ:ico>04535910</typ:ico>
|
||||
<typ:dic>CZ04535910</typ:dic>
|
||||
<typ:mobilPhone>720984344</typ:mobilPhone>
|
||||
<typ:email>info@hanibal.cz</typ:email>
|
||||
<typ:www>www.hanibal.cz</typ:www>
|
||||
</typ:address>
|
||||
<typ:establishment>
|
||||
<typ:company>Hanibal sport</typ:company>
|
||||
<typ:city>Praha 2</typ:city>
|
||||
<typ:street>Korunní 16</typ:street>
|
||||
<typ:zip>120 00</typ:zip>
|
||||
</typ:establishment>
|
||||
</inv:myIdentity>
|
||||
<inv:numberOrder>164001</inv:numberOrder>
|
||||
<inv:dateOrder>2021-02-23</inv:dateOrder>
|
||||
<inv:paymentType>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>Pøíkazem</typ:ids>
|
||||
<typ:paymentType>draft</typ:paymentType>
|
||||
</inv:paymentType>
|
||||
<inv:account>
|
||||
<typ:id>10</typ:id>
|
||||
<typ:ids>FIO2</typ:ids>
|
||||
<typ:accountNo>2900330821</typ:accountNo>
|
||||
</inv:account>
|
||||
<inv:symConst>0008</inv:symConst>
|
||||
<inv:centre>
|
||||
<typ:id>5</typ:id>
|
||||
<typ:ids>ESHOP</typ:ids>
|
||||
</inv:centre>
|
||||
<inv:liquidation/>
|
||||
<inv:markRecord>true</inv:markRecord>
|
||||
<inv:parameters>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrCisloBaliku</typ:name>
|
||||
<typ:textValue>2074122220</typ:textValue>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>RefVPrDoprava</typ:name>
|
||||
<typ:listValueRef>
|
||||
<typ:id>81</typ:id>
|
||||
<typ:ids>ZAS_CZ</typ:ids>
|
||||
</typ:listValueRef>
|
||||
<typ:list>
|
||||
<typ:id>802</typ:id>
|
||||
<typ:ids>Doprava</typ:ids>
|
||||
</typ:list>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrZapl</typ:name>
|
||||
<typ:booleanValue>false</typ:booleanValue>
|
||||
</typ:parameter>
|
||||
</inv:parameters>
|
||||
</inv:invoiceHeader>
|
||||
<inv:invoiceDetail>
|
||||
<inv:invoiceItem>
|
||||
<inv:id>1014839</inv:id>
|
||||
<inv:text>Petzl pøilba Boreo ::orange::M-L</inv:text>
|
||||
<inv:quantity>1.0</inv:quantity>
|
||||
<inv:unit>ks</inv:unit>
|
||||
<inv:coefficient>1.0</inv:coefficient>
|
||||
<inv:payVAT>true</inv:payVAT>
|
||||
<inv:rateVAT value="21">high</inv:rateVAT>
|
||||
<inv:discountPercentage>0.0</inv:discountPercentage>
|
||||
<inv:homeCurrency>
|
||||
<typ:unitPrice>1269</typ:unitPrice>
|
||||
<typ:price>1048.76</typ:price>
|
||||
<typ:priceVAT>220.24</typ:priceVAT>
|
||||
<typ:priceSum>1269</typ:priceSum>
|
||||
</inv:homeCurrency>
|
||||
<inv:code>PET509S012</inv:code>
|
||||
<inv:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>17</typ:id>
|
||||
<typ:ids>04</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>288261</typ:id>
|
||||
<typ:ids>PET509S012</typ:ids>
|
||||
<typ:EAN>3342540830882</typ:EAN>
|
||||
</typ:stockItem>
|
||||
</inv:stockItem>
|
||||
<inv:PDP>false</inv:PDP>
|
||||
<inv:linkedDocument>
|
||||
<typ:sourceAgenda>receivedOrder</typ:sourceAgenda>
|
||||
<typ:sourceDocument>
|
||||
<typ:id>331251</typ:id>
|
||||
<typ:number>212905880</typ:number>
|
||||
</typ:sourceDocument>
|
||||
<typ:sourceDocumentItem>
|
||||
<typ:sourceItemId>846486</typ:sourceItemId>
|
||||
</typ:sourceDocumentItem>
|
||||
</inv:linkedDocument>
|
||||
</inv:invoiceItem>
|
||||
<inv:invoiceItem>
|
||||
<inv:id>1014840</inv:id>
|
||||
<inv:text>Doprava Zásilkovna ÈR</inv:text>
|
||||
<inv:quantity>1.0</inv:quantity>
|
||||
<inv:unit>ks</inv:unit>
|
||||
<inv:coefficient>1.0</inv:coefficient>
|
||||
<inv:payVAT>true</inv:payVAT>
|
||||
<inv:rateVAT value="21">high</inv:rateVAT>
|
||||
<inv:discountPercentage>0.0</inv:discountPercentage>
|
||||
<inv:homeCurrency>
|
||||
<typ:unitPrice>69</typ:unitPrice>
|
||||
<typ:price>57.02</typ:price>
|
||||
<typ:priceVAT>11.98</typ:priceVAT>
|
||||
<typ:priceSum>69</typ:priceSum>
|
||||
</inv:homeCurrency>
|
||||
<inv:code>POS153</inv:code>
|
||||
<inv:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>17</typ:id>
|
||||
<typ:ids>04</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>253035</typ:id>
|
||||
<typ:ids>POS153</typ:ids>
|
||||
</typ:stockItem>
|
||||
</inv:stockItem>
|
||||
<inv:PDP>false</inv:PDP>
|
||||
<inv:linkedDocument>
|
||||
<typ:sourceAgenda>receivedOrder</typ:sourceAgenda>
|
||||
<typ:sourceDocument>
|
||||
<typ:id>331251</typ:id>
|
||||
<typ:number>212905880</typ:number>
|
||||
</typ:sourceDocument>
|
||||
<typ:sourceDocumentItem>
|
||||
<typ:sourceItemId>846487</typ:sourceItemId>
|
||||
</typ:sourceDocumentItem>
|
||||
</inv:linkedDocument>
|
||||
</inv:invoiceItem>
|
||||
<inv:invoiceAdvancePaymentItem>
|
||||
<inv:id>1014859</inv:id>
|
||||
<inv:sourceDocument>
|
||||
<typ:id>239695</typ:id>
|
||||
<typ:number>210800001</typ:number>
|
||||
</inv:sourceDocument>
|
||||
<inv:quantity>1.0</inv:quantity>
|
||||
<inv:payVAT>true</inv:payVAT>
|
||||
<inv:rateVAT value="0">none</inv:rateVAT>
|
||||
<inv:discountPercentage>0.0</inv:discountPercentage>
|
||||
<inv:homeCurrency>
|
||||
<typ:unitPrice>-1338</typ:unitPrice>
|
||||
<typ:price>-1338</typ:price>
|
||||
<typ:priceVAT>0</typ:priceVAT>
|
||||
<typ:priceSum>-1338</typ:priceSum>
|
||||
</inv:homeCurrency>
|
||||
<inv:note>è. 210800001</inv:note>
|
||||
<inv:symPar>210800001</inv:symPar>
|
||||
<inv:accounting>
|
||||
<typ:id>84</typ:id>
|
||||
<typ:ids>nepoužívat</typ:ids>
|
||||
</inv:accounting>
|
||||
</inv:invoiceAdvancePaymentItem>
|
||||
</inv:invoiceDetail>
|
||||
<inv:invoiceSummary>
|
||||
<inv:roundingDocument>none</inv:roundingDocument>
|
||||
<inv:roundingVAT>none</inv:roundingVAT>
|
||||
<inv:typeCalculateVATInclusivePrice>VATNewMethod</inv:typeCalculateVATInclusivePrice>
|
||||
<inv:homeCurrency>
|
||||
<typ:priceNone>0</typ:priceNone>
|
||||
<typ:priceLow>0</typ:priceLow>
|
||||
<typ:priceLowVAT>0</typ:priceLowVAT>
|
||||
<typ:priceLowSum>0</typ:priceLowSum>
|
||||
<typ:priceHigh>1105.78</typ:priceHigh>
|
||||
<typ:priceHighVAT>232.22</typ:priceHighVAT>
|
||||
<typ:priceHighSum>1338</typ:priceHighSum>
|
||||
<typ:price3>0</typ:price3>
|
||||
<typ:price3VAT>0</typ:price3VAT>
|
||||
<typ:price3Sum>0</typ:price3Sum>
|
||||
<typ:round>
|
||||
<typ:priceRound>0</typ:priceRound>
|
||||
</typ:round>
|
||||
</inv:homeCurrency>
|
||||
</inv:invoiceSummary>
|
||||
<inv:EET>
|
||||
<typ:stateEET>notEnter</typ:stateEET>
|
||||
</inv:EET>
|
||||
</lst:invoice>
|
||||
</lst:listInvoice>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>
|
||||
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0"?>
|
||||
<INVOICES xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd" xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd" xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd" xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd" response="ok">
|
||||
<INVOICE>
|
||||
<ORDER_NO>IC128453</ORDER_NO>
|
||||
<INVOICE_POHODA_ID>IC227192</INVOICE_POHODA_ID>
|
||||
<INVOICE_TYPE>issuedCorrectiveTax</INVOICE_TYPE>
|
||||
<INVOICE_PREFIX>2015</INVOICE_PREFIX>
|
||||
<INVOICE_NUMBER>201501736</INVOICE_NUMBER>
|
||||
<DATE_CREATED>2020-12-09</DATE_CREATED>
|
||||
<EXECUTED/>
|
||||
<PACKAGE_ID/>
|
||||
<ORDER_POHODA_ID>IC128453</ORDER_POHODA_ID>
|
||||
<NOTE_ADMIN>
|
||||
<ODD_ORDER_NO>web128453</ODD_ORDER_NO>
|
||||
<ODD_TEXT>Opravný daňový doklad k daňovému dokladu č. 200524183
|
||||
Důvod opravy:
|
||||
</ODD_TEXT>
|
||||
</NOTE_ADMIN>
|
||||
<ID_LANGUAGE>cs</ID_LANGUAGE>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<CURRENCY_RATE>1</CURRENCY_RATE>
|
||||
<EMAIL>nazad.marcel@gmail.com</EMAIL>
|
||||
<PHONE>+420736411413</PHONE>
|
||||
<NOTE>Opravný daňový doklad k daňovému dokladu č. 200524183
|
||||
Důvod opravy:
|
||||
</NOTE>
|
||||
<DELIVERY/>
|
||||
<PAYMENT>GoPay</PAYMENT>
|
||||
<USER>
|
||||
<POHODA_ID>81544</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>Marcel</NAME>
|
||||
<SURNAME>Nazad - ELEKTROSMS</SURNAME>
|
||||
<FIRM/>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>Chrudichromská 7</STREET>
|
||||
<CITY>Boskovice</CITY>
|
||||
<ZIP>68001</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE>+420736411413</PHONE>
|
||||
<EMAIL>nazad.marcel@gmail.com</EMAIL>
|
||||
</INVOICE_ADDRESS>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>Marcel</NAME>
|
||||
<SURNAME>Nazad - ELEKTROSMS</SURNAME>
|
||||
<FIRM/>
|
||||
<STREET>Chrudichromská 7</STREET>
|
||||
<CITY>Boskovice</CITY>
|
||||
<ZIP>68001</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE>+420736411413</PHONE>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID/>
|
||||
<CODE>SEN297S002</CODE>
|
||||
<NAME>Sensor prádlo Merino Wool Air DR 2017 dámské ::magenta::M</NAME>
|
||||
<PIECE_PRICE>1049.5867768595</PIECE_PRICE>
|
||||
<TOTAL_PRICE>-1049.5867768595</TOTAL_PRICE>
|
||||
<PIECES>-1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID/>
|
||||
<CODE>RAB024S001</CODE>
|
||||
<NAME>Rab rukavice Forge 160 Glove ::ebony::S</NAME>
|
||||
<PIECE_PRICE>328.925619834711</PIECE_PRICE>
|
||||
<TOTAL_PRICE>-328.925619834711</TOTAL_PRICE>
|
||||
<PIECES>-1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</INVOICE>
|
||||
|
||||
<INVOICE>
|
||||
<ORDER_NO>164001</ORDER_NO>
|
||||
<INVOICE_POHODA_ID>241497</INVOICE_POHODA_ID>
|
||||
<INVOICE_TYPE>issuedInvoice</INVOICE_TYPE>
|
||||
<INVOICE_PREFIX>2105</INVOICE_PREFIX>
|
||||
<INVOICE_NUMBER>210507247</INVOICE_NUMBER>
|
||||
<DATE_CREATED>2021-03-10</DATE_CREATED>
|
||||
<EXECUTED/>
|
||||
<PACKAGE_ID>2074122220</PACKAGE_ID>
|
||||
</INVOICE>
|
||||
</INVOICES>
|
||||
@@ -0,0 +1,314 @@
|
||||
{
|
||||
"stores": [
|
||||
{
|
||||
"id": 13,
|
||||
"name": "Horní Počernice",
|
||||
"id_delivery": null,
|
||||
"type": 0,
|
||||
"figure": "N",
|
||||
"data": "{\"mserver\":\"0\"}"
|
||||
},
|
||||
{
|
||||
"id": 20,
|
||||
"name": "Hlavní sklad SM",
|
||||
"id_delivery": null,
|
||||
"type": 0,
|
||||
"pohoda_id": "000-hlavni",
|
||||
"figure": "Y",
|
||||
"data": "{\"mserver\":\"1\"}"
|
||||
}
|
||||
],
|
||||
"products": [
|
||||
{
|
||||
"id": 23432,
|
||||
"title": "ADIDAS ACE 17.1 FG W",
|
||||
"code": "S77044",
|
||||
"ean": null,
|
||||
"short_descr": "",
|
||||
"long_descr": "<p>Ovládni hru díky kopačkám ACE 17.1. Zažij totální kontrolu nad míčem díky hybridnímu svršku PRIMEKNIT a TECHFIT®, který se ihned přizpůsobí noze. Technologie NSG zajišťuje perfektní kontrolu nad míčem v jakýchkoliv podmínkách. Podešev SPRINTFRAME zaručí optimální přilnavost na pevném povrchu. A ty tak nebudeš mít jediný problém v rychlých změnách směru a rychlosti. </p>",
|
||||
"parameters": "",
|
||||
"price": 5619.0083,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"id_cn": 640011000090,
|
||||
"discount": 50.00740000,
|
||||
"producer": 10,
|
||||
"guarantee": 0,
|
||||
"in_store": 4,
|
||||
"pieces_sold": 3,
|
||||
"delivery_time": 0,
|
||||
"campaign": "Z",
|
||||
"updated": "2022-09-09 13:38:16",
|
||||
"date_added": "2020-10-26 13:46:18",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": null,
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"note": null,
|
||||
"weight": 0.715000,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"4\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2022-08-09 16:04:28",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null
|
||||
},
|
||||
{
|
||||
"id": 24344,
|
||||
"title": "ADIDAS ACE 16.1 PRIMEKNIT",
|
||||
"code": "S76470",
|
||||
"ean": null,
|
||||
"short_descr": "",
|
||||
"long_descr": "<p>ADIDAS ACE 16.1 PRIMEKNIT</p>",
|
||||
"parameters": "",
|
||||
"price": 5619.0083,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"id_cn": 640011000090,
|
||||
"discount": 50.00740000,
|
||||
"producer": 10,
|
||||
"guarantee": 0,
|
||||
"in_store": 4,
|
||||
"pieces_sold": 4,
|
||||
"delivery_time": 0,
|
||||
"campaign": "Z",
|
||||
"updated": "2022-09-09 14:10:08",
|
||||
"date_added": "2020-10-26 15:04:15",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": null,
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.715000,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"4\"}",
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2022-08-03 15:13:32",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null,
|
||||
"confpos": 0
|
||||
}
|
||||
],
|
||||
"products_variations": [
|
||||
{
|
||||
"id": 57949,
|
||||
"id_product": 23432,
|
||||
"code": "S77044-40.2/3",
|
||||
"ean": 4058025231547,
|
||||
"title": "Velikost: 40.2/3",
|
||||
"in_store": 0,
|
||||
"delivery_time": -2,
|
||||
"price": 5619.0083,
|
||||
"figure": "Y",
|
||||
"updated": "2022-09-09 13:38:16",
|
||||
"note": null,
|
||||
"weight": 0.715000,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2022-06-27 09:19:16",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null,
|
||||
"data": null,
|
||||
"price_common": null
|
||||
},
|
||||
{
|
||||
"id": 60196,
|
||||
"id_product": 24344,
|
||||
"code": "S76470-41.1/3",
|
||||
"ean": 4056565662340,
|
||||
"title": "Velikost: 41.1/3",
|
||||
"in_store": 1,
|
||||
"delivery_time": -2,
|
||||
"price": 5619.0083,
|
||||
"figure": "Y",
|
||||
"updated": "2022-09-09 14:10:08",
|
||||
"date_added": null,
|
||||
"in_store_min": null,
|
||||
"note": null,
|
||||
"weight": 0.715000,
|
||||
"bonus_points": null,
|
||||
"pohoda_sync_date": "2022-06-27 09:19:13",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null,
|
||||
"data": null,
|
||||
"price_common": null
|
||||
}
|
||||
],
|
||||
"orders": [
|
||||
{
|
||||
"id": 58760,
|
||||
"order_no": "01000058749",
|
||||
"currency_rate": 1.00000000,
|
||||
"currency": "CZK",
|
||||
"id_user": null,
|
||||
"date_created": "2022-09-09 11:38:16",
|
||||
"date_accept": null,
|
||||
"date_handle": null,
|
||||
"date_updated": "2022-09-09 13:38:17",
|
||||
"date_due": null,
|
||||
"status": 0,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 3399.0000,
|
||||
"total_price_without_vat": 2809.0900,
|
||||
"invoice_name": "Test",
|
||||
"invoice_surname": "Test",
|
||||
"invoice_firm": "",
|
||||
"invoice_ico": "",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "Test 123",
|
||||
"invoice_city": "Jilemnice",
|
||||
"invoice_zip": "51401",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420787878787",
|
||||
"invoice_email": "test@test.com",
|
||||
"delivery_name": "Test",
|
||||
"delivery_surname": "Test",
|
||||
"delivery_firm": "",
|
||||
"delivery_street": "Test 123",
|
||||
"delivery_city": "Jilemnice",
|
||||
"delivery_zip": "51401",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Payment on delivery - PPL Czech Republic",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"172.42.0.1\",\"remote_port\":\"52870\",\"user_agent\":\"Mozilla\\/5.0 (X11; Linux x86_64; rv:104.0) Gecko\\/20100101 Firefox\\/104.0\",\"referer\":null,\"cart_id\":\"62f8a09a2f5111eda5920242ac2a000a\",\"client_id\":\"999823472.1662625917\",\"utm_source\":null,\"utm_medium\":null,\"utm_campaign\":null,\"discounts\":{\"email\":\"test@test.com\",\"gift\":{\"2\":{\"selected\":false}}},\"delivery_data\":{\"package_weight\":2,\"package_count\":1},\"payment_data\":[],\"mServerIndex\":0,\"conversion_sent\":1}",
|
||||
"flags": "D",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": "+420787878787",
|
||||
"pohoda_sync_date": null,
|
||||
"pohoda_id": null,
|
||||
"user_order_no": null,
|
||||
"total_weight": 0.715000
|
||||
},
|
||||
{
|
||||
"id": 58758,
|
||||
"order_no": "01000058747",
|
||||
"id_language": "en",
|
||||
"currency_rate": 1.00000000,
|
||||
"currency": "CZK",
|
||||
"id_user": null,
|
||||
"date_created": "2022-09-09 11:23:04",
|
||||
"date_accept": null,
|
||||
"date_handle": null,
|
||||
"date_updated": "2022-09-09 13:23:04",
|
||||
"date_due": null,
|
||||
"status": 0,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 3399.0000,
|
||||
"total_price_without_vat": 2809.0900,
|
||||
"invoice_name": "Test",
|
||||
"invoice_surname": "Test",
|
||||
"invoice_firm": "",
|
||||
"invoice_ico": "",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "Test 123",
|
||||
"invoice_city": "Jilemnice",
|
||||
"invoice_zip": "51401",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420787878787",
|
||||
"invoice_email": "test@test.com",
|
||||
"delivery_name": "Test",
|
||||
"delivery_surname": "Test",
|
||||
"delivery_firm": "",
|
||||
"delivery_street": "Test 123",
|
||||
"delivery_city": "Jilemnice",
|
||||
"delivery_zip": "51401",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Payment on delivery - PPL Czech Republic",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"172.42.0.1\",\"remote_port\":\"40101\",\"user_agent\":\"Mozilla\\/5.0 (X11; Linux x86_64; rv:104.0) Gecko\\/20100101 Firefox\\/104.0\",\"referer\":null,\"cart_id\":\"62f8a09a2f5111eda5920242ac2a000a\",\"client_id\":\"999823472.1662625917\",\"utm_source\":null,\"utm_medium\":null,\"utm_campaign\":null,\"discounts\":{\"email\":\"test@test.com\",\"gift\":{\"2\":{\"selected\":false}}},\"delivery_data\":{\"package_weight\":2,\"package_count\":1},\"payment_data\":[],\"mServerIndex\":1,\"conversion_sent\":1}",
|
||||
"flags": "D",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": "+420787878787",
|
||||
"pohoda_sync_date": null,
|
||||
"pohoda_id": null,
|
||||
"user_order_no": null,
|
||||
"total_weight": 0.715000
|
||||
}
|
||||
],
|
||||
"order_items": [
|
||||
{
|
||||
"id": 211068,
|
||||
"id_order": 58760,
|
||||
"id_product": 23432,
|
||||
"id_variation": 57949,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 1,
|
||||
"piece_price": 2809.0909,
|
||||
"total_price": 2809.0909,
|
||||
"descr": "ADIDAS ACE 17.1 FG W (Size: 40.2/3) (Code: S77044-40.2/3)",
|
||||
"tax": 21,
|
||||
"date": "2022-09-09 13:38:16",
|
||||
"note": "{\"contract\":\"FNSHP-VYB\",\"topSectionId\":[8]}",
|
||||
"discount": 0.0000,
|
||||
"pohoda_id": null
|
||||
},
|
||||
{
|
||||
"id": 211066,
|
||||
"id_order": 58758,
|
||||
"id_product": 24344,
|
||||
"id_variation": 60196,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 1,
|
||||
"piece_price": 2809.0909,
|
||||
"total_price": 2809.0909,
|
||||
"descr": "ADIDAS ACE 16.1 PRIMEKNIT (Size: 41.1/3) (Code: S76470-41.1/3)",
|
||||
"tax": 21,
|
||||
"date": "2022-09-09 13:23:04",
|
||||
"note": "{\"contract\":\"FNSHP-VYB\",\"topSectionId\":[8]}",
|
||||
"discount": 0.0000,
|
||||
"pohoda_id": null
|
||||
}
|
||||
],
|
||||
"stores_items": [
|
||||
{
|
||||
"id": 28404,
|
||||
"id_store": 13,
|
||||
"id_product": 23432,
|
||||
"id_variation": 57949,
|
||||
"quantity": 1,
|
||||
"min_quantity": null,
|
||||
"integrity_unique": "13-23432-57949"
|
||||
},
|
||||
{
|
||||
"id": 28172,
|
||||
"id_store": 20,
|
||||
"id_product": 24344,
|
||||
"id_variation": 60196,
|
||||
"quantity": 1,
|
||||
"min_quantity": null,
|
||||
"integrity_unique": "13-24344-60196"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\MultipleServers;
|
||||
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
use KupShop\PohodaBundle\Tests\TestUtilHelper;
|
||||
use KupShop\PohodaBundle\Utils\PohodaConnector;
|
||||
use KupShop\PohodaBundle\Utils\Tools\PohodaProductHelper;
|
||||
|
||||
class MultipleServersTest extends \DatabaseTestCase
|
||||
{
|
||||
use TestUtilHelper;
|
||||
|
||||
/** @var PohodaConnector */
|
||||
private $pohodaConnector;
|
||||
|
||||
/** @var PohodaProductHelper */
|
||||
private $pohodaProductHelper;
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$this->prepareMServer();
|
||||
|
||||
$this->pohodaConnector = ServiceContainer::getService(PohodaConnector::class);
|
||||
$this->pohodaProductHelper = ServiceContainer::getService(PohodaProductHelper::class);
|
||||
}
|
||||
|
||||
public function testConnectorExecutions()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$iterations = 0;
|
||||
$this->pohodaConnector->executeConnections(function () use (&$iterations) {
|
||||
$iterations++;
|
||||
});
|
||||
$this->assertEquals(1, $iterations);
|
||||
|
||||
$this->prepareMServer('Test', '123456', '0123456789', 'http://test:4052/xml');
|
||||
|
||||
$iterations = 0;
|
||||
$expectedNames = ['Admin', 'Test'];
|
||||
$this->pohodaConnector->executeConnections(function () use (&$iterations, $expectedNames) {
|
||||
$this->assertEquals($expectedNames[$this->pohodaConnector->getCurrentKey()], $this->pohodaConnector->getCurrent()['username']);
|
||||
$iterations++;
|
||||
});
|
||||
$this->assertEquals(2, $iterations);
|
||||
|
||||
// Default check
|
||||
$this->assertEquals(0, $this->pohodaConnector->getDefaultKey());
|
||||
$this->assertEquals('Admin', $this->pohodaConnector->getDefault()['username']);
|
||||
|
||||
// Active connection check
|
||||
$this->pohodaConnector->setActiveConfigById(1);
|
||||
$this->assertEquals('Test', $this->pohodaConnector->getCurrent()['username']);
|
||||
$this->pohodaConnector->setActiveConfigById(0);
|
||||
$this->assertEquals('Admin', $this->pohodaConnector->getCurrent()['username']);
|
||||
}
|
||||
|
||||
public function testProductHelper()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
// mServer 0.
|
||||
$order = new \Order();
|
||||
$order->createFromDB(58760);
|
||||
$order->fetchItems();
|
||||
$this->assertEquals(0, $this->pohodaProductHelper->findMServerIndexByPurchaseState($order->getPurchaseState()));
|
||||
|
||||
$this->prepareMServer('Test', '123456', '0123456789', 'http://test:4052/xml');
|
||||
|
||||
// mServer 1.
|
||||
$orderX = new \Order();
|
||||
$orderX->createFromDB(58758);
|
||||
$orderX->fetchItems();
|
||||
$this->assertEquals(1, $this->pohodaProductHelper->findMServerIndexByPurchaseState($orderX->getPurchaseState()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
{
|
||||
"delivery_type_delivery": [
|
||||
{
|
||||
"id": 25,
|
||||
"position": 0,
|
||||
"currency": "CZK",
|
||||
"name": "Česká pošta - Balík Do balíkovny",
|
||||
"price": 40.4959,
|
||||
"photo": "p25.png",
|
||||
"class": "Balikovna",
|
||||
"time_days": 2,
|
||||
"time_hours": "13:00:00",
|
||||
"description": "<p>Způsob dopravy: Česká pošta - balík do balíkovny</p>",
|
||||
"price_registered": null,
|
||||
"price_dont_countin_from": null,
|
||||
"price_dont_countin_from_reg": null,
|
||||
"currencies": null,
|
||||
"cart_description": null,
|
||||
"data": "{\"pohoda_delivery\":\"CPNB\",\"restrictions\":{\"enabled\":\"N\",\"countries\":[\"CZ\"]}}"
|
||||
}
|
||||
],
|
||||
"delivery_type_payment": [
|
||||
{
|
||||
"id": 1,
|
||||
"position": 0,
|
||||
"currency": "CZK",
|
||||
"name": "Dobírka",
|
||||
"price": 28.9260,
|
||||
"class": "Dobirka",
|
||||
"photo": "p1.png",
|
||||
"description": "<p>Výše dobírky: <strong>{ZAPLATIT}</strong></p>",
|
||||
"data": "{\"pohoda_payment\":\"Dob\\u00edrkou\"}",
|
||||
"cart_description": null
|
||||
}
|
||||
],
|
||||
"delivery_type": [
|
||||
{
|
||||
"id": 43,
|
||||
"currency": "CZK",
|
||||
"id_delivery": 25,
|
||||
"id_payment": 1,
|
||||
"price": null,
|
||||
"vat": 1,
|
||||
"price_dont_countin_from": 1800.0000,
|
||||
"format": null,
|
||||
"figure": "Y",
|
||||
"description": null,
|
||||
"payment_class": null,
|
||||
"price_dont_countin_from_reg": 999.0000,
|
||||
"data": null
|
||||
}
|
||||
],
|
||||
"orders": [
|
||||
{
|
||||
"id": 207055,
|
||||
"order_no": "B21207055",
|
||||
"id_language": "cs",
|
||||
"currency": "CZK",
|
||||
"currency_rate": 1.00000000,
|
||||
"id_user": null,
|
||||
"date_created": "2021-05-13 17:26:58",
|
||||
"date_accept": "2021-05-13 17:28:15",
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-05-13 17:28:15",
|
||||
"date_due": null,
|
||||
"status": 1,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 734.0000,
|
||||
"invoice_name": "Zdeněk",
|
||||
"invoice_surname": "Adamec",
|
||||
"invoice_firm": "",
|
||||
"invoice_ico": "",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "test 123",
|
||||
"invoice_city": "Vrchlabí",
|
||||
"invoice_zip": "54301",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420123456789",
|
||||
"invoice_email": "adamec@wpj.cz",
|
||||
"delivery_name": "Zdeněk",
|
||||
"delivery_surname": "Adamec",
|
||||
"delivery_firm": "",
|
||||
"delivery_street": "BALÍKOVNA",
|
||||
"delivery_city": "Vrchlabí 1",
|
||||
"delivery_zip": "54301",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Dobírka - Česká pošta - Balík Do balíkovny",
|
||||
"id_delivery": 43,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"89.190.72.98\",\"remote_port\":\"38545\",\"user_agent\":\"Mozilla\\/5.0 (X11; Linux x86_64; rv:84.0) Gecko\\/20100101 Firefox\\/84.0\",\"referer\":null,\"delivery_data\":{\"zip\":\"54301\"},\"discounts\":{\"email\":\"adamec@wpj.cz\"},\"conversion_sent\":1}",
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": "",
|
||||
"pohoda_sync_date": "2021-05-13 17:28:15",
|
||||
"pohoda_id": "223342"
|
||||
},
|
||||
{
|
||||
"id": 207056,
|
||||
"order_no": "021207056",
|
||||
"id_language": "cs",
|
||||
"currency": "CZK",
|
||||
"currency_rate": 1.00000000,
|
||||
"id_user": null,
|
||||
"date_created": "2021-05-21 08:45:39",
|
||||
"date_accept": null,
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-05-21 06:45:40",
|
||||
"date_due": null,
|
||||
"status": 0,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 950.0000,
|
||||
"invoice_name": "Zdeněk",
|
||||
"invoice_surname": "Aaa",
|
||||
"invoice_firm": "",
|
||||
"invoice_ico": "",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "",
|
||||
"invoice_city": "",
|
||||
"invoice_zip": "",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420123456789",
|
||||
"invoice_email": "test@wpj.cz",
|
||||
"delivery_name": "Zdeněk",
|
||||
"delivery_surname": "Aaa",
|
||||
"delivery_firm": "",
|
||||
"delivery_street": "",
|
||||
"delivery_city": "",
|
||||
"delivery_zip": "",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Hotově - Osobní odběr Zlín",
|
||||
"id_delivery": 43,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"172.42.0.1\",\"remote_port\":\"46528\",\"user_agent\":\"Mozilla\\/5.0 (X11; Linux x86_64; rv:84.0) Gecko\\/20100101 Firefox\\/84.0\",\"referer\":null,\"discounts\":{\"email\":\"test@wpj.cz\"},\"conversion_sent\":1}",
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": "+420123456789",
|
||||
"pohoda_sync_date": null,
|
||||
"pohoda_id": "22335000"
|
||||
}
|
||||
],
|
||||
"producers":[
|
||||
{
|
||||
"id": 57,
|
||||
"name": "K A M A spol. s r.o.",
|
||||
"photo": "",
|
||||
"web": "",
|
||||
"active": "Y",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": null,
|
||||
"orderby": "title",
|
||||
"orderdir": "ASC",
|
||||
"filter_url": "k-a-m-a-spol-s-r-o_",
|
||||
"title": null,
|
||||
"data": null
|
||||
}
|
||||
],
|
||||
"products": [
|
||||
{
|
||||
"id": 4731,
|
||||
"title": "Běžecká čepice KAMA A87 Černá",
|
||||
"code": "3-00404-CERNA",
|
||||
"ean": 8591006068931,
|
||||
"short_descr": "Hřejivý a slušivý kousek kvalitní vlny od české značky KAMA vás udrží v teple za každého počasí. Ovčí vlna Merino vás překvapí svou hebkostí a schopností regulovat teplotu, díky tomu bude příjemně hřát i když bude mokrá. Účinně absorbuje vlhkost, kterou následně odpaří do ovzduší a proto se budete cítit vždy komfortně. Jemné barevné tóny a krásné norské vzory okouzlí opravdu každého a hned se do nich zamilujete.",
|
||||
"long_descr": "<p><strong>KAMA je česká rodinná firma</strong>, která úspěšně<strong> působí na trhu již 30 let</strong>. Za dobu svého působení pracuje s <strong>nejkvalitnější vlněnou přízí</strong> značky <strong>SCHOELLER</strong>, která je vyráběna s ohledem na <strong>zdraví člověka</strong> a <strong>šetrnosti k přírodě</strong>. Jejich pletené výrobky <strong>jsou krásným dílem přírodního materiálu</strong>, kterým je kvalitní ovčí vlna a <strong>moderních vláken</strong>. Pletené <strong>svetry</strong>, <strong>čepice</strong>,<strong> rukavice</strong> a <strong>deky</strong> jsou jejich hlavním sortimentem. </p>",
|
||||
"parameters": "",
|
||||
"price": 650.0000,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"discount": 0.00000000,
|
||||
"producer": 57,
|
||||
"guarantee": 0,
|
||||
"in_store": 199,
|
||||
"pieces_sold": 18,
|
||||
"delivery_time": 0,
|
||||
"campaign": "",
|
||||
"updated": "2021-05-13 15:26:58",
|
||||
"date_added": "2018-09-17 12:57:31",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": null,
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"data": "{\"generate_coupon\":\"N\"}",
|
||||
"weight": null,
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null,
|
||||
"pohoda_sync_date": "2021-05-13 16:19:38"
|
||||
}
|
||||
],
|
||||
"products_variations": [
|
||||
{
|
||||
"id": 8967,
|
||||
"id_product": 4731,
|
||||
"code": "3-00404-14-L",
|
||||
"ean": 8591006068948,
|
||||
"title": "Velikost oblečení: L",
|
||||
"in_store": 99,
|
||||
"delivery_time": 0,
|
||||
"price": 537.1901,
|
||||
"figure": "Y",
|
||||
"updated": "2021-05-13 15:26:58",
|
||||
"date_added": "2021-05-13 15:26:58",
|
||||
"weight": null,
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null,
|
||||
"data": null,
|
||||
"price_common": null,
|
||||
"pohoda_sync_date": "2021-05-13 16:19:38"
|
||||
}
|
||||
],
|
||||
"order_items": [
|
||||
{
|
||||
"id": 584790,
|
||||
"id_order": 207055,
|
||||
"id_product": 4731,
|
||||
"id_variation": 8967,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 1,
|
||||
"piece_price": 537.1901,
|
||||
"total_price": 537.1901,
|
||||
"descr": "Běžecká čepice KAMA A87 Černá (Velikost oblečení: L) (Kód: 3-00404-CERNA)",
|
||||
"tax": 21,
|
||||
"date": "2021-05-13 15:26:58",
|
||||
"note": "{\"stores\":{\"Prodejna\":\"0\",\"Eshop\":\"100\"}}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 584791,
|
||||
"id_order": 207055,
|
||||
"id_product": null,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 69.4215,
|
||||
"total_price": 69.4215,
|
||||
"descr": "Dobírka - Česká pošta - Balík Do balíkovny",
|
||||
"tax": 21,
|
||||
"date": "2021-05-13 15:26:58",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
}
|
||||
],
|
||||
"order_items": [
|
||||
{
|
||||
"id": 584790,
|
||||
"id_order": 207056,
|
||||
"id_product": 4731,
|
||||
"id_variation": 8967,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 1,
|
||||
"piece_price": 537.1901,
|
||||
"total_price": 537.1901,
|
||||
"descr": "Běžecká čepice KAMA A87 Černá (Velikost oblečení: L) (Kód: 3-00404-CERNA)",
|
||||
"tax": 21,
|
||||
"date": "2021-05-13 15:26:58",
|
||||
"note": "{\"stores\":{\"Prodejna\":\"0\",\"Eshop\":\"100\"}}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 584791,
|
||||
"id_order": 207056,
|
||||
"id_product": null,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 69.4215,
|
||||
"total_price": 69.4215,
|
||||
"descr": "Dobírka - Česká pošta - Balík Do balíkovny",
|
||||
"tax": 21,
|
||||
"date": "2021-05-13 15:26:58",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\Orders\Delete;
|
||||
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
use KupShop\PohodaBundle\Utils\Exporters\OrdersDeleter;
|
||||
use KupShop\PohodaBundle\Utils\PohodaConnector;
|
||||
use KupShop\PohodaBundle\Utils\Tools\TransformHelper;
|
||||
use Query\Operator;
|
||||
|
||||
class DeleteOrderTest extends \DatabaseTestCase
|
||||
{
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
protected $PohodaConnector;
|
||||
/**
|
||||
* @var TransformHelper
|
||||
*/
|
||||
protected $transformHelper;
|
||||
|
||||
/**
|
||||
* @var OrdersDeleter
|
||||
*/
|
||||
protected $ordersDeleter;
|
||||
|
||||
protected $requestTemplate = 'requests/ordersDel.tpl';
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$dbcfg = \Settings::getDefault();
|
||||
$dbcfg->saveValue('pohoda', []);
|
||||
$dbcfg->updateValue('pohoda', [
|
||||
'mservers' => [
|
||||
0 => [
|
||||
'active' => 'N',
|
||||
'url' => 'http://pohoda.atpt.cz:4052/xml',
|
||||
'username' => 'Admin',
|
||||
'password' => '',
|
||||
'ico' => '0123456789',
|
||||
'maintenanceFrom' => '',
|
||||
'maintenanceTo' => '',
|
||||
'productsIn' => [
|
||||
'last_sync' => '13.5.2021 16:12:59',
|
||||
'internet' => 'N', ],
|
||||
'ordersOut' => [
|
||||
'last_sync' => '13.5.2021 17:28:09',
|
||||
'last_sync_diff' => '', ],
|
||||
'issuedInvoiceIn' => [
|
||||
'last_sync' => '',
|
||||
'last_sync_diff' => '', ],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
$this->ordersDeleter = $this->get(OrdersDeleter::class);
|
||||
$this->PohodaConnector = ServiceContainer::getService(PohodaConnector::class);
|
||||
$this->transformHelper = $this->get(TransformHelper::class);
|
||||
}
|
||||
|
||||
public function testRequestOrder()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
$this->ordersDeleter->setIDs(['207055', '207056']);
|
||||
|
||||
$orders = $this->ordersDeleter->getData();
|
||||
if ($orders) {
|
||||
$request = $this->PohodaConnector->getRequestContent($this->requestTemplate, ['orders' => $orders]);
|
||||
$request = $this->ordersDeleter->replace($request);
|
||||
$this->assertEquals(file_get_contents(__DIR__.'/requestOrders.xml'), $request);
|
||||
}
|
||||
}
|
||||
|
||||
public function testDeleteOrder()
|
||||
{
|
||||
$mock = $this->getMockBuilder(PohodaConnector::class)
|
||||
->setMethods(['sendRequest'])
|
||||
->getMock();
|
||||
|
||||
$mock->method('sendRequest')
|
||||
->willReturn(file_get_contents(__DIR__.'/responseOrders.xml'));
|
||||
$mock->method('setActiveConfigById')
|
||||
->willReturn(true);
|
||||
$this->set(PohodaConnector::class, $mock);
|
||||
$this->PohodaConnector = $this->get(PohodaConnector::class);
|
||||
|
||||
$this->setEnvironment();
|
||||
$this->ordersDeleter->setIDs(['207055', '207056']);
|
||||
$this->ordersDeleter->processData();
|
||||
|
||||
$qb = sqlQueryBuilder()
|
||||
->select('order_no, pohoda_sync_date, pohoda_id ')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['id' => '207055']))
|
||||
->execute()
|
||||
->fetch();
|
||||
$this->assertEquals('B21207055', $qb['order_no']);
|
||||
$this->assertEquals(null, $qb['pohoda_sync_date']);
|
||||
$this->assertEquals(null, $qb['pohoda_id']);
|
||||
|
||||
$qb = sqlQueryBuilder()
|
||||
->select('order_no, pohoda_sync_date, pohoda_id ')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['id' => '207056']))
|
||||
->execute()
|
||||
->fetch();
|
||||
$this->assertEquals('021207056', $qb['order_no']);
|
||||
$this->assertEquals(null, $qb['pohoda_id']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<dat:dataPack id="obj001" ico="0123456789" application="KupShop" version="2.0" note="Smazání přijaté objednavky"
|
||||
xmlns:dat="http://www.stormware.cz/schema/version_2/data.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd"
|
||||
xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd">
|
||||
<dat:dataPackItem id="207055" version="2.0">
|
||||
<ord:order version="2.0">
|
||||
<ord:actionType>
|
||||
<ord:delete>
|
||||
<!--filtr pro vyhledani zaznamu-->
|
||||
<ftr:filter agenda="prijate_objednavky">
|
||||
<ftr:id>223342</ftr:id>
|
||||
</ftr:filter>
|
||||
</ord:delete>
|
||||
</ord:actionType>
|
||||
</ord:order>
|
||||
</dat:dataPackItem>
|
||||
<dat:dataPackItem id="207056" version="2.0">
|
||||
<ord:order version="2.0">
|
||||
<ord:actionType>
|
||||
<ord:delete>
|
||||
<!--filtr pro vyhledani zaznamu-->
|
||||
<ftr:filter agenda="prijate_objednavky">
|
||||
<ftr:id>22335000</ftr:id>
|
||||
</ftr:filter>
|
||||
</ord:delete>
|
||||
</ord:actionType>
|
||||
</ord:order>
|
||||
</dat:dataPackItem>
|
||||
</dat:dataPack>
|
||||
@@ -0,0 +1,85 @@
|
||||
<rsp:responsePack version="2.0" id="obj001" state="ok" programVersion="12707.7 SQL (22.3.2021)" ico="0123456789"
|
||||
key="e71cb91a-d0c0-4417-a08a-60ad172d559e" note="Smaz<61>n<EFBFBD> p<>ijat<61> objednavky"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd"
|
||||
xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd"
|
||||
xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd"
|
||||
xmlns:lCen="http://www.stormware.cz/schema/version_2/list_centre.xsd"
|
||||
xmlns:lAcv="http://www.stormware.cz/schema/version_2/list_activity.xsd"
|
||||
xmlns:acu="http://www.stormware.cz/schema/version_2/accountingunit.xsd"
|
||||
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
|
||||
xmlns:vch="http://www.stormware.cz/schema/version_2/voucher.xsd"
|
||||
xmlns:int="http://www.stormware.cz/schema/version_2/intDoc.xsd"
|
||||
xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd"
|
||||
xmlns:ofr="http://www.stormware.cz/schema/version_2/offer.xsd"
|
||||
xmlns:enq="http://www.stormware.cz/schema/version_2/enquiry.xsd"
|
||||
xmlns:vyd="http://www.stormware.cz/schema/version_2/vydejka.xsd"
|
||||
xmlns:pri="http://www.stormware.cz/schema/version_2/prijemka.xsd"
|
||||
xmlns:bal="http://www.stormware.cz/schema/version_2/balance.xsd"
|
||||
xmlns:pre="http://www.stormware.cz/schema/version_2/prevodka.xsd"
|
||||
xmlns:vyr="http://www.stormware.cz/schema/version_2/vyroba.xsd"
|
||||
xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd"
|
||||
xmlns:con="http://www.stormware.cz/schema/version_2/contract.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd"
|
||||
xmlns:prm="http://www.stormware.cz/schema/version_2/parameter.xsd"
|
||||
xmlns:lCon="http://www.stormware.cz/schema/version_2/list_contract.xsd"
|
||||
xmlns:ctg="http://www.stormware.cz/schema/version_2/category.xsd"
|
||||
xmlns:ipm="http://www.stormware.cz/schema/version_2/intParam.xsd"
|
||||
xmlns:str="http://www.stormware.cz/schema/version_2/storage.xsd"
|
||||
xmlns:idp="http://www.stormware.cz/schema/version_2/individualPrice.xsd"
|
||||
xmlns:sup="http://www.stormware.cz/schema/version_2/supplier.xsd"
|
||||
xmlns:prn="http://www.stormware.cz/schema/version_2/print.xsd"
|
||||
xmlns:isd="http://www.stormware.cz/schema/version_2/isdoc.xsd"
|
||||
xmlns:sEET="http://www.stormware.cz/schema/version_2/sendEET.xsd"
|
||||
xmlns:act="http://www.stormware.cz/schema/version_2/accountancy.xsd"
|
||||
xmlns:bnk="http://www.stormware.cz/schema/version_2/bank.xsd"
|
||||
xmlns:sto="http://www.stormware.cz/schema/version_2/store.xsd"
|
||||
xmlns:grs="http://www.stormware.cz/schema/version_2/groupStocks.xsd"
|
||||
xmlns:acp="http://www.stormware.cz/schema/version_2/actionPrice.xsd"
|
||||
xmlns:csh="http://www.stormware.cz/schema/version_2/cashRegister.xsd"
|
||||
xmlns:bka="http://www.stormware.cz/schema/version_2/bankAccount.xsd"
|
||||
xmlns:ilt="http://www.stormware.cz/schema/version_2/inventoryLists.xsd"
|
||||
xmlns:nms="http://www.stormware.cz/schema/version_2/numericalSeries.xsd"
|
||||
xmlns:pay="http://www.stormware.cz/schema/version_2/payment.xsd"
|
||||
xmlns:mKasa="http://www.stormware.cz/schema/version_2/mKasa.xsd"
|
||||
xmlns:gdp="http://www.stormware.cz/schema/version_2/GDPR.xsd"
|
||||
xmlns:est="http://www.stormware.cz/schema/version_2/establishment.xsd"
|
||||
xmlns:cen="http://www.stormware.cz/schema/version_2/centre.xsd"
|
||||
xmlns:acv="http://www.stormware.cz/schema/version_2/activity.xsd"
|
||||
xmlns:afp="http://www.stormware.cz/schema/version_2/accountingFormOfPayment.xsd"
|
||||
xmlns:vat="http://www.stormware.cz/schema/version_2/classificationVAT.xsd"
|
||||
xmlns:rgn="http://www.stormware.cz/schema/version_2/registrationNumber.xsd"
|
||||
xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd"
|
||||
xmlns:asv="http://www.stormware.cz/schema/version_2/accountingSalesVouchers.xsd"
|
||||
xmlns:arch="http://www.stormware.cz/schema/version_2/archive.xsd"
|
||||
xmlns:req="http://www.stormware.cz/schema/version_2/productRequirement.xsd"
|
||||
xmlns:mov="http://www.stormware.cz/schema/version_2/movement.xsd">
|
||||
<rsp:responsePackItem version="2.0" id="207055" state="ok">
|
||||
<ord:orderResponse version="2.0" state="ok">
|
||||
<rdc:producedDetails>
|
||||
<rdc:id>223342</rdc:id>
|
||||
<rdc:number>B21207055</rdc:number>
|
||||
<rdc:actionType>delete</rdc:actionType>
|
||||
</rdc:producedDetails>
|
||||
</ord:orderResponse>
|
||||
</rsp:responsePackItem>
|
||||
<rsp:responsePackItem version="2.0" id="207056" state="ok">
|
||||
<ord:orderResponse version="2.0" state="error">
|
||||
<rdc:importDetails>
|
||||
<rdc:detail>
|
||||
<rdc:state>error</rdc:state>
|
||||
<rdc:errno>115</rdc:errno>
|
||||
<rdc:note>Zadan<EFBFBD> z<>znam se nepoda<64>ilo naj<61>t.</rdc:note>
|
||||
<rdc:XPath>/dat:dataPack/dat:dataPackItem[2]/ord:order[1]/ord:actionType/ord:delete</rdc:XPath>
|
||||
</rdc:detail>
|
||||
</rdc:importDetails>
|
||||
<rdc:producedDetails>
|
||||
<rdc:id>0</rdc:id>
|
||||
<rdc:actionType>delete</rdc:actionType>
|
||||
</rdc:producedDetails>
|
||||
</ord:orderResponse>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>
|
||||
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"users": [
|
||||
{
|
||||
"id": 71864,
|
||||
"id_language": null,
|
||||
"passw": "$2y$10$3I9OjX8G/RaBaBjUvhdkLOigVLSyJyeOMJ/RrEAWaAAgLOQ0qBFhy",
|
||||
"user_key": "",
|
||||
"figure": "Y",
|
||||
"name": "Petr",
|
||||
"surname": "Kukač",
|
||||
"firm": "",
|
||||
"street": "Tvrdého 642",
|
||||
"city": "Praha",
|
||||
"zip": "19900",
|
||||
"country": "",
|
||||
"currency": "CZK",
|
||||
"email": "petr.k@hanibal.cz",
|
||||
"ico": "",
|
||||
"dic": "",
|
||||
"phone": "123456789",
|
||||
"mobile": "",
|
||||
"fax": "",
|
||||
"gender": null,
|
||||
"delivery_name": "",
|
||||
"delivery_surname": "",
|
||||
"delivery_firm": "",
|
||||
"delivery_street": "",
|
||||
"delivery_city": "",
|
||||
"delivery_zip": "",
|
||||
"delivery_country": "",
|
||||
"account_no": "",
|
||||
"account_bank": "",
|
||||
"account_symbol": "",
|
||||
"get_news": "N",
|
||||
"prefer_transport": null,
|
||||
"date_reg": "2019-01-17 16:19:58",
|
||||
"date_logged": null,
|
||||
"custom_address": "",
|
||||
"state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"date_subscribe": null,
|
||||
"date_unsubscribe": null,
|
||||
"note": null,
|
||||
"custom_data": null,
|
||||
"delivery_phone": "",
|
||||
"pohoda_id": 59319,
|
||||
"pohoda_sync_date": null,
|
||||
"pohoda_id_address": 42651
|
||||
}
|
||||
],
|
||||
"orders": [
|
||||
{
|
||||
"id": 97097,
|
||||
"order_no": "WEB110010",
|
||||
"id_language": "cs",
|
||||
"currency_rate": 26.1400,
|
||||
"currency": "EUR",
|
||||
"id_user": 71864,
|
||||
"date_created": "2020-08-17 00:00:00",
|
||||
"date_accept": null,
|
||||
"date_handle": null,
|
||||
"date_due": null,
|
||||
"status": 0,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 116.6800,
|
||||
"invoice_name": "Petr",
|
||||
"invoice_surname": "Kukač",
|
||||
"invoice_firm": "Petr Kukač",
|
||||
"invoice_ico": "",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "Tvrdého 642",
|
||||
"invoice_city": "Praha",
|
||||
"invoice_zip": "13000",
|
||||
"invoice_country": "SK",
|
||||
"invoice_phone": "+420123456789",
|
||||
"invoice_email": "petr.k@hanibal.cz",
|
||||
"delivery_name": "Petr",
|
||||
"delivery_surname": "Kukač",
|
||||
"delivery_firm": "Petr Kukač",
|
||||
"delivery_street": "Tvrdého 642",
|
||||
"delivery_city": "",
|
||||
"delivery_zip": "13000",
|
||||
"delivery_country": "SK",
|
||||
"delivery_type": "",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "N",
|
||||
"note_user": null,
|
||||
"note_admin": null,
|
||||
"flags": "",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_phone": "",
|
||||
"pohoda_sync_date": "2020-08-18 10:40:26",
|
||||
"pohoda_id": 284250
|
||||
}
|
||||
],
|
||||
"order_items": [
|
||||
{
|
||||
"id": 3140318,
|
||||
"id_order": 97097,
|
||||
"id_product": null,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 75.5700,
|
||||
"total_price": 91.4400,
|
||||
"descr": "Tilak vesta Tourmalet Lady ::ebony grey::M",
|
||||
"tax": 21,
|
||||
"date": "2020-08-18 10:40:51",
|
||||
"note": "",
|
||||
"discount": 0.0000,
|
||||
"pohoda_id": 698744
|
||||
},
|
||||
{
|
||||
"id": 3140319,
|
||||
"id_order": 97097,
|
||||
"id_product": null,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 4.1200,
|
||||
"total_price": 4.9900,
|
||||
"descr": "Doprava GLS SK",
|
||||
"tax": 21,
|
||||
"date": "2020-08-18 10:40:55",
|
||||
"note": "",
|
||||
"discount": 0.0000,
|
||||
"pohoda_id": 698745
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\Orders\Import;
|
||||
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
use KupShop\PohodaBundle\Tests\TestUtilHelper;
|
||||
use KupShop\PohodaBundle\Utils\PohodaConnector;
|
||||
use KupShop\PohodaBundle\Utils\Tools\PohodaOrderImporter;
|
||||
use KupShop\PohodaBundle\Utils\Tools\TransformHelper;
|
||||
use Query\Operator;
|
||||
|
||||
class ImportOrderTest extends \DatabaseTestCase
|
||||
{
|
||||
use TestUtilHelper;
|
||||
/** @var PohodaConnector */
|
||||
private $pohodaConnector;
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* @var TransformHelper
|
||||
*/
|
||||
protected $transformHelper;
|
||||
|
||||
/**
|
||||
* @var PohodaOrderImporter
|
||||
*/
|
||||
protected $pohodaOrderImporter;
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
\Settings::getDefault()->saveValue('pohoda', []);
|
||||
|
||||
$this->pohodaConnector = ServiceContainer::getService(PohodaConnector::class);
|
||||
$this->pohodaOrderImporter = $this->get(PohodaOrderImporter::class);
|
||||
$this->transformHelper = $this->get(TransformHelper::class);
|
||||
$this->prepareMServer();
|
||||
}
|
||||
|
||||
public function testTransformOrdersIn()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
$xmlResponse = file_get_contents(__DIR__.'/ordersInResponse.xml');
|
||||
$transformedXML = $this->transformHelper->baseTransform($xmlResponse, $this->transformHelper->loadXslt('ordersIn.xsl'));
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/ordersInResult.xml', $transformedXML);
|
||||
}
|
||||
|
||||
public function testImportInsertOrder()
|
||||
{
|
||||
$instance = $this->autowire(ImportOrderMock::class);
|
||||
$this->set(PohodaOrderImporter::class, $instance);
|
||||
|
||||
$this->setEnvironment();
|
||||
$this->pohodaConnector->reloadConfig();
|
||||
$this->pohodaOrderImporter->resetResolveCounter();
|
||||
|
||||
$xml = file_get_contents(__DIR__.'/ordersInResult.xml');
|
||||
$this->pohodaOrderImporter->importOrders($xml, true);
|
||||
|
||||
// ORDER
|
||||
$qb = sqlQueryBuilder()
|
||||
->select('invoice_email, pohoda_id, package_id')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['order_no' => 'WEB110011']))
|
||||
->execute()
|
||||
->fetch();
|
||||
|
||||
$this->assertEquals('petr.k@hanibal.cz', $qb['invoice_email']);
|
||||
$this->assertEquals('0_284251', $qb['pohoda_id']);
|
||||
$this->assertEquals(null, $qb['package_id']);
|
||||
|
||||
// ORDER_ITEM
|
||||
$qb_item = sqlQueryBuilder()
|
||||
->select('tax, descr')
|
||||
->from('order_items')
|
||||
->andWhere('pohoda_id=698746')
|
||||
->execute()
|
||||
->fetch();
|
||||
$this->assertEquals(2, $this->pohodaOrderImporter->getResolveCounter());
|
||||
$this->assertEquals(15, $qb_item['tax']);
|
||||
$this->assertEquals('Chimpanzee tyčinka Energy ::citron::-', $qb_item['descr']);
|
||||
}
|
||||
|
||||
public function testImportUpdateOrder()
|
||||
{
|
||||
$instance = $this->autowire(ImportOrderMock::class);
|
||||
$this->set(PohodaOrderImporter::class, $instance);
|
||||
|
||||
$this->setEnvironment();
|
||||
$this->pohodaConnector->reloadConfig();
|
||||
|
||||
$this->pohodaOrderImporter->resetResolveCounter();
|
||||
|
||||
// BEFORE UPDATE ORDER
|
||||
$beforeOrder = sqlQueryBuilder()
|
||||
->select('invoice_name, invoice_surname, pohoda_id, package_id')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['order_no' => 'WEB110010']))
|
||||
->execute()
|
||||
->fetch();
|
||||
$this->assertEquals('Petr', $beforeOrder['invoice_name']);
|
||||
$this->assertEquals('Kukač', $beforeOrder['invoice_surname']);
|
||||
$this->assertEquals('284250', $beforeOrder['pohoda_id']);
|
||||
$this->assertEquals(null, $beforeOrder['package_id']);
|
||||
|
||||
// BEFORE UPDATE ITEM
|
||||
$beforeItem = sqlQueryBuilder()
|
||||
->select('descr, pieces')
|
||||
->from('order_items')
|
||||
->andWhere(Operator::equals(['pohoda_id' => 698744]))
|
||||
->execute()
|
||||
->fetch();
|
||||
$this->assertEquals('Tilak vesta Tourmalet Lady ::ebony grey::M', $beforeItem['descr']);
|
||||
$this->assertEquals(1, $beforeItem['pieces']);
|
||||
|
||||
// LOAD CHANGES AND UPDATE
|
||||
$xml = file_get_contents(__DIR__.'/ordersInResultChange.xml');
|
||||
$this->pohodaOrderImporter->importOrders($xml, true);
|
||||
|
||||
// AFTER UPDATE ORDER
|
||||
$afterOrder = sqlQueryBuilder()
|
||||
->select('invoice_name, invoice_surname, pohoda_id, package_id')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['order_no' => 'WEB110010']))
|
||||
->execute()
|
||||
->fetch();
|
||||
$this->assertEquals(2, $this->pohodaOrderImporter->getResolveCounter());
|
||||
$this->assertEquals('Petr TEST', $afterOrder['invoice_name']);
|
||||
$this->assertEquals('Kukač TEST', $afterOrder['invoice_surname']);
|
||||
$this->assertEquals('0_284250', $afterOrder['pohoda_id']);
|
||||
$this->assertEquals('B123456', $afterOrder['package_id']);
|
||||
|
||||
// LOAD CHANGES AND UPDATE
|
||||
$xml = file_get_contents(__DIR__.'/ordersInResultChange2.xml');
|
||||
$this->pohodaOrderImporter->importOrders($xml, true);
|
||||
|
||||
// AFTER UPDATE ORDER
|
||||
$afterOrder = sqlQueryBuilder()
|
||||
->select('invoice_name, invoice_surname, pohoda_id, package_id')
|
||||
->from('orders')
|
||||
->andWhere(Operator::equals(['order_no' => 'WEB110010']))
|
||||
->execute()
|
||||
->fetch();
|
||||
// in ordersInResultChange2.xml is different package id - don't update it on order
|
||||
$this->assertEquals('B123456', $afterOrder['package_id']);
|
||||
}
|
||||
|
||||
public function testDeleteOrderItem()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$before = sqlQueryBuilder()
|
||||
->select('id_order')
|
||||
->from('order_items')
|
||||
->andWhere(Operator::equals(['pohoda_id' => 698745]))
|
||||
->execute()
|
||||
->fetchColumn();
|
||||
|
||||
$this->assertEquals(97097, $before);
|
||||
|
||||
$xml = file_get_contents(__DIR__.'/ordersInDeleteItem.xml');
|
||||
$this->pohodaOrderImporter->importOrders($xml, true);
|
||||
|
||||
$after = sqlQueryBuilder()
|
||||
->select('id')
|
||||
->from('order_items')
|
||||
->andWhere(Operator::equals(['pohoda_id' => 698745]))
|
||||
->execute()
|
||||
->fetchColumn();
|
||||
|
||||
$this->assertEquals(null, $after);
|
||||
}
|
||||
}
|
||||
|
||||
class ImportOrderMock extends PohodaOrderImporter
|
||||
{
|
||||
/** @var int|null */
|
||||
private $resolveCounter;
|
||||
|
||||
public function resetResolveCounter(int $resolveCounter = 0)
|
||||
{
|
||||
$this->resolveCounter = $resolveCounter;
|
||||
}
|
||||
|
||||
public function getResolveCounter(): int
|
||||
{
|
||||
return $this->resolveCounter;
|
||||
}
|
||||
|
||||
public function resolveOrder($orderElement, $qbOrder): int
|
||||
{
|
||||
return $this->resolveCounter++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ORDERS xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd" xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd" xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd">
|
||||
<ORDER>
|
||||
<ORDER_POHODA_ID>284250</ORDER_POHODA_ID>
|
||||
<ORDER_NO>WEB110010</ORDER_NO>
|
||||
<DATE_CREATED>2020-08-17</DATE_CREATED>
|
||||
<ID_LANGUAGE>cs</ID_LANGUAGE>
|
||||
<CURRENCY>EUR</CURRENCY>
|
||||
<CURRENCY_RATE>26.14</CURRENCY_RATE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
<PHONE>+420123456789</PHONE>
|
||||
<NOTE>XXX</NOTE>
|
||||
<DELIVERY/>
|
||||
<PAYMENT>Převod</PAYMENT>
|
||||
<USER>
|
||||
<POHODA_ID>59319</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>Petr</NAME>
|
||||
<SURNAME>Kukač</SURNAME>
|
||||
<FIRM>Petr Kukač</FIRM>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>13000</ZIP>
|
||||
<COUNTRY>SK</COUNTRY>
|
||||
<PHONE>+420123456789</PHONE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
</INVOICE_ADDRESS>
|
||||
<STATUSES>
|
||||
<STATUS>0</STATUS>
|
||||
</STATUSES>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>Petr</NAME>
|
||||
<SURNAME>Kukač</SURNAME>
|
||||
<FIRM>Petr Kukač</FIRM>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>13000</ZIP>
|
||||
<COUNTRY>SK</COUNTRY>
|
||||
<PHONE/>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID>698744</POHODA_ID>
|
||||
<CODE>TIL298S014</CODE>
|
||||
<NAME>Tilak vesta Tourmalet Lady ::ebony grey::M</NAME>
|
||||
<PIECE_PRICE>75.57</PIECE_PRICE>
|
||||
<TOTAL_PRICE>91.44</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
</ORDERS>
|
||||
@@ -0,0 +1,463 @@
|
||||
<?xml version="1.0" encoding="Windows-1250"?>
|
||||
<rsp:responsePack version="2.0" id="001" state="ok" programVersion="12502.14 SQL (30.6.2020)" ico="04535510"
|
||||
key="4ba37787-5455-4689-bdcc-c519e4375dda" note="Požadavek na export výbìru objednávek"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd"
|
||||
xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd"
|
||||
xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd"
|
||||
xmlns:lCen="http://www.stormware.cz/schema/version_2/list_centre.xsd"
|
||||
xmlns:lAcv="http://www.stormware.cz/schema/version_2/list_activity.xsd"
|
||||
xmlns:acu="http://www.stormware.cz/schema/version_2/accountingunit.xsd"
|
||||
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
|
||||
xmlns:vch="http://www.stormware.cz/schema/version_2/voucher.xsd"
|
||||
xmlns:int="http://www.stormware.cz/schema/version_2/intDoc.xsd"
|
||||
xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd"
|
||||
xmlns:ofr="http://www.stormware.cz/schema/version_2/offer.xsd"
|
||||
xmlns:enq="http://www.stormware.cz/schema/version_2/enquiry.xsd"
|
||||
xmlns:vyd="http://www.stormware.cz/schema/version_2/vydejka.xsd"
|
||||
xmlns:pri="http://www.stormware.cz/schema/version_2/prijemka.xsd"
|
||||
xmlns:bal="http://www.stormware.cz/schema/version_2/balance.xsd"
|
||||
xmlns:pre="http://www.stormware.cz/schema/version_2/prevodka.xsd"
|
||||
xmlns:vyr="http://www.stormware.cz/schema/version_2/vyroba.xsd"
|
||||
xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd"
|
||||
xmlns:con="http://www.stormware.cz/schema/version_2/contract.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd"
|
||||
xmlns:prm="http://www.stormware.cz/schema/version_2/parameter.xsd"
|
||||
xmlns:lCon="http://www.stormware.cz/schema/version_2/list_contract.xsd"
|
||||
xmlns:ctg="http://www.stormware.cz/schema/version_2/category.xsd"
|
||||
xmlns:ipm="http://www.stormware.cz/schema/version_2/intParam.xsd"
|
||||
xmlns:str="http://www.stormware.cz/schema/version_2/storage.xsd"
|
||||
xmlns:idp="http://www.stormware.cz/schema/version_2/individualPrice.xsd"
|
||||
xmlns:sup="http://www.stormware.cz/schema/version_2/supplier.xsd"
|
||||
xmlns:prn="http://www.stormware.cz/schema/version_2/print.xsd"
|
||||
xmlns:sEET="http://www.stormware.cz/schema/version_2/sendEET.xsd"
|
||||
xmlns:act="http://www.stormware.cz/schema/version_2/accountancy.xsd"
|
||||
xmlns:bnk="http://www.stormware.cz/schema/version_2/bank.xsd"
|
||||
xmlns:sto="http://www.stormware.cz/schema/version_2/store.xsd"
|
||||
xmlns:grs="http://www.stormware.cz/schema/version_2/groupStocks.xsd"
|
||||
xmlns:acp="http://www.stormware.cz/schema/version_2/actionPrice.xsd"
|
||||
xmlns:csh="http://www.stormware.cz/schema/version_2/cashRegister.xsd"
|
||||
xmlns:bka="http://www.stormware.cz/schema/version_2/bankAccount.xsd"
|
||||
xmlns:ilt="http://www.stormware.cz/schema/version_2/inventoryLists.xsd"
|
||||
xmlns:nms="http://www.stormware.cz/schema/version_2/numericalSeries.xsd"
|
||||
xmlns:pay="http://www.stormware.cz/schema/version_2/payment.xsd"
|
||||
xmlns:mKasa="http://www.stormware.cz/schema/version_2/mKasa.xsd"
|
||||
xmlns:gdp="http://www.stormware.cz/schema/version_2/GDPR.xsd"
|
||||
xmlns:est="http://www.stormware.cz/schema/version_2/establishment.xsd"
|
||||
xmlns:cen="http://www.stormware.cz/schema/version_2/centre.xsd"
|
||||
xmlns:acv="http://www.stormware.cz/schema/version_2/activity.xsd"
|
||||
xmlns:afp="http://www.stormware.cz/schema/version_2/accountingFormOfPayment.xsd"
|
||||
xmlns:vat="http://www.stormware.cz/schema/version_2/classificationVAT.xsd"
|
||||
xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd"
|
||||
xmlns:asv="http://www.stormware.cz/schema/version_2/accountingSalesVouchers.xsd"
|
||||
xmlns:arch="http://www.stormware.cz/schema/version_2/archive.xsd">
|
||||
<rsp:responsePackItem version="2.0" id="li1" state="ok">
|
||||
<lst:listOrder version="2.0" dateTimeStamp="2020-08-18T09:55:44" dateValidFrom="2020-08-18" state="ok">
|
||||
<lst:order version="2.0">
|
||||
<ord:orderHeader>
|
||||
<ord:id>284250</ord:id>
|
||||
<ord:orderType>receivedOrder</ord:orderType>
|
||||
<ord:number>
|
||||
<typ:id>1212</typ:id>
|
||||
<typ:ids>2029</typ:ids>
|
||||
<typ:numberRequested>202913284</typ:numberRequested>
|
||||
</ord:number>
|
||||
<ord:numberOrder>WEB110010</ord:numberOrder>
|
||||
<ord:date>2020-08-17</ord:date>
|
||||
<ord:dateFrom>2020-08-17</ord:dateFrom>
|
||||
<ord:note>XXX</ord:note>
|
||||
<ord:partnerIdentity>
|
||||
<typ:id>59319</typ:id>
|
||||
<typ:address>
|
||||
<typ:company>Petr Kukaè</typ:company>
|
||||
<typ:name>Petr Kukaè</typ:name>
|
||||
<typ:city>Praha</typ:city>
|
||||
<typ:street>Tvrdého 642</typ:street>
|
||||
<typ:zip>13000</typ:zip>
|
||||
<typ:country>
|
||||
<typ:id>196</typ:id>
|
||||
<typ:ids>SK</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>+420123456789</typ:phone>
|
||||
<typ:mobilPhone>+420123456789</typ:mobilPhone>
|
||||
<typ:email>petr.k@hanibal.cz</typ:email>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:company>Petr Kukaè</typ:company>
|
||||
<typ:name>Petr Kukaè</typ:name>
|
||||
<typ:city>Praha</typ:city>
|
||||
<typ:street>Tvrdého 642</typ:street>
|
||||
<typ:zip>13000</typ:zip>
|
||||
<typ:country>
|
||||
<typ:id>196</typ:id>
|
||||
<typ:ids>SK</typ:ids>
|
||||
</typ:country>
|
||||
<typ:email>+420123456789</typ:email>
|
||||
</typ:shipToAddress>
|
||||
</ord:partnerIdentity>
|
||||
<ord:myIdentity>
|
||||
<typ:address>
|
||||
<typ:company>TESTOVACÍ AKTUÁLNÍ DB</typ:company>
|
||||
<typ:city>Praha 2</typ:city>
|
||||
<typ:street>Korunní 732/16</typ:street>
|
||||
<typ:zip>120 00</typ:zip>
|
||||
<typ:ico>04535510</typ:ico>
|
||||
<typ:dic>CZ04535510</typ:dic>
|
||||
<typ:mobilPhone>720984344</typ:mobilPhone>
|
||||
<typ:email>info@hanibal.cz</typ:email>
|
||||
<typ:www>www.hanibal.cz</typ:www>
|
||||
</typ:address>
|
||||
<typ:establishment>
|
||||
<typ:company>Hanibal sport</typ:company>
|
||||
<typ:city>Praha 2</typ:city>
|
||||
<typ:street>Korunní 16</typ:street>
|
||||
<typ:zip>120 00</typ:zip>
|
||||
</typ:establishment>
|
||||
</ord:myIdentity>
|
||||
<ord:paymentType>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>Pøíkazem</typ:ids>
|
||||
<typ:paymentType>draft</typ:paymentType>
|
||||
</ord:paymentType>
|
||||
<ord:priceLevel>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>Prodejní</typ:ids>
|
||||
</ord:priceLevel>
|
||||
<ord:isExecuted>false</ord:isExecuted>
|
||||
<ord:isDelivered>false</ord:isDelivered>
|
||||
<ord:isReserved>false</ord:isReserved>
|
||||
<ord:centre>
|
||||
<typ:id>5</typ:id>
|
||||
<typ:ids>ESHOP</typ:ids>
|
||||
</ord:centre>
|
||||
<ord:permanentDocument>false</ord:permanentDocument>
|
||||
<ord:markRecord>true</ord:markRecord>
|
||||
<ord:parameters>
|
||||
<typ:parameter>
|
||||
<typ:name>RefVPrStav</typ:name>
|
||||
<typ:listValueRef>
|
||||
<typ:id>16</typ:id>
|
||||
<typ:ids>PRIJATO</typ:ids>
|
||||
</typ:listValueRef>
|
||||
<typ:list>
|
||||
<typ:id>803</typ:id>
|
||||
<typ:ids>Stav</typ:ids>
|
||||
</typ:list>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrZapl</typ:name>
|
||||
<typ:booleanValue>false</typ:booleanValue>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrPDoklad</typ:name>
|
||||
<typ:textValue>110010</typ:textValue>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrIDvydejny</typ:name>
|
||||
<typ:textValue/>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrPayPalTID</typ:name>
|
||||
<typ:textValue/>
|
||||
</typ:parameter>
|
||||
</ord:parameters>
|
||||
</ord:orderHeader>
|
||||
<ord:orderDetail>
|
||||
<ord:orderItem>
|
||||
<ord:id>698744</ord:id>
|
||||
<ord:text>Tilak vesta Tourmalet Lady ::ebony grey::M</ord:text>
|
||||
<ord:quantity>1.0</ord:quantity>
|
||||
<ord:delivered>0.0</ord:delivered>
|
||||
<ord:unit>ks</ord:unit>
|
||||
<ord:coefficient>1.0</ord:coefficient>
|
||||
<ord:payVAT>true</ord:payVAT>
|
||||
<ord:rateVAT value="21">high</ord:rateVAT>
|
||||
<ord:discountPercentage>0.0</ord:discountPercentage>
|
||||
<ord:homeCurrency>
|
||||
<typ:unitPrice>2390.24</typ:unitPrice>
|
||||
<typ:price>1975.4</typ:price>
|
||||
<typ:priceVAT>414.84</typ:priceVAT>
|
||||
<typ:priceSum>2390.24</typ:priceSum>
|
||||
</ord:homeCurrency>
|
||||
<ord:foreignCurrency>
|
||||
<typ:unitPrice>91.44</typ:unitPrice>
|
||||
<typ:price>75.57</typ:price>
|
||||
<typ:priceVAT>15.87</typ:priceVAT>
|
||||
<typ:priceSum>91.44</typ:priceSum>
|
||||
</ord:foreignCurrency>
|
||||
<ord:code>TIL298S014</ord:code>
|
||||
<ord:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>17</typ:id>
|
||||
<typ:ids>04</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>204890</typ:id>
|
||||
<typ:ids>TIL298S014</typ:ids>
|
||||
<typ:EAN>8595185351150</typ:EAN>
|
||||
</typ:stockItem>
|
||||
</ord:stockItem>
|
||||
<ord:PDP>false</ord:PDP>
|
||||
<ord:parameters/>
|
||||
</ord:orderItem>
|
||||
<ord:orderItem>
|
||||
<ord:id>698745</ord:id>
|
||||
<ord:text>Doprava GLS SK</ord:text>
|
||||
<ord:quantity>1.0</ord:quantity>
|
||||
<ord:delivered>0.0</ord:delivered>
|
||||
<ord:unit>ks</ord:unit>
|
||||
<ord:coefficient>1.0</ord:coefficient>
|
||||
<ord:payVAT>true</ord:payVAT>
|
||||
<ord:rateVAT value="21">high</ord:rateVAT>
|
||||
<ord:discountPercentage>0.0</ord:discountPercentage>
|
||||
<ord:homeCurrency>
|
||||
<typ:unitPrice>130.44</typ:unitPrice>
|
||||
<typ:price>107.8</typ:price>
|
||||
<typ:priceVAT>22.64</typ:priceVAT>
|
||||
<typ:priceSum>130.44</typ:priceSum>
|
||||
</ord:homeCurrency>
|
||||
<ord:foreignCurrency>
|
||||
<typ:unitPrice>4.99</typ:unitPrice>
|
||||
<typ:price>4.12</typ:price>
|
||||
<typ:priceVAT>0.87</typ:priceVAT>
|
||||
<typ:priceSum>4.99</typ:priceSum>
|
||||
</ord:foreignCurrency>
|
||||
<ord:code>POS156</ord:code>
|
||||
<ord:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>17</typ:id>
|
||||
<typ:ids>04</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>253038</typ:id>
|
||||
<typ:ids>POS156</typ:ids>
|
||||
</typ:stockItem>
|
||||
</ord:stockItem>
|
||||
<ord:PDP>false</ord:PDP>
|
||||
<ord:parameters/>
|
||||
</ord:orderItem>
|
||||
</ord:orderDetail>
|
||||
<ord:orderSummary>
|
||||
<ord:roundingDocument>none</ord:roundingDocument>
|
||||
<ord:roundingVAT>none</ord:roundingVAT>
|
||||
<ord:typeCalculateVATInclusivePrice>VATNewMethod</ord:typeCalculateVATInclusivePrice>
|
||||
<ord:homeCurrency>
|
||||
<typ:priceNone>0</typ:priceNone>
|
||||
<typ:priceLow>0</typ:priceLow>
|
||||
<typ:priceLowVAT>0</typ:priceLowVAT>
|
||||
<typ:priceLowSum>0</typ:priceLowSum>
|
||||
<typ:priceHigh>2083.2</typ:priceHigh>
|
||||
<typ:priceHighVAT>437.48</typ:priceHighVAT>
|
||||
<typ:priceHighSum>2520.68</typ:priceHighSum>
|
||||
<typ:price3>0</typ:price3>
|
||||
<typ:price3VAT>0</typ:price3VAT>
|
||||
<typ:price3Sum>0</typ:price3Sum>
|
||||
<typ:round>
|
||||
<typ:priceRound>0</typ:priceRound>
|
||||
</typ:round>
|
||||
</ord:homeCurrency>
|
||||
<ord:foreignCurrency>
|
||||
<typ:currency>
|
||||
<typ:id>9</typ:id>
|
||||
<typ:ids>EUR</typ:ids>
|
||||
</typ:currency>
|
||||
<typ:rate>26.14</typ:rate>
|
||||
<typ:amount>1</typ:amount>
|
||||
<typ:priceSum>96.43</typ:priceSum>
|
||||
<typ:round>
|
||||
<typ:priceRound>0</typ:priceRound>
|
||||
</typ:round>
|
||||
</ord:foreignCurrency>
|
||||
</ord:orderSummary>
|
||||
</lst:order>
|
||||
<lst:order version="2.0">
|
||||
<ord:orderHeader>
|
||||
<ord:id>284251</ord:id>
|
||||
<ord:orderType>receivedOrder</ord:orderType>
|
||||
<ord:number>
|
||||
<typ:id>1141</typ:id>
|
||||
<typ:ids>2025</typ:ids>
|
||||
<typ:numberRequested>202505711</typ:numberRequested>
|
||||
</ord:number>
|
||||
<ord:numberOrder>WEB110011</ord:numberOrder>
|
||||
<ord:date>2020-08-17</ord:date>
|
||||
<ord:dateFrom>2020-08-17</ord:dateFrom>
|
||||
<ord:partnerIdentity>
|
||||
<typ:id>59319</typ:id>
|
||||
<typ:address>
|
||||
<typ:company>.. ....</typ:company>
|
||||
<typ:name>.. ....</typ:name>
|
||||
<typ:city>Osobni odber</typ:city>
|
||||
<typ:street>Osobni odber 123</typ:street>
|
||||
<typ:zip>11000</typ:zip>
|
||||
<typ:country>
|
||||
<typ:id>48</typ:id>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>+44444415991</typ:phone>
|
||||
<typ:mobilPhone>+44444415991</typ:mobilPhone>
|
||||
<typ:email>petr.k@hanibal.cz</typ:email>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:company>.. ....</typ:company>
|
||||
<typ:name>.. ....</typ:name>
|
||||
<typ:city>Praha</typ:city>
|
||||
<typ:street>Tvrdého 642</typ:street>
|
||||
<typ:zip>19900</typ:zip>
|
||||
<typ:country>
|
||||
<typ:id>48</typ:id>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:email>+44444415991</typ:email>
|
||||
</typ:shipToAddress>
|
||||
</ord:partnerIdentity>
|
||||
<ord:myIdentity>
|
||||
<typ:address>
|
||||
<typ:company>TESTOVACÍ AKTUÁLNÍ DB</typ:company>
|
||||
<typ:city>Praha 2</typ:city>
|
||||
<typ:street>Korunní 732/16</typ:street>
|
||||
<typ:zip>120 00</typ:zip>
|
||||
<typ:ico>04535510</typ:ico>
|
||||
<typ:dic>CZ04535510</typ:dic>
|
||||
<typ:mobilPhone>720984344</typ:mobilPhone>
|
||||
<typ:email>info@hanibal.cz</typ:email>
|
||||
<typ:www>www.hanibal.cz</typ:www>
|
||||
</typ:address>
|
||||
<typ:establishment>
|
||||
<typ:company>Hanibal sport</typ:company>
|
||||
<typ:city>Praha 2</typ:city>
|
||||
<typ:street>Korunní 16</typ:street>
|
||||
<typ:zip>120 00</typ:zip>
|
||||
</typ:establishment>
|
||||
</ord:myIdentity>
|
||||
<ord:paymentType>
|
||||
<typ:id>2</typ:id>
|
||||
<typ:ids>hotovì</typ:ids>
|
||||
<typ:paymentType>cash</typ:paymentType>
|
||||
</ord:paymentType>
|
||||
<ord:priceLevel>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>Prodejní</typ:ids>
|
||||
</ord:priceLevel>
|
||||
<ord:isExecuted>false</ord:isExecuted>
|
||||
<ord:isDelivered>false</ord:isDelivered>
|
||||
<ord:isReserved>false</ord:isReserved>
|
||||
<ord:centre>
|
||||
<typ:id>5</typ:id>
|
||||
<typ:ids>ESHOP</typ:ids>
|
||||
</ord:centre>
|
||||
<ord:permanentDocument>false</ord:permanentDocument>
|
||||
<ord:markRecord>true</ord:markRecord>
|
||||
<ord:parameters>
|
||||
<typ:parameter>
|
||||
<typ:name>RefVPrStav</typ:name>
|
||||
<typ:listValueRef>
|
||||
<typ:id>16</typ:id>
|
||||
<typ:ids>PRIJATO</typ:ids>
|
||||
</typ:listValueRef>
|
||||
<typ:list>
|
||||
<typ:id>803</typ:id>
|
||||
<typ:ids>Stav</typ:ids>
|
||||
</typ:list>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrZapl</typ:name>
|
||||
<typ:booleanValue>false</typ:booleanValue>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrPDoklad</typ:name>
|
||||
<typ:textValue>110011</typ:textValue>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrIDvydejny</typ:name>
|
||||
<typ:textValue/>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrPayPalTID</typ:name>
|
||||
<typ:textValue/>
|
||||
</typ:parameter>
|
||||
</ord:parameters>
|
||||
</ord:orderHeader>
|
||||
<ord:orderDetail>
|
||||
<ord:orderItem>
|
||||
<ord:id>698746</ord:id>
|
||||
<ord:text>Chimpanzee tyèinka Energy ::citron::-</ord:text>
|
||||
<ord:quantity>1.0</ord:quantity>
|
||||
<ord:delivered>0.0</ord:delivered>
|
||||
<ord:unit>ks</ord:unit>
|
||||
<ord:coefficient>1.0</ord:coefficient>
|
||||
<ord:payVAT>true</ord:payVAT>
|
||||
<ord:rateVAT value="15">low</ord:rateVAT>
|
||||
<ord:discountPercentage>0.0</ord:discountPercentage>
|
||||
<ord:homeCurrency>
|
||||
<typ:unitPrice>39</typ:unitPrice>
|
||||
<typ:price>33.91</typ:price>
|
||||
<typ:priceVAT>5.09</typ:priceVAT>
|
||||
<typ:priceSum>39</typ:priceSum>
|
||||
</ord:homeCurrency>
|
||||
<ord:code>CHI001S006</ord:code>
|
||||
<ord:stockItem>
|
||||
<typ:store>
|
||||
<typ:id>10</typ:id>
|
||||
<typ:ids>02</typ:ids>
|
||||
</typ:store>
|
||||
<typ:stockItem>
|
||||
<typ:id>84441</typ:id>
|
||||
<typ:ids>CHI001S006</typ:ids>
|
||||
<typ:EAN>8594157870934</typ:EAN>
|
||||
</typ:stockItem>
|
||||
</ord:stockItem>
|
||||
<ord:PDP>false</ord:PDP>
|
||||
<ord:parameters/>
|
||||
</ord:orderItem>
|
||||
<ord:orderItem>
|
||||
<ord:id>698747</ord:id>
|
||||
<ord:text>Osobní odbìr Senovážné</ord:text>
|
||||
<ord:quantity>1.0</ord:quantity>
|
||||
<ord:delivered>0.0</ord:delivered>
|
||||
<ord:unit>ks</ord:unit>
|
||||
<ord:coefficient>1.0</ord:coefficient>
|
||||
<ord:payVAT>true</ord:payVAT>
|
||||
<ord:rateVAT value="21">high</ord:rateVAT>
|
||||
<ord:discountPercentage>0.0</ord:discountPercentage>
|
||||
<ord:homeCurrency>
|
||||
<typ:unitPrice>0</typ:unitPrice>
|
||||
<typ:price>0</typ:price>
|
||||
<typ:priceVAT>0</typ:priceVAT>
|
||||
<typ:priceSum>0</typ:priceSum>
|
||||
</ord:homeCurrency>
|
||||
<ord:code>OSO002</ord:code>
|
||||
<ord:linkToStock>
|
||||
<typ:id>291505</typ:id>
|
||||
</ord:linkToStock>
|
||||
<ord:PDP>false</ord:PDP>
|
||||
<ord:parameters/>
|
||||
</ord:orderItem>
|
||||
</ord:orderDetail>
|
||||
<ord:orderSummary>
|
||||
<ord:roundingDocument>none</ord:roundingDocument>
|
||||
<ord:roundingVAT>none</ord:roundingVAT>
|
||||
<ord:typeCalculateVATInclusivePrice>VATNewMethod</ord:typeCalculateVATInclusivePrice>
|
||||
<ord:homeCurrency>
|
||||
<typ:priceNone>0</typ:priceNone>
|
||||
<typ:priceLow>33.91</typ:priceLow>
|
||||
<typ:priceLowVAT>5.09</typ:priceLowVAT>
|
||||
<typ:priceLowSum>39</typ:priceLowSum>
|
||||
<typ:priceHigh>0</typ:priceHigh>
|
||||
<typ:priceHighVAT>0</typ:priceHighVAT>
|
||||
<typ:priceHighSum>0</typ:priceHighSum>
|
||||
<typ:price3>0</typ:price3>
|
||||
<typ:price3VAT>0</typ:price3VAT>
|
||||
<typ:price3Sum>0</typ:price3Sum>
|
||||
<typ:round>
|
||||
<typ:priceRound>0</typ:priceRound>
|
||||
</typ:round>
|
||||
</ord:homeCurrency>
|
||||
</ord:orderSummary>
|
||||
</lst:order>
|
||||
</lst:listOrder>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>
|
||||
@@ -0,0 +1,150 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ORDERS xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd" xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd" xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd">
|
||||
<ORDER>
|
||||
<ORDER_POHODA_ID>284250</ORDER_POHODA_ID>
|
||||
<ORDER_NO>WEB110010</ORDER_NO>
|
||||
<DATE_CREATED>2020-08-17</DATE_CREATED>
|
||||
<EXECUTED>false</EXECUTED>
|
||||
<!--<ID_LANGUAGE>cs</ID_LANGUAGE>-->
|
||||
<STORNO/>
|
||||
<OPTIONAL_PARAMETERS>
|
||||
<RefVPrStav>PRIJATO</RefVPrStav>
|
||||
<VPrZapl>false</VPrZapl>
|
||||
<VPrPDoklad>110010</VPrPDoklad>
|
||||
<VPrIDvydejny/>
|
||||
<VPrPayPalTID/>
|
||||
</OPTIONAL_PARAMETERS>
|
||||
<CURRENCY>EUR</CURRENCY>
|
||||
<CURRENCY_RATE>26.14</CURRENCY_RATE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
<PHONE>+420123456789</PHONE>
|
||||
<NOTE/>
|
||||
<DELIVERY/>
|
||||
<DELIVERY_NAME/>
|
||||
<PAYMENT_NAME>Příkazem</PAYMENT_NAME>
|
||||
<PACKAGE_ID/>
|
||||
<PAYMENT>Převod</PAYMENT>
|
||||
<USER>
|
||||
<POHODA_ID>59319</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>Petr</NAME>
|
||||
<SURNAME>Kukač</SURNAME>
|
||||
<FIRM>Petr Kukač</FIRM>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>13000</ZIP>
|
||||
<COUNTRY>SK</COUNTRY>
|
||||
<PHONE>+420123456789</PHONE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
</INVOICE_ADDRESS>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>Petr</NAME>
|
||||
<SURNAME>Kukač</SURNAME>
|
||||
<FIRM>Petr Kukač</FIRM>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>13000</ZIP>
|
||||
<COUNTRY>SK</COUNTRY>
|
||||
<PHONE/>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID>698744</POHODA_ID>
|
||||
<CODE>TIL298S014</CODE>
|
||||
<EAN>8595185351150</EAN>
|
||||
<NAME>Tilak vesta Tourmalet Lady ::ebony grey::M</NAME>
|
||||
<PIECE_PRICE>75.5702479338843</PIECE_PRICE>
|
||||
<TOTAL_PRICE>75.5702479338843</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID>698745</POHODA_ID>
|
||||
<CODE>POS156</CODE>
|
||||
<EAN/>
|
||||
<NAME>Doprava GLS SK</NAME>
|
||||
<PIECE_PRICE>4.123966942148761</PIECE_PRICE>
|
||||
<TOTAL_PRICE>4.123966942148761</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
<ORDER>
|
||||
<ORDER_POHODA_ID>284251</ORDER_POHODA_ID>
|
||||
<ORDER_NO>WEB110011</ORDER_NO>
|
||||
<DATE_CREATED>2020-08-17</DATE_CREATED>
|
||||
<EXECUTED>false</EXECUTED>
|
||||
<!--<ID_LANGUAGE>cs</ID_LANGUAGE>-->
|
||||
<STORNO/>
|
||||
<OPTIONAL_PARAMETERS>
|
||||
<RefVPrStav>PRIJATO</RefVPrStav>
|
||||
<VPrZapl>false</VPrZapl>
|
||||
<VPrPDoklad>110011</VPrPDoklad>
|
||||
<VPrIDvydejny/>
|
||||
<VPrPayPalTID/>
|
||||
</OPTIONAL_PARAMETERS>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<CURRENCY_RATE>1</CURRENCY_RATE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
<PHONE>+44444415991</PHONE>
|
||||
<NOTE/>
|
||||
<DELIVERY/>
|
||||
<DELIVERY_NAME/>
|
||||
<PAYMENT_NAME>hotově</PAYMENT_NAME>
|
||||
<PACKAGE_ID/>
|
||||
<PAYMENT>Hotovost</PAYMENT>
|
||||
<USER>
|
||||
<POHODA_ID>59319</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>..</NAME>
|
||||
<SURNAME>....</SURNAME>
|
||||
<FIRM>.. ....</FIRM>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>Osobni odber 123</STREET>
|
||||
<CITY>Osobni odber</CITY>
|
||||
<ZIP>11000</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE>+44444415991</PHONE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
</INVOICE_ADDRESS>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>..</NAME>
|
||||
<SURNAME>....</SURNAME>
|
||||
<FIRM>.. ....</FIRM>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>19900</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE/>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID>698746</POHODA_ID>
|
||||
<CODE>CHI001S006</CODE>
|
||||
<EAN>8594157870934</EAN>
|
||||
<NAME>Chimpanzee tyčinka Energy ::citron::-</NAME>
|
||||
<PIECE_PRICE>33.9130434782609</PIECE_PRICE>
|
||||
<TOTAL_PRICE>33.9130434782609</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>15</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID>698747</POHODA_ID>
|
||||
<CODE>OSO002</CODE>
|
||||
<EAN/>
|
||||
<NAME>Osobní odběr Senovážné</NAME>
|
||||
<PIECE_PRICE>0</PIECE_PRICE>
|
||||
<TOTAL_PRICE>0</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
</ORDERS>
|
||||
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ORDERS xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd" xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd" xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd">
|
||||
<ORDER>
|
||||
<ORDER_POHODA_ID>284250</ORDER_POHODA_ID>
|
||||
<ORDER_NO>WEB110010</ORDER_NO>
|
||||
<DATE_CREATED>2020-08-17</DATE_CREATED>
|
||||
<ID_LANGUAGE>cs</ID_LANGUAGE>
|
||||
<CURRENCY>EUR</CURRENCY>
|
||||
<CURRENCY_RATE>26.14</CURRENCY_RATE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
<PHONE>+420123456789</PHONE>
|
||||
<NOTE>XXX</NOTE>
|
||||
<DELIVERY/>
|
||||
<PAYMENT>Převod</PAYMENT>
|
||||
<PACKAGE_ID>B123456</PACKAGE_ID>
|
||||
<USER>
|
||||
<POHODA_ID>59319</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>Petr TEST</NAME>
|
||||
<SURNAME>Kukač TEST</SURNAME>
|
||||
<FIRM>Petr Kukač</FIRM>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>13000</ZIP>
|
||||
<COUNTRY>SK</COUNTRY>
|
||||
<PHONE>+420123456789</PHONE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
</INVOICE_ADDRESS>
|
||||
<STATUSES>
|
||||
<STATUS>0</STATUS>
|
||||
</STATUSES>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>Petr</NAME>
|
||||
<SURNAME>Kukač</SURNAME>
|
||||
<FIRM>Petr Kukač</FIRM>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>13000</ZIP>
|
||||
<COUNTRY>SK</COUNTRY>
|
||||
<PHONE/>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID>698744</POHODA_ID>
|
||||
<CODE>TIL298S014</CODE>
|
||||
<NAME>TEST TITLE</NAME>
|
||||
<PIECE_PRICE>75.57</PIECE_PRICE>
|
||||
<TOTAL_PRICE>91.44</TOTAL_PRICE>
|
||||
<PIECES>50.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID>698745</POHODA_ID>
|
||||
<CODE>POS156</CODE>
|
||||
<NAME>Doprava GLS SK</NAME>
|
||||
<PIECE_PRICE>4.12</PIECE_PRICE>
|
||||
<TOTAL_PRICE>4.99</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
<ORDER>
|
||||
<ORDER_POHODA_ID>284251</ORDER_POHODA_ID>
|
||||
<ORDER_NO>WEB110011</ORDER_NO>
|
||||
<DATE_CREATED>2020-08-17</DATE_CREATED>
|
||||
<ID_LANGUAGE>cs</ID_LANGUAGE>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<CURRENCY_RATE>1</CURRENCY_RATE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
<PHONE>+44444415991</PHONE>
|
||||
<NOTE/>
|
||||
<DELIVERY/>
|
||||
<PAYMENT>Hotovost</PAYMENT>
|
||||
<USER>
|
||||
<POHODA_ID>59319</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>..</NAME>
|
||||
<SURNAME>....</SURNAME>
|
||||
<FIRM>.. ....</FIRM>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>Osobni odber 123</STREET>
|
||||
<CITY>Osobni odber</CITY>
|
||||
<ZIP>11000</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE>+44444415991</PHONE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
</INVOICE_ADDRESS>
|
||||
<STATUSES>
|
||||
<STATUS>0</STATUS>
|
||||
</STATUSES>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>..</NAME>
|
||||
<SURNAME>....</SURNAME>
|
||||
<FIRM>.. ....</FIRM>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>19900</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE/>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID>698746</POHODA_ID>
|
||||
<CODE>CHI001S006</CODE>
|
||||
<NAME>Chimpanzee tyčinka Energy ::citron::-</NAME>
|
||||
<PIECE_PRICE>33.91</PIECE_PRICE>
|
||||
<TOTAL_PRICE>39</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>15</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID>698747</POHODA_ID>
|
||||
<CODE>OSO002</CODE>
|
||||
<NAME>Osobní odběr Senovážné</NAME>
|
||||
<PIECE_PRICE>0</PIECE_PRICE>
|
||||
<TOTAL_PRICE>0</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
</ORDERS>
|
||||
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ORDERS xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd" xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd" xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd">
|
||||
<ORDER>
|
||||
<ORDER_POHODA_ID>284250</ORDER_POHODA_ID>
|
||||
<ORDER_NO>WEB110010</ORDER_NO>
|
||||
<DATE_CREATED>2020-08-17</DATE_CREATED>
|
||||
<ID_LANGUAGE>cs</ID_LANGUAGE>
|
||||
<CURRENCY>EUR</CURRENCY>
|
||||
<CURRENCY_RATE>26.14</CURRENCY_RATE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
<PHONE>+420123456789</PHONE>
|
||||
<NOTE>XXX</NOTE>
|
||||
<DELIVERY/>
|
||||
<PAYMENT>Převod</PAYMENT>
|
||||
<PACKAGE_ID>N666</PACKAGE_ID>
|
||||
<USER>
|
||||
<POHODA_ID>59319</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>Petr TEST</NAME>
|
||||
<SURNAME>Kukač TEST</SURNAME>
|
||||
<FIRM>Petr Kukač</FIRM>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>13000</ZIP>
|
||||
<COUNTRY>SK</COUNTRY>
|
||||
<PHONE>+420123456789</PHONE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
</INVOICE_ADDRESS>
|
||||
<STATUSES>
|
||||
<STATUS>0</STATUS>
|
||||
</STATUSES>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>Petr</NAME>
|
||||
<SURNAME>Kukač</SURNAME>
|
||||
<FIRM>Petr Kukač</FIRM>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>13000</ZIP>
|
||||
<COUNTRY>SK</COUNTRY>
|
||||
<PHONE/>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID>698744</POHODA_ID>
|
||||
<CODE>TIL298S014</CODE>
|
||||
<NAME>TEST TITLE</NAME>
|
||||
<PIECE_PRICE>75.57</PIECE_PRICE>
|
||||
<TOTAL_PRICE>91.44</TOTAL_PRICE>
|
||||
<PIECES>50.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID>698745</POHODA_ID>
|
||||
<CODE>POS156</CODE>
|
||||
<NAME>Doprava GLS SK</NAME>
|
||||
<PIECE_PRICE>4.12</PIECE_PRICE>
|
||||
<TOTAL_PRICE>4.99</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
<ORDER>
|
||||
<ORDER_POHODA_ID>284251</ORDER_POHODA_ID>
|
||||
<ORDER_NO>WEB110011</ORDER_NO>
|
||||
<DATE_CREATED>2020-08-17</DATE_CREATED>
|
||||
<ID_LANGUAGE>cs</ID_LANGUAGE>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<CURRENCY_RATE>1</CURRENCY_RATE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
<PHONE>+44444415991</PHONE>
|
||||
<NOTE/>
|
||||
<DELIVERY/>
|
||||
<PAYMENT>Hotovost</PAYMENT>
|
||||
<USER>
|
||||
<POHODA_ID>59319</POHODA_ID>
|
||||
</USER>
|
||||
<INVOICE_ADDRESS>
|
||||
<NAME>..</NAME>
|
||||
<SURNAME>....</SURNAME>
|
||||
<FIRM>.. ....</FIRM>
|
||||
<ICO/>
|
||||
<DIC/>
|
||||
<STREET>Osobni odber 123</STREET>
|
||||
<CITY>Osobni odber</CITY>
|
||||
<ZIP>11000</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE>+44444415991</PHONE>
|
||||
<EMAIL>petr.k@hanibal.cz</EMAIL>
|
||||
</INVOICE_ADDRESS>
|
||||
<STATUSES>
|
||||
<STATUS>0</STATUS>
|
||||
</STATUSES>
|
||||
<DELIVERY_ADDRESS>
|
||||
<NAME>..</NAME>
|
||||
<SURNAME>....</SURNAME>
|
||||
<FIRM>.. ....</FIRM>
|
||||
<STREET>Tvrdého 642</STREET>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>19900</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE/>
|
||||
</DELIVERY_ADDRESS>
|
||||
<ITEMS>
|
||||
<ITEM>
|
||||
<POHODA_ID>698746</POHODA_ID>
|
||||
<CODE>CHI001S006</CODE>
|
||||
<NAME>Chimpanzee tyčinka Energy ::citron::-</NAME>
|
||||
<PIECE_PRICE>33.91</PIECE_PRICE>
|
||||
<TOTAL_PRICE>39</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>15</VAT>
|
||||
</ITEM>
|
||||
<ITEM>
|
||||
<POHODA_ID>698747</POHODA_ID>
|
||||
<CODE>OSO002</CODE>
|
||||
<NAME>Osobní odběr Senovážné</NAME>
|
||||
<PIECE_PRICE>0</PIECE_PRICE>
|
||||
<TOTAL_PRICE>0</TOTAL_PRICE>
|
||||
<PIECES>1.0</PIECES>
|
||||
<VAT>21</VAT>
|
||||
</ITEM>
|
||||
</ITEMS>
|
||||
</ORDER>
|
||||
</ORDERS>
|
||||
@@ -0,0 +1,273 @@
|
||||
{
|
||||
"orders": [
|
||||
{
|
||||
"id": 273455,
|
||||
"order_no": "021273455",
|
||||
"id_language": "cs",
|
||||
"currency": "CZK",
|
||||
"currency_rate": 1.00000000,
|
||||
"id_user": null,
|
||||
"date_created": "2021-08-25 13:48:13",
|
||||
"date_accept": null,
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-08-25 11:48:13",
|
||||
"date_due": null,
|
||||
"status": 0,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 257.0000,
|
||||
"invoice_name": "TEST",
|
||||
"invoice_surname": "TEST",
|
||||
"invoice_firm": "",
|
||||
"invoice_ico": "",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "TEST 123",
|
||||
"invoice_city": "TEST",
|
||||
"invoice_zip": "51401",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420121212121",
|
||||
"invoice_email": "vancl@wpj.cz",
|
||||
"delivery_name": "TEST",
|
||||
"delivery_surname": "TEST",
|
||||
"delivery_firm": "",
|
||||
"delivery_street": "TEST 123",
|
||||
"delivery_city": "TEST",
|
||||
"delivery_zip": "51401",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Dobírkou - GLS kurýr",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "TEST",
|
||||
"note_admin": "{\"ip_address\":\"172.42.0.1\",\"remote_port\":\"57072\",\"user_agent\":\"Mozilla\\/5.0 (X11; Linux x86_64; rv:87.0) Gecko\\/20100101 Firefox\\/87.0\",\"referer\":null,\"cart_id\":\"97a0030099d411ea917f96455fb92490\",\"client_id\":\"118865907.1592848519\",\"discount_data\":{\"bonus_program\":[]},\"discounts\":{\"email\":\"vancl@wpj.cz\"},\"payment_data\":[],\"conversion_sent\":1}",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"flags": "R,D",
|
||||
"delivery_phone": "+420121212121",
|
||||
"pohoda_sync_date": null,
|
||||
"pohoda_id": null
|
||||
},
|
||||
{
|
||||
"id": 273454,
|
||||
"order_no": "021273454",
|
||||
"id_language": "cs",
|
||||
"currency": "CZK",
|
||||
"currency_rate": 1.00000000,
|
||||
"id_user": null,
|
||||
"date_created": "2021-08-25 13:14:37",
|
||||
"date_accept": null,
|
||||
"date_handle": null,
|
||||
"date_updated": "2021-08-25 11:14:37",
|
||||
"date_due": null,
|
||||
"status": 0,
|
||||
"status_payed": 0,
|
||||
"status_dispatch": 0,
|
||||
"status_storno": 0,
|
||||
"total_price": 467.0000,
|
||||
"invoice_name": "TEST",
|
||||
"invoice_surname": "TEST",
|
||||
"invoice_firm": "",
|
||||
"invoice_ico": "",
|
||||
"invoice_dic": "",
|
||||
"invoice_street": "TEST 123",
|
||||
"invoice_city": "TEST",
|
||||
"invoice_zip": "51401",
|
||||
"invoice_country": "CZ",
|
||||
"invoice_phone": "+420121212121",
|
||||
"invoice_email": "vancl@wpj.cz",
|
||||
"delivery_name": "TEST",
|
||||
"delivery_surname": "TEST",
|
||||
"delivery_firm": "",
|
||||
"delivery_street": "TEST 123",
|
||||
"delivery_city": "TEST",
|
||||
"delivery_zip": "51401",
|
||||
"delivery_country": "CZ",
|
||||
"delivery_type": "Dobírkou - GLS kurýr",
|
||||
"id_delivery": null,
|
||||
"delivery_complete": "",
|
||||
"note_user": "",
|
||||
"note_admin": "{\"ip_address\":\"172.42.0.1\",\"remote_port\":\"56572\",\"user_agent\":\"Mozilla\\/5.0 (X11; Linux x86_64; rv:87.0) Gecko\\/20100101 Firefox\\/87.0\",\"referer\":null,\"cart_id\":\"97a0030099d411ea917f96455fb92490\",\"client_id\":\"118865907.1592848519\",\"discount_data\":{\"bonus_program\":[]},\"discounts\":{\"email\":\"vancl@wpj.cz\"},\"payment_data\":[],\"conversion_sent\":1}",
|
||||
"admin": null,
|
||||
"note_invoice": null,
|
||||
"package_id": null,
|
||||
"invoice_state": "",
|
||||
"invoice_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"delivery_custom_address": "",
|
||||
"flags": "D",
|
||||
"delivery_phone": "+420121212121",
|
||||
"pohoda_sync_date": null,
|
||||
"pohoda_id": null
|
||||
}
|
||||
],
|
||||
"products": [
|
||||
{
|
||||
"id": 69086,
|
||||
"title": "2 pack kalhotek 1119 BI modré",
|
||||
"code": "la1119bikalblu",
|
||||
"ean": null,
|
||||
"short_descr": "Komfortní dámské kalhotky - 2 kusy v balení, zdobené krásnou krajkou na zadní části.",
|
||||
"long_descr": "<p>Dámské kalhotky v pestré kombinaci vzorů a barev. Kalhotky jsou vepředu hladké v kombinaci s elastickou jemnou krajkou, která přechází do zadní části. Jsou ušité z kvalitní bavlny, která v kombinaci s elastanem zajišťuje maximální pružnost látky. Kalhotky se krásně přizpůsobí Vaší postavě. Mají klasický střih. <strong>Cena je za 2 ks (v balení vždy dva vzory - viz fotografie).</strong></p>",
|
||||
"parameters": "",
|
||||
"price": 271.9008,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"id_cn": null,
|
||||
"discount": 0.00000000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 36,
|
||||
"pieces_sold": 19,
|
||||
"delivery_time": 0,
|
||||
"campaign": "B2B",
|
||||
"updated": "2021-08-25 11:14:37",
|
||||
"date_added": "2020-06-22 14:39:57",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": null,
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"weight": null,
|
||||
"bonus_points": null,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"67\"}",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null,
|
||||
"pohoda_sync_date": "2021-08-18 16:01:07"
|
||||
},
|
||||
{
|
||||
"id": 69416,
|
||||
"title": "Bavlněná rouška s kapsou na filtr korálová se srdíčky",
|
||||
"code": "nellykoralsrdce",
|
||||
"ean": null,
|
||||
"short_descr": "Dvouvrstvá tvarovaná bavlněná rouška za uši a s kapsou na vložení filtru.",
|
||||
"long_descr": "<p>Kvalitní bavlněná rouška české výroby s kapsou na filtr. Ouška jsou v tunýlku. Šířka: 20 cm, výška včetně části pod bradu cca 14 cm.</p>\r\n\r\n<p>Tento střih je velmi praktický, pohodlný a dobře sedí a roušku lze velmi rychle nasadit.</p>\r\n\r\n<p>Rouška je vyrobena ze 100% bavlny. Roušku je možno vyvařovat. </p>\r\n\r\n<p>Ochranná rouška je určena pro opakované použití. Nejedná se o certifikovanou zdravotní roušku. Každá rouška je hygienicky zabalena.</p>\r\n\r\n<p><strong>Z hygienických důvodů dle §1837 písmeno g) občanského zákoníku se na roušky nevztahuje reklamace.</strong></p>",
|
||||
"parameters": "",
|
||||
"price": 131.4050,
|
||||
"price_common": 0.0000,
|
||||
"vat": 1,
|
||||
"id_cn": null,
|
||||
"discount": 25.15720000,
|
||||
"producer": null,
|
||||
"guarantee": 0,
|
||||
"in_store": 30,
|
||||
"pieces_sold": 10,
|
||||
"delivery_time": -2,
|
||||
"campaign": "B2B,R",
|
||||
"updated": "2021-08-25 11:48:56",
|
||||
"date_added": "2020-09-29 11:59:00",
|
||||
"figure": "Y",
|
||||
"show_raw_price": "N",
|
||||
"position": null,
|
||||
"meta_title": null,
|
||||
"meta_description": null,
|
||||
"meta_keywords": null,
|
||||
"show_in_feed": "Y",
|
||||
"max_cpc": 0,
|
||||
"in_store_min": null,
|
||||
"weight": 0.0100,
|
||||
"bonus_points": null,
|
||||
"data": "{\"generate_coupon\":\"N\",\"generate_coupon_discount\":\"67\"}",
|
||||
"show_in_search": "Y",
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null,
|
||||
"pohoda_sync_date": null
|
||||
}
|
||||
],
|
||||
"products_variations": [
|
||||
{
|
||||
"id": 76730,
|
||||
"id_product": 69086,
|
||||
"code": "la1119bikalblu_L",
|
||||
"ean": 5904577808869,
|
||||
"title": "Velikost: L",
|
||||
"in_store": 5,
|
||||
"delivery_time": 0,
|
||||
"price": 271.9008,
|
||||
"figure": "Y",
|
||||
"updated": "2021-08-25 11:20:22",
|
||||
"date_added": "2021-08-25 11:20:22",
|
||||
"weight": 0.1500,
|
||||
"bonus_points": null,
|
||||
"width": null,
|
||||
"height": null,
|
||||
"depth": null,
|
||||
"data": null,
|
||||
"price_common": null,
|
||||
"pohoda_sync_date": null
|
||||
}
|
||||
],
|
||||
"order_items": [
|
||||
{
|
||||
"id": 434242,
|
||||
"id_order": 273455,
|
||||
"id_product": 69416,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 1,
|
||||
"piece_price": 98.3471,
|
||||
"total_price": 98.3471,
|
||||
"descr": "Bavlněná rouška s kapsou na filtr korálová se srdíčky",
|
||||
"tax": 21,
|
||||
"date": "2021-08-25 11:48:13",
|
||||
"note": "",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 434243,
|
||||
"id_order": 273455,
|
||||
"id_product": null,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 114.0496,
|
||||
"total_price": 114.0496,
|
||||
"descr": "Dobírkou - GLS kurýr",
|
||||
"tax": 21,
|
||||
"date": "2021-08-25 13:48:13",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 434240,
|
||||
"id_order": 273454,
|
||||
"id_product": 69086,
|
||||
"id_variation": 76730,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 1,
|
||||
"piece_price": 271.9008,
|
||||
"total_price": 271.9008,
|
||||
"descr": "2 pack kalhotek 1119 BI modré (Velikost: L)",
|
||||
"tax": 21,
|
||||
"date": "2021-08-25 11:14:37",
|
||||
"note": "",
|
||||
"discount": 0.0000
|
||||
},
|
||||
{
|
||||
"id": 434241,
|
||||
"id_order": 273454,
|
||||
"id_product": null,
|
||||
"id_variation": null,
|
||||
"pieces": 1,
|
||||
"pieces_reserved": 0,
|
||||
"piece_price": 114.0496,
|
||||
"total_price": 114.0496,
|
||||
"descr": "Dobírkou - GLS kurýr",
|
||||
"tax": 21,
|
||||
"date": "2021-08-25 13:14:37",
|
||||
"note": "{\"item_type\":\"delivery\"}",
|
||||
"discount": 0.0000
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\Products;
|
||||
|
||||
use KupShop\PohodaBundle\Utils\Exporters\ProductExporter;
|
||||
use KupShop\PohodaBundle\Utils\Tools\TransformHelper;
|
||||
|
||||
class ProductCreateTest extends \DatabaseTestCase
|
||||
{
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* @var TransformHelper
|
||||
*/
|
||||
protected $transformHelper;
|
||||
|
||||
/**
|
||||
* @var ProductExporter
|
||||
*/
|
||||
protected $pohodaProductCreator;
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$this->pohodaOrderImporter = $this->get(ProductExporter::class);
|
||||
$this->transformHelper = $this->get(TransformHelper::class);
|
||||
}
|
||||
|
||||
public function testExportProductsTransform()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
$xmlResponse = file_get_contents(__DIR__.'/productExported.xml');
|
||||
$transformedXML = $this->transformHelper->baseTransform($xmlResponse, $this->transformHelper->loadXslt('createProducts.xsl'));
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/productsTransformed.xml', $transformedXML);
|
||||
}
|
||||
|
||||
public function testExportProducts()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
$pohodaProductCreator = $this->get(ProductExporter::class);
|
||||
|
||||
// $ordersOutXML = $ordersOut->getXML([4047]);
|
||||
//
|
||||
// $ordersOutXML = $this->transformHelper->baseTransform($ordersOutXML, $this->transformHelper->loadXslt('ordersOut.xsl'));
|
||||
//
|
||||
// $this->assertXmlStringEqualsXmlFile(__DIR__.'/ExportOrders.xml', $ordersOutXML->saveXML());
|
||||
$this->assertEquals(1, 1);
|
||||
}
|
||||
}
|
||||
104
bundles/KupShop/PohodaBundle/Tests/Products/productExported.xml
Normal file
104
bundles/KupShop/PohodaBundle/Tests/Products/productExported.xml
Normal file
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PRODUCTS>
|
||||
<PRODUCT>
|
||||
<PRODUCT_ID>69015</PRODUCT_ID>
|
||||
<CODE>eldarcatherinegrey</CODE>
|
||||
<EAN></EAN>
|
||||
<PRODUCT>Dámská spodní košilka Catherine šedá</PRODUCT>
|
||||
<SHORT_DESCRIPTION>Dámská šedá spodní košilka z kvalitní čisté bavlny s zdobnými prvky na horním okraji košilky - lesklá lemovka.
|
||||
</SHORT_DESCRIPTION>
|
||||
<LONG_DESCRIPTION><p>Tenká elastická ramínka. Košilka je pohodlná, skvěle padne na tělo. Jemný materiál, příjemný na dotek.
|
||||
Košilku můžete nosit pod oblečením především v chladnějším období. Baleno v dárkové krabičce. Celková délka košilky je cca 60 cm
|
||||
(velikost S, M), cca 62 cm (L), cca 64 cm (velikost XXL).</p>
|
||||
</LONG_DESCRIPTION>
|
||||
<ADDITIONAL_DESCRIPTION></ADDITIONAL_DESCRIPTION>
|
||||
<PRODUCER id="86">Eldar</PRODUCER>
|
||||
<WEIGHT></WEIGHT>
|
||||
<PRICE>180.9917</PRICE>
|
||||
<VAT>21</VAT>
|
||||
<RATEVAT>high</RATEVAT>
|
||||
<DISCOUNT>0</DISCOUNT>
|
||||
<IN_STORE>15</IN_STORE>
|
||||
<VISIBILITY>Y</VISIBILITY>
|
||||
<VARIATIONS>
|
||||
<VARIATION>
|
||||
<LABELS>
|
||||
<LABEL name="Velikost">XL</LABEL>
|
||||
</LABELS>
|
||||
<ID>76423</ID>
|
||||
<CODE>eldarcatherinegrey_XL</CODE>
|
||||
<EAN>5901490173197</EAN>
|
||||
<IN_STORE>1</IN_STORE>
|
||||
<PRICE>180.9917</PRICE>
|
||||
<VAT>21</VAT>
|
||||
<RATEVAT>high</RATEVAT>
|
||||
<VISIBILITY>Y</VISIBILITY>
|
||||
</VARIATION>
|
||||
</VARIATIONS>
|
||||
</PRODUCT>
|
||||
<PRODUCT>
|
||||
<PRODUCT_ID>69086</PRODUCT_ID>
|
||||
<CODE>la1119bikalblu</CODE>
|
||||
<EAN></EAN>
|
||||
<PRODUCT>2 pack kalhotek 1119 BI modré</PRODUCT>
|
||||
<SHORT_DESCRIPTION>Komfortní dámské kalhotky - 2 kusy v balení, zdobené krásnou krajkou na zadní části.</SHORT_DESCRIPTION>
|
||||
<LONG_DESCRIPTION><p>Dámské kalhotky v pestré kombinaci vzorů a barev. Kalhotky jsou vepředu hladké v kombinaci s elastickou
|
||||
jemnou krajkou, která přechází do zadní části. Jsou ušité z kvalitní bavlny, která v kombinaci s elastanem zajišťuje maximální
|
||||
pružnost látky. Kalhotky se krásně přizpůsobí Vaší postavě. Mají klasický střih. <strong>Cena je za 2 ks (v balení vždy
|
||||
dva vzory - viz fotografie).</strong></p>
|
||||
</LONG_DESCRIPTION>
|
||||
<ADDITIONAL_DESCRIPTION></ADDITIONAL_DESCRIPTION>
|
||||
<PRODUCER id="117">Lama</PRODUCER>
|
||||
<WEIGHT></WEIGHT>
|
||||
<PRICE>271.9008</PRICE>
|
||||
<VAT>21</VAT>
|
||||
<RATEVAT>high</RATEVAT>
|
||||
<DISCOUNT>0</DISCOUNT>
|
||||
<IN_STORE>36</IN_STORE>
|
||||
<VISIBILITY>Y</VISIBILITY>
|
||||
<VARIATIONS>
|
||||
<VARIATION>
|
||||
<LABELS>
|
||||
<LABEL name="Velikost">L</LABEL>
|
||||
</LABELS>
|
||||
<ID>76730</ID>
|
||||
<CODE>la1119bikalblu_L</CODE>
|
||||
<EAN>5904577808869</EAN>
|
||||
<IN_STORE>5</IN_STORE>
|
||||
<PRICE>271.9008</PRICE>
|
||||
<VAT>21</VAT>
|
||||
<RATEVAT>high</RATEVAT>
|
||||
<VISIBILITY>Y</VISIBILITY>
|
||||
</VARIATION>
|
||||
</VARIATIONS>
|
||||
</PRODUCT>
|
||||
<PRODUCT>
|
||||
<PRODUCT_ID>69416</PRODUCT_ID>
|
||||
<CODE>nellykoralsrdce</CODE>
|
||||
<EAN></EAN>
|
||||
<PRODUCT>Bavlněná rouška s kapsou na filtr korálová se srdíčky</PRODUCT>
|
||||
<SHORT_DESCRIPTION>Dvouvrstvá tvarovaná bavlněná rouška za uši a s kapsou na vložení filtru.</SHORT_DESCRIPTION>
|
||||
<LONG_DESCRIPTION><p>Kvalitní bavlněná rouška české výroby s kapsou na filtr. Ouška jsou v tunýlku. Šířka: 20 cm, výška včetně
|
||||
části pod bradu cca 14 cm.</p>
|
||||
|
||||
<p>Tento střih je velmi praktický, pohodlný a dobře sedí a roušku lze velmi rychle nasadit.</p>
|
||||
|
||||
<p>Rouška je vyrobena ze 100% bavlny. Roušku je možno vyvařovat. </p>
|
||||
|
||||
<p>Ochranná rouška je určena pro opakované použití. Nejedná se o certifikovanou zdravotní roušku. Každá rouška je hygienicky
|
||||
zabalena.</p>
|
||||
|
||||
<p><strong>Z hygienických důvodů dle §1837 písmeno g) občanského zákoníku se na roušky nevztahuje reklamace.</strong></p>
|
||||
</LONG_DESCRIPTION>
|
||||
<ADDITIONAL_DESCRIPTION></ADDITIONAL_DESCRIPTION>
|
||||
<PRODUCER id="73">ELEGANT</PRODUCER>
|
||||
<WEIGHT>0.0100</WEIGHT>
|
||||
<PRICE>131.4050</PRICE>
|
||||
<VAT>21</VAT>
|
||||
<RATEVAT>high</RATEVAT>
|
||||
<DISCOUNT>25.1572</DISCOUNT>
|
||||
<IN_STORE>30</IN_STORE>
|
||||
<VISIBILITY>Y</VISIBILITY>
|
||||
<VARIATIONS/>
|
||||
</PRODUCT>
|
||||
</PRODUCTS>
|
||||
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0"?>
|
||||
<dat:dataPack xmlns:dat="http://www.stormware.cz/schema/version_2/data.xsd" xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd" xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd" application="Pohoda" ico="{KUPSHOP_ICO}" id="1" note="KupshopSync" version="2.0">
|
||||
<dat:dataPackItem id="69015_76423" version="2.0">
|
||||
<stk:stock version="2.0">
|
||||
<stk:actionType>
|
||||
<stk:add/>
|
||||
</stk:actionType>
|
||||
<stk:stockHeader>
|
||||
<stk:stockType>card</stk:stockType>
|
||||
<stk:code>eldarcatherinegrey_XL</stk:code>
|
||||
<stk:EAN>5901490173197</stk:EAN>
|
||||
<stk:isInternet>true</stk:isInternet>
|
||||
<stk:name>Dámská spodní košilka Catherine šedá</stk:name>
|
||||
<stk:nameComplement/>
|
||||
<stk:typePrice>
|
||||
<typ:ids>Zákazník</typ:ids>
|
||||
</stk:typePrice>
|
||||
<stk:sellingRateVAT>high</stk:sellingRateVAT>
|
||||
<stk:purchasingPrice>0</stk:purchasingPrice>
|
||||
<stk:sellingPrice>180.9917</stk:sellingPrice>
|
||||
<stk:mass/>
|
||||
<stk:producer/>
|
||||
<stk:description>Dámská šedá spodní košilka z kvalitní čisté bavlny s zdobnými prvky na horním okraji košilky - lesklá lemovka.
|
||||
</stk:description>
|
||||
<stk:description2><p>Tenká elastická ramínka. Košilka je pohodlná, skvěle padne na tělo. Jemný materiál, příjemný na dotek.
|
||||
Košilku můžete nosit pod oblečením především v chladnějším období. Baleno v dárkové krabičce. Celková délka košilky je cca 60 cm
|
||||
(velikost S, M), cca 62 cm (L), cca 64 cm (velikost XXL).</p>
|
||||
</stk:description2>
|
||||
<stk:typeServiceMOSS>
|
||||
<typ:ids>GD</typ:ids>
|
||||
</stk:typeServiceMOSS>
|
||||
<stk:note>Načteno z XML.</stk:note>
|
||||
</stk:stockHeader>
|
||||
</stk:stock>
|
||||
</dat:dataPackItem>
|
||||
<dat:dataPackItem id="69086_76730" version="2.0">
|
||||
<stk:stock version="2.0">
|
||||
<stk:actionType>
|
||||
<stk:add/>
|
||||
</stk:actionType>
|
||||
<stk:stockHeader>
|
||||
<stk:stockType>card</stk:stockType>
|
||||
<stk:code>la1119bikalblu_L</stk:code>
|
||||
<stk:EAN>5904577808869</stk:EAN>
|
||||
<stk:isInternet>true</stk:isInternet>
|
||||
<stk:name>2 pack kalhotek 1119 BI modré</stk:name>
|
||||
<stk:nameComplement/>
|
||||
<stk:typePrice>
|
||||
<typ:ids>Zákazník</typ:ids>
|
||||
</stk:typePrice>
|
||||
<stk:sellingRateVAT>high</stk:sellingRateVAT>
|
||||
<stk:purchasingPrice>0</stk:purchasingPrice>
|
||||
<stk:sellingPrice>271.9008</stk:sellingPrice>
|
||||
<stk:mass/>
|
||||
<stk:producer/>
|
||||
<stk:description>Komfortní dámské kalhotky - 2 kusy v balení, zdobené krásnou krajkou na zadní části.</stk:description>
|
||||
<stk:description2><p>Dámské kalhotky v pestré kombinaci vzorů a barev. Kalhotky jsou vepředu hladké v kombinaci s elastickou
|
||||
jemnou krajkou, která přechází do zadní části. Jsou ušité z kvalitní bavlny, která v kombinaci s elastanem zajišťuje maximální
|
||||
pružnost látky. Kalhotky se krásně přizpůsobí Vaší postavě.  Mají klasický střih. <strong>Cena je za 2 ks (v balení vždy
|
||||
dva vzory - viz fotografie).</strong></p>
|
||||
</stk:description2>
|
||||
<stk:typeServiceMOSS>
|
||||
<typ:ids>GD</typ:ids>
|
||||
</stk:typeServiceMOSS>
|
||||
<stk:note>Načteno z XML.</stk:note>
|
||||
</stk:stockHeader>
|
||||
</stk:stock>
|
||||
</dat:dataPackItem>
|
||||
<dat:dataPackItem id="69416" version="2.0">
|
||||
<stk:stock version="2.0">
|
||||
<stk:actionType>
|
||||
<stk:add/>
|
||||
</stk:actionType>
|
||||
<stk:stockHeader>
|
||||
<stk:stockType>card</stk:stockType>
|
||||
<stk:code>nellykoralsrdce</stk:code>
|
||||
<stk:EAN/>
|
||||
<stk:isInternet>true</stk:isInternet>
|
||||
<stk:name>Bavlněná rouška s kapsou na filtr korálová se srdíčky</stk:name>
|
||||
<stk:typePrice>
|
||||
<typ:ids>Zákazník</typ:ids>
|
||||
</stk:typePrice>
|
||||
<stk:sellingRateVAT>high</stk:sellingRateVAT>
|
||||
<stk:purchasingPrice>0</stk:purchasingPrice>
|
||||
<stk:sellingPrice>131.4050</stk:sellingPrice>
|
||||
<stk:mass>0.0100</stk:mass>
|
||||
<stk:producer>ELEGANT</stk:producer>
|
||||
<stk:description>Dvouvrstvá tvarovaná bavlněná rouška za uši a s kapsou na vložení filtru.</stk:description>
|
||||
<stk:description2><p>Kvalitní bavlněná rouška české výroby s kapsou na filtr. Ouška jsou v tunýlku. Šířka: 20 cm, výška včetně
|
||||
části pod bradu cca 14 cm.</p>
|
||||

|
||||
<p>Tento střih je velmi praktický, pohodlný a dobře sedí a roušku lze velmi rychle nasadit.</p>
|
||||

|
||||
<p>Rouška je vyrobena ze 100% bavlny. Roušku je možno vyvařovat. </p>
|
||||

|
||||
<p>Ochranná rouška je určena pro opakované použití. Nejedná se o certifikovanou zdravotní roušku. Každá rouška je hygienicky
|
||||
zabalena.</p>
|
||||

|
||||
<p><strong>Z hygienických důvodů dle §1837 písmeno g) občanského zákoníku se na roušky nevztahuje reklamace.</strong></p>
|
||||
</stk:description2>
|
||||
<stk:typeServiceMOSS>
|
||||
<typ:ids>GD</typ:ids>
|
||||
</stk:typeServiceMOSS>
|
||||
<stk:note>Načteno z XML.</stk:note>
|
||||
</stk:stockHeader>
|
||||
</stk:stock>
|
||||
</dat:dataPackItem>
|
||||
</dat:dataPack>
|
||||
21
bundles/KupShop/PohodaBundle/Tests/ShopItems_withStores.xml
Normal file
21
bundles/KupShop/PohodaBundle/Tests/ShopItems_withStores.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SHOP xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd">
|
||||
<SHOPITEM>
|
||||
<PRODUCT_CODE>B00536</PRODUCT_CODE>
|
||||
<PRODUCT>AKTIVNÍ UHLÍ KYBLÍK 4 kg</PRODUCT>
|
||||
<STORE id="2">2</STORE>
|
||||
<VAT>21</VAT>
|
||||
<PRICE>487.603305785124</PRICE>
|
||||
<EAN>8595635600371</EAN>
|
||||
</SHOPITEM>
|
||||
<SHOPITEM>
|
||||
<PRODUCT_CODE>B00536</PRODUCT_CODE>
|
||||
<PRODUCT>AKTIVNÍ UHLÍ KYBLÍK 4 kg</PRODUCT>
|
||||
<STORE id="3">3</STORE>
|
||||
<VAT>21</VAT>
|
||||
<PRICE>487.603305785124</PRICE>
|
||||
<EAN>8595635600371</EAN>
|
||||
</SHOPITEM>
|
||||
</SHOP>
|
||||
51
bundles/KupShop/PohodaBundle/Tests/TestUtilHelper.php
Normal file
51
bundles/KupShop/PohodaBundle/Tests/TestUtilHelper.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests;
|
||||
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
use KupShop\PohodaBundle\Utils\PohodaConnector;
|
||||
|
||||
/**
|
||||
* Trait TestUtilHelper.
|
||||
*/
|
||||
trait TestUtilHelper
|
||||
{
|
||||
public function prepareMServer($username = 'Admin', $passwd = '', $ico = '0123456789', $url = 'http://test:4052/xml')
|
||||
{
|
||||
$this->pohodaConnector = ServiceContainer::getService(PohodaConnector::class);
|
||||
$dbcfg = \Settings::getDefault();
|
||||
|
||||
if (empty($dbcfg->loadValue('pohoda'))) {
|
||||
\Settings::getDefault()->saveValue('pohoda', []);
|
||||
}
|
||||
|
||||
$pohoda = $dbcfg->loadValue('pohoda') ?: [];
|
||||
|
||||
$pohoda['mservers'][] = [
|
||||
'active' => 'Y',
|
||||
'url' => $url,
|
||||
'username' => $username,
|
||||
'password' => $passwd,
|
||||
'server_name' => '123',
|
||||
'ico' => $ico,
|
||||
'maintenanceFrom' => '',
|
||||
'maintenanceTo' => '',
|
||||
'productsIn' => [
|
||||
'last_sync' => '13.5.2021 16:12:59',
|
||||
'internet' => 'N', ],
|
||||
'ordersOut' => [
|
||||
'last_sync' => '13.5.2021 17:28:09',
|
||||
'last_sync_diff' => '', ],
|
||||
'issuedInvoiceIn' => [
|
||||
'last_sync' => '',
|
||||
'last_sync_diff' => '', ],
|
||||
'dev_activate' => 'Y',
|
||||
'usersOut' => [
|
||||
'last_sync' => '13.5.2021 17:28:09',
|
||||
'last_sync_diff' => '', ],
|
||||
];
|
||||
|
||||
$dbcfg->updateValue('pohoda', $pohoda);
|
||||
$this->pohodaConnector->reloadConfig();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,292 @@
|
||||
{
|
||||
"users" : [
|
||||
{
|
||||
"id" : 2,
|
||||
"id_language" : null,
|
||||
"passw" : "$2y$10$SYA9i04HEUEp31hGoze/WuuWzsLo8xxmJSqmyGubMeoWobxjA0/K.",
|
||||
"user_key" : "r90p06rftme6v8dg11j6prcc81",
|
||||
"figure" : "Y",
|
||||
"name" : "Wpj",
|
||||
"surname" : "Wpj",
|
||||
"firm" : "",
|
||||
"street" : "Fügnerova 1288",
|
||||
"city" : "Vrchlabí",
|
||||
"zip" : "54301",
|
||||
"country" : "",
|
||||
"currency" : "CZK",
|
||||
"email" : "wpj@wpj.cz",
|
||||
"ico" : "",
|
||||
"dic" : "",
|
||||
"phone" : "+420775131478",
|
||||
"mobile" : "",
|
||||
"fax" : "",
|
||||
"gender" : null,
|
||||
"delivery_name" : "",
|
||||
"delivery_surname" : "",
|
||||
"delivery_firm" : "",
|
||||
"delivery_street" : "",
|
||||
"delivery_city" : "",
|
||||
"delivery_zip" : "",
|
||||
"delivery_country" : "",
|
||||
"account_no" : "",
|
||||
"account_bank" : "",
|
||||
"account_symbol" : "",
|
||||
"get_news" : "Y",
|
||||
"prefer_transport" : null,
|
||||
"date_reg" : "2023-08-01 12:09:05",
|
||||
"date_updated" : "2023-08-01 12:09:05",
|
||||
"date_logged" : null,
|
||||
"custom_address" : "",
|
||||
"state" : "",
|
||||
"delivery_custom_address" : "",
|
||||
"delivery_state" : "",
|
||||
"date_subscribe" : "2015-02-16 00:00:00",
|
||||
"date_unsubscribe" : null,
|
||||
"note" : null,
|
||||
"custom_data" : null,
|
||||
"delivery_phone" : "",
|
||||
"pohoda_id" : null,
|
||||
"pohoda_sync_date" : null,
|
||||
"pohoda_id_address" : null,
|
||||
"id_pricelist" : null,
|
||||
"due_days" : null,
|
||||
"birthdate" : null
|
||||
},
|
||||
{
|
||||
"id" : 3,
|
||||
"id_language" : null,
|
||||
"passw" : "$2y$10$njbmSrHDfMUwdQUk83t80eyukaqW4EsaCGpvGp1dEOOOnlyAyN.RK",
|
||||
"user_key" : "",
|
||||
"figure" : "Y",
|
||||
"name" : "Joe",
|
||||
"surname" : "Joe",
|
||||
"firm" : "",
|
||||
"street" : "",
|
||||
"city" : "",
|
||||
"zip" : "",
|
||||
"country" : "",
|
||||
"currency" : "CZK",
|
||||
"email" : "joe@wpj.cz",
|
||||
"ico" : "",
|
||||
"dic" : "",
|
||||
"phone" : "",
|
||||
"mobile" : "",
|
||||
"fax" : "",
|
||||
"gender" : null,
|
||||
"delivery_name" : "",
|
||||
"delivery_surname" : "",
|
||||
"delivery_firm" : "",
|
||||
"delivery_street" : "",
|
||||
"delivery_city" : "",
|
||||
"delivery_zip" : "",
|
||||
"delivery_country" : "",
|
||||
"account_no" : "",
|
||||
"account_bank" : "",
|
||||
"account_symbol" : "",
|
||||
"get_news" : "Y",
|
||||
"prefer_transport" : null,
|
||||
"date_reg" : "2015-02-16 00:00:00",
|
||||
"date_updated" : "2015-02-16 00:00:00",
|
||||
"date_logged" : null,
|
||||
"custom_address" : "",
|
||||
"state" : "",
|
||||
"delivery_custom_address" : "",
|
||||
"delivery_state" : "",
|
||||
"date_subscribe" : "2015-02-16 00:00:00",
|
||||
"date_unsubscribe" : null,
|
||||
"note" : null,
|
||||
"custom_data" : null,
|
||||
"delivery_phone" : "",
|
||||
"pohoda_id" : null
|
||||
},
|
||||
{
|
||||
"id" : 12,
|
||||
"id_language" : "cs",
|
||||
"passw" : "",
|
||||
"user_key" : "",
|
||||
"figure" : "N",
|
||||
"name" : "dfsaas",
|
||||
"surname" : "fdsfsadfas",
|
||||
"firm" : "",
|
||||
"street" : "dsafsdafsa 55",
|
||||
"city" : "sdfdsafdsa",
|
||||
"zip" : "50000",
|
||||
"country" : "CZ",
|
||||
"currency" : "CZK",
|
||||
"email" : "haman@wpj.cz",
|
||||
"ico" : "",
|
||||
"dic" : "",
|
||||
"phone" : "+420123456789",
|
||||
"mobile" : "",
|
||||
"fax" : "",
|
||||
"gender" : null,
|
||||
"delivery_name" : "dfsaas",
|
||||
"delivery_surname" : "fdsfsadfas",
|
||||
"delivery_firm" : "",
|
||||
"delivery_street" : "dsafsdafsa 55",
|
||||
"delivery_city" : "sdfdsafdsa",
|
||||
"delivery_zip" : "50000",
|
||||
"delivery_country" : "CZ",
|
||||
"account_no" : "",
|
||||
"account_bank" : "",
|
||||
"account_symbol" : "",
|
||||
"get_news" : "Y",
|
||||
"prefer_transport" : null,
|
||||
"date_reg" : "2020-03-18 08:53:57",
|
||||
"date_updated" : "2020-03-18 08:53:57",
|
||||
"date_logged" : null,
|
||||
"custom_address" : "",
|
||||
"state" : "",
|
||||
"delivery_custom_address" : "",
|
||||
"delivery_state" : "",
|
||||
"date_subscribe" : "2020-03-18 08:53:57",
|
||||
"date_unsubscribe" : null,
|
||||
"note" : null,
|
||||
"custom_data" : null,
|
||||
"delivery_phone" : "+420123456789",
|
||||
"pohoda_id" : null
|
||||
},
|
||||
{
|
||||
"id" : 13,
|
||||
"id_language" : "cs",
|
||||
"passw" : "",
|
||||
"user_key" : "",
|
||||
"figure" : "N",
|
||||
"name" : "Jan",
|
||||
"surname" : "Test",
|
||||
"firm" : "",
|
||||
"street" : "",
|
||||
"city" : "",
|
||||
"zip" : "",
|
||||
"country" : "CZ",
|
||||
"currency" : "CZK",
|
||||
"email" : "prokop@wpj.cz",
|
||||
"ico" : "",
|
||||
"dic" : "",
|
||||
"phone" : "+420773566666",
|
||||
"mobile" : "",
|
||||
"fax" : "",
|
||||
"gender" : null,
|
||||
"delivery_name" : "Jan",
|
||||
"delivery_surname" : "Test",
|
||||
"delivery_firm" : "",
|
||||
"delivery_street" : "",
|
||||
"delivery_city" : "",
|
||||
"delivery_zip" : "",
|
||||
"delivery_country" : "CZ",
|
||||
"account_no" : "",
|
||||
"account_bank" : "",
|
||||
"account_symbol" : "",
|
||||
"get_news" : "Y",
|
||||
"prefer_transport" : null,
|
||||
"date_reg" : "2020-03-18 08:53:57",
|
||||
"date_updated" : "2020-06-04 08:14:49",
|
||||
"date_logged" : null,
|
||||
"custom_address" : "",
|
||||
"state" : "",
|
||||
"delivery_custom_address" : "",
|
||||
"delivery_state" : "",
|
||||
"date_subscribe" : "2020-04-25 10:46:53",
|
||||
"date_unsubscribe" : null,
|
||||
"note" : null,
|
||||
"custom_data" : null,
|
||||
"delivery_phone" : "+420773566666",
|
||||
"pohoda_id" : null
|
||||
},
|
||||
{
|
||||
"id" : 14,
|
||||
"id_language" : "cs",
|
||||
"passw" : "",
|
||||
"user_key" : "",
|
||||
"figure" : "N",
|
||||
"name" : "Candy",
|
||||
"surname" : "Store",
|
||||
"firm" : "",
|
||||
"street" : "Zamocka 1",
|
||||
"city" : "Bratislava",
|
||||
"zip" : "81103",
|
||||
"country" : "SK",
|
||||
"currency" : "CZK",
|
||||
"email" : "info@candy-store.cz",
|
||||
"ico" : "",
|
||||
"dic" : "",
|
||||
"phone" : "+421777018998",
|
||||
"mobile" : "",
|
||||
"fax" : "",
|
||||
"gender" : null,
|
||||
"delivery_name" : "Candy",
|
||||
"delivery_surname" : "Store",
|
||||
"delivery_firm" : "",
|
||||
"delivery_street" : "Zamocka 1",
|
||||
"delivery_city" : "Bratislava",
|
||||
"delivery_zip" : "81103",
|
||||
"delivery_country" : "SK",
|
||||
"account_no" : "",
|
||||
"account_bank" : "",
|
||||
"account_symbol" : "",
|
||||
"get_news" : "Y",
|
||||
"prefer_transport" : null,
|
||||
"date_reg" : "2020-03-18 08:53:57",
|
||||
"date_updated" : "2020-06-08 13:12:35",
|
||||
"date_logged" : null,
|
||||
"custom_address" : "",
|
||||
"state" : "",
|
||||
"delivery_custom_address" : "",
|
||||
"delivery_state" : "",
|
||||
"date_subscribe" : "2020-05-05 15:50:12",
|
||||
"date_unsubscribe" : null,
|
||||
"note" : null,
|
||||
"custom_data" : null,
|
||||
"delivery_phone" : "+421777018998",
|
||||
"pohoda_id" : null
|
||||
},
|
||||
{
|
||||
"id" : 18,
|
||||
"id_language" : null,
|
||||
"passw" : "$2y$10$A4IVAx3.r13yV0Xg50CLBuvs51NEXoiwvOjYFfT1BkH.0JbVfa63q",
|
||||
"user_key" : "",
|
||||
"figure" : "Y",
|
||||
"name" : "Martin",
|
||||
"surname" : "Strejček",
|
||||
"firm" : "",
|
||||
"street" : "U Rajské zahrady 8",
|
||||
"city" : "Praha 3",
|
||||
"zip" : "13000",
|
||||
"country" : "CZ",
|
||||
"currency" : "CZK",
|
||||
"email" : "martin.strejcek@volny.cz",
|
||||
"ico" : "",
|
||||
"dic" : "",
|
||||
"phone" : "+420774052987",
|
||||
"mobile" : "",
|
||||
"fax" : "",
|
||||
"gender" : null,
|
||||
"delivery_name" : "Martin",
|
||||
"delivery_surname" : "Strejček",
|
||||
"delivery_firm" : "Martin Strejček",
|
||||
"delivery_street" : "U Rajské zahrady 8",
|
||||
"delivery_city" : "Praha 3",
|
||||
"delivery_zip" : "13000",
|
||||
"delivery_country" : "CZ",
|
||||
"account_no" : "",
|
||||
"account_bank" : "",
|
||||
"account_symbol" : "",
|
||||
"get_news" : "N",
|
||||
"prefer_transport" : null,
|
||||
"date_reg" : "2017-08-07 09:50:03",
|
||||
"date_updated" : "2018-08-07 09:50:03",
|
||||
"date_logged" : null,
|
||||
"custom_address" : "",
|
||||
"state" : "",
|
||||
"delivery_custom_address" : "",
|
||||
"delivery_state" : "",
|
||||
"date_subscribe" : null,
|
||||
"date_unsubscribe" : null,
|
||||
"note" : null,
|
||||
"custom_data" : null,
|
||||
"delivery_phone" : "",
|
||||
"pohoda_id" : null,
|
||||
"pohoda_sync_date" : "2020-08-10 12:02:14"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\Users\Export;
|
||||
|
||||
use KupShop\DevelopmentBundle\Util\Tests\LoggerTestTrait;
|
||||
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
||||
use KupShop\PohodaBundle\Tests\TestUtilHelper;
|
||||
use KupShop\PohodaBundle\Utils\Exporters\UsersExporter;
|
||||
use KupShop\PohodaBundle\Utils\PohodaConnector;
|
||||
use KupShop\PohodaBundle\Utils\Tools\TransformHelper;
|
||||
use KupShop\UserBundle\Event\UserRegisteredEvent;
|
||||
use KupShop\UserBundle\Util\UserExporter;
|
||||
use Query\Operator;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Messenger\TraceableMessageBus;
|
||||
|
||||
class ExportUserTest extends \DatabaseTestCase
|
||||
{
|
||||
use LoggerTestTrait;
|
||||
|
||||
use TestUtilHelper;
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
protected TransformHelper $transformHelper;
|
||||
|
||||
protected UserExporter $userExporter;
|
||||
|
||||
protected UsersExporter $usersExporter;
|
||||
|
||||
private TraceableMessageBus $asyncBus;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->asyncBus = $this->get('async_bus');
|
||||
}
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$this->userExporter = $this->get(UserExporter::class);
|
||||
$this->transformHelper = $this->get(TransformHelper::class);
|
||||
$this->usersExporter = $this->get(UsersExporter::class);
|
||||
$this->getLogger();
|
||||
$this->prepareMServer();
|
||||
}
|
||||
|
||||
public function testTransformUsersOut()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
// LOAD FILE
|
||||
$xmlResponse = file_get_contents(__DIR__.'/exportedUsersOut.xml');
|
||||
|
||||
// TRANSFORM XML
|
||||
$resultXML = $this->transformHelper->baseTransform($xmlResponse, $this->transformHelper->loadXslt('usersOut.xsl'));
|
||||
|
||||
// COMPARE TRANSFORMATION
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/usersOutResult.xml', $resultXML);
|
||||
}
|
||||
|
||||
public function testProcessResponse()
|
||||
{
|
||||
$this->setEnvironment();
|
||||
|
||||
// LOAD RESPONSE FILE
|
||||
$xmlResponse = file_get_contents(__DIR__.'/addressProcessResponse.xml');
|
||||
|
||||
// SUSPICIOUS USERS
|
||||
$IDs = [18];
|
||||
|
||||
// TEST BEFORE UPDATE
|
||||
$beforeAction = $this->getActualUsers($IDs);
|
||||
$this->assertEquals(null, $beforeAction['martin.strejcek@volny.cz']['pohoda_id']);
|
||||
|
||||
// UPDATE USERS pohoda_id
|
||||
$this->usersExporter->processResponse($xmlResponse);
|
||||
|
||||
// TEST AFTER UPDATE
|
||||
$afterAction = $this->getActualUsers($IDs);
|
||||
$this->assertEquals('8867', $afterAction['martin.strejcek@volny.cz']['pohoda_id']);
|
||||
|
||||
$response = simplexml_load_string($xmlResponse);
|
||||
$logData = null;
|
||||
foreach ($response->xpath('rsp:responsePackItem') as $responsePackItem) {
|
||||
$logData = $responsePackItem->asXML();
|
||||
}
|
||||
$testHandler = $this->getTestHandler();
|
||||
$this->assertEquals(true, $testHandler->hasNoticeThatContains('POHODA RESPONSE: User Export'));
|
||||
foreach ($testHandler->getRecords() as $record) {
|
||||
if ($record['message'] == 'POHODA RESPONSE: User Export') {
|
||||
$this->assertEquals($logData, $record['context']['data']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function testAsyncExportUser()
|
||||
{
|
||||
$instance = $this->autowire(PohodaConnectorMock::class);
|
||||
$this->set(PohodaConnector::class, $instance);
|
||||
|
||||
$this->prepareMServer();
|
||||
|
||||
$eventDispatcher = ServiceContainer::getService(EventDispatcherInterface::class);
|
||||
$event = new UserRegisteredEvent(\User::createFromId(2));
|
||||
|
||||
$returnValue = $eventDispatcher->dispatch($event);
|
||||
|
||||
self::assertEquals(2, $returnValue->getUser()->id);
|
||||
|
||||
$pohodaId = sqlQueryBuilder()->select('pohoda_id')
|
||||
->from('users')
|
||||
->where('id=2')
|
||||
->execute()->fetchOne();
|
||||
|
||||
$this->assertEquals(999, $pohodaId);
|
||||
}
|
||||
|
||||
private function getActualUsers($IDs)
|
||||
{
|
||||
return sqlFetchAll(sqlQueryBuilder()
|
||||
->select('id, pohoda_id, email')
|
||||
->from('users')
|
||||
->andWhere(Operator::inIntArray($IDs, 'id'))
|
||||
->execute(), 'email');
|
||||
}
|
||||
}
|
||||
|
||||
class PohodaConnectorMock extends PohodaConnector
|
||||
{
|
||||
public function sendRequest($XmlBodyRequest)
|
||||
{
|
||||
return '<?xml version="1.0" encoding="WINDOWS-1250"?>
|
||||
<rsp:responsePack xmlns:lwl="http://www.stormware.cz/schema/version_2/liquidationWithoutLink.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd" note="Users export"
|
||||
key="0cf0e9cd-23ce-498c-8f2d-2b2149efa343" ico="0123456789" programVersion="13304.1 SQL (2.2.2023)" state="ok" id=""
|
||||
version="2.0">
|
||||
<rsp:responsePackItem state="ok" id="2" version="2.0">
|
||||
<adb:addressbookResponse state="ok" version="2.0">
|
||||
<rdc:producedDetails>
|
||||
<rdc:id>999</rdc:id>
|
||||
<rdc:code/>
|
||||
<rdc:actionType>add</rdc:actionType>
|
||||
</rdc:producedDetails>
|
||||
</adb:addressbookResponse>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="Windows-1250"?>
|
||||
<rsp:responsePack version="2.0" id="" state="ok" programVersion="12502.14 SQL (30.6.2020)" ico="04535510"
|
||||
key="4ba37787-5455-4689-bdcc-c519e4375dda" note="Users export"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd"
|
||||
xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd"
|
||||
xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd"
|
||||
xmlns:lCen="http://www.stormware.cz/schema/version_2/list_centre.xsd"
|
||||
xmlns:lAcv="http://www.stormware.cz/schema/version_2/list_activity.xsd"
|
||||
xmlns:acu="http://www.stormware.cz/schema/version_2/accountingunit.xsd"
|
||||
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
|
||||
xmlns:vch="http://www.stormware.cz/schema/version_2/voucher.xsd"
|
||||
xmlns:int="http://www.stormware.cz/schema/version_2/intDoc.xsd"
|
||||
xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd"
|
||||
xmlns:ofr="http://www.stormware.cz/schema/version_2/offer.xsd"
|
||||
xmlns:enq="http://www.stormware.cz/schema/version_2/enquiry.xsd"
|
||||
xmlns:vyd="http://www.stormware.cz/schema/version_2/vydejka.xsd"
|
||||
xmlns:pri="http://www.stormware.cz/schema/version_2/prijemka.xsd"
|
||||
xmlns:bal="http://www.stormware.cz/schema/version_2/balance.xsd"
|
||||
xmlns:pre="http://www.stormware.cz/schema/version_2/prevodka.xsd"
|
||||
xmlns:vyr="http://www.stormware.cz/schema/version_2/vyroba.xsd"
|
||||
xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd"
|
||||
xmlns:con="http://www.stormware.cz/schema/version_2/contract.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd"
|
||||
xmlns:prm="http://www.stormware.cz/schema/version_2/parameter.xsd"
|
||||
xmlns:lCon="http://www.stormware.cz/schema/version_2/list_contract.xsd"
|
||||
xmlns:ctg="http://www.stormware.cz/schema/version_2/category.xsd"
|
||||
xmlns:ipm="http://www.stormware.cz/schema/version_2/intParam.xsd"
|
||||
xmlns:str="http://www.stormware.cz/schema/version_2/storage.xsd"
|
||||
xmlns:idp="http://www.stormware.cz/schema/version_2/individualPrice.xsd"
|
||||
xmlns:sup="http://www.stormware.cz/schema/version_2/supplier.xsd"
|
||||
xmlns:prn="http://www.stormware.cz/schema/version_2/print.xsd"
|
||||
xmlns:sEET="http://www.stormware.cz/schema/version_2/sendEET.xsd"
|
||||
xmlns:act="http://www.stormware.cz/schema/version_2/accountancy.xsd"
|
||||
xmlns:bnk="http://www.stormware.cz/schema/version_2/bank.xsd"
|
||||
xmlns:sto="http://www.stormware.cz/schema/version_2/store.xsd"
|
||||
xmlns:grs="http://www.stormware.cz/schema/version_2/groupStocks.xsd"
|
||||
xmlns:acp="http://www.stormware.cz/schema/version_2/actionPrice.xsd"
|
||||
xmlns:csh="http://www.stormware.cz/schema/version_2/cashRegister.xsd"
|
||||
xmlns:bka="http://www.stormware.cz/schema/version_2/bankAccount.xsd"
|
||||
xmlns:ilt="http://www.stormware.cz/schema/version_2/inventoryLists.xsd"
|
||||
xmlns:nms="http://www.stormware.cz/schema/version_2/numericalSeries.xsd"
|
||||
xmlns:pay="http://www.stormware.cz/schema/version_2/payment.xsd"
|
||||
xmlns:mKasa="http://www.stormware.cz/schema/version_2/mKasa.xsd"
|
||||
xmlns:gdp="http://www.stormware.cz/schema/version_2/GDPR.xsd"
|
||||
xmlns:est="http://www.stormware.cz/schema/version_2/establishment.xsd"
|
||||
xmlns:cen="http://www.stormware.cz/schema/version_2/centre.xsd"
|
||||
xmlns:acv="http://www.stormware.cz/schema/version_2/activity.xsd"
|
||||
xmlns:afp="http://www.stormware.cz/schema/version_2/accountingFormOfPayment.xsd"
|
||||
xmlns:vat="http://www.stormware.cz/schema/version_2/classificationVAT.xsd"
|
||||
xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd"
|
||||
xmlns:asv="http://www.stormware.cz/schema/version_2/accountingSalesVouchers.xsd"
|
||||
xmlns:arch="http://www.stormware.cz/schema/version_2/archive.xsd">
|
||||
<rsp:responsePackItem version="2.0" id="18" state="ok">
|
||||
<adb:addressbookResponse version="2.0" state="ok">
|
||||
<rdc:producedDetails>
|
||||
<rdc:id>8867</rdc:id>
|
||||
<rdc:code/>
|
||||
<rdc:actionType>update</rdc:actionType>
|
||||
<rdc:itemDetails type="ADdodaci">
|
||||
<rdc:item>
|
||||
<rdc:actionType>add</rdc:actionType>
|
||||
<rdc:producedItem>
|
||||
<rdc:id>48759</rdc:id>
|
||||
</rdc:producedItem>
|
||||
</rdc:item>
|
||||
</rdc:itemDetails>
|
||||
</rdc:producedDetails>
|
||||
</adb:addressbookResponse>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>
|
||||
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<USERS>
|
||||
<USER>
|
||||
<ID>12</ID>
|
||||
<EMAIL>wpj@wpj.cz</EMAIL>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<INVOICE>
|
||||
<NAME>TestPoImportu</NAME>
|
||||
<SURNAME>WpjPoImportu</SURNAME>
|
||||
<COMPANY>wpj s.r.o.</COMPANY>
|
||||
<ADDRESS>Ulice 12</ADDRESS>
|
||||
<CITY>Mesto</CITY>
|
||||
<ZIP>54321</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<ICO>12345678</ICO>
|
||||
<DIC>CZ12345678</DIC>
|
||||
<PHONE>777 777 777</PHONE>
|
||||
<ADDRESS2>Firma wpj s.r.o.</ADDRESS2>
|
||||
<STATE>Stát</STATE>
|
||||
</INVOICE>
|
||||
<DELIVERY>
|
||||
<NAME>Test</NAME>
|
||||
<SURNAME>Wpj</SURNAME>
|
||||
<COMPANY>wpj s.r.o.</COMPANY>
|
||||
<ADDRESS>Ulice 12</ADDRESS>
|
||||
<CITY>Mesto</CITY>
|
||||
<ZIP>12345</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE>777 777 777</PHONE>
|
||||
<ADDRESS2>Firma wpj s.r.o.</ADDRESS2>
|
||||
<STATE>Královehradecká kraj</STATE>
|
||||
</DELIVERY>
|
||||
<DATE>
|
||||
<REG>2020-05-25 13:58:22</REG>
|
||||
<SUBSCRIBE>2020-05-25 13:58:23</SUBSCRIBE>
|
||||
<UNSUBSCRIBE>2020-05-25 13:58:24</UNSUBSCRIBE>
|
||||
</DATE>
|
||||
</USER>
|
||||
<USER>
|
||||
<ID>13</ID>
|
||||
<EMAIL>customupdate@wpj.cz</EMAIL>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<INVOICE>
|
||||
<NAME>Test</NAME>
|
||||
<SURNAME>Wpj</SURNAME>
|
||||
<COMPANY>wpj s.r.o.</COMPANY>
|
||||
<ADDRESS>Ulice 12</ADDRESS>
|
||||
<CITY>Mesto</CITY>
|
||||
<ZIP>54321</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<ICO>12345678</ICO>
|
||||
<DIC>CZ12345678</DIC>
|
||||
<PHONE>777 777 777</PHONE>
|
||||
<ADDRESS2>Firma wpj s.r.o.</ADDRESS2>
|
||||
<STATE>Stát</STATE>
|
||||
</INVOICE>
|
||||
<DELIVERY>
|
||||
<NAME>Test</NAME>
|
||||
<SURNAME>Wpj</SURNAME>
|
||||
<COMPANY>wpj s.r.o.</COMPANY>
|
||||
<ADDRESS>Ulice 12</ADDRESS>
|
||||
<CITY>Mesto</CITY>
|
||||
<ZIP>12345</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE>777 777 777</PHONE>
|
||||
<ADDRESS2>Firma wpj s.r.o.</ADDRESS2>
|
||||
<STATE>Královehradecká kraj</STATE>
|
||||
</DELIVERY>
|
||||
<DATE>
|
||||
<REG>2020-05-25 13:58:22</REG>
|
||||
<SUBSCRIBE>2020-05-25 13:58:23</SUBSCRIBE>
|
||||
<UNSUBSCRIBE>2020-05-25 13:58:24</UNSUBSCRIBE>
|
||||
</DATE>
|
||||
</USER>
|
||||
<USER>
|
||||
<ID>4</ID>
|
||||
<EMAIL>petr@peggy.com</EMAIL>
|
||||
<CURRENCY>CZK</CURRENCY>
|
||||
<GROUPS/>
|
||||
<INVOICE>
|
||||
<NAME>Pe</NAME>
|
||||
<SURNAME>Peggy</SURNAME>
|
||||
<COMPANY>kelio</COMPANY>
|
||||
<ADDRESS>manicky 2</ADDRESS>
|
||||
<CITY>Brno</CITY>
|
||||
<ZIP>61400</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<ICO></ICO>
|
||||
<DIC></DIC>
|
||||
<PHONE>111222333</PHONE>
|
||||
<ADDRESS2></ADDRESS2>
|
||||
<STATE></STATE>
|
||||
</INVOICE>
|
||||
<DELIVERY>
|
||||
<NAME></NAME>
|
||||
<SURNAME></SURNAME>
|
||||
<COMPANY>Peggyho Kelio</COMPANY>
|
||||
<ADDRESS>0</ADDRESS>
|
||||
<CITY>Brno</CITY>
|
||||
<ZIP>61400</ZIP>
|
||||
<COUNTRY>CZ</COUNTRY>
|
||||
<PHONE></PHONE>
|
||||
<ADDRESS2></ADDRESS2>
|
||||
<STATE></STATE>
|
||||
</DELIVERY>
|
||||
<DATE>
|
||||
<REG>2014-06-11 14:46:18</REG>
|
||||
<SUBSCRIBE>0000-00-00 00:00:00</SUBSCRIBE>
|
||||
<UNSUBSCRIBE></UNSUBSCRIBE>
|
||||
</DATE>
|
||||
<POHODA_ID>638626</POHODA_ID>
|
||||
<POHODA_ID_ADDRESS>1480</POHODA_ID_ADDRESS>
|
||||
<GET_NEWS>N</GET_NEWS>
|
||||
</USER>
|
||||
</USERS>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><dat:dataPack xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd" xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd" xmlns:dat="http://www.stormware.cz/schema/version_2/data.xsd" xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd" version="2.0" id="" application="Pohoda" note="Users export" ico="{KUPSHOP_ICO}">
|
||||
<dat:dataPackItem id="12" version="2.0">
|
||||
<adb:addressbook version="2.0">
|
||||
<adb:addressbookHeader>
|
||||
<adb:identity>
|
||||
<typ:address>
|
||||
<typ:company>wpj s.r.o.</typ:company>
|
||||
<typ:name>TestPoImportu WpjPoImportu</typ:name>
|
||||
<typ:city>Mesto</typ:city>
|
||||
<typ:street>Ulice 12</typ:street>
|
||||
<typ:zip>54321</typ:zip>
|
||||
<typ:ico>12345678</typ:ico>
|
||||
<typ:dic>CZ12345678</typ:dic>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>777 777 777</typ:phone>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:defaultShipAddress>true</typ:defaultShipAddress>
|
||||
<typ:company>wpj s.r.o.</typ:company>
|
||||
<typ:name>Test Wpj</typ:name>
|
||||
<typ:city>Mesto</typ:city>
|
||||
<typ:street>Ulice 12</typ:street>
|
||||
<typ:zip>12345</typ:zip>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>777 777 777</typ:phone>
|
||||
</typ:shipToAddress>
|
||||
</adb:identity>
|
||||
<adb:region>Stát</adb:region>
|
||||
<adb:phone>777 777 777</adb:phone>
|
||||
<adb:email>wpj@wpj.cz</adb:email>
|
||||
</adb:addressbookHeader>
|
||||
</adb:addressbook>
|
||||
</dat:dataPackItem>
|
||||
<dat:dataPackItem id="13" version="2.0">
|
||||
<adb:addressbook version="2.0">
|
||||
<adb:addressbookHeader>
|
||||
<adb:identity>
|
||||
<typ:address>
|
||||
<typ:company>wpj s.r.o.</typ:company>
|
||||
<typ:name>Test Wpj</typ:name>
|
||||
<typ:city>Mesto</typ:city>
|
||||
<typ:street>Ulice 12</typ:street>
|
||||
<typ:zip>54321</typ:zip>
|
||||
<typ:ico>12345678</typ:ico>
|
||||
<typ:dic>CZ12345678</typ:dic>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>777 777 777</typ:phone>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:defaultShipAddress>true</typ:defaultShipAddress>
|
||||
<typ:company>wpj s.r.o.</typ:company>
|
||||
<typ:name>Test Wpj</typ:name>
|
||||
<typ:city>Mesto</typ:city>
|
||||
<typ:street>Ulice 12</typ:street>
|
||||
<typ:zip>12345</typ:zip>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>777 777 777</typ:phone>
|
||||
</typ:shipToAddress>
|
||||
</adb:identity>
|
||||
<adb:region>Stát</adb:region>
|
||||
<adb:phone>777 777 777</adb:phone>
|
||||
<adb:email>customupdate@wpj.cz</adb:email>
|
||||
</adb:addressbookHeader>
|
||||
</adb:addressbook>
|
||||
</dat:dataPackItem>
|
||||
<dat:dataPackItem id="4" version="2.0">
|
||||
<adb:addressbook version="2.0">
|
||||
<adb:actionType>
|
||||
<adb:update>
|
||||
<ftr:filter>
|
||||
<ftr:id>638626</ftr:id>
|
||||
</ftr:filter>
|
||||
</adb:update>
|
||||
</adb:actionType>
|
||||
<adb:addressbookHeader>
|
||||
<adb:identity>
|
||||
<typ:address>
|
||||
<typ:company>kelio</typ:company>
|
||||
<typ:name>Pe Peggy</typ:name>
|
||||
<typ:city>Brno</typ:city>
|
||||
<typ:street>manicky 2</typ:street>
|
||||
<typ:zip>61400</typ:zip>
|
||||
<typ:ico/>
|
||||
<typ:dic/>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone>111222333</typ:phone>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:actionType>
|
||||
<typ:update>
|
||||
<ftr:filter>
|
||||
<ftr:id>1480</ftr:id>
|
||||
</ftr:filter>
|
||||
</typ:update>
|
||||
</typ:actionType>
|
||||
<typ:defaultShipAddress>true</typ:defaultShipAddress>
|
||||
<typ:company>Peggyho Kelio</typ:company>
|
||||
<typ:name> </typ:name>
|
||||
<typ:city>Brno</typ:city>
|
||||
<typ:street>0</typ:street>
|
||||
<typ:zip>61400</typ:zip>
|
||||
<typ:country>
|
||||
<typ:ids>CZ</typ:ids>
|
||||
</typ:country>
|
||||
<typ:phone/>
|
||||
</typ:shipToAddress>
|
||||
</adb:identity>
|
||||
<adb:region/>
|
||||
<adb:phone>111222333</adb:phone>
|
||||
<adb:email>petr@peggy.com</adb:email>
|
||||
</adb:addressbookHeader>
|
||||
</adb:addressbook>
|
||||
</dat:dataPackItem>
|
||||
</dat:dataPack>
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"users": [
|
||||
{
|
||||
"id": 2,
|
||||
"id_language": null,
|
||||
"passw": "$2y$10$SYA9i04HEUEp31hGoze/WuuWzsLo8xxmJSqmyGubMeoWobxjA0/K.",
|
||||
"user_key": "r90p06rftme6v8dg11j6prcc81",
|
||||
"figure": "Y",
|
||||
"name": "Wpj",
|
||||
"surname": "Wpj",
|
||||
"firm": "",
|
||||
"street": "Fügnerova 1288",
|
||||
"city": "Vrchlabí",
|
||||
"zip": "54301",
|
||||
"country": "",
|
||||
"currency": "CZK",
|
||||
"email": "wpj@wpj.cz",
|
||||
"ico": "",
|
||||
"dic": "",
|
||||
"phone": "+420775131478",
|
||||
"mobile": "",
|
||||
"fax": "",
|
||||
"gender": null,
|
||||
"delivery_name": "",
|
||||
"delivery_surname": "",
|
||||
"delivery_firm": "",
|
||||
"delivery_street": "",
|
||||
"delivery_city": "",
|
||||
"delivery_zip": "",
|
||||
"delivery_country": "",
|
||||
"account_no": "",
|
||||
"account_bank": "",
|
||||
"account_symbol": "",
|
||||
"get_news": "Y",
|
||||
"prefer_transport": 4,
|
||||
"date_reg": "2015-02-16 00:00:00",
|
||||
"date_logged": null,
|
||||
"custom_address": "",
|
||||
"state": "",
|
||||
"delivery_custom_address": "",
|
||||
"delivery_state": "",
|
||||
"date_subscribe": "2015-02-16 00:00:00",
|
||||
"date_unsubscribe": null,
|
||||
"note": null,
|
||||
"custom_data": null,
|
||||
"delivery_phone": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\PohodaBundle\Tests\Users\Import;
|
||||
|
||||
use KupShop\DevelopmentBundle\Util\Tests\LoggerTestTrait;
|
||||
use KupShop\PohodaBundle\Tests\TestUtilHelper;
|
||||
use KupShop\PohodaBundle\Utils\Importers\UsersImporter;
|
||||
use KupShop\PohodaBundle\Utils\Tools\TransformHelper;
|
||||
use KupShop\UserBundle\Util\UserImporter;
|
||||
use Query\Operator;
|
||||
|
||||
class ImportUserTest extends \DatabaseTestCase
|
||||
{
|
||||
use LoggerTestTrait;
|
||||
use TestUtilHelper;
|
||||
|
||||
public function getDataSet()
|
||||
{
|
||||
return $this->getJsonDataSetFromFile();
|
||||
}
|
||||
|
||||
/**
|
||||
* @var TransformHelper
|
||||
*/
|
||||
protected $transformHelper;
|
||||
|
||||
/**
|
||||
* @var UserImporter
|
||||
*/
|
||||
protected $userImporter;
|
||||
|
||||
protected function setEnvironment()
|
||||
{
|
||||
$this->userImporter = $this->get(UsersImporter::class);
|
||||
$this->transformHelper = $this->get(TransformHelper::class);
|
||||
$this->getLogger();
|
||||
}
|
||||
|
||||
public function testTransformUsersIn()
|
||||
{
|
||||
$resultXML = $this->transformXML('users', 'users');
|
||||
$this->assertXmlStringEqualsXmlFile(__DIR__.'/usersInResult.xml', $resultXML);
|
||||
}
|
||||
|
||||
public function testImportInsertUsers()
|
||||
{
|
||||
// TRANSFORM XML
|
||||
$resultXML = $this->transformXML('users', 'users');
|
||||
|
||||
// IMPORT USERS
|
||||
$this->userImporter->importUsers($resultXML);
|
||||
|
||||
// EXPECTED NEW USERS
|
||||
$insertedEmails = [
|
||||
'info@stormware.cz',
|
||||
'obchod@boll.cz',
|
||||
'sklad@email.cz',
|
||||
];
|
||||
|
||||
// GET EXPECTED USERS
|
||||
$users = sqlFetchAll(sqlQueryBuilder()
|
||||
->select('*')
|
||||
->from('users')
|
||||
->andWhere(Operator::inStringArray($insertedEmails, 'email'))
|
||||
->execute(), 'email');
|
||||
|
||||
// TESTING DATA
|
||||
$this->assertCount(3, $users);
|
||||
$this->assertEquals('Stormware s.r.o.', $users['info@stormware.cz']['firm']);
|
||||
$this->assertEquals('Praha', $users['sklad@email.cz']['city']);
|
||||
$this->assertEquals('Petrohradská 216/3', $users['obchod@boll.cz']['street']);
|
||||
|
||||
// TEST LOG
|
||||
$testHandler = $this->getTestHandler();
|
||||
$this->assertEquals(true, $testHandler->hasNoticeThatContains('POHODA RESPONSE: Users Import'));
|
||||
foreach ($testHandler->getRecords() as $record) {
|
||||
if ($record['message'] == 'POHODA RESPONSE: Users Import') {
|
||||
if ($users[$record['context']['data']->EMAIL->__toString()] ?? false) {
|
||||
$this->assertEquals($users[$record['context']['data']->EMAIL->__toString()]['firm'], $record['context']['data']->INVOICE->COMPANY);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function testImportUpdateUsers()
|
||||
{
|
||||
// TRANSFORM XML
|
||||
$resultXML = $this->transformXML('users', 'users');
|
||||
|
||||
// EXPECTED EMAIL UPDATE
|
||||
$updateEmail = 'wpj@wpj.cz';
|
||||
|
||||
// TEST BEFORE IMPORT
|
||||
$beforeUpdateData = $this->getDatabaseData($updateEmail);
|
||||
$this->assertEquals('Fügnerova 1288', $beforeUpdateData['wpj@wpj.cz']['street']);
|
||||
|
||||
// IMPORT USERS
|
||||
$this->userImporter->importUsers($resultXML);
|
||||
|
||||
// GET UPDATES
|
||||
$updateData = $this->getDatabaseData($updateEmail);
|
||||
|
||||
// TESTING DATA
|
||||
$this->assertEquals('New WPJ t. e. s. t.', $updateData['wpj@wpj.cz']['firm']);
|
||||
$this->assertEquals('U WPJ, test 123', $updateData['wpj@wpj.cz']['street']);
|
||||
}
|
||||
|
||||
public function getDatabaseData($updateEmail)
|
||||
{
|
||||
return sqlFetchAll(sqlQueryBuilder()
|
||||
->select('*')
|
||||
->from('users')
|
||||
->andWhere(Operator::equals(['email' => $updateEmail]))
|
||||
->execute(), 'email');
|
||||
}
|
||||
|
||||
public function transformXML($prefixInXML, $prefixTransformXSL)
|
||||
{
|
||||
$this->setEnvironment();
|
||||
$this->prepareMServer();
|
||||
$xmlResponse = file_get_contents(__DIR__.'/'.$prefixInXML.'InResponse.xml');
|
||||
|
||||
return $this->transformHelper->baseTransform($xmlResponse, $this->transformHelper->loadXslt($prefixTransformXSL.'In.xsl'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
<rsp:responsePack version="2.0" id="001" state="ok" programVersion="12502.14 SQL (30.6.2020)" ico="04535510"
|
||||
key="4ba37787-5455-4689-bdcc-c519e4375dda" note="Export adresáře,export nových nebo změněných záznamů."
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd"
|
||||
xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd"
|
||||
xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd"
|
||||
xmlns:lCen="http://www.stormware.cz/schema/version_2/list_centre.xsd"
|
||||
xmlns:lAcv="http://www.stormware.cz/schema/version_2/list_activity.xsd"
|
||||
xmlns:acu="http://www.stormware.cz/schema/version_2/accountingunit.xsd"
|
||||
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
|
||||
xmlns:vch="http://www.stormware.cz/schema/version_2/voucher.xsd"
|
||||
xmlns:int="http://www.stormware.cz/schema/version_2/intDoc.xsd"
|
||||
xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd"
|
||||
xmlns:ofr="http://www.stormware.cz/schema/version_2/offer.xsd"
|
||||
xmlns:enq="http://www.stormware.cz/schema/version_2/enquiry.xsd"
|
||||
xmlns:vyd="http://www.stormware.cz/schema/version_2/vydejka.xsd"
|
||||
xmlns:pri="http://www.stormware.cz/schema/version_2/prijemka.xsd"
|
||||
xmlns:bal="http://www.stormware.cz/schema/version_2/balance.xsd"
|
||||
xmlns:pre="http://www.stormware.cz/schema/version_2/prevodka.xsd"
|
||||
xmlns:vyr="http://www.stormware.cz/schema/version_2/vyroba.xsd"
|
||||
xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd"
|
||||
xmlns:con="http://www.stormware.cz/schema/version_2/contract.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd"
|
||||
xmlns:prm="http://www.stormware.cz/schema/version_2/parameter.xsd"
|
||||
xmlns:lCon="http://www.stormware.cz/schema/version_2/list_contract.xsd"
|
||||
xmlns:ctg="http://www.stormware.cz/schema/version_2/category.xsd"
|
||||
xmlns:ipm="http://www.stormware.cz/schema/version_2/intParam.xsd"
|
||||
xmlns:str="http://www.stormware.cz/schema/version_2/storage.xsd"
|
||||
xmlns:idp="http://www.stormware.cz/schema/version_2/individualPrice.xsd"
|
||||
xmlns:sup="http://www.stormware.cz/schema/version_2/supplier.xsd"
|
||||
xmlns:prn="http://www.stormware.cz/schema/version_2/print.xsd"
|
||||
xmlns:sEET="http://www.stormware.cz/schema/version_2/sendEET.xsd"
|
||||
xmlns:act="http://www.stormware.cz/schema/version_2/accountancy.xsd"
|
||||
xmlns:bnk="http://www.stormware.cz/schema/version_2/bank.xsd"
|
||||
xmlns:sto="http://www.stormware.cz/schema/version_2/store.xsd"
|
||||
xmlns:grs="http://www.stormware.cz/schema/version_2/groupStocks.xsd"
|
||||
xmlns:acp="http://www.stormware.cz/schema/version_2/actionPrice.xsd"
|
||||
xmlns:csh="http://www.stormware.cz/schema/version_2/cashRegister.xsd"
|
||||
xmlns:bka="http://www.stormware.cz/schema/version_2/bankAccount.xsd"
|
||||
xmlns:ilt="http://www.stormware.cz/schema/version_2/inventoryLists.xsd"
|
||||
xmlns:nms="http://www.stormware.cz/schema/version_2/numericalSeries.xsd"
|
||||
xmlns:pay="http://www.stormware.cz/schema/version_2/payment.xsd"
|
||||
xmlns:mKasa="http://www.stormware.cz/schema/version_2/mKasa.xsd"
|
||||
xmlns:gdp="http://www.stormware.cz/schema/version_2/GDPR.xsd"
|
||||
xmlns:est="http://www.stormware.cz/schema/version_2/establishment.xsd"
|
||||
xmlns:cen="http://www.stormware.cz/schema/version_2/centre.xsd"
|
||||
xmlns:acv="http://www.stormware.cz/schema/version_2/activity.xsd"
|
||||
xmlns:afp="http://www.stormware.cz/schema/version_2/accountingFormOfPayment.xsd"
|
||||
xmlns:vat="http://www.stormware.cz/schema/version_2/classificationVAT.xsd"
|
||||
xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd"
|
||||
xmlns:asv="http://www.stormware.cz/schema/version_2/accountingSalesVouchers.xsd"
|
||||
xmlns:arch="http://www.stormware.cz/schema/version_2/archive.xsd">
|
||||
<rsp:responsePackItem version="2.0" id="01" state="ok">
|
||||
<lAdb:listAddressBook version="2.0" dateTimeStamp="2020-07-22T10:51:33" dateValidFrom="2020-07-22" state="ok">
|
||||
<lAdb:addressbook version="2.0">
|
||||
<adb:addressbookHeader>
|
||||
<adb:id>1</adb:id>
|
||||
<adb:identity>
|
||||
<typ:address>
|
||||
<typ:company>Stormware s.r.o.</typ:company>
|
||||
<typ:division/>
|
||||
<typ:name/>
|
||||
<typ:city>Jihlava</typ:city>
|
||||
<typ:street>Za Prachárnou 45, PS22</typ:street>
|
||||
<typ:zip>586 01</typ:zip>
|
||||
<typ:ico>25313142</typ:ico>
|
||||
<typ:dic>CZ25313142</typ:dic>
|
||||
</typ:address>
|
||||
</adb:identity>
|
||||
<adb:phone>567 11 77 11 servis</adb:phone>
|
||||
<adb:fax>567 112 610</adb:fax>
|
||||
<adb:email>info@stormware.cz</adb:email>
|
||||
<adb:web>www.stormware.cz</adb:web>
|
||||
<adb:adGroup>Výrobce software</adb:adGroup>
|
||||
<adb:adKey>Viz historie</adb:adKey>
|
||||
<adb:p1>true</adb:p1>
|
||||
<adb:p2>true</adb:p2>
|
||||
<adb:p3>false</adb:p3>
|
||||
<adb:p4>false</adb:p4>
|
||||
<adb:p5>false</adb:p5>
|
||||
<adb:p6>false</adb:p6>
|
||||
<adb:intNote>Servisní kód 963317</adb:intNote>
|
||||
<adb:turnover>0</adb:turnover>
|
||||
<adb:parameters>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrnej</typ:name>
|
||||
<typ:booleanValue>false</typ:booleanValue>
|
||||
</typ:parameter>
|
||||
</adb:parameters>
|
||||
<adb:markRecord>false</adb:markRecord>
|
||||
</adb:addressbookHeader>
|
||||
<adb:addressbookAccount>
|
||||
<adb:accountItem>
|
||||
<adb:id>99</adb:id>
|
||||
<adb:accountNumber>19-4660550217</adb:accountNumber>
|
||||
<adb:symSpec/>
|
||||
<adb:bankCode>0100</adb:bankCode>
|
||||
<adb:defaultAccount>true</adb:defaultAccount>
|
||||
</adb:accountItem>
|
||||
</adb:addressbookAccount>
|
||||
<adb:addressbookGDPR>
|
||||
<adb:restrictProcessing>false</adb:restrictProcessing>
|
||||
<adb:dateSale>2019-05-06</adb:dateSale>
|
||||
</adb:addressbookGDPR>
|
||||
</lAdb:addressbook>
|
||||
<lAdb:addressbook version="2.0">
|
||||
<adb:addressbookHeader>
|
||||
<adb:id>5</adb:id>
|
||||
<adb:identity>
|
||||
<typ:address>
|
||||
<typ:company>Acron Czech, s.r.o.</typ:company>
|
||||
<typ:division/>
|
||||
<typ:name/>
|
||||
<typ:city>Praha</typ:city>
|
||||
<typ:street>Veleslavínská 150/44</typ:street>
|
||||
<typ:zip>162 00</typ:zip>
|
||||
<typ:ico>49702041</typ:ico>
|
||||
<typ:dic>CZ49702041</typ:dic>
|
||||
</typ:address>
|
||||
<typ:shipToAddress>
|
||||
<typ:id>2</typ:id>
|
||||
<typ:division>REKLAMACE</typ:division>
|
||||
<typ:name>Acron</typ:name>
|
||||
<typ:city>Praha 6</typ:city>
|
||||
<typ:street>Evropská 695/73</typ:street>
|
||||
<typ:defaultShipAddress>true</typ:defaultShipAddress>
|
||||
<typ:zip>160 00</typ:zip>
|
||||
</typ:shipToAddress>
|
||||
</adb:identity>
|
||||
<adb:region>Hlavní město Praha</adb:region>
|
||||
<adb:phone>236161836</adb:phone>
|
||||
<adb:mobil>sklad 311 573 801</adb:mobil>
|
||||
<adb:fax>603 312 081</adb:fax>
|
||||
<adb:email>sklad@email.cz</adb:email>
|
||||
<adb:p1>true</adb:p1>
|
||||
<adb:p2>true</adb:p2>
|
||||
<adb:p3>false</adb:p3>
|
||||
<adb:p4>false</adb:p4>
|
||||
<adb:p5>false</adb:p5>
|
||||
<adb:p6>false</adb:p6>
|
||||
<adb:turnover>0</adb:turnover>
|
||||
<adb:parameters>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrnej</typ:name>
|
||||
<typ:booleanValue>false</typ:booleanValue>
|
||||
</typ:parameter>
|
||||
</adb:parameters>
|
||||
<adb:markRecord>false</adb:markRecord>
|
||||
</adb:addressbookHeader>
|
||||
<adb:addressbookAccount>
|
||||
<adb:accountItem>
|
||||
<adb:id>71</adb:id>
|
||||
<adb:accountNumber>164411738</adb:accountNumber>
|
||||
<adb:symSpec/>
|
||||
<adb:bankCode>0300</adb:bankCode>
|
||||
<adb:defaultAccount>true</adb:defaultAccount>
|
||||
</adb:accountItem>
|
||||
</adb:addressbookAccount>
|
||||
<adb:addressbookGDPR>
|
||||
<adb:restrictProcessing>false</adb:restrictProcessing>
|
||||
<adb:dateSale>2018-05-27</adb:dateSale>
|
||||
<adb:dateAfterSale>2013-06-29</adb:dateAfterSale>
|
||||
</adb:addressbookGDPR>
|
||||
</lAdb:addressbook>
|
||||
<lAdb:addressbook version="2.0">
|
||||
<adb:addressbookHeader>
|
||||
<adb:id>9</adb:id>
|
||||
<adb:identity>
|
||||
<typ:address>
|
||||
<typ:company>Boll Gear sro</typ:company>
|
||||
<typ:division/>
|
||||
<typ:name>Luděk Pravda, Michal Beránek</typ:name>
|
||||
<typ:city>Praha 10</typ:city>
|
||||
<typ:street>Petrohradská 216/3</typ:street>
|
||||
<typ:zip>101 00</typ:zip>
|
||||
<typ:ico>25671286</typ:ico>
|
||||
<typ:dic>CZ25671286</typ:dic>
|
||||
</typ:address>
|
||||
</adb:identity>
|
||||
<adb:region>Hlavní město Praha</adb:region>
|
||||
<adb:phone>267184639</adb:phone>
|
||||
<adb:mobil>774728613 M.Beranek</adb:mobil>
|
||||
<adb:fax>267184691</adb:fax>
|
||||
<adb:email>obchod@boll.cz</adb:email>
|
||||
<adb:web>www.boll.cz</adb:web>
|
||||
<adb:agreement>10440</adb:agreement>
|
||||
<adb:p1>true</adb:p1>
|
||||
<adb:p2>true</adb:p2>
|
||||
<adb:p3>false</adb:p3>
|
||||
<adb:p4>false</adb:p4>
|
||||
<adb:p5>false</adb:p5>
|
||||
<adb:p6>false</adb:p6>
|
||||
<adb:message>REKLAMACE - jedině poštou, posílat ihned!</adb:message>
|
||||
<adb:intNote>22/1 Boll - ceny sedí (Mt)</adb:intNote>
|
||||
<adb:turnover>4840</adb:turnover>
|
||||
<adb:parameters>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrnej</typ:name>
|
||||
<typ:booleanValue>false</typ:booleanValue>
|
||||
</typ:parameter>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrekokomid</typ:name>
|
||||
<typ:textValue>P02110009</typ:textValue>
|
||||
</typ:parameter>
|
||||
</adb:parameters>
|
||||
<adb:markRecord>true</adb:markRecord>
|
||||
</adb:addressbookHeader>
|
||||
<adb:addressbookAccount>
|
||||
<adb:accountItem>
|
||||
<adb:id>2</adb:id>
|
||||
<adb:accountNumber>2000133961</adb:accountNumber>
|
||||
<adb:symSpec/>
|
||||
<adb:bankCode>2010</adb:bankCode>
|
||||
<adb:defaultAccount>true</adb:defaultAccount>
|
||||
</adb:accountItem>
|
||||
</adb:addressbookAccount>
|
||||
<adb:addressbookGDPR>
|
||||
<adb:restrictProcessing>false</adb:restrictProcessing>
|
||||
<adb:dateSale>2019-07-10</adb:dateSale>
|
||||
<adb:dateAfterSale>2013-08-16</adb:dateAfterSale>
|
||||
</adb:addressbookGDPR>
|
||||
</lAdb:addressbook>
|
||||
<lAdb:addressbook version="2.0">
|
||||
<adb:addressbookHeader>
|
||||
<adb:id>50</adb:id>
|
||||
<adb:identity>
|
||||
<typ:address>
|
||||
<typ:company>New WPJ t. e. s. t.</typ:company>
|
||||
<typ:division/>
|
||||
<typ:name/>
|
||||
<typ:city>Jihlava</typ:city>
|
||||
<typ:street>U WPJ, test 123</typ:street>
|
||||
<typ:zip>586 01</typ:zip>
|
||||
<typ:ico>25313142</typ:ico>
|
||||
<typ:dic>CZ212216</typ:dic>
|
||||
</typ:address>
|
||||
</adb:identity>
|
||||
<adb:phone>567 11 77 11 servis</adb:phone>
|
||||
<adb:fax>567 112 610</adb:fax>
|
||||
<adb:email>wpj@wpj.cz</adb:email>
|
||||
<adb:web>www.stormware.cz</adb:web>
|
||||
<adb:adGroup>Výrobce software</adb:adGroup>
|
||||
<adb:adKey>Viz historie</adb:adKey>
|
||||
<adb:p1>true</adb:p1>
|
||||
<adb:p2>true</adb:p2>
|
||||
<adb:p3>false</adb:p3>
|
||||
<adb:p4>false</adb:p4>
|
||||
<adb:p5>false</adb:p5>
|
||||
<adb:p6>false</adb:p6>
|
||||
<adb:intNote>Servisní kód 963317</adb:intNote>
|
||||
<adb:turnover>0</adb:turnover>
|
||||
<adb:parameters>
|
||||
<typ:parameter>
|
||||
<typ:name>VPrnej</typ:name>
|
||||
<typ:booleanValue>false</typ:booleanValue>
|
||||
</typ:parameter>
|
||||
</adb:parameters>
|
||||
<adb:markRecord>false</adb:markRecord>
|
||||
</adb:addressbookHeader>
|
||||
<adb:addressbookAccount>
|
||||
<adb:accountItem>
|
||||
<adb:id>99</adb:id>
|
||||
<adb:accountNumber>19-4660550217</adb:accountNumber>
|
||||
<adb:symSpec/>
|
||||
<adb:bankCode>0100</adb:bankCode>
|
||||
<adb:defaultAccount>true</adb:defaultAccount>
|
||||
</adb:accountItem>
|
||||
</adb:addressbookAccount>
|
||||
<adb:addressbookGDPR>
|
||||
<adb:restrictProcessing>false</adb:restrictProcessing>
|
||||
<adb:dateSale>2019-05-06</adb:dateSale>
|
||||
</adb:addressbookGDPR>
|
||||
</lAdb:addressbook>
|
||||
</lAdb:listAddressBook>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<USERS xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd" xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd">
|
||||
<USER>
|
||||
<EMAIL>info@stormware.cz</EMAIL>
|
||||
<ID>1</ID>
|
||||
<INVOICE>
|
||||
<NAME/>
|
||||
<SURNAME/>
|
||||
<COMPANY>Stormware s.r.o.</COMPANY>
|
||||
<ADDRESS>Za Prachárnou 45, PS22</ADDRESS>
|
||||
<CITY>Jihlava</CITY>
|
||||
<ZIP>586 01</ZIP>
|
||||
<COUNTRY/>
|
||||
<ICO>25313142</ICO>
|
||||
<DIC>CZ25313142</DIC>
|
||||
<PHONE>567 11 77 11 servis</PHONE>
|
||||
</INVOICE>
|
||||
<DELIVERY>
|
||||
<ID/>
|
||||
<NAME/>
|
||||
<SURNAME/>
|
||||
<COMPANY/>
|
||||
<ADDRESS/>
|
||||
<CITY/>
|
||||
<ZIP/>
|
||||
<COUNTRY/>
|
||||
<PHONE/>
|
||||
<ADDRESS2/>
|
||||
</DELIVERY>
|
||||
</USER>
|
||||
<USER>
|
||||
<EMAIL>sklad@email.cz</EMAIL>
|
||||
<ID>5</ID>
|
||||
<INVOICE>
|
||||
<NAME/>
|
||||
<SURNAME/>
|
||||
<COMPANY>Acron Czech, s.r.o.</COMPANY>
|
||||
<ADDRESS>Veleslavínská 150/44</ADDRESS>
|
||||
<CITY>Praha</CITY>
|
||||
<ZIP>162 00</ZIP>
|
||||
<COUNTRY/>
|
||||
<ICO>49702041</ICO>
|
||||
<DIC>CZ49702041</DIC>
|
||||
<PHONE>236161836</PHONE>
|
||||
</INVOICE>
|
||||
<DELIVERY>
|
||||
<ID>2</ID>
|
||||
<NAME>Acron</NAME>
|
||||
<SURNAME/>
|
||||
<COMPANY/>
|
||||
<ADDRESS>Evropská 695/73</ADDRESS>
|
||||
<CITY>Praha 6</CITY>
|
||||
<ZIP>160 00</ZIP>
|
||||
<COUNTRY/>
|
||||
<PHONE/>
|
||||
<ADDRESS2>true</ADDRESS2>
|
||||
</DELIVERY>
|
||||
</USER>
|
||||
<USER>
|
||||
<EMAIL>obchod@boll.cz</EMAIL>
|
||||
<ID>9</ID>
|
||||
<INVOICE>
|
||||
<NAME>Luděk</NAME>
|
||||
<SURNAME>Pravda, Michal Beránek </SURNAME>
|
||||
<COMPANY>Boll Gear sro</COMPANY>
|
||||
<ADDRESS>Petrohradská 216/3</ADDRESS>
|
||||
<CITY>Praha 10</CITY>
|
||||
<ZIP>101 00</ZIP>
|
||||
<COUNTRY/>
|
||||
<ICO>25671286</ICO>
|
||||
<DIC>CZ25671286</DIC>
|
||||
<PHONE>267184639</PHONE>
|
||||
</INVOICE>
|
||||
<DELIVERY>
|
||||
<ID/>
|
||||
<NAME/>
|
||||
<SURNAME/>
|
||||
<COMPANY/>
|
||||
<ADDRESS/>
|
||||
<CITY/>
|
||||
<ZIP/>
|
||||
<COUNTRY/>
|
||||
<PHONE/>
|
||||
<ADDRESS2/>
|
||||
</DELIVERY>
|
||||
</USER>
|
||||
<USER>
|
||||
<EMAIL>wpj@wpj.cz</EMAIL>
|
||||
<ID>50</ID>
|
||||
<INVOICE>
|
||||
<NAME/>
|
||||
<SURNAME/>
|
||||
<COMPANY>New WPJ t. e. s. t.</COMPANY>
|
||||
<ADDRESS>U WPJ, test 123</ADDRESS>
|
||||
<CITY>Jihlava</CITY>
|
||||
<ZIP>586 01</ZIP>
|
||||
<COUNTRY/>
|
||||
<ICO>25313142</ICO>
|
||||
<DIC>CZ212216</DIC>
|
||||
<PHONE>567 11 77 11 servis</PHONE>
|
||||
</INVOICE>
|
||||
<DELIVERY>
|
||||
<ID/>
|
||||
<NAME/>
|
||||
<SURNAME/>
|
||||
<COMPANY/>
|
||||
<ADDRESS/>
|
||||
<CITY/>
|
||||
<ZIP/>
|
||||
<COUNTRY/>
|
||||
<PHONE/>
|
||||
<ADDRESS2/>
|
||||
</DELIVERY>
|
||||
</USER>
|
||||
</USERS>
|
||||
170
bundles/KupShop/PohodaBundle/Tests/productsInResponse.xml
Normal file
170
bundles/KupShop/PohodaBundle/Tests/productsInResponse.xml
Normal file
@@ -0,0 +1,170 @@
|
||||
<?xml version="1.0" encoding="Windows-1250"?>
|
||||
<rsp:responsePack version="2.0" id="001" state="ok" programVersion="12104.8 SQL (13.3.2019)" ico="29186951"
|
||||
key="d18da258-8640-4294-bd55-e094c0312498" note="Export zasob"
|
||||
xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd"
|
||||
xmlns:rdc="http://www.stormware.cz/schema/version_2/documentresponse.xsd"
|
||||
xmlns:typ="http://www.stormware.cz/schema/version_2/type.xsd"
|
||||
xmlns:lst="http://www.stormware.cz/schema/version_2/list.xsd"
|
||||
xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd"
|
||||
xmlns:lAdb="http://www.stormware.cz/schema/version_2/list_addBook.xsd"
|
||||
xmlns:lCen="http://www.stormware.cz/schema/version_2/list_centre.xsd"
|
||||
xmlns:lAcv="http://www.stormware.cz/schema/version_2/list_activity.xsd"
|
||||
xmlns:acu="http://www.stormware.cz/schema/version_2/accountingunit.xsd"
|
||||
xmlns:inv="http://www.stormware.cz/schema/version_2/invoice.xsd"
|
||||
xmlns:vch="http://www.stormware.cz/schema/version_2/voucher.xsd"
|
||||
xmlns:int="http://www.stormware.cz/schema/version_2/intDoc.xsd"
|
||||
xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd"
|
||||
xmlns:ord="http://www.stormware.cz/schema/version_2/order.xsd"
|
||||
xmlns:ofr="http://www.stormware.cz/schema/version_2/offer.xsd"
|
||||
xmlns:enq="http://www.stormware.cz/schema/version_2/enquiry.xsd"
|
||||
xmlns:vyd="http://www.stormware.cz/schema/version_2/vydejka.xsd"
|
||||
xmlns:pri="http://www.stormware.cz/schema/version_2/prijemka.xsd"
|
||||
xmlns:bal="http://www.stormware.cz/schema/version_2/balance.xsd"
|
||||
xmlns:pre="http://www.stormware.cz/schema/version_2/prevodka.xsd"
|
||||
xmlns:vyr="http://www.stormware.cz/schema/version_2/vyroba.xsd"
|
||||
xmlns:pro="http://www.stormware.cz/schema/version_2/prodejka.xsd"
|
||||
xmlns:con="http://www.stormware.cz/schema/version_2/contract.xsd"
|
||||
xmlns:adb="http://www.stormware.cz/schema/version_2/addressbook.xsd"
|
||||
xmlns:prm="http://www.stormware.cz/schema/version_2/parameter.xsd"
|
||||
xmlns:lCon="http://www.stormware.cz/schema/version_2/list_contract.xsd"
|
||||
xmlns:ctg="http://www.stormware.cz/schema/version_2/category.xsd"
|
||||
xmlns:ipm="http://www.stormware.cz/schema/version_2/intParam.xsd"
|
||||
xmlns:str="http://www.stormware.cz/schema/version_2/storage.xsd"
|
||||
xmlns:idp="http://www.stormware.cz/schema/version_2/individualPrice.xsd"
|
||||
xmlns:sup="http://www.stormware.cz/schema/version_2/supplier.xsd"
|
||||
xmlns:prn="http://www.stormware.cz/schema/version_2/print.xsd"
|
||||
xmlns:sEET="http://www.stormware.cz/schema/version_2/sendEET.xsd"
|
||||
xmlns:act="http://www.stormware.cz/schema/version_2/accountancy.xsd"
|
||||
xmlns:bnk="http://www.stormware.cz/schema/version_2/bank.xsd"
|
||||
xmlns:sto="http://www.stormware.cz/schema/version_2/store.xsd"
|
||||
xmlns:grs="http://www.stormware.cz/schema/version_2/groupStocks.xsd"
|
||||
xmlns:acp="http://www.stormware.cz/schema/version_2/actionPrice.xsd"
|
||||
xmlns:csh="http://www.stormware.cz/schema/version_2/cashRegister.xsd"
|
||||
xmlns:bka="http://www.stormware.cz/schema/version_2/bankAccount.xsd"
|
||||
xmlns:ilt="http://www.stormware.cz/schema/version_2/inventoryLists.xsd"
|
||||
xmlns:nms="http://www.stormware.cz/schema/version_2/numericalSeries.xsd"
|
||||
xmlns:pay="http://www.stormware.cz/schema/version_2/payment.xsd"
|
||||
xmlns:mKasa="http://www.stormware.cz/schema/version_2/mKasa.xsd"
|
||||
xmlns:gdp="http://www.stormware.cz/schema/version_2/GDPR.xsd"
|
||||
xmlns:est="http://www.stormware.cz/schema/version_2/establishment.xsd"
|
||||
xmlns:cen="http://www.stormware.cz/schema/version_2/centre.xsd"
|
||||
xmlns:acv="http://www.stormware.cz/schema/version_2/activity.xsd"
|
||||
xmlns:ftr="http://www.stormware.cz/schema/version_2/filter.xsd">
|
||||
<rsp:responsePackItem version="2.0" id="a55" state="ok">
|
||||
<lStk:listStock version="2.0" dateTimeStamp="2019-04-11T10:53:10" dateValidFrom="2019-04-11" state="ok">
|
||||
<lStk:stock version="2.0">
|
||||
<stk:stockHeader>
|
||||
<stk:id>1410</stk:id>
|
||||
<stk:stockType>card</stk:stockType>
|
||||
<stk:code>B00536</stk:code>
|
||||
<stk:EAN>8595635600371</stk:EAN>
|
||||
<stk:isSales>true</stk:isSales>
|
||||
<stk:isInternet>false</stk:isInternet>
|
||||
<stk:purchasingRateVAT>high</stk:purchasingRateVAT>
|
||||
<stk:sellingRateVAT value="21">high</stk:sellingRateVAT>
|
||||
<stk:name>AKTIVNÍ UHLÍ KYBLÍK 4 kg</stk:name>
|
||||
<stk:nameComplement/>
|
||||
<stk:unit>ks</stk:unit>
|
||||
<stk:storage>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>Hlavní</typ:ids>
|
||||
</stk:storage>
|
||||
<stk:typePrice>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>SK</typ:ids>
|
||||
</stk:typePrice>
|
||||
<stk:weightedPurchasePrice>0</stk:weightedPurchasePrice>
|
||||
<stk:purchasingPrice>373</stk:purchasingPrice>
|
||||
<stk:sellingPrice payVAT="true">590</stk:sellingPrice>
|
||||
<stk:count>3.0</stk:count>
|
||||
<stk:countReceivedOrders>0.0</stk:countReceivedOrders>
|
||||
<stk:reservation>0.0</stk:reservation>
|
||||
<stk:reclamation>0.0</stk:reclamation>
|
||||
<stk:orderName>B00536</stk:orderName>
|
||||
<stk:orderQuantity>0.0</stk:orderQuantity>
|
||||
<stk:countIssuedOrders>0.0</stk:countIssuedOrders>
|
||||
<stk:producer>Sakura</stk:producer>
|
||||
<stk:news>false</stk:news>
|
||||
<stk:clearanceSale>false</stk:clearanceSale>
|
||||
<stk:sale>false</stk:sale>
|
||||
<stk:recommended>false</stk:recommended>
|
||||
<stk:discount>false</stk:discount>
|
||||
<stk:prepare>false</stk:prepare>
|
||||
<stk:controlLimitTaxLiability>false</stk:controlLimitTaxLiability>
|
||||
<stk:description>Aktivní uhlí 5l kyblík</stk:description>
|
||||
<stk:categories>
|
||||
<stk:idCategory>4</stk:idCategory>
|
||||
<stk:idCategory>5</stk:idCategory>
|
||||
</stk:categories>
|
||||
<stk:markRecord>false</stk:markRecord>
|
||||
</stk:stockHeader>
|
||||
<stk:stockPriceItem>
|
||||
<stk:stockPrice>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>Prodejní</typ:ids>
|
||||
<typ:price>590</typ:price>
|
||||
</stk:stockPrice>
|
||||
<stk:stockPrice>
|
||||
<typ:id>2</typ:id>
|
||||
<typ:ids>Sleva 1</typ:ids>
|
||||
<typ:price>578.2</typ:price>
|
||||
</stk:stockPrice>
|
||||
</stk:stockPriceItem>
|
||||
</lStk:stock>
|
||||
<lStk:stock version="2.0">
|
||||
<stk:stockHeader>
|
||||
<stk:id>1411</stk:id>
|
||||
<stk:stockType>card</stk:stockType>
|
||||
<stk:code>43010040</stk:code>
|
||||
<stk:EAN>4250300211545</stk:EAN>
|
||||
<stk:isSales>true</stk:isSales>
|
||||
<stk:isInternet>false</stk:isInternet>
|
||||
<stk:purchasingRateVAT>high</stk:purchasingRateVAT>
|
||||
<stk:sellingRateVAT value="21">high</stk:sellingRateVAT>
|
||||
<stk:name>ALGEN STOP PØÍPRAVEK PROTI ØASÁM 1 l</stk:name>
|
||||
<stk:nameComplement/>
|
||||
<stk:storage>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>Hlavní</typ:ids>
|
||||
</stk:storage>
|
||||
<stk:typePrice>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>SK</typ:ids>
|
||||
</stk:typePrice>
|
||||
<stk:weightedPurchasePrice>0</stk:weightedPurchasePrice>
|
||||
<stk:purchasingPrice>351</stk:purchasingPrice>
|
||||
<stk:sellingPrice payVAT="true">616</stk:sellingPrice>
|
||||
<stk:count>2.0</stk:count>
|
||||
<stk:countReceivedOrders>0.0</stk:countReceivedOrders>
|
||||
<stk:reservation>0.0</stk:reservation>
|
||||
<stk:reclamation>0.0</stk:reclamation>
|
||||
<stk:orderName>43010040</stk:orderName>
|
||||
<stk:orderQuantity>0.0</stk:orderQuantity>
|
||||
<stk:countIssuedOrders>0.0</stk:countIssuedOrders>
|
||||
<stk:producer>Tripond</stk:producer>
|
||||
<stk:news>false</stk:news>
|
||||
<stk:clearanceSale>false</stk:clearanceSale>
|
||||
<stk:sale>false</stk:sale>
|
||||
<stk:recommended>false</stk:recommended>
|
||||
<stk:discount>false</stk:discount>
|
||||
<stk:prepare>false</stk:prepare>
|
||||
<stk:controlLimitTaxLiability>false</stk:controlLimitTaxLiability>
|
||||
<stk:description>Algen Stop pøípravek proti øasám 1 l na 20 m3 vody</stk:description>
|
||||
<stk:markRecord>false</stk:markRecord>
|
||||
</stk:stockHeader>
|
||||
<stk:stockPriceItem>
|
||||
<stk:stockPrice>
|
||||
<typ:id>2</typ:id>
|
||||
<typ:ids>Sleva 1</typ:ids>
|
||||
<typ:price>498.9</typ:price>
|
||||
</stk:stockPrice>
|
||||
<stk:stockPrice>
|
||||
<typ:id>1</typ:id>
|
||||
<typ:ids>Prodejní</typ:ids>
|
||||
<typ:price>616</typ:price>
|
||||
</stk:stockPrice>
|
||||
</stk:stockPriceItem>
|
||||
</lStk:stock>
|
||||
</lStk:listStock>
|
||||
</rsp:responsePackItem>
|
||||
</rsp:responsePack>
|
||||
31
bundles/KupShop/PohodaBundle/Tests/productsInResult.xml
Normal file
31
bundles/KupShop/PohodaBundle/Tests/productsInResult.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0"?>
|
||||
<SHOP xmlns:lStk="http://www.stormware.cz/schema/version_2/list_stock.xsd" xmlns:rsp="http://www.stormware.cz/schema/version_2/response.xsd" xmlns:stk="http://www.stormware.cz/schema/version_2/stock.xsd">
|
||||
<SHOPITEM>
|
||||
<PRODUCT>AKTIVNÍ UHLÍ KYBLÍK 4 kg</PRODUCT>
|
||||
<CODE>B00536</CODE>
|
||||
<PRODUCT_CODE>B00536</PRODUCT_CODE>
|
||||
<EAN>8595635600371</EAN>
|
||||
<IN_STORE>3</IN_STORE>
|
||||
<PRODUCER>Sakura</PRODUCER>
|
||||
<WEIGHT/>
|
||||
<INIT_CATEGORY empty="true"/>
|
||||
<DESCRIPTION>Aktivní uhlí 5l kyblík</DESCRIPTION>
|
||||
<VAT>21</VAT>
|
||||
<PRICE>487.603305785124</PRICE>
|
||||
<CUSTOM_PHOTOS force="true"/>
|
||||
</SHOPITEM>
|
||||
<SHOPITEM>
|
||||
<PRODUCT>ALGEN STOP PŘÍPRAVEK PROTI ŘASÁM 1 l</PRODUCT>
|
||||
<CODE>43010040</CODE>
|
||||
<PRODUCT_CODE>43010040</PRODUCT_CODE>
|
||||
<EAN>4250300211545</EAN>
|
||||
<IN_STORE>2</IN_STORE>
|
||||
<PRODUCER>Tripond</PRODUCER>
|
||||
<WEIGHT/>
|
||||
<INIT_CATEGORY empty="true"/>
|
||||
<DESCRIPTION>Algen Stop přípravek proti řasám 1 l na 20 m3 vody</DESCRIPTION>
|
||||
<VAT>21</VAT>
|
||||
<PRICE>509.090909090909</PRICE>
|
||||
<CUSTOM_PHOTOS force="true"/>
|
||||
</SHOPITEM>
|
||||
</SHOP>
|
||||
Reference in New Issue
Block a user