пох
This commit is contained in:
parent
0d654ad790
commit
0fa1c977ca
|
@ -28,7 +28,7 @@
|
|||
"mirzaev/yii2-arangodb": ">=2.1.x-dev",
|
||||
"mirzaev/yii2-arangodb-sessions": ">=1.1.x-dev",
|
||||
"guzzlehttp/guzzle": "^7.3",
|
||||
"mnvx/lowrapper": "^1.0"
|
||||
"phpoffice/phpspreadsheet": "^1.18"
|
||||
},
|
||||
"require-dev": {
|
||||
"codeception/codeception": ">=4.1",
|
||||
|
|
|
@ -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": "128ca2ce9581ee88384d5c0eb626732b",
|
||||
"content-hash": "2d649fe15bca353de389fb356d2d7d48",
|
||||
"packages": [
|
||||
{
|
||||
"name": "bower-asset/bootstrap",
|
||||
|
@ -1104,56 +1104,6 @@
|
|||
],
|
||||
"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",
|
||||
|
@ -1277,16 +1227,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpoffice/phpspreadsheet",
|
||||
"version": "1.17.1",
|
||||
"version": "1.18.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
|
||||
"reference": "c55269cb06911575a126dc225a05c0e4626e5fb4"
|
||||
"reference": "418cd304e8e6b417ea79c3b29126a25dc4b1170c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/c55269cb06911575a126dc225a05c0e4626e5fb4",
|
||||
"reference": "c55269cb06911575a126dc225a05c0e4626e5fb4",
|
||||
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/418cd304e8e6b417ea79c3b29126a25dc4b1170c",
|
||||
"reference": "418cd304e8e6b417ea79c3b29126a25dc4b1170c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1305,20 +1255,23 @@
|
|||
"ext-zlib": "*",
|
||||
"ezyang/htmlpurifier": "^4.13",
|
||||
"maennchen/zipstream-php": "^2.1",
|
||||
"markbaker/complex": "^1.5||^2.0",
|
||||
"markbaker/matrix": "^1.2||^2.0",
|
||||
"php": "^7.2||^8.0",
|
||||
"markbaker/complex": "^2.0",
|
||||
"markbaker/matrix": "^2.0",
|
||||
"php": "^7.2 || ^8.0",
|
||||
"psr/http-client": "^1.0",
|
||||
"psr/http-factory": "^1.0",
|
||||
"psr/simple-cache": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"dompdf/dompdf": "^0.8.5",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "dev-master",
|
||||
"dompdf/dompdf": "^1.0",
|
||||
"friendsofphp/php-cs-fixer": "^2.18",
|
||||
"jpgraph/jpgraph": "^4.0",
|
||||
"mpdf/mpdf": "^8.0",
|
||||
"phpcompatibility/php-compatibility": "^9.3",
|
||||
"phpunit/phpunit": "^8.5||^9.3",
|
||||
"phpstan/phpstan": "^0.12.82",
|
||||
"phpstan/phpstan-phpunit": "^0.12.18",
|
||||
"phpunit/phpunit": "^8.5",
|
||||
"squizlabs/php_codesniffer": "^3.5",
|
||||
"tecnickcom/tcpdf": "^6.3"
|
||||
},
|
||||
|
@ -1372,9 +1325,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
|
||||
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.17.1"
|
||||
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.18.0"
|
||||
},
|
||||
"time": "2021-03-02T17:54:11+00:00"
|
||||
"time": "2021-05-31T18:21:15+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/http-client",
|
||||
|
@ -1536,56 +1489,6 @@
|
|||
},
|
||||
"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",
|
||||
|
@ -2163,151 +2066,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": "triagens/arangodb",
|
||||
"version": "v3.6.0",
|
||||
|
@ -6589,6 +6347,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": "symfony/service-contracts",
|
||||
"version": "v2.2.0",
|
||||
|
|
|
@ -16,6 +16,7 @@ use app\models\Product;
|
|||
use app\models\OrderEdgeSupply;
|
||||
use app\models\AccountEdgeOrder;
|
||||
use app\models\connection\Dellin;
|
||||
use app\models\Invoice;
|
||||
use app\models\Notification;
|
||||
use app\models\SupplyEdgeProduct;
|
||||
|
||||
|
@ -92,7 +93,7 @@ class OrderController extends Controller
|
|||
public function actionIndex()
|
||||
{
|
||||
// Инициализация
|
||||
$orders = Order::search(type: 'all', limit: 10, page: 1, select: '{account_edge_order, order}');
|
||||
$orders = Order::search(type: 'all', limit: 10, page: 1, select: '{account_edge_order, order}', supplies: true);
|
||||
$moderator_orders = self::genOrdersForModeration();
|
||||
|
||||
if (yii::$app->request->isPost) {
|
||||
|
@ -377,6 +378,15 @@ class OrderController extends Controller
|
|||
if ($edge->update()) {
|
||||
// Удалось сохранить изменения
|
||||
|
||||
// Генерация счета
|
||||
Invoice::generate($this->renderPartial('/invoice/order/pattern', [
|
||||
'account' => yii::$app->user->identity->_key,
|
||||
'order' => [
|
||||
'id' => $edge->_key,
|
||||
'date' => $edge->date ?? time() // @todo доделать
|
||||
]
|
||||
]));
|
||||
|
||||
// Запись в журнал
|
||||
$model->journal('requested');
|
||||
|
||||
|
@ -410,6 +420,8 @@ class OrderController extends Controller
|
|||
* Включает поиск запрошенных заказов и связанных с ними поставках
|
||||
*
|
||||
* @return array ['order' => array, 'order_edge_account' => array, 'supplies' => array]
|
||||
*
|
||||
* @todo Уничтожить заменив на Order::search(supplies: true)
|
||||
*/
|
||||
protected static function genOrdersForModeration(int $page = 1): array
|
||||
{
|
||||
|
|
|
@ -7,27 +7,25 @@ namespace app\models;
|
|||
use yii;
|
||||
use yii\base\Model;
|
||||
|
||||
use Mnvx\Lowrapper\Converter;
|
||||
use Mnvx\Lowrapper\LowrapperParameters;
|
||||
use Mnvx\Lowrapper\Format;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
// use PhpOffice\PhpSpreadsheet\Reader\Xlsx as XlsxReader;
|
||||
// use PhpOffice\PhpSpreadsheet\Writer\Html;
|
||||
use PhpOffice\PhpSpreadsheet\Reader\Html as HtmlReader;
|
||||
class Invoice extends Model
|
||||
{
|
||||
public function generate(): array
|
||||
public static function generate(string $html): void
|
||||
{
|
||||
// Создаем объект конвертера
|
||||
$converter = new Converter();
|
||||
$reader = new HtmlReader();
|
||||
$spreadsheet = $reader->loadFromString($html);
|
||||
|
||||
// Описываем параметры для конвертера
|
||||
$parameters = (new LowrapperParameters())
|
||||
// На вход подаем строку с HTML
|
||||
->setInputData('<html>My html file</html>')
|
||||
// В каком формате нужен результат
|
||||
->setOutputFormat(Format::TEXT_DOCX)
|
||||
// Файл для сохранения результата
|
||||
->setOutputFile('path-to-result-docx.docx');
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
$writer->save('hello world228.xlsx');
|
||||
|
||||
// Запускаем конвертацию
|
||||
$converter->convert($parameters);
|
||||
// $reader = new XlsxReader();
|
||||
// $reader->setReadDataOnly(true);
|
||||
// $spreadsheet = $reader->load('../views/invoice/order/original.xlsx');
|
||||
|
||||
// $writer = new Html($spreadsheet);
|
||||
// $writer->save('hello world.html');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -234,8 +234,10 @@ class Order extends Document implements DocumentInterface
|
|||
|
||||
/**
|
||||
* Поиск заказа
|
||||
*
|
||||
* @todo Привести в порядок
|
||||
*/
|
||||
public static function search(Account|string $account = null, string $type = 'current', int $limit = 1, int $page = 1, string $select = null): self|array|null
|
||||
public static function search(Account|string $account = null, string $type = 'current', int $limit = 1, int $page = 1, string $select = null, bool $supplies = false): self|array|null
|
||||
{
|
||||
// Инициализация аккаунта
|
||||
if (empty($account) && isset(yii::$app->user->identity)) {
|
||||
|
@ -271,7 +273,6 @@ class Order extends Document implements DocumentInterface
|
|||
];
|
||||
}
|
||||
|
||||
|
||||
// Инициализация сдвига по запрашиваемым данным (пагинация)
|
||||
$offset = $limit * ($page - 1);
|
||||
|
||||
|
@ -289,6 +290,25 @@ class Order extends Document implements DocumentInterface
|
|||
direction: 'INBOUND'
|
||||
);
|
||||
|
||||
if ($supplies) {
|
||||
// Запрошен поиск поставок
|
||||
|
||||
foreach ($return as &$container) {
|
||||
// Перебор заказов
|
||||
|
||||
// Инициализация настроек
|
||||
$config = $container['order'];
|
||||
unset($config['_id'], $config['_rev'], $config['_id']);
|
||||
|
||||
if ($buffer = new Order($config)) {
|
||||
// Удалось инициализировать буфер заказа
|
||||
|
||||
// Чтение полного содержания
|
||||
$container['supplies'] = $buffer->content(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $limit === 1 ? $return[0] ?? null : $return;
|
||||
}
|
||||
|
||||
|
@ -458,7 +478,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;
|
||||
}
|
||||
|
||||
// Запись цены (цена поставки + цена доставки + наша наценка)
|
||||
|
|
|
@ -0,0 +1,129 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Competency List</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table style="height: 100vh;" cols="13" rows="50">
|
||||
<tr>
|
||||
<td style="text-align: center; outline: 2px solid;" colspan="13" rowspan="3" valign="center"><b>ВНИМАНИЕ! Уважаемые покупатели, просим вас указывать в назначении платежа: Аванс за запчасти по договору №<?= $account ?></b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="text-align: center;" colspan="13"><b>Образец заполнения платежного поручения</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: solid;" colspan="6" rowspan="2" valign="top">АО "ТИНЬКОФФ БАНК" г. Москва</td>
|
||||
<td style="border: solid;" valign="top">БИК</td>
|
||||
<td style="border: solid;" colspan="6" valign="top">044525974</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: solid;" rowspan="2" valign="top">Сч. №</td>
|
||||
<td style="border: solid;" colspan="6" rowspan="2" valign="top">30101810145250000974</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: solid;" colspan="6" valign="top">Банк получателя</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: solid;" valign="top">ИНН</td>
|
||||
<td style="text-align: left; border: solid;" colspan="2" valign="top">2724241607</td>
|
||||
<td style="border: solid;" valign="top">КПП</td>
|
||||
<td style="text-align: left; border: solid;" colspan="2" valign="top">272401001</td>
|
||||
<td style="border: solid;" valign="top">Сч. №</td>
|
||||
<td style="text-align: left; border: solid;" colspan="6" valign="top">40702810610000696279</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: solid;" colspan="6" rowspan="3" valign="top">ООО "СтандартМашинери"</td>
|
||||
<td style="border: solid;" valign="top">Вид оп.</td>
|
||||
<td style="text-align: left; border: solid;" valign="top">01</td>
|
||||
<td style="border: solid;" colspan="2" valign="top">Срок плат.</td>
|
||||
<td style="text-align: left; border: solid;" colspan="3" valign="top"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: solid;" valign="top">Наз. пл.</td>
|
||||
<td style="border: solid;"></td>
|
||||
<td style="border: solid;" colspan="2" valign="top">Очер. плат.</td>
|
||||
<td style="text-align: left; border: solid;" colspan="3" valign="top">5</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="border: solid;" valign="top">Код</td>
|
||||
<td style="border: solid;"></td>
|
||||
<td style="border: solid;" colspan="2" valign="top">Рез. поле</td>
|
||||
<td style="text-align: left; border: solid;" colspan="3" valign="top"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style="text-indent: 2px; text-align: left; border-bottom: medium; font-size: 18rem;" colspan="13" rowspan="3" valign="center">
|
||||
<b>Счет на оплату №<?= $order['id'] ?> от <?= date('d.m.Y', $order['date']) ?></b>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" rowspan="2" valign="center">Поставщик</td>
|
||||
<td style="word-wrap: break-word;" colspan="11" rowspan="2" valign="top"><b>ООО "СтандартМашинери", ИНН 2724241607, КПП 272401001, 680014, Хабаровский край, Хабаровск г, Промышленная ул, дом 3, офис 105, тел.: 89242128879</b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2" rowspan="2" valign="center">Покупатель</td>
|
||||
<td style="word-wrap: break-word;" colspan="11" rowspan="2" valign="left"><b></b></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="13"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Тест</td>
|
||||
<td>Тест</td>
|
||||
<td>Тест</td>
|
||||
<td>Тест</td>
|
||||
<td>Тест</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -116,7 +116,7 @@ if (
|
|||
<a id="<?= $part['_key'] ?>_supply" class="row p-2 px-0 rounded row_supply" type="button" onclick="return orders_supply_edit('<?= $part['_key'] ?>', <?= $order['order']['_key'] ?>);">
|
||||
<img class="col-auto px-0 h-100 img-fluid rounded" src="<?= $covr ?>" />
|
||||
<p id="<?= $part['_key'] ?>_supply_stts_indicator" class="col d-flex text-dark"><?= $supply['product']['catn'] ?>
|
||||
<?php if(isset($part['stts']) && $part['stts'] == 1) :?>
|
||||
<?php if (isset($part['stts']) && $part['stts'] == 1) : ?>
|
||||
<span id="<?= $part['_key'] ?>_supply_stts_indicator_icon" class="ml-auto my-auto fas fa-check"></span>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
|
@ -173,9 +173,9 @@ if (
|
|||
<h4 class="ml-4 mt-2 mb-4"><i class="fas fa-list mr-2"></i>Заказы</h4>
|
||||
<div class="col mb-4 list rounded overflow-hidden">
|
||||
<div class="row py-2">
|
||||
<div class="pl-3 mr-1">
|
||||
<!-- <div class="pl-3 mr-1">
|
||||
<input id="checkbox_cart_all" type="checkbox" onchange="return cart_list_checkbox(this);" />
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-2 ml-auto">
|
||||
<span>Статус</span>
|
||||
</div>
|
||||
|
@ -192,13 +192,86 @@ if (
|
|||
// Инициализация
|
||||
extract($order);
|
||||
|
||||
// Пропуск активного заказа (несформированного, корзины)
|
||||
if ($account_edge_order[0]['type'] === 'current') continue;
|
||||
|
||||
// Инициализация
|
||||
$date = empty($jrnl) ? '' : date('H:i d.m.Y', end($jrnl)['date']);
|
||||
|
||||
// Инициализация буфера поставок
|
||||
$supplies_html = '';
|
||||
|
||||
if (isset($supplies)) {
|
||||
// Найдены поставки
|
||||
|
||||
// Инициализация поставок
|
||||
foreach ($supplies as $supply) {
|
||||
// Перебор поставок
|
||||
|
||||
// Инициализация окружения
|
||||
extract($supply);
|
||||
|
||||
// Инициализация доставки
|
||||
if (isset($delivery['error'])) {
|
||||
// Не удалось рассчитать доставку
|
||||
|
||||
// Инициализация индикатора
|
||||
$delivery_icon = '';
|
||||
|
||||
// Инициализация времени
|
||||
$delivery = '?';
|
||||
|
||||
// Инициализация цены
|
||||
$cost = '?';
|
||||
} else {
|
||||
// Удалось рассчитать доставку
|
||||
|
||||
// Инициализация типа доставки
|
||||
$delivery_type = reset($order_edge_supply)['dlvr']['type'] ?? 'auto';
|
||||
|
||||
// Инициализация индикатора
|
||||
$delivery_icon = match ($delivery_type) {
|
||||
'avia' => '<i class="mr-1 fas fa-plane"></i>',
|
||||
default => '<i class="mr-1 fas fa-truck"></i>'
|
||||
};
|
||||
|
||||
// Рассчет времени
|
||||
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;
|
||||
|
||||
// Инициализация цены
|
||||
$cost = $cost . ' ' . $currency;
|
||||
}
|
||||
|
||||
foreach ($order_edge_supply as $part) {
|
||||
// Перебор связей поставок с заказом
|
||||
|
||||
// Инициализация статуса связи поставки
|
||||
$status = $part['stts'] ?? 0;
|
||||
|
||||
$supplies_html .= <<<HTML
|
||||
<div class="row py-2">
|
||||
<div class="col">{$supply['catn']}</div>
|
||||
<div class="col">$status</div>
|
||||
<div class="col">$delivery</div>
|
||||
<div class="col">$cost</div>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo <<<HTML
|
||||
<div class="row py-2 cart_list_target">
|
||||
<div class="pl-3 mr-1">
|
||||
<!-- <div class="pl-3 mr-1">
|
||||
<input type="checkbox" onchange="return cart_list_checkbox(this);"/>
|
||||
</div> -->
|
||||
<div class="col pl-3 mr-1">
|
||||
$supplies_html
|
||||
</div>
|
||||
<div class="col-2 ml-auto">
|
||||
{$account_edge_order[0]['type']}
|
||||
|
@ -220,12 +293,6 @@ if (
|
|||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="row mb-2 mx-0">
|
||||
<select id="cart_list_action" class="form-control mr-3 button_clean w-auto" name="CartListAction">
|
||||
<option value="none" hidden>Действие с выбранными</option>
|
||||
<option value="delete" onclick="return cart_list_delete();">Удалить</option>
|
||||
</select>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
background-color: #fff;
|
||||
}
|
||||
|
||||
#page_orders .page_order_panel .list .row:nth-child(2n+1) {
|
||||
#page_orders .page_order_panel .list > .row:nth-child(2n+1) {
|
||||
background-color: #f7f6f9;
|
||||
}
|
||||
|
||||
#page_orders .page_order_panel .list .row:first-child {
|
||||
#page_orders .page_order_panel .list > .row:first-child {
|
||||
background-color: #dbdde3;
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue