diff --git a/composer.json b/composer.json index 783461a..0d81e34 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "mirzaev/yii2-arangodb": ">=2.1.x-dev", "mirzaev/yii2-arangodb-sessions": ">=1.1.x-dev", "guzzlehttp/guzzle": "^7.3", - "cdek-it/sdk2.0": "^0.1.5" + "mnvx/lowrapper": "^1.0" }, "require-dev": { "codeception/codeception": ">=4.1", diff --git a/composer.lock b/composer.lock index 555ba10..a9b3d82 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d8be640c77a23c843e66c35f4a38c151", + "content-hash": "128ca2ce9581ee88384d5c0eb626732b", "packages": [ { "name": "bower-asset/bootstrap", @@ -205,78 +205,6 @@ }, "time": "2020-09-08T12:58:28+00:00" }, - { - "name": "cdek-it/sdk2.0", - "version": "0.1.5", - "source": { - "type": "git", - "url": "https://github.com/cdek-it/sdk2.0.git", - "reference": "e4553bbbfa3c6270dd4bb3c9044d44dfe218ec25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cdek-it/sdk2.0/zipball/e4553bbbfa3c6270dd4bb3c9044d44dfe218ec25", - "reference": "e4553bbbfa3c6270dd4bb3c9044d44dfe218ec25", - "shasum": "" - }, - "require": { - "ext-json": "*", - "jms/serializer": "^1.14.0", - "nyholm/psr7": "^1.2", - "php": "^7.1", - "psr/http-client": "^1.0", - "rakit/validation": "^1.1" - }, - "require-dev": { - "phan/phan": "^1 <1.3 || >1.3.0", - "php-coveralls/php-coveralls": "^2.1", - "php-http/mock-client": "^1.3", - "phpmd/phpmd": "^2.7", - "phpstan/phpstan": ">=0.10", - "phpunit/phpunit": "^6.5 || ^7.4", - "squizlabs/php_codesniffer": "*", - "symfony/http-client": "^4.3", - "vimeo/psalm": ">=3.0.16" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "v0.0.1-dev" - } - }, - "autoload": { - "psr-4": { - "CdekSDK2\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Viktor Chizhekov", - "homepage": "https://github.com/ihomyak", - "role": "Creator" - } - ], - "description": "PHP SDK для API v2.0 от сервиса интеграции компании СДЭК", - "homepage": "https://www.cdek.ru/clients/integrator.html", - "keywords": [ - "cdek", - "delivery", - "sdk", - "v2.0", - "СДЭК", - "служба доставки" - ], - "support": { - "docs": "https://github.com/cdek-it/sdk2.0/blob/master/README.md", - "issues": "https://github.com/cdek-it/sdk2.0/issues", - "source": "https://github.com/cdek-it/sdk2.0/tree/0.1.5" - }, - "time": "2020-09-03T10:43:13+00:00" - }, { "name": "cebe/markdown", "version": "1.2.1", @@ -341,145 +269,6 @@ }, "time": "2018-03-26T11:24:36+00:00" }, - { - "name": "doctrine/annotations", - "version": "1.12.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/b17c5014ef81d212ac539f07a1001832df1b6d3b", - "reference": "b17c5014ef81d212ac539f07a1001832df1b6d3b", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/cache": "1.*", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.12.1" - }, - "time": "2021-02-21T21:00:45+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", - "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^8.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2020-11-10T18:47:58+00:00" - }, { "name": "doctrine/lexer", "version": "1.2.1", @@ -977,192 +766,6 @@ }, "time": "2020-11-03T22:35:03+00:00" }, - { - "name": "jms/metadata", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/metadata.git", - "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/metadata/zipball/e5854ab1aa643623dc64adde718a8eec32b957a8", - "reference": "e5854ab1aa643623dc64adde718a8eec32b957a8", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "doctrine/cache": "~1.0", - "symfony/cache": "~3.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - }, - "autoload": { - "psr-0": { - "Metadata\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Asmir Mustafic", - "email": "goetas@gmail.com" - }, - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Class/method/property metadata management in PHP", - "keywords": [ - "annotations", - "metadata", - "xml", - "yaml" - ], - "support": { - "issues": "https://github.com/schmittjoh/metadata/issues", - "source": "https://github.com/schmittjoh/metadata/tree/1.x" - }, - "time": "2018-10-26T12:40:10+00:00" - }, - { - "name": "jms/parser-lib", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/parser-lib.git", - "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/parser-lib/zipball/c509473bc1b4866415627af0e1c6cc8ac97fa51d", - "reference": "c509473bc1b4866415627af0e1c6cc8ac97fa51d", - "shasum": "" - }, - "require": { - "phpoption/phpoption": ">=0.9,<2.0-dev" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-0": { - "JMS\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache2" - ], - "description": "A library for easily creating recursive-descent parsers.", - "support": { - "issues": "https://github.com/schmittjoh/parser-lib/issues", - "source": "https://github.com/schmittjoh/parser-lib/tree/1.0.0" - }, - "time": "2012-11-18T18:08:43+00:00" - }, - { - "name": "jms/serializer", - "version": "1.14.1", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/serializer.git", - "reference": "ba908d278fff27ec01fb4349f372634ffcd697c0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/ba908d278fff27ec01fb4349f372634ffcd697c0", - "reference": "ba908d278fff27ec01fb4349f372634ffcd697c0", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.0", - "doctrine/instantiator": "^1.0.3", - "jms/metadata": "^1.3", - "jms/parser-lib": "1.*", - "php": "^5.5|^7.0", - "phpcollection/phpcollection": "~0.1", - "phpoption/phpoption": "^1.1" - }, - "conflict": { - "twig/twig": "<1.12" - }, - "require-dev": { - "doctrine/orm": "~2.1", - "doctrine/phpcr-odm": "^1.3|^2.0", - "ext-pdo_sqlite": "*", - "jackalope/jackalope-doctrine-dbal": "^1.1.5", - "phpunit/phpunit": "^4.8|^5.0", - "propel/propel1": "~1.7", - "psr/container": "^1.0", - "symfony/dependency-injection": "^2.7|^3.3|^4.0", - "symfony/expression-language": "^2.6|^3.0", - "symfony/filesystem": "^2.1", - "symfony/form": "~2.1|^3.0", - "symfony/translation": "^2.1|^3.0", - "symfony/validator": "^2.2|^3.0", - "symfony/yaml": "^2.1|^3.0", - "twig/twig": "~1.12|~2.0" - }, - "suggest": { - "doctrine/cache": "Required if you like to use cache functionality.", - "doctrine/collections": "Required if you like to use doctrine collection types as ArrayCollection.", - "symfony/yaml": "Required if you'd like to serialize data to YAML format." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-1.x": "1.14-dev" - } - }, - "autoload": { - "psr-0": { - "JMS\\Serializer": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Asmir Mustafic", - "email": "goetas@gmail.com" - } - ], - "description": "Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.", - "homepage": "http://jmsyst.com/libs/serializer", - "keywords": [ - "deserialization", - "jaxb", - "json", - "serialization", - "xml" - ], - "support": { - "issues": "https://github.com/schmittjoh/serializer/issues", - "source": "https://github.com/schmittjoh/serializer/tree/1.14.1" - }, - "time": "2020-02-22T20:59:37+00:00" - }, { "name": "maennchen/zipstream-php", "version": "2.1.0", @@ -1501,6 +1104,56 @@ ], "time": "2021-03-29T00:19:31+00:00" }, + { + "name": "mnvx/lowrapper", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/mnvx/lowrapper.git", + "reference": "aaba5349bbfd69d46e63df95beefbd877047a9e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mnvx/lowrapper/zipball/aaba5349bbfd69d46e63df95beefbd877047a9e8", + "reference": "aaba5349bbfd69d46e63df95beefbd877047a9e8", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "psr/log": "^1.0", + "symfony/process": "^3.1|^4.1|^5.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Mnvx\\Lowrapper\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP wrapper over LibreOffice converter", + "homepage": "https://github.com/mnvx/lowrapper", + "keywords": [ + "LibreOffice", + "converter", + "docx", + "excel", + "pdf", + "word", + "xls", + "xlsx" + ], + "support": { + "issues": "https://github.com/mnvx/lowrapper/issues", + "source": "https://github.com/mnvx/lowrapper/tree/1.0.8" + }, + "time": "2021-04-26T16:12:14+00:00" + }, { "name": "moonlandsoft/yii2-phpexcel", "version": "2.0.0", @@ -1622,189 +1275,6 @@ "MIT" ] }, - { - "name": "nyholm/psr7", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/Nyholm/psr7.git", - "reference": "23ae1f00fbc6a886cbe3062ca682391b9cc7c37b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/23ae1f00fbc6a886cbe3062ca682391b9cc7c37b", - "reference": "23ae1f00fbc6a886cbe3062ca682391b9cc7c37b", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "php-http/message-factory": "^1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "http-interop/http-factory-tests": "^0.8", - "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5 || 8.5 || 9.4", - "symfony/error-handler": "^4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "Nyholm\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - }, - { - "name": "Martijn van der Ven", - "email": "martijn@vanderven.se" - } - ], - "description": "A fast PHP7 implementation of PSR-7", - "homepage": "https://tnyholm.se", - "keywords": [ - "psr-17", - "psr-7" - ], - "support": { - "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.4.0" - }, - "funding": [ - { - "url": "https://github.com/Zegnat", - "type": "github" - }, - { - "url": "https://github.com/nyholm", - "type": "github" - } - ], - "time": "2021-02-18T15:41:32+00:00" - }, - { - "name": "php-http/message-factory", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-http/message-factory.git", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com" - } - ], - "description": "Factory interfaces for PSR-7 HTTP Message", - "homepage": "http://php-http.org", - "keywords": [ - "factory", - "http", - "message", - "stream", - "uri" - ], - "support": { - "issues": "https://github.com/php-http/message-factory/issues", - "source": "https://github.com/php-http/message-factory/tree/master" - }, - "time": "2015-12-19T14:08:53+00:00" - }, - { - "name": "phpcollection/phpcollection", - "version": "0.5.0", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-collection.git", - "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", - "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", - "shasum": "" - }, - "require": { - "phpoption/phpoption": "1.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.4-dev" - } - }, - "autoload": { - "psr-0": { - "PhpCollection": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache2" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "General-Purpose Collection Library for PHP", - "keywords": [ - "collection", - "list", - "map", - "sequence", - "set" - ], - "support": { - "issues": "https://github.com/schmittjoh/php-collection/issues", - "source": "https://github.com/schmittjoh/php-collection/tree/master" - }, - "time": "2015-05-17T12:39:23+00:00" - }, { "name": "phpoffice/phpspreadsheet", "version": "1.17.1", @@ -1906,75 +1376,6 @@ }, "time": "2021-03-02T17:54:11+00:00" }, - { - "name": "phpoption/phpoption", - "version": "1.7.5", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/994ecccd8f3283ecf5ac33254543eb0ac946d525", - "reference": "994ecccd8f3283ecf5ac33254543eb0ac946d525", - "shasum": "" - }, - "require": { - "php": "^5.5.9 || ^7.0 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", - "phpunit/phpunit": "^4.8.35 || ^5.7.27 || ^6.5.6 || ^7.0 || ^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "PhpOption\\": "src/PhpOption/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Johannes M. Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Graham Campbell", - "email": "graham@alt-three.com" - } - ], - "description": "Option Type for PHP", - "keywords": [ - "language", - "option", - "php", - "type" - ], - "support": { - "issues": "https://github.com/schmittjoh/php-option/issues", - "source": "https://github.com/schmittjoh/php-option/tree/1.7.5" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], - "time": "2020-07-20T17:29:33+00:00" - }, { "name": "psr/http-client", "version": "1.0.1", @@ -2135,6 +1536,56 @@ }, "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, { "name": "psr/simple-cache", "version": "1.0.1", @@ -2186,52 +1637,6 @@ }, "time": "2017-10-23T01:57:42+00:00" }, - { - "name": "rakit/validation", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/rakit/validation.git", - "reference": "ff003a35cdf5030a5f2482299f4c93f344a35b29" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rakit/validation/zipball/ff003a35cdf5030a5f2482299f4c93f344a35b29", - "reference": "ff003a35cdf5030a5f2482299f4c93f344a35b29", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=7.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^6.5", - "squizlabs/php_codesniffer": "^3" - }, - "type": "library", - "autoload": { - "psr-4": { - "Rakit\\Validation\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Muhammad Syifa", - "email": "emsifa@gmail.com" - } - ], - "description": "PHP Laravel like standalone validation library", - "support": { - "issues": "https://github.com/rakit/validation/issues", - "source": "https://github.com/rakit/validation/tree/v1.4.0" - }, - "time": "2020-08-27T05:07:01+00:00" - }, { "name": "ralouphie/getallheaders", "version": "3.0.3", @@ -2758,6 +2163,151 @@ ], "time": "2021-01-07T16:49:33+00:00" }, + { + "name": "symfony/polyfill-php80", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/process", + "version": "v5.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/313a38f09c77fbcdc1d223e57d368cea76a2fd2f", + "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.2.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-27T10:15:41+00:00" + }, { "name": "triagens/arangodb", "version": "v3.6.0", @@ -3957,6 +3507,75 @@ }, "time": "2020-12-18T16:18:31+00:00" }, + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-11-10T18:47:58+00:00" + }, { "name": "fakerphp/faker", "version": "v1.14.1", @@ -6970,151 +6589,6 @@ ], "time": "2021-01-07T16:49:33+00:00" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", - "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - }, - { - "name": "symfony/process", - "version": "v5.2.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/313a38f09c77fbcdc1d223e57d368cea76a2fd2f", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/polyfill-php80": "^1.15" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Executes commands in sub-processes", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/process/tree/v5.2.4" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-27T10:15:41+00:00" - }, { "name": "symfony/service-contracts", "version": "v2.2.0", diff --git a/mirzaev/skillparts/system/config/web.php.example b/mirzaev/skillparts/system/config/web.php.example index 0628606..78b4a3f 100644 --- a/mirzaev/skillparts/system/config/web.php.example +++ b/mirzaev/skillparts/system/config/web.php.example @@ -81,7 +81,7 @@ $config = [ 'orders' => 'order/index', 'orders/<_key:[^/]+>/' => 'order/', 'orders/supply/<_key:[^/]+>/' => 'order/supply-', - 'orders/supply/<_key:[^/]+>//' => 'order/supply--' + 'orders/supply/<_key:[^/]+>//' => 'order/supply--' ], ], diff --git a/mirzaev/skillparts/system/controllers/OrderController.php b/mirzaev/skillparts/system/controllers/OrderController.php index 6a8493d..3ac3a57 100644 --- a/mirzaev/skillparts/system/controllers/OrderController.php +++ b/mirzaev/skillparts/system/controllers/OrderController.php @@ -20,7 +20,7 @@ use app\models\Notification; use app\models\SupplyEdgeProduct; use Codeception\PHPUnit\ResultPrinter\HTML; - +use DateTime; use Exception; class OrderController extends Controller @@ -34,7 +34,20 @@ class OrderController extends Controller [ 'allow' => true, 'roles' => ['@'], - 'actions' => ['index', 'accept', 'read', 'write', 'delete', 'amount-update', 'pay', 'supply-read', 'supply-write-stts'] + 'actions' => [ + 'index', + 'accept', + 'read', + 'write', + 'delete', + 'amount-update', + 'pay', + 'supply-read', + 'supply-write-stts', + 'supply-edit-time', + 'supply-edit-cost', + 'supply-edit-comm' + ] ], [ 'allow' => false, @@ -429,32 +442,45 @@ class OrderController extends Controller // Инициализация ребра: ПОСТАВКА -> ТОВАР $supply_edge_product = SupplyEdgeProduct::searchBySupplyId($order_edge_supply->_to); - // // Поиск ребра до аккаунта - // $account = Account::searchBySupplyId($order_edge_supply->_to); + // Поиск ребра до аккаунта + $account = Account::searchBySupplyId($order_edge_supply->_to); - // // Поиск привязанного товара - // $product = Product::searchBySupplyId($order_edge_supply->_to); + // Поиск привязанного товара + $product = Product::searchBySupplyId($order_edge_supply->_to); - // try { - // // Инициализация доставки - // $delivery = Dellin::calcDeliveryAdvanced( - // explode('_', $account['opts']['delivery_from_terminal'])[1], - // explode('_', yii::$app->user->identity->opts['delivery_to_terminal'])[1], - // (int) ($product['wght'] ?? 0), - // (int) ($product['dmns']['x'] ?? 0), - // (int) ($product['dmns']['y'] ?? 0), - // (int) ($product['dmns']['z'] ?? 0) - // ); - // } catch (Exception $e) { - // // var_dump(json_decode($e->getMessage(), true)['errors']); die; - // } + try { + // Инициализация доставки + $delivery = Dellin::calcDeliveryAdvanced( + $account['opts']['delivery_from_terminal'], + yii::$app->user->identity->opts['delivery_to_terminal'], + (int) ($product['wght'] ?? 0), + (int) ($product['dmns']['x'] ?? 0), + (int) ($product['dmns']['y'] ?? 0), + (int) ($product['dmns']['z'] ?? 0), + avia: $order_edge_supply->dlvr['type'] === 'avia' + ); + + // Рассчет времени + try { + $delivery_converted = DateTime::createFromFormat('Y-m-d H:i:s', $delivery['orderDates']['giveoutFromOspReceiver'])->getTimestamp(); + } catch (Exception $e) { + $delivery_converted = DateTime::createFromFormat('Y-m-d', $delivery['orderDates']['arrivalToOspReceiver'])->getTimestamp(); + } + $delivery = ceil(($delivery_converted - time()) / 60 / 60 / 24) + 1; + } catch (Exception $e) { + // var_dump($e->getMessage()); + // var_dump($e->getTrace()); + // var_dump($e->getFile()); die; + + // var_dump(json_decode($e->getMessage(), true)['errors']); die; + } // Запись параметров $buffer['cost'] = $order_edge_supply->cost ?? $order_edge_supply->cost = $supply_edge_product[0]['onec']['Цены']['Цена']['ЦенаЗаЕдиницу']; - $buffer['time'] = $order_edge_supply->time ?? 0; - // $buffer['time'] = $order_edge_supply->time ?? $delivery ?? 0; + $buffer['time'] = $order_edge_supply->time ?? $delivery ?? 0; $buffer['comm'] = $order_edge_supply->comm ?? $order_edge_supply->comm = 'Комментарий к заказу'; $buffer['stts'] = $order_edge_supply->stts ?? $order_edge_supply->stts = 0; + $buffer['id'] = $order_edge_supply->_key ?? 'Неизвестно'; $order_edge_supply->save(); } @@ -469,7 +495,7 @@ class OrderController extends Controller } /** - * Чтение инстанции поставки в заказе (order_edge_supply) + * Запись статуса поставки в заказе (order_edge_supply) * * @param int $_key Ключ записи в коллекции order_edge_supply * @@ -484,14 +510,138 @@ class OrderController extends Controller if ($order_edge_supply = OrderEdgeSupply::searchById($_id = OrderEdgeSupply::collectionName() . '/' . $_key)) { // Удалось найти инстанцию поставки - // Запись в буфер вывода и буфер записи в базу данных - $buffer['stts'] = $order_edge_supply->stts = $stts; + // Запись в буфер записи в базу данных + $order_edge_supply->stts = $stts; // Отправка в базу данных if ($order_edge_supply->save()) { // Удалось сохранить изменения + // Запись в буфер вывода + $buffer['stts'] = $order_edge_supply->stts; + } else { + // Не удалось сохранить изменения + yii::$app->response->statusCode = 500; + } + } + + // Запись обязательных параметров + $buffer['_csrf'] = yii::$app->request->getCsrfToken(); + + // Настройка ответа + yii::$app->response->format = Response::FORMAT_JSON; + + return $buffer; + } + + /** + * Запись цены поставки в заказе (order_edge_supply) + * + * @param int $_key Ключ записи в коллекции order_edge_supply + * + * @return string|array|null + */ + public function actionSupplyEditCost(int $_key): string|array|null + { + // Инициализация + $cost = yii::$app->request->post('cost') ?? yii::$app->request->get('cost'); + $buffer = []; + + if ($order_edge_supply = OrderEdgeSupply::searchById($_id = OrderEdgeSupply::collectionName() . '/' . $_key)) { + // Удалось найти инстанцию поставки + + // Запись в буфер записи в базу данных + $order_edge_supply->cost = $cost; + + // Отправка в базу данных + if ($order_edge_supply->save()) { + // Удалось сохранить изменения + + // Запись в буфер вывода + $buffer['cost'] = $order_edge_supply->cost; + } else { + // Не удалось сохранить изменения + + yii::$app->response->statusCode = 500; + } + } + + // Запись обязательных параметров + $buffer['_csrf'] = yii::$app->request->getCsrfToken(); + + // Настройка ответа + yii::$app->response->format = Response::FORMAT_JSON; + + return $buffer; + } + + /** + * Запись времени доставки поставки в заказе (order_edge_supply) + * + * @param int $_key Ключ записи в коллекции order_edge_supply + * + * @return string|array|null + */ + public function actionSupplyEditTime(int $_key): string|array|null + { + // Инициализация + $time = yii::$app->request->post('time') ?? yii::$app->request->get('time'); + $buffer = []; + + if ($order_edge_supply = OrderEdgeSupply::searchById($_id = OrderEdgeSupply::collectionName() . '/' . $_key)) { + // Удалось найти инстанцию поставки + + // Запись в буфер записи в базу данных + $order_edge_supply->time = $time; + + // Отправка в базу данных + if ($order_edge_supply->save()) { + // Удалось сохранить изменения + + // Запись в буфер вывода + $buffer['time'] = $order_edge_supply->time; + } else { + // Не удалось сохранить изменения + + yii::$app->response->statusCode = 500; + } + } + + // Запись обязательных параметров + $buffer['_csrf'] = yii::$app->request->getCsrfToken(); + + // Настройка ответа + yii::$app->response->format = Response::FORMAT_JSON; + + return $buffer; + } + + /** + * Запись комментария поставки в заказе (order_edge_supply) + * + * @param int $_key Ключ записи в коллекции order_edge_supply + * + * @return string|array|null + */ + public function actionSupplyEditComm(int $_key): string|array|null + { + // Инициализация + $comm = yii::$app->request->post('comm') ?? yii::$app->request->get('comm'); + $buffer = []; + + if ($order_edge_supply = OrderEdgeSupply::searchById($_id = OrderEdgeSupply::collectionName() . '/' . $_key)) { + // Удалось найти инстанцию поставки + + // Запись в буфер записи в базу данных + $order_edge_supply->comm = $comm; + + // Отправка в базу данных + if ($order_edge_supply->save()) { + // Удалось сохранить изменения + + // Запись в буфер вывода + $buffer['comm'] = $order_edge_supply->comm; } else { // Не удалось сохранить изменения diff --git a/mirzaev/skillparts/system/models/Invoice.php b/mirzaev/skillparts/system/models/Invoice.php new file mode 100644 index 0000000..df0acf8 --- /dev/null +++ b/mirzaev/skillparts/system/models/Invoice.php @@ -0,0 +1,33 @@ +setInputData('My html file') + // В каком формате нужен результат + ->setOutputFormat(Format::TEXT_DOCX) + // Файл для сохранения результата + ->setOutputFile('path-to-result-docx.docx'); + + // Запускаем конвертацию + $converter->convert($parameters); + } +} diff --git a/mirzaev/skillparts/system/models/Order.php b/mirzaev/skillparts/system/models/Order.php index ff430e8..a9a46a8 100644 --- a/mirzaev/skillparts/system/models/Order.php +++ b/mirzaev/skillparts/system/models/Order.php @@ -458,7 +458,7 @@ class Order extends Document implements DocumentInterface // var_dump($e->getTrace()); // var_dump($e->getFile()); die; - // var_dump(json_decode($e->getMessage(), true)['errors']); die; + var_dump(json_decode($e->getMessage(), true)['errors']); die; } // Запись цены (цена поставки + цена доставки + наша наценка) diff --git a/mirzaev/skillparts/system/models/connection/Dellin.php b/mirzaev/skillparts/system/models/connection/Dellin.php index d3f8ea8..3cf3460 100644 --- a/mirzaev/skillparts/system/models/connection/Dellin.php +++ b/mirzaev/skillparts/system/models/connection/Dellin.php @@ -171,7 +171,8 @@ class Dellin extends Model 'sessionID' => self::$session, 'delivery' => [ 'derival' => [ - 'produceDate' => date('Y-m-d', time() + ($settings['delivery_handle_time'] ?? 86400)) + // 'produceDate' => date('Y-m-d', time() + ($settings['delivery_handle_time'] ?? 86400)) + 'produceDate' => date('Y-m-d', time() + 86400 * 3) ] ], 'members' => [ diff --git a/mirzaev/skillparts/system/views/cart/index.php b/mirzaev/skillparts/system/views/cart/index.php index 0030a80..680c02e 100644 --- a/mirzaev/skillparts/system/views/cart/index.php +++ b/mirzaev/skillparts/system/views/cart/index.php @@ -63,7 +63,7 @@ use DateTime; default => '' }; - // Инициализация времени + // Рассчет времени try { $delivery_converted = DateTime::createFromFormat('Y-m-d H:i:s', $connection['delivery']['orderDates']['giveoutFromOspReceiver'])->getTimestamp(); } catch (Exception $e) { diff --git a/mirzaev/skillparts/system/views/invoice/order/pattern.php b/mirzaev/skillparts/system/views/invoice/order/pattern.php new file mode 100644 index 0000000..e69de29 diff --git a/mirzaev/skillparts/system/views/orders/index.php b/mirzaev/skillparts/system/views/orders/index.php index f7e435c..3bac62d 100644 --- a/mirzaev/skillparts/system/views/orders/index.php +++ b/mirzaev/skillparts/system/views/orders/index.php @@ -66,8 +66,8 @@ if ( ]; ?> -

#

-

+

#

+

@@ -133,7 +133,7 @@ if ( -
+

Выберите поставку

diff --git a/mirzaev/skillparts/system/views/suppliers/request.php b/mirzaev/skillparts/system/views/suppliers/request.php index f29818c..c0c52fe 100644 --- a/mirzaev/skillparts/system/views/suppliers/request.php +++ b/mirzaev/skillparts/system/views/suppliers/request.php @@ -44,6 +44,13 @@ AppAsset::register($this); + registerCsrfMetaTags() ?> @@ -90,8 +97,8 @@ AppAsset::register($this); field($model_request, 'phon', ['options' => ['class' => "mb-3"]])->input('tel', ['aria-invalid' => false, 'aria-required' => true, 'pattern' => '7[0-9]{3}[0-9]{3}[0-9]{2}[0-9]{2}', 'placeholder' => '79091112233', 'title' => '79091112233']); ?> field($model_request, 'mail', ['options' => ['class' => "mb-3"]])->input('email', ['placeholder' => 'company@mail.ru']); ?> field($model_request, 'file', ['options' => ['class' => "mb-3 d-flex flex-column justify-content-center"]])->fileInput(['multiple' => true, 'class' => 'my-auto px-0']) ?> +
-
@@ -103,6 +110,8 @@ AppAsset::register($this); endBody() ?> + + diff --git a/mirzaev/skillparts/system/web/js/orders_panel.js b/mirzaev/skillparts/system/web/js/orders_panel.js index f6b40df..8548315 100644 --- a/mirzaev/skillparts/system/web/js/orders_panel.js +++ b/mirzaev/skillparts/system/web/js/orders_panel.js @@ -11,8 +11,6 @@ function order_init(order_key) { // Инициализация let target = panel.children[2].children[0].children[i]; - console.log(i); - if ((target === undefined || target.children[1] === undefined || target.children[1].children[0] === undefined) && !target.classList.contains('dropdown-divider')) { supplies_are_confirmed = false; @@ -78,24 +76,65 @@ function orders_supply_edit(supply_key, order_key) { // Удаление индикатора загрузки panel.innerHTML = ''; + // Идентификатор + if (document.getElementById(supply.getAttribute('id') + '_id') === null) { + // Инициализация контейнера + let container = document.createElement('div'); + container.setAttribute('id', supply.getAttribute('id') + '_id'); + container.setAttribute('class', 'row mb-1 px-3'); + + // Инициализация названия + let name = document.createElement('p'); + name.setAttribute('id', supply.getAttribute('id') + '_id_name'); + name.setAttribute('class', 'col-auto px-0 ml-0 mr-2'); + name.innerText = 'Идентификатор:'; + + // Инициализация идентификатора + let text = document.createElement('p'); + text.setAttribute('id', supply.getAttribute('id') + '_id_value'); + text.setAttribute('class', 'col-auto px-0 mx-0 font-weight-bold'); + if (data.id !== undefined) { + text.innerText = '#' + data.id; + } else { + text.innerText = 'Неизвестно'; + } + + // Запись в документ + panel.appendChild(container); + container.appendChild(name); + container.appendChild(text); + }; + + // // Разделитель статического информационного блока от блока с динамическими данными + // if (document.getElementById(supply.getAttribute('id') + '_info_divider') === null) { + // // Инициализация контейнера + // let divider = document.createElement('div'); + // divider.setAttribute('id', supply.getAttribute('id') + '_info_divider'); + // divider.setAttribute('class', 'dropdown-divider mb-2');; + + // // Запись в документ + // panel.appendChild(divider); + // }; + // Цена if (document.getElementById(supply.getAttribute('id') + '_cost') === null) { // Инициализация контейнера let container = document.createElement('div'); container.setAttribute('id', supply.getAttribute('id') + '_cost'); - container.setAttribute('class', 'row mb-3 px-3'); + container.setAttribute('class', 'row px-3'); // Инициализация названия let name = document.createElement('p'); name.setAttribute('id', supply.getAttribute('id') + '_cost_name'); - name.setAttribute('class', 'col-2 text-center'); + name.setAttribute('class', 'col-auto px-0 ml-0 mr-2'); name.innerText = 'Цена'; // Инициализация поля let input = document.createElement('input'); input.setAttribute('id', supply.getAttribute('id') + '_cost_input'); - input.setAttribute('class', 'col-10 form-control'); + input.setAttribute('class', 'col-2 text-center form-control-plaintext'); input.setAttribute('type', 'number'); + input.setAttribute('onchange', 'return orders_supply_cost_edit(' + supply_key + ', this);') if (data.cost !== undefined) { input.setAttribute('value', data.cost); } else { @@ -103,10 +142,16 @@ function orders_supply_edit(supply_key, order_key) { } input.setAttribute('aria-invalid', 'false'); + // Инициализация дополнительных данных + let info = document.createElement('p'); + info.setAttribute('class', 'col-auto px-0 ml-2 mr-0'); + info.innerText = 'рублей'; + // Запись в документ panel.appendChild(container); container.appendChild(name); container.appendChild(input); + container.appendChild(info); }; // Время доставки @@ -114,19 +159,20 @@ function orders_supply_edit(supply_key, order_key) { // Инициализация контейнера let container = document.createElement('div'); container.setAttribute('id', supply.getAttribute('id') + '_time'); - container.setAttribute('class', 'row mb-3 px-3'); + container.setAttribute('class', 'row mb-2 px-3'); // Инициализация названия let name = document.createElement('p'); name.setAttribute('id', supply.getAttribute('id') + '_time_name'); - name.setAttribute('class', 'col-2 text-center'); + name.setAttribute('class', 'col-auto px-0 ml-0 mr-2'); name.innerText = 'Время'; // Инициализация поля let input = document.createElement('input'); input.setAttribute('id', supply.getAttribute('id') + '_time_input'); - input.setAttribute('class', 'col-10 form-control'); + input.setAttribute('class', 'col-1 text-center form-control-plaintext'); input.setAttribute('type', 'number'); + input.setAttribute('onchange', 'return orders_supply_time_edit(' + supply_key + ', this);') if (data.time !== undefined) { input.setAttribute('value', data.time); } else { @@ -134,10 +180,16 @@ function orders_supply_edit(supply_key, order_key) { } input.setAttribute('aria-invalid', 'false'); + // Инициализация дополнительных данных + let info = document.createElement('p'); + info.setAttribute('class', 'col-auto px-0 ml-2 mr-0'); + info.innerText = 'дней'; + // Запись в документ panel.appendChild(container); container.appendChild(name); container.appendChild(input); + container.appendChild(info); }; // Комментарий @@ -153,10 +205,11 @@ function orders_supply_edit(supply_key, order_key) { textarea.setAttribute('class', 'col-12 form-control'); textarea.setAttribute('cols', '50'); textarea.setAttribute('rows', '3'); + textarea.setAttribute('onchange', 'return orders_supply_comm_edit(' + supply_key + ', this);') if (data.comm === undefined) { - textarea.innerText = 'Комментарий к заказу'; + textarea.value = 'Комментарий к заказу'; } else { - textarea.innerText = data.comm; + textarea.value = data.comm; } // Запись в документ @@ -192,8 +245,6 @@ function orders_supply_edit(supply_key, order_key) { // Инициализация let title = document.getElementById(supply.getAttribute('id') + '_stts_indicator'); - console.log(title.children[0]); - if (title.children[0] === undefined) { // Индикатор не найден @@ -263,3 +314,99 @@ function orders_supply_comm_write(button, supply_key, order_key) { return false; } + +/** + * Изменить цену товара в заказе + */ + function orders_supply_cost_edit(supply_key, input) { + if (supply_key !== undefined && input !== undefined) { + // Обработка входных параметров + + $.ajax({ + url: '/orders/supply/' + supply_key + '/edit/cost', + type: 'post', + dataType: 'json', + data: { + '_csrf': yii.getCsrfToken(), + 'cost': input.value + }, + success: function (data, status) { + if (data.cost !== undefined) { + input.value = data.cost; + } + + orders_response_success(data, status); + }, + error: orders_response_error + }); + } + + // Пересчитывание стоимости + cart_cost_calculate(); + + return false; +} + +/** + * Изменить время доставки товара в заказе + */ + function orders_supply_time_edit(supply_key, input) { + if (supply_key !== undefined && input !== undefined) { + // Обработка входных параметров + + $.ajax({ + url: '/orders/supply/' + supply_key + '/edit/time', + type: 'post', + dataType: 'json', + data: { + '_csrf': yii.getCsrfToken(), + 'time': input.value + }, + success: function (data, status) { + if (data.time !== undefined) { + input.value = data.time; + } + + orders_response_success(data, status); + }, + error: orders_response_error + }); + } + + // Пересчитывание стоимости + cart_cost_calculate(); + + return false; +} + +/** + * Изменить комментарий товара в заказе + */ + function orders_supply_comm_edit(supply_key, input) { + if (supply_key !== undefined && input !== undefined) { + // Обработка входных параметров + + $.ajax({ + url: '/orders/supply/' + supply_key + '/edit/comm', + type: 'post', + dataType: 'json', + data: { + '_csrf': yii.getCsrfToken(), + 'comm': input.value + }, + success: function (data, status) { + if (data.comm !== undefined) { + input.value = data.comm; + } + + orders_response_success(data, status); + }, + error: orders_response_error + }); + } + + // Пересчитывание стоимости + cart_cost_calculate(); + + return false; +}