From b2b340ecfecc49f3b4474534af2e398e0fbd5ac8 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:25:48 +0200 Subject: [PATCH 01/25] Update composer --- composer.json | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index bc8dc2a0..6973cc5a 100644 --- a/composer.json +++ b/composer.json @@ -5,26 +5,28 @@ "description": "Invoicing plugin for Sylius.", "license": "MIT", "require": { - "php": "^8.1", + "php": "^8.2", "knplabs/knp-snappy-bundle": "^1.8", "ramsey/uuid": "^3.9 || ^4.0", "sylius/grid-bundle": "^1.9", "sylius/resource-bundle": "^1.9", - "sylius/sylius": "~1.12.0 || ~1.13.0", - "symfony/config": "^5.4 || ^6.4", - "symfony/dependency-injection": "^5.4.21 || ^6.4", - "symfony/form": "^5.4.21 || ^6.4", - "symfony/framework-bundle": "^5.4.21 || ^6.4", - "symfony/http-foundation": "^5.4.21 || ^6.4", - "symfony/http-kernel": "^5.4.21 || ^6.4", - "symfony/messenger": "^5.4.21 || ^6.4", - "symfony/options-resolver": "^5.4.21 || ^6.4", - "symfony/routing": "^5.4.21 || ^6.4" + "sylius/sylius": "2.0.x-dev", + "sylius/twig-hooks": "^0.4", + "symfony/config": "^6.4 || ^7.1", + "symfony/console": "^6.4.1 || ^7.1", + "symfony/dependency-injection": "^6.4 || ^7.1", + "symfony/form": "^6.4 || ^7.1", + "symfony/framework-bundle": "^6.4 || ^7.1", + "symfony/http-foundation": "^6.4 || ^7.1", + "symfony/http-kernel": "^6.4 || ^7.1", + "symfony/messenger": "^6.4 || ^7.1", + "symfony/options-resolver": "^6.4 || ^7.1", + "symfony/routing": "^6.4 || ^7.1" }, "require-dev": { "behat/behat": "^3.6.1", "behat/mink-selenium2-driver": "~1.6.0", - "friends-of-behat/exclude-specifications-extension": "^0.2 || ^0.3", + "friends-of-behat/exclude-specifications-extension": "^0.3", "friends-of-behat/mink": "^1.8", "friends-of-behat/mink-browserkit-driver": "^1.4", "friends-of-behat/mink-debug-extension": "^2.0", @@ -44,12 +46,12 @@ "phpunit/phpunit": "^9.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", "sylius-labs/coding-standard": "~4.0.0", - "symfony/browser-kit": "^5.4.21 || ^6.4", - "symfony/debug-bundle": "^5.4.21 || ^6.4", - "symfony/dotenv": "^5.4.21 || ^6.4", - "symfony/intl": "^5.4 || ^6.0", - "symfony/webpack-encore-bundle": "^1.15", - "symfony/web-profiler-bundle": "^5.4.21 || ^6.4" + "symfony/browser-kit": "^6.4 || ^7.1", + "symfony/debug-bundle": "^6.4 || ^7.1", + "symfony/dotenv": "^6.4 || ^7.1", + "symfony/intl": "^6.4 || ^7.1", + "symfony/webpack-encore-bundle": "^2.1", + "symfony/web-profiler-bundle": "^6.4 || ^7.1" }, "autoload": { "psr-4": { @@ -87,7 +89,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "prefer-stable": true From 9c649c270822ea9ac5cffb44bf2a744afb02c6dd Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:35:40 +0200 Subject: [PATCH 02/25] Upgrade Package.json --- tests/Application/package.json | 58 ++++++---------------------------- 1 file changed, 9 insertions(+), 49 deletions(-) diff --git a/tests/Application/package.json b/tests/Application/package.json index d7847319..c1e2c0f9 100644 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -1,68 +1,28 @@ { "dependencies": { - "@babel/polyfill": "^7.0.0", - "chart.js": "^3.7.1", - "jquery": "^3.5.0", - "jquery.dirtyforms": "^2.0.0", - "lightbox2": "^2.9.0", - "semantic-ui-css": "^2.2.0", - "slick-carousel": "^1.8.1" + "@sylius-ui/admin": "file:../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle", + "@sylius-ui/shop": "file:../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle", + "@symfony/ux-live-component": "file:../../vendor/symfony/ux-live-component/assets", + "@symfony/ux-autocomplete": "file:../../vendor/symfony/ux-autocomplete/assets" }, "devDependencies": { - "@babel/core": "^7.0.0", - "@babel/plugin-external-helpers": "^7.0.0", "@babel/plugin-proposal-object-rest-spread": "^7.18.9", - "@babel/preset-env": "^7.18.10", - "@babel/register": "^7.0.0", - "@rollup/plugin-babel": "^5.3.1", - "@rollup/plugin-commonjs": "^22.0.2", - "@rollup/plugin-inject": "^4.0.4", - "@rollup/plugin-node-resolve": "^13.3.0", - "@semantic-ui-react/css-patch": "^1.1.2", - "@symfony/webpack-encore": "^3.1.0", - "babel-plugin-fast-async": "^6.1.2", - "babel-plugin-module-resolver": "^4.1.0", - "dedent": "^0.7.0", - "eslint": "^8.23.0", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-import-resolver-babel-module": "^5.3.1", - "eslint-plugin-import": "^2.26.0", - "fast-async": "^6.3.8", - "gulp": "^4.0.2", - "gulp-chug": "^0.5.1", - "gulp-concat": "^2.6.1", - "gulp-debug": "^4.0.0", - "gulp-if": "^3.0.0", - "gulp-livereload": "^4.0.2", - "gulp-order": "^1.2.0", - "gulp-sass": "^5.1.0", - "gulp-sourcemaps": "^3.0.0", - "gulp-uglifycss": "^1.1.0", - "merge-stream": "^2.0.0", - "rollup": "^2.79.0", - "rollup-plugin-terser": "^7.0.2", "sass": "^1.54.8", "sass-loader": "^13.0.0", - "upath": "^2.0.1", - "yargs": "^17.5.1" + "tom-select": "^2.2.2" }, "engines": { - "node": "^18 || ^20" + "node": "^20" }, - "engineStrict": true, + "license": "MIT", "scripts": { - "watch": "encore dev --watch", "build": "encore dev", "build:prod": "encore production", - "gulp": "gulp build", "lint": "yarn lint:js", - "lint:js": "eslint gulpfile.babel.js", - "postinstall": "semantic-ui-css-patch" + "watch": "encore dev --watch" }, "repository": { "type": "git", "url": "git+https://github.com/Sylius/Sylius.git" - }, - "author": "Paweł Jędrzejewski", - "license": "MIT" + } } From 183a9fe4a04216e028600ccbd413878289a67f86 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:36:47 +0200 Subject: [PATCH 03/25] Cleanup routes --- .../config/app/routing/admin_invoicing.yml | 15 ++------------- .../config/app/routing/shop_invoicing.yml | 11 ----------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/Resources/config/app/routing/admin_invoicing.yml b/src/Resources/config/app/routing/admin_invoicing.yml index 31210723..f07813e8 100644 --- a/src/Resources/config/app/routing/admin_invoicing.yml +++ b/src/Resources/config/app/routing/admin_invoicing.yml @@ -2,7 +2,7 @@ sylius_invoicing_plugin_invoice: resource: | alias: sylius_invoicing_plugin.invoice section: admin - templates: "@SyliusAdmin\\Crud" + templates: "@SyliusAdmin\\shared\\crud" only: ['index'] grid: sylius_invoicing_plugin_invoice permission: true @@ -21,7 +21,7 @@ sylius_invoicing_plugin_admin_invoice_show: _sylius: section: admin permission: true - template: "@SyliusInvoicingPlugin/Invoice/show.html.twig" + template: "@SyliusAdmin/shared/crud/show.html.twig" sylius_invoicing_plugin_admin_invoice_download: path: /invoices/{id}/download @@ -35,17 +35,6 @@ sylius_invoicing_plugin_admin_invoice_resend: defaults: _controller: sylius_invoicing_plugin.ui.action.resend_invoice -sylius_invoicing_plugin_admin_order_invoices_partial: - path: /_partial/invoices/{orderNumber}/ - methods: [GET] - defaults: - _controller: sylius_invoicing_plugin.controller.invoice::indexAction - _sylius: - template: $template - repository: - method: findByOrderNumber - arguments: $orderNumber - sylius_invoicing_admin_order_show_by_number: path: /orders/by-number/{number} methods: [GET] diff --git a/src/Resources/config/app/routing/shop_invoicing.yml b/src/Resources/config/app/routing/shop_invoicing.yml index b967f6c8..84fc75e4 100644 --- a/src/Resources/config/app/routing/shop_invoicing.yml +++ b/src/Resources/config/app/routing/shop_invoicing.yml @@ -3,14 +3,3 @@ sylius_invoicing_plugin_shop_invoice_download: methods: [GET] defaults: _controller: sylius_invoicing_plugin.ui.action.download_invoice - -sylius_invoicing_plugin_shop_order_invoices_partial: - path: /_partial/invoices/{orderNumber}/ - methods: [GET] - defaults: - _controller: sylius_invoicing_plugin.controller.invoice::indexAction - _sylius: - template: $template - repository: - method: findByOrderNumber - arguments: $orderNumber From d1a0f7e762f77013cb3d6168163ec0e6d06da2ce Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:38:25 +0200 Subject: [PATCH 04/25] cleanup config --- src/Resources/config/config.yml | 63 ++++--------------- tests/Application/assets/admin/entry.js | 1 - tests/Application/assets/shop/entry.js | 1 - tests/Application/config/bundles.php | 23 +++---- .../Application/config/packages/_sylius.yaml | 7 +-- .../config/packages/dev/jms_serializer.yaml | 12 ---- .../config/packages/jms_serializer.yaml | 4 -- .../config/packages/prod/jms_serializer.yaml | 10 --- .../Application/config/packages/security.yaml | 11 +--- tests/Application/gulpfile.babel.js | 0 .../Application/public/media/image/.gitignore | 0 tests/Application/webpack.config.js | 49 ++------------- 12 files changed, 28 insertions(+), 153 deletions(-) delete mode 100644 tests/Application/config/packages/dev/jms_serializer.yaml delete mode 100644 tests/Application/config/packages/jms_serializer.yaml delete mode 100644 tests/Application/config/packages/prod/jms_serializer.yaml delete mode 100644 tests/Application/gulpfile.babel.js delete mode 100644 tests/Application/public/media/image/.gitignore diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index c3d386f8..e93e0455 100644 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -1,3 +1,6 @@ +imports: + - { resource: 'app/twig_hooks/**/*.yaml' } + parameters: sylius_invoicing.invoice_save_path: "%kernel.project_dir%/private/invoices/" sylius_invoicing.filesystem_adapter.invoice: "sylius_invoicing_invoice" @@ -11,7 +14,7 @@ sylius_mailer: emails: invoice_generated: subject: sylius.emails.invoice_generated.subject - template: "@SyliusInvoicingPlugin/Invoice/Email/invoiceGenerated.html.twig" + template: "@SyliusInvoicingPlugin/admin/invoice/email/invoiceGenerated.html.twig" knp_snappy: pdf: @@ -29,7 +32,9 @@ winzou_state_machine: sylius_grid: templates: filter: - invoice_channel: '@SyliusInvoicingPlugin/Grid/Filter/channel.html.twig' + invoice_channel: '@SyliusInvoicingPlugin/admin/invoice/index/grid/filter/channel.html.twig' + action: + download: '@SyliusInvoicingPlugin/admin/shared/action/download.html.twig' grids: sylius_invoicing_plugin_invoice: driver: @@ -47,20 +52,20 @@ sylius_grid: type: twig label: sylius.ui.order options: - template: '@SyliusInvoicingPlugin/Invoice/Grid/Field/orderNumber.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/index/grid/field/order_number.html.twig' sortable: order.number channel: type: twig label: sylius.ui.channel options: - template: "@SyliusInvoicingPlugin/Invoice/Grid/Field/channel.html.twig" + template: "@SyliusAdmin/shared/grid/field/channel.html.twig" total: type: twig label: sylius.ui.total path: . sortable: total options: - template: "@SyliusAdmin/Order/Grid/Field/total.html.twig" + template: "@SyliusAdmin/order/grid/field/order_total.html.twig" issuedAt: type: datetime label: sylius_invoicing_plugin.ui.issued_at @@ -87,10 +92,8 @@ sylius_grid: show: type: show download: - type: default - label: sylius_invoicing_plugin.ui.download_invoice + type: download enabled: '%sylius_invoicing.pdf_generator.enabled%' - icon: download options: link: route: sylius_invoicing_plugin_admin_invoice_download @@ -106,50 +109,6 @@ sylius_grid: parameters: id: resource.id -sylius_ui: - events: - sylius.admin.order.show.summary: - blocks: - sylius_invoicing_plugin: - template: '@SyliusInvoicingPlugin/Order/Admin/fetchInvoices.html.twig' - priority: 15 - - sylius.shop.account.order.show.subcontent: - blocks: - sylius_invoicing_plugin: - template: '@SyliusInvoicingPlugin/Order/Shop/fetchInvoices.html.twig' - priority: 15 - - sylius_invoicing.admin.invoice.buttons: - blocks: - back_button: - template: '@SyliusInvoicingPlugin/Invoice/Show/_backButton.html.twig' - priority: 30 - download_button: - template: '@SyliusInvoicingPlugin/Invoice/Admin/_downloadButton.html.twig' - enabled: '%sylius_invoicing.pdf_generator.enabled%' - priority: 20 - resend_button: - template: '@SyliusInvoicingPlugin/Invoice/Admin/_resendButton.html.twig' - priority: 10 - - sylius_invoicing.admin.order.invoices.list.actions.buttons: - blocks: - download_button: - template: '@SyliusInvoicingPlugin/Invoice/Admin/_downloadButton.html.twig' - enabled: '%sylius_invoicing.pdf_generator.enabled%' - priority: 20 - resend_button: - template: '@SyliusInvoicingPlugin/Invoice/Admin/_resendButton.html.twig' - priority: 10 - - sylius_invoicing.shop.order.invoices.list.actions: - blocks: - download_button: - template: '@SyliusInvoicingPlugin/Order/Shop/_downloadButton.html.twig' - enabled: '%sylius_invoicing.pdf_generator.enabled%' - priority: 10 - framework: messenger: buses: diff --git a/tests/Application/assets/admin/entry.js b/tests/Application/assets/admin/entry.js index 635f5acc..e69de29b 100644 --- a/tests/Application/assets/admin/entry.js +++ b/tests/Application/assets/admin/entry.js @@ -1 +0,0 @@ -import 'sylius/bundle/AdminBundle/Resources/private/entry'; diff --git a/tests/Application/assets/shop/entry.js b/tests/Application/assets/shop/entry.js index aadc3174..e69de29b 100644 --- a/tests/Application/assets/shop/entry.js +++ b/tests/Application/assets/shop/entry.js @@ -1 +0,0 @@ -import 'sylius/bundle/ShopBundle/Resources/private/entry'; diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index f51687e6..34aa83d6 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -1,8 +1,6 @@ ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], @@ -31,12 +29,8 @@ Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true], Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true], Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], - Sylius\Calendar\SyliusCalendarBundle::class => ['all' => true], winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true], Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], - Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true], - JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], - FOS\RestBundle\FOSRestBundle::class => ['all' => true], Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], @@ -48,7 +42,7 @@ Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true], Sylius\Bundle\AdminBundle\SyliusAdminBundle::class => ['all' => true], Sylius\Bundle\ShopBundle\SyliusShopBundle::class => ['all' => true], - ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + ApiPlatform\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], Sylius\Bundle\ApiBundle\SyliusApiBundle::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true, 'test_cached' => true], @@ -58,12 +52,11 @@ Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true], - SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], + Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true], + Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], + Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true], + Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true], + Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true], + Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true] ]; - -if (SyliusCoreBundle::VERSION_ID >= '11300') { - $bundles[Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class] = ['all' => true]; -} - -return $bundles; diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 389cb69f..94d3f511 100644 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -1,13 +1,10 @@ imports: - { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" } - - - { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" } - - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" } - + - { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" } - { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" } - - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" } + parameters: sylius_core.public_dir: '%kernel.project_dir%/public' diff --git a/tests/Application/config/packages/dev/jms_serializer.yaml b/tests/Application/config/packages/dev/jms_serializer.yaml deleted file mode 100644 index 2f32a9b1..00000000 --- a/tests/Application/config/packages/dev/jms_serializer.yaml +++ /dev/null @@ -1,12 +0,0 @@ -jms_serializer: - visitors: - json_serialization: - options: - - JSON_PRETTY_PRINT - - JSON_UNESCAPED_SLASHES - - JSON_PRESERVE_ZERO_FRACTION - json_deserialization: - options: - - JSON_PRETTY_PRINT - - JSON_UNESCAPED_SLASHES - - JSON_PRESERVE_ZERO_FRACTION diff --git a/tests/Application/config/packages/jms_serializer.yaml b/tests/Application/config/packages/jms_serializer.yaml deleted file mode 100644 index ed7bc613..00000000 --- a/tests/Application/config/packages/jms_serializer.yaml +++ /dev/null @@ -1,4 +0,0 @@ -jms_serializer: - visitors: - xml_serialization: - format_output: '%kernel.debug%' diff --git a/tests/Application/config/packages/prod/jms_serializer.yaml b/tests/Application/config/packages/prod/jms_serializer.yaml deleted file mode 100644 index c2881820..00000000 --- a/tests/Application/config/packages/prod/jms_serializer.yaml +++ /dev/null @@ -1,10 +0,0 @@ -jms_serializer: - visitors: - json_serialization: - options: - - JSON_UNESCAPED_SLASHES - - JSON_PRESERVE_ZERO_FRACTION - json_deserialization: - options: - - JSON_UNESCAPED_SLASHES - - JSON_PRESERVE_ZERO_FRACTION diff --git a/tests/Application/config/packages/security.yaml b/tests/Application/config/packages/security.yaml index 2f5c6875..fce3e181 100644 --- a/tests/Application/config/packages/security.yaml +++ b/tests/Application/config/packages/security.yaml @@ -1,5 +1,4 @@ security: - enable_authenticator_manager: true providers: sylius_admin_user_provider: id: sylius.admin_user_provider.email_or_name_based @@ -98,11 +97,6 @@ security: security: false access_control: - - { path: "%sylius.security.admin_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] } - - { path: "%sylius.security.admin_regex%/_partial", role: ROLE_NO_ACCESS } - - { path: "%sylius.security.shop_regex%/_partial", role: PUBLIC_ACCESS, ips: [127.0.0.1, ::1] } - - { path: "%sylius.security.shop_regex%/_partial", role: ROLE_NO_ACCESS } - - { path: "%sylius.security.admin_regex%/forgotten-password", role: PUBLIC_ACCESS } - { path: "%sylius.security.admin_regex%/login", role: PUBLIC_ACCESS } @@ -114,9 +108,8 @@ security: - { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS } - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER } - - { path: "%sylius.security.new_api_admin_route%/reset-password-requests", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } - - { path: "%sylius.security.new_api_admin_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_admin_route%/administrators/token", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER } - - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.new_api_shop_route%/customers/token", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS } diff --git a/tests/Application/gulpfile.babel.js b/tests/Application/gulpfile.babel.js deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/Application/public/media/image/.gitignore b/tests/Application/public/media/image/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/Application/webpack.config.js b/tests/Application/webpack.config.js index 4f4fe541..5d944034 100644 --- a/tests/Application/webpack.config.js +++ b/tests/Application/webpack.config.js @@ -1,49 +1,10 @@ const path = require('path'); -const Encore = require('@symfony/webpack-encore'); -const syliusBundles = path.resolve(__dirname, '../../vendor/sylius/sylius/src/Sylius/Bundle/'); -const uiBundleScripts = path.resolve(syliusBundles, 'UiBundle/Resources/private/js/'); -const uiBundleResources = path.resolve(syliusBundles, 'UiBundle/Resources/private/'); +const SyliusAdmin = require('@sylius-ui/admin'); +const SyliusShop = require('@sylius-ui/shop'); -// Shop config -Encore - .setOutputPath('public/build/shop/') - .setPublicPath('/build/shop') - .addEntry('shop-entry', './assets/shop/entry.js') - .disableSingleRuntimeChunk() - .cleanupOutputBeforeBuild() - .enableSourceMaps(!Encore.isProduction()) - .enableVersioning(Encore.isProduction()) - .enableSassLoader(); +const adminConfig = SyliusAdmin.getWebpackConfig(path.resolve(__dirname)); -const shopConfig = Encore.getWebpackConfig(); +const shopConfig = SyliusShop.getWebpackConfig(path.resolve(__dirname)); -shopConfig.resolve.alias['sylius/ui'] = uiBundleScripts; -shopConfig.resolve.alias['sylius/ui-resources'] = uiBundleResources; -shopConfig.resolve.alias['sylius/bundle'] = syliusBundles; -shopConfig.resolve.alias['chart.js/dist/Chart.min'] = path.resolve(__dirname, 'node_modules/chart.js/dist/chart.min.js'); -shopConfig.name = 'shop'; - -Encore.reset(); - -// Admin config -Encore - .setOutputPath('public/build/admin/') - .setPublicPath('/build/admin') - .addEntry('admin-entry', './assets/admin/entry.js') - .disableSingleRuntimeChunk() - .cleanupOutputBeforeBuild() - .enableSourceMaps(!Encore.isProduction()) - .enableVersioning(Encore.isProduction()) - .enableSassLoader(); - -const adminConfig = Encore.getWebpackConfig(); - -adminConfig.resolve.alias['sylius/ui'] = uiBundleScripts; -adminConfig.resolve.alias['sylius/ui-resources'] = uiBundleResources; -adminConfig.resolve.alias['sylius/bundle'] = syliusBundles; -adminConfig.resolve.alias['chart.js/dist/Chart.min'] = path.resolve(__dirname, 'node_modules/chart.js/dist/chart.min.js'); -adminConfig.externals = { ...adminConfig.externals, window: 'window', document: 'document' }; -adminConfig.name = 'admin'; - -module.exports = [shopConfig, adminConfig]; +module.exports = [adminConfig, shopConfig]; From a16cf19e8a30ccc9eb2eb5ee81a38d2ecd73ad2f Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:41:49 +0200 Subject: [PATCH 05/25] Move show Invoice templates from views to templates directory, split it to twig hooks --- .../views/Grid/Filter/channel.html.twig | 3 - .../Invoice/Admin/_downloadButton.html.twig | 5 - .../Invoice/Admin/_resendButton.html.twig | 5 - .../Invoice/Grid/Field/channel.html.twig | 1 - .../Invoice/Grid/Field/orderNumber.html.twig | 1 - .../views/Invoice/Show/_backButton.html.twig | 5 - .../views/Invoice/Show/_billingData.html.twig | 17 -- .../views/Invoice/Show/_breadcrumb.html.twig | 10 -- .../views/Invoice/Show/_header.html.twig | 20 --- .../Invoice/Show/_shopBillingData.html.twig | 22 --- src/Resources/views/Invoice/show.html.twig | 157 ------------------ .../invoice/email}/invoiceGenerated.html.twig | 0 .../index/grid/field/order_number.html.twig | 1 + .../index/grid/filter/channel.html.twig | 3 + .../header/title_block/actions.html.twig | 3 + .../actions/back_to_index.html.twig | 5 + .../header/title_block/title.html.twig | 5 + .../header/title_block/title/number.html.twig | 3 + .../title_block/title/subtitle.html.twig | 20 +++ .../invoice/show/content/page_body.html.twig | 7 + .../show/content/page_body/buyer.html.twig | 19 +++ .../content/page_body/buyer/city.html.twig | 1 + .../content/page_body/buyer/company.html.twig | 5 + .../page_body/buyer/country_code.html.twig | 1 + .../page_body/buyer/first_name.html.twig | 3 + .../page_body/buyer/postcode.html.twig | 3 + .../content/page_body/buyer/street.html.twig | 1 + .../show/content/page_body/card.html.twig | 5 + .../content/page_body/card/body.html.twig | 3 + .../page_body/card/body/table.html.twig | 5 + .../page_body/card/body/table/body.html.twig | 7 + .../card/body/table/body/currency.html.twig | 1 + .../body/discounted_unit_net_price.html.twig | 1 + .../body/table/body/gross_value.html.twig | 1 + .../card/body/table/body/name.html.twig | 1 + .../card/body/table/body/net_value.html.twig | 1 + .../card/body/table/body/no.html.twig | 1 + .../card/body/table/body/quantity.html.twig | 1 + .../card/body/table/body/tax_amount.html.twig | 1 + .../card/body/table/body/tax_rate.html.twig | 1 + .../body/table/body/unit_net_price.html.twig | 1 + .../card/body/table/footer.html.twig | 3 + .../body/table/footer/net_total.html.twig | 5 + .../body/table/footer/tax_items.html.twig | 14 ++ .../table/footer/tax_items/tax_item.html.twig | 0 .../table/footer/tax_items/tax_rate.html.twig | 0 .../body/table/footer/taxes_total.html.twig | 5 + .../card/body/table/footer/total.html.twig | 5 + .../card/body/table/header.html.twig | 5 + .../card/body/table/header/currency.html.twig | 1 + .../discounted_unit_net_price.html.twig | 1 + .../body/table/header/gross_value.html.twig | 1 + .../card/body/table/header/name.html.twig | 1 + .../body/table/header/net_value.html.twig | 1 + .../card/body/table/header/no.html.twig | 1 + .../card/body/table/header/quantity.html.twig | 1 + .../body/table/header/tax_amount.html.twig | 1 + .../card/body/table/header/tax_rate.html.twig | 1 + .../table/header/unit_net_price.html.twig | 1 + .../content/page_body/card/footer.html.twig | 12 ++ .../show/content/page_body/seller.html.twig | 21 +++ .../content/page_body/seller/city.html.twig | 3 + .../page_body/seller/company.html.twig | 3 + .../page_body/seller/country_code.html.twig | 5 + .../page_body/seller/postcode.html.twig | 5 + .../page_body/seller/representative.html.twig | 3 + .../content/page_body/seller/street.html.twig | 3 + .../content/page_body/seller/tax_id.html.twig | 3 + 68 files changed, 215 insertions(+), 246 deletions(-) delete mode 100644 src/Resources/views/Grid/Filter/channel.html.twig delete mode 100644 src/Resources/views/Invoice/Admin/_downloadButton.html.twig delete mode 100644 src/Resources/views/Invoice/Admin/_resendButton.html.twig delete mode 100644 src/Resources/views/Invoice/Grid/Field/channel.html.twig delete mode 100644 src/Resources/views/Invoice/Grid/Field/orderNumber.html.twig delete mode 100644 src/Resources/views/Invoice/Show/_backButton.html.twig delete mode 100644 src/Resources/views/Invoice/Show/_billingData.html.twig delete mode 100644 src/Resources/views/Invoice/Show/_breadcrumb.html.twig delete mode 100644 src/Resources/views/Invoice/Show/_header.html.twig delete mode 100644 src/Resources/views/Invoice/Show/_shopBillingData.html.twig delete mode 100644 src/Resources/views/Invoice/show.html.twig rename src/{Resources/views/Invoice/Email => templates/admin/invoice/email}/invoiceGenerated.html.twig (100%) create mode 100644 src/templates/admin/invoice/index/grid/field/order_number.html.twig create mode 100644 src/templates/admin/invoice/index/grid/filter/channel.html.twig create mode 100644 src/templates/admin/invoice/show/content/header/title_block/actions.html.twig create mode 100644 src/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig create mode 100644 src/templates/admin/invoice/show/content/header/title_block/title.html.twig create mode 100644 src/templates/admin/invoice/show/content/header/title_block/title/number.html.twig create mode 100644 src/templates/admin/invoice/show/content/header/title_block/title/subtitle.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/buyer.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/buyer/city.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/buyer/company.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/buyer/country_code.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/buyer/first_name.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/buyer/postcode.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/buyer/street.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/currency.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/discounted_unit_net_price.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/gross_value.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/name.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/net_value.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/no.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/quantity.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_amount.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_rate.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/body/unit_net_price.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/footer.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/footer/net_total.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_item.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_rate.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/footer/taxes_total.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/footer/total.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/currency.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/discounted_unit_net_price.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/gross_value.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/name.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/net_value.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/no.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/quantity.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_amount.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_rate.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/body/table/header/unit_net_price.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/card/footer.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/seller.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/seller/city.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/seller/company.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/seller/country_code.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/seller/postcode.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/seller/representative.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/seller/street.html.twig create mode 100644 src/templates/admin/invoice/show/content/page_body/seller/tax_id.html.twig diff --git a/src/Resources/views/Grid/Filter/channel.html.twig b/src/Resources/views/Grid/Filter/channel.html.twig deleted file mode 100644 index 81480fcd..00000000 --- a/src/Resources/views/Grid/Filter/channel.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% form_theme form '@SyliusUi/Form/theme.html.twig' %} - -{{ form_row(form) }} diff --git a/src/Resources/views/Invoice/Admin/_downloadButton.html.twig b/src/Resources/views/Invoice/Admin/_downloadButton.html.twig deleted file mode 100644 index 068b8cc6..00000000 --- a/src/Resources/views/Invoice/Admin/_downloadButton.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -{% set path = path('sylius_invoicing_plugin_admin_invoice_download', {'id': invoice.id}) %} - -{{ buttons.default(path, 'sylius_invoicing_plugin.ui.download_invoice'|trans, invoice.id, 'download', 'blue') }} diff --git a/src/Resources/views/Invoice/Admin/_resendButton.html.twig b/src/Resources/views/Invoice/Admin/_resendButton.html.twig deleted file mode 100644 index e6f57e3b..00000000 --- a/src/Resources/views/Invoice/Admin/_resendButton.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -{% set path = path('sylius_invoicing_plugin_admin_invoice_resend', {'id': invoice.id}) %} - -{{ buttons.default(path, 'sylius_invoicing_plugin.ui.resend_invoice'|trans, invoice.id, 'send') }} diff --git a/src/Resources/views/Invoice/Grid/Field/channel.html.twig b/src/Resources/views/Invoice/Grid/Field/channel.html.twig deleted file mode 100644 index 7341ba10..00000000 --- a/src/Resources/views/Invoice/Grid/Field/channel.html.twig +++ /dev/null @@ -1 +0,0 @@ -{% include '@SyliusAdmin/Common/_channel.html.twig' with {'channel': data} %} diff --git a/src/Resources/views/Invoice/Grid/Field/orderNumber.html.twig b/src/Resources/views/Invoice/Grid/Field/orderNumber.html.twig deleted file mode 100644 index 39987143..00000000 --- a/src/Resources/views/Invoice/Grid/Field/orderNumber.html.twig +++ /dev/null @@ -1 +0,0 @@ -#{{ data }} diff --git a/src/Resources/views/Invoice/Show/_backButton.html.twig b/src/Resources/views/Invoice/Show/_backButton.html.twig deleted file mode 100644 index 03096ac8..00000000 --- a/src/Resources/views/Invoice/Show/_backButton.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -{% set path = path('sylius_invoicing_plugin_admin_invoice_index') %} - -{{ buttons.default(path, '', 'back', 'arrow alternate circle left outline') }} diff --git a/src/Resources/views/Invoice/Show/_billingData.html.twig b/src/Resources/views/Invoice/Show/_billingData.html.twig deleted file mode 100644 index 8af704a9..00000000 --- a/src/Resources/views/Invoice/Show/_billingData.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% set billingData = invoice.billingData %} - -

- {{ 'sylius_invoicing_plugin.ui.buyer'|trans }} -

-
-
- {{ billingData.firstName }} {{ billingData.lastName }} - {% if billingData.company %} - {{ billingData.company }}
- {% endif %} - {{ billingData.street }}
- {{ billingData.city }}
- - {{ billingData.countryCode|sylius_country_name|upper }} {{ billingData.postcode }} -
-
diff --git a/src/Resources/views/Invoice/Show/_breadcrumb.html.twig b/src/Resources/views/Invoice/Show/_breadcrumb.html.twig deleted file mode 100644 index 2a4ba37b..00000000 --- a/src/Resources/views/Invoice/Show/_breadcrumb.html.twig +++ /dev/null @@ -1,10 +0,0 @@ -{% import '@SyliusAdmin/Macro/breadcrumb.html.twig' as breadcrumb %} - -{% set breadcrumbs = [ - { label: 'sylius.ui.administration'|trans, url: path('sylius_admin_dashboard') }, - { label: 'sylius_invoicing_plugin.ui.invoices'|trans, url: path('sylius_invoicing_plugin_admin_invoice_index') }, - { label: invoice.id, url: path('sylius_invoicing_plugin_admin_invoice_show', { 'id': invoice.id }) } -] -%} - -{{ breadcrumb.crumble(breadcrumbs) }} diff --git a/src/Resources/views/Invoice/Show/_header.html.twig b/src/Resources/views/Invoice/Show/_header.html.twig deleted file mode 100644 index 5e7fd8b9..00000000 --- a/src/Resources/views/Invoice/Show/_header.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -

- -
- {{ 'sylius_invoicing_plugin.ui.invoice'|trans }} {{ invoice.number }} -
-
-
- {{ 'sylius_invoicing_plugin.ui.issued_at'|trans }}: {{ invoice.issuedAt|format_datetime }} -
-
- {{ 'sylius_invoicing_plugin.ui.issued_for_order'|trans }}: #{{ invoice.order.number }} -
-
- {{ 'sylius_invoicing_plugin.ui.issued_from'|trans }} - {% include '@SyliusAdmin/Common/_channel.html.twig' with {'channel': invoice.channel} %} -
-
-
-
-

diff --git a/src/Resources/views/Invoice/Show/_shopBillingData.html.twig b/src/Resources/views/Invoice/Show/_shopBillingData.html.twig deleted file mode 100644 index 7c39638e..00000000 --- a/src/Resources/views/Invoice/Show/_shopBillingData.html.twig +++ /dev/null @@ -1,22 +0,0 @@ -{% set shopBillingData = invoice.shopBillingData %} - -{% if shopBillingData %} -

- {{ 'sylius_invoicing_plugin.ui.seller'|trans }} -

-
-
- {% if shopBillingData.company %}{{ shopBillingData.company }}{% endif %} - {% if shopBillingData.representative %}{{ shopBillingData.representative }}{% endif %} - {% if shopBillingData.street %}{{ shopBillingData.street }}
{% endif %} - {% if shopBillingData.city %}{{ shopBillingData.city }}
{% endif %} - {% if shopBillingData.taxId %}{{ shopBillingData.taxId }}
{% endif %} - {% if shopBillingData.countryCode %} - - {% endif %} - {% if shopBillingData.countryCode and shopBillingData.postcode %} - {{ shopBillingData.countryCode|sylius_country_name|upper }} {{ shopBillingData.postcode }} - {% endif %} -
-
-{% endif %} diff --git a/src/Resources/views/Invoice/show.html.twig b/src/Resources/views/Invoice/show.html.twig deleted file mode 100644 index 3e8c5812..00000000 --- a/src/Resources/views/Invoice/show.html.twig +++ /dev/null @@ -1,157 +0,0 @@ -{% extends '@SyliusAdmin/layout.html.twig' %} - -{% import '@SyliusAdmin/Common/Macro/money.html.twig' as money %} - -{% block title %}{{ 'sylius.ui.invoice'|trans ~ ' ' ~ invoice.number }} {{ parent() }}{% endblock %} - -{% block content %} -
-
- {% include '@SyliusInvoicingPlugin/Invoice/Show/_header.html.twig' %} - {% include '@SyliusInvoicingPlugin/Invoice/Show/_breadcrumb.html.twig' %} -
-
- {{ sylius_template_event('sylius_invoicing.admin.invoice.buttons', _context) }} -
-
- -
-
- {% include '@SyliusInvoicingPlugin/Invoice/Show/_billingData.html.twig' %} -
-
- {% include '@SyliusInvoicingPlugin/Invoice/Show/_shopBillingData.html.twig' %} -
-
-
-
- - - - - - - - - - - - - - - - - {% for item in invoice.lineItems %} - - - - - - - - - - - - - {% endfor %} - - - - - - - - - - - - - - - - - - - {% if invoice.taxItems.count() > 0 %} - - - - - - - {% for item in invoice.taxItems %} - - - - - - {% endfor %} - {% endif %} - -
{{ 'sylius_invoicing_plugin.ui.no'|trans }}{{ 'sylius.ui.name'|trans }}{{ 'sylius.ui.quantity'|trans }}{{ 'sylius_invoicing_plugin.ui.unit_net_price'|trans }}{{ 'sylius_invoicing_plugin.ui.discounted_unit_net_price'|trans }}{{ 'sylius_invoicing_plugin.ui.net_value'|trans }}{{ 'sylius_invoicing_plugin.ui.tax_rate'|trans }}{{ 'sylius_invoicing_plugin.ui.tax_amount'|trans }}{{ 'sylius_invoicing_plugin.ui.gross_value'|trans }}{{ 'sylius.ui.currency'|trans }}
- {{ loop.index }} - - {{ item.name }} {% if item.variantName is not null %}({{ item.variantName }}){% endif %} - - {{ item.quantity }} - - {{ '%0.2f'|format(item.unitPrice/100) }} - - {{ '%0.2f'|format(item.discountedUnitNetPrice/100) }} - - {{ '%0.2f'|format(item.subtotal/100) }} - - {% if item.taxRate is null %}0%{% else %}{{ item.taxRate }}{% endif %} - - {{ '%0.2f'|format(item.taxTotal/100) }} - - {{ '%0.2f'|format(item.total/100) }} - - {{ invoice.currencyCode }} -
- {{ 'sylius_invoicing_plugin.ui.net_total'|trans }}: - - {{ '%0.2f'|format(invoice.subtotal/100) }} - - {{ invoice.currencyCode }} -
- {{ 'sylius_invoicing_plugin.ui.taxes_total'|trans }}: - - {{ '%0.2f'|format(invoice.taxesTotal/100) }} - - {{ invoice.currencyCode }} -
- {{ 'sylius.ui.total'|trans }}: - - {{ '%0.2f'|format(invoice.total/100) }} - - {{ invoice.currencyCode }} -
- {{ 'sylius_invoicing_plugin.ui.tax_rate'|trans }} - - {{ 'sylius_invoicing_plugin.ui.tax_amount'|trans }} - - {{ 'sylius.ui.currency'|trans }} -
- {{ item.label }}: - - {{ '%0.2f'|format(item.amount/100) }} - - {{ invoice.currencyCode }} -
-
-
-
- {{ 'sylius_invoicing_plugin.ui.payment.paid'|trans }}: - - {% if invoice.paymentState() is constant('Sylius\\InvoicingPlugin\\Entity\\InvoiceInterface::PAYMENT_STATE_COMPLETED') %} - {{ 'sylius_invoicing_plugin.ui.payment.yes'|trans }} - {% else %} - {{ 'sylius_invoicing_plugin.ui.payment.no'|trans }} - {% endif %} - -
-
-
-{% endblock %} diff --git a/src/Resources/views/Invoice/Email/invoiceGenerated.html.twig b/src/templates/admin/invoice/email/invoiceGenerated.html.twig similarity index 100% rename from src/Resources/views/Invoice/Email/invoiceGenerated.html.twig rename to src/templates/admin/invoice/email/invoiceGenerated.html.twig diff --git a/src/templates/admin/invoice/index/grid/field/order_number.html.twig b/src/templates/admin/invoice/index/grid/field/order_number.html.twig new file mode 100644 index 00000000..4008a4da --- /dev/null +++ b/src/templates/admin/invoice/index/grid/field/order_number.html.twig @@ -0,0 +1 @@ +#{{ data }} diff --git a/src/templates/admin/invoice/index/grid/filter/channel.html.twig b/src/templates/admin/invoice/index/grid/filter/channel.html.twig new file mode 100644 index 00000000..9f591997 --- /dev/null +++ b/src/templates/admin/invoice/index/grid/filter/channel.html.twig @@ -0,0 +1,3 @@ +{% form_theme form '@SyliusAdmin/shared/form_theme.html.twig' %} + +{{ form_row(form) }} diff --git a/src/templates/admin/invoice/show/content/header/title_block/actions.html.twig b/src/templates/admin/invoice/show/content/header/title_block/actions.html.twig new file mode 100644 index 00000000..6dd05642 --- /dev/null +++ b/src/templates/admin/invoice/show/content/header/title_block/actions.html.twig @@ -0,0 +1,3 @@ +
+ {% hook 'actions' %} +
diff --git a/src/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig b/src/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig new file mode 100644 index 00000000..3a3243e0 --- /dev/null +++ b/src/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig @@ -0,0 +1,5 @@ +{% from '@SyliusAdmin/shared/helper/icon.html.twig' import icon %} + + + {{ icon({ icon: 'arrow_back_up', class: 'icon' }) }} + diff --git a/src/templates/admin/invoice/show/content/header/title_block/title.html.twig b/src/templates/admin/invoice/show/content/header/title_block/title.html.twig new file mode 100644 index 00000000..c80e5593 --- /dev/null +++ b/src/templates/admin/invoice/show/content/header/title_block/title.html.twig @@ -0,0 +1,5 @@ +
+
+ {% hook 'title' %} +
+
diff --git a/src/templates/admin/invoice/show/content/header/title_block/title/number.html.twig b/src/templates/admin/invoice/show/content/header/title_block/title/number.html.twig new file mode 100644 index 00000000..0fcdf130 --- /dev/null +++ b/src/templates/admin/invoice/show/content/header/title_block/title/number.html.twig @@ -0,0 +1,3 @@ +

+ {{ 'sylius_invoicing_plugin.ui.invoice'|trans }} {{ hookable_metadata.context.resource.number }} +

diff --git a/src/templates/admin/invoice/show/content/header/title_block/title/subtitle.html.twig b/src/templates/admin/invoice/show/content/header/title_block/title/subtitle.html.twig new file mode 100644 index 00000000..0a9cd358 --- /dev/null +++ b/src/templates/admin/invoice/show/content/header/title_block/title/subtitle.html.twig @@ -0,0 +1,20 @@ +{% set invoice = hookable_metadata.context.resource %} + +
+
    +
  • + {{ 'sylius_invoicing_plugin.ui.issued_at'|trans }}: + {{ invoice.issuedAt|format_datetime }} +
  • +
  • + {{ 'sylius_invoicing_plugin.ui.issued_for_order'|trans }}: + #{{ invoice.order.number }} +
  • +
  • + {{ 'sylius_invoicing_plugin.ui.issued_from'|trans }}: +
    + {% include '@SyliusAdmin/shared/grid/field/channel.html.twig' with {'data': invoice.channel} %} +
    +
  • +
+
diff --git a/src/templates/admin/invoice/show/content/page_body.html.twig b/src/templates/admin/invoice/show/content/page_body.html.twig new file mode 100644 index 00000000..f6223340 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body.html.twig @@ -0,0 +1,7 @@ +
+
+
+ {% hook 'page_body' %} +
+
+
diff --git a/src/templates/admin/invoice/show/content/page_body/buyer.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer.html.twig new file mode 100644 index 00000000..4641ecaf --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/buyer.html.twig @@ -0,0 +1,19 @@ +{% set invoice = hookable_metadata.context.resource %} +{% set billingData = invoice.billingData %} + +
+
+
+
+ {{ 'sylius_invoicing_plugin.ui.buyer'|trans }} +
+
+
+
+
+ {% hook 'buyer' %} +
+
+
+
+
diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/city.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer/city.html.twig new file mode 100644 index 00000000..b4a2b489 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/buyer/city.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.resource.billingData.city }}
diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/company.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer/company.html.twig new file mode 100644 index 00000000..bbe537a9 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/buyer/company.html.twig @@ -0,0 +1,5 @@ +{% set billingData = hookable_metadata.context.resource.billingData %} + +{% if billingData.company %} + {{ billingData.company }}
+{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/country_code.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer/country_code.html.twig new file mode 100644 index 00000000..b5199bea --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/buyer/country_code.html.twig @@ -0,0 +1 @@ + diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/first_name.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer/first_name.html.twig new file mode 100644 index 00000000..36df1bae --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/buyer/first_name.html.twig @@ -0,0 +1,3 @@ +{% set billingData = hookable_metadata.context.resource.billingData %} + +{{ billingData.firstName }} {{ billingData.lastName }} diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/postcode.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer/postcode.html.twig new file mode 100644 index 00000000..9cf589d9 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/buyer/postcode.html.twig @@ -0,0 +1,3 @@ +{% set billingData = hookable_metadata.context.resource.billingData %} + +{{ billingData.countryCode|sylius_country_name|upper }} {{ billingData.postcode }} diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/street.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer/street.html.twig new file mode 100644 index 00000000..179ffa5e --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/buyer/street.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.resource.billingData.street }}
diff --git a/src/templates/admin/invoice/show/content/page_body/card.html.twig b/src/templates/admin/invoice/show/content/page_body/card.html.twig new file mode 100644 index 00000000..d5e00f32 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card.html.twig @@ -0,0 +1,5 @@ +{% set invoice = hookable_metadata.context.resource %} + +
+ {% hook 'card' %} +
diff --git a/src/templates/admin/invoice/show/content/page_body/card/body.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body.html.twig new file mode 100644 index 00000000..44429c31 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body.html.twig @@ -0,0 +1,3 @@ +
+ {% hook 'body' %} +
diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table.html.twig new file mode 100644 index 00000000..e5e75a2c --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table.html.twig @@ -0,0 +1,5 @@ +
+ + {% hook 'table' %} +
+
diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body.html.twig new file mode 100644 index 00000000..895f6351 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body.html.twig @@ -0,0 +1,7 @@ + + {% for item in hookable_metadata.context.resource.lineItems %} + + {% hook 'body' with { item, loop } %} + + {% endfor %} + diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/currency.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/currency.html.twig new file mode 100644 index 00000000..3d2cf821 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/currency.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.resource.currencyCode }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/discounted_unit_net_price.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/discounted_unit_net_price.html.twig new file mode 100644 index 00000000..8346ff93 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/discounted_unit_net_price.html.twig @@ -0,0 +1 @@ +{{ '%0.2f'|format(hookable_metadata.context.item.discountedUnitNetPrice/100) }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/gross_value.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/gross_value.html.twig new file mode 100644 index 00000000..32f0a20d --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/gross_value.html.twig @@ -0,0 +1 @@ +{{ '%0.2f'|format(hookable_metadata.context.item.total/100) }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/name.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/name.html.twig new file mode 100644 index 00000000..2d706ddc --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/name.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.item.name }} {% if hookable_metadata.context.item.variantName is not null %}({{ hookable_metadata.context.item.variantName }}){% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/net_value.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/net_value.html.twig new file mode 100644 index 00000000..829fecac --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/net_value.html.twig @@ -0,0 +1 @@ +{{ '%0.2f'|format(hookable_metadata.context.item.subtotal/100) }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/no.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/no.html.twig new file mode 100644 index 00000000..468618da --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/no.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.loop.index }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/quantity.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/quantity.html.twig new file mode 100644 index 00000000..99592e6b --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/quantity.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.item.quantity }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_amount.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_amount.html.twig new file mode 100644 index 00000000..617d43f7 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_amount.html.twig @@ -0,0 +1 @@ +{{ '%0.2f'|format(hookable_metadata.context.item.taxTotal/100) }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_rate.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_rate.html.twig new file mode 100644 index 00000000..8e8ebd72 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_rate.html.twig @@ -0,0 +1 @@ +{% if hookable_metadata.context.item.taxRate is null %}0%{% else %}{{ hookable_metadata.context.item.taxRate }}{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/unit_net_price.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/unit_net_price.html.twig new file mode 100644 index 00000000..cf702eb1 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/body/unit_net_price.html.twig @@ -0,0 +1 @@ +{{ '%0.2f'|format(hookable_metadata.context.item.unitPrice/100) }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer.html.twig new file mode 100644 index 00000000..e9653d75 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer.html.twig @@ -0,0 +1,3 @@ + + {% hook 'footer' %} + diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/net_total.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/net_total.html.twig new file mode 100644 index 00000000..0e610c6d --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/net_total.html.twig @@ -0,0 +1,5 @@ + + {{ 'sylius_invoicing_plugin.ui.net_total'|trans }}: + {{ '%0.2f'|format(hookable_metadata.context.resource.subtotal/100) }} + {{ hookable_metadata.context.resource.currencyCode }} + diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items.html.twig new file mode 100644 index 00000000..02b701dd --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items.html.twig @@ -0,0 +1,14 @@ +{% if hookable_metadata.context.resource.taxItems.count() > 0 %} + + {{ 'sylius_invoicing_plugin.ui.tax_rate'|trans }} + {{ 'sylius_invoicing_plugin.ui.tax_amount'|trans }} + {{ 'sylius.ui.currency'|trans }} + + {% for item in hookable_metadata.context.resource.taxItems %} + + {{ item.label }}: + {{ '%0.2f'|format(item.amount/100) }} + {{ hookable_metadata.context.resource.currencyCode }} + + {% endfor %} +{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_item.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_item.html.twig new file mode 100644 index 00000000..e69de29b diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_rate.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_rate.html.twig new file mode 100644 index 00000000..e69de29b diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/taxes_total.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/taxes_total.html.twig new file mode 100644 index 00000000..17b789d0 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/taxes_total.html.twig @@ -0,0 +1,5 @@ + + {{ 'sylius_invoicing_plugin.ui.taxes_total'|trans }}: + {{ '%0.2f'|format(hookable_metadata.context.resource.taxesTotal/100) }} + {{ hookable_metadata.context.resource.currencyCode }} + diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/total.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/total.html.twig new file mode 100644 index 00000000..3f6791da --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/total.html.twig @@ -0,0 +1,5 @@ + + {{ 'sylius.ui.total'|trans }}: + {{ '%0.2f'|format(hookable_metadata.context.resource.total/100) }} + {{ hookable_metadata.context.resource.currencyCode }} + diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header.html.twig new file mode 100644 index 00000000..8b3926f5 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header.html.twig @@ -0,0 +1,5 @@ + + + {% hook 'header' %} + + diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/currency.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/currency.html.twig new file mode 100644 index 00000000..bb8d9b9d --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/currency.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.currency'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/discounted_unit_net_price.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/discounted_unit_net_price.html.twig new file mode 100644 index 00000000..e902cb47 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/discounted_unit_net_price.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing_plugin.ui.discounted_unit_net_price'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/gross_value.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/gross_value.html.twig new file mode 100644 index 00000000..1a633f05 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/gross_value.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing_plugin.ui.gross_value'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/name.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/name.html.twig new file mode 100644 index 00000000..ec340a10 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/name.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.name'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/net_value.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/net_value.html.twig new file mode 100644 index 00000000..f494a03c --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/net_value.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing_plugin.ui.net_value'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/no.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/no.html.twig new file mode 100644 index 00000000..e9d1b9d9 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/no.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing_plugin.ui.no'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/quantity.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/quantity.html.twig new file mode 100644 index 00000000..2174fe59 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/quantity.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.quantity'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_amount.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_amount.html.twig new file mode 100644 index 00000000..ed128b51 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_amount.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing_plugin.ui.tax_amount'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_rate.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_rate.html.twig new file mode 100644 index 00000000..42d100cb --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_rate.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing_plugin.ui.tax_rate'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/unit_net_price.html.twig b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/unit_net_price.html.twig new file mode 100644 index 00000000..0d7c84dc --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/body/table/header/unit_net_price.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing_plugin.ui.unit_net_price'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/card/footer.html.twig b/src/templates/admin/invoice/show/content/page_body/card/footer.html.twig new file mode 100644 index 00000000..73dbe0d7 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/card/footer.html.twig @@ -0,0 +1,12 @@ + diff --git a/src/templates/admin/invoice/show/content/page_body/seller.html.twig b/src/templates/admin/invoice/show/content/page_body/seller.html.twig new file mode 100644 index 00000000..10a59181 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/seller.html.twig @@ -0,0 +1,21 @@ +{% set invoice = hookable_metadata.context.resource %} +{% set shopBillingData = invoice.shopBillingData %} + +{% if shopBillingData %} +
+
+
+
+ {{ 'sylius_invoicing_plugin.ui.seller'|trans }} +
+
+
+
+
+ {% hook 'seller' %} +
+
+
+
+
+{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/city.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/city.html.twig new file mode 100644 index 00000000..849d6ab5 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/seller/city.html.twig @@ -0,0 +1,3 @@ +{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} + +{% if shopBillingData.city %}{{ shopBillingData.city }}
{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/company.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/company.html.twig new file mode 100644 index 00000000..50c5b2aa --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/seller/company.html.twig @@ -0,0 +1,3 @@ +{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} + +{% if shopBillingData.company %}{{ shopBillingData.company }}{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/country_code.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/country_code.html.twig new file mode 100644 index 00000000..c56ed1d3 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/seller/country_code.html.twig @@ -0,0 +1,5 @@ +{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} + +{% if shopBillingData.countryCode %} + +{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/postcode.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/postcode.html.twig new file mode 100644 index 00000000..0f1ccb1c --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/seller/postcode.html.twig @@ -0,0 +1,5 @@ +{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} + +{% if shopBillingData.countryCode and shopBillingData.postcode %} + {{ shopBillingData.countryCode|sylius_country_name|upper }} {{ shopBillingData.postcode }} +{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/representative.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/representative.html.twig new file mode 100644 index 00000000..f8f81f32 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/seller/representative.html.twig @@ -0,0 +1,3 @@ +{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} + +{% if shopBillingData.representative %}{{ shopBillingData.representative }}{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/street.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/street.html.twig new file mode 100644 index 00000000..5957193c --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/seller/street.html.twig @@ -0,0 +1,3 @@ +{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} + +{% if shopBillingData.street %}{{ shopBillingData.street }}
{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/tax_id.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/tax_id.html.twig new file mode 100644 index 00000000..bceca3a3 --- /dev/null +++ b/src/templates/admin/invoice/show/content/page_body/seller/tax_id.html.twig @@ -0,0 +1,3 @@ +{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} + +{% if shopBillingData.taxId %}{{ shopBillingData.taxId }}
{% endif %} From 685901aa00f24077caaf57d7989077d55a231d79 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:44:13 +0200 Subject: [PATCH 06/25] Split the invoices on order admin show to twig hooks and move to templates directory --- .../views/Order/Admin/_invoices.html.twig | 34 ------------------- .../views/Order/Admin/fetchInvoices.html.twig | 1 - .../content/sections/invoices/table.html.twig | 10 ++++++ .../sections/invoices/table/body.html.twig | 7 ++++ .../invoices/table/body/actions.html.twig | 3 ++ .../invoices/table/body/channel.html.twig | 3 ++ .../invoices/table/body/issued_at.html.twig | 3 ++ .../invoices/table/body/number.html.twig | 3 ++ .../sections/invoices/table/head.html.twig | 5 +++ .../invoices/table/head/actions.html.twig | 1 + .../invoices/table/head/channel.html.twig | 1 + .../invoices/table/head/issued_at.html.twig | 1 + .../invoices/table/head/number.html.twig | 1 + 13 files changed, 38 insertions(+), 35 deletions(-) delete mode 100644 src/Resources/views/Order/Admin/_invoices.html.twig delete mode 100644 src/Resources/views/Order/Admin/fetchInvoices.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/body.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/body/actions.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/body/channel.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/body/issued_at.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/body/number.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/head.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/head/actions.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/head/channel.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/head/issued_at.html.twig create mode 100644 src/templates/admin/order/show/content/sections/invoices/table/head/number.html.twig diff --git a/src/Resources/views/Order/Admin/_invoices.html.twig b/src/Resources/views/Order/Admin/_invoices.html.twig deleted file mode 100644 index c1eaf313..00000000 --- a/src/Resources/views/Order/Admin/_invoices.html.twig +++ /dev/null @@ -1,34 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -
-

{{ 'sylius_invoicing_plugin.ui.invoices'|trans }}

- - - - - - - - - - - {% for invoice in invoices %} - - - - - - {% endfor %} - -
{{ 'sylius.ui.number'|trans }}{{ 'sylius.ui.channel'|trans }}{{ 'sylius_invoicing_plugin.ui.issued_at'|trans }}{{ 'sylius.ui.actions'|trans }}
- {{ invoice.number }} - - {% include '@SyliusAdmin/Common/_channel.html.twig' with {'channel': invoice.channel} %} - - {{ invoice.issuedAt|format_date }} - -
- {{ sylius_template_event('sylius_invoicing.admin.order.invoices.list.actions.buttons', _context) }} -
-
-
diff --git a/src/Resources/views/Order/Admin/fetchInvoices.html.twig b/src/Resources/views/Order/Admin/fetchInvoices.html.twig deleted file mode 100644 index 00a74c6d..00000000 --- a/src/Resources/views/Order/Admin/fetchInvoices.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ render(url('sylius_invoicing_plugin_admin_order_invoices_partial', {'orderNumber': order.number, 'template': '@SyliusInvoicingPlugin/Order/Admin/_invoices.html.twig'})) }} diff --git a/src/templates/admin/order/show/content/sections/invoices/table.html.twig b/src/templates/admin/order/show/content/sections/invoices/table.html.twig new file mode 100644 index 00000000..7ce8220d --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table.html.twig @@ -0,0 +1,10 @@ +
+
+
+ {{ 'sylius_invoicing_plugin.ui.invoices'|trans }} +
+
+ + {% hook 'table' %} +
+
diff --git a/src/templates/admin/order/show/content/sections/invoices/table/body.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/body.html.twig new file mode 100644 index 00000000..a2121a0e --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/body.html.twig @@ -0,0 +1,7 @@ + + {% for invoice in hookable_metadata.context.invoices %} + + {% hook 'body' with { invoice } %} + + {% endfor %} + diff --git a/src/templates/admin/order/show/content/sections/invoices/table/body/actions.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/body/actions.html.twig new file mode 100644 index 00000000..82679abd --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/body/actions.html.twig @@ -0,0 +1,3 @@ + + {% hook 'actions' %} + diff --git a/src/templates/admin/order/show/content/sections/invoices/table/body/channel.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/body/channel.html.twig new file mode 100644 index 00000000..51f85b49 --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/body/channel.html.twig @@ -0,0 +1,3 @@ + + {% include '@SyliusAdmin/shared/grid/field/channel.html.twig' with {'data': hookable_metadata.context.invoice.channel} %} + diff --git a/src/templates/admin/order/show/content/sections/invoices/table/body/issued_at.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/body/issued_at.html.twig new file mode 100644 index 00000000..ff38fe43 --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/body/issued_at.html.twig @@ -0,0 +1,3 @@ + + {{ hookable_metadata.context.invoice.issuedAt|format_date }} + diff --git a/src/templates/admin/order/show/content/sections/invoices/table/body/number.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/body/number.html.twig new file mode 100644 index 00000000..45f120a4 --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/body/number.html.twig @@ -0,0 +1,3 @@ + + {{ hookable_metadata.context.invoice.number }} + diff --git a/src/templates/admin/order/show/content/sections/invoices/table/head.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/head.html.twig new file mode 100644 index 00000000..34449406 --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/head.html.twig @@ -0,0 +1,5 @@ + + + {% hook 'head' %} + + diff --git a/src/templates/admin/order/show/content/sections/invoices/table/head/actions.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/head/actions.html.twig new file mode 100644 index 00000000..204784dd --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/head/actions.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.actions'|trans }} diff --git a/src/templates/admin/order/show/content/sections/invoices/table/head/channel.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/head/channel.html.twig new file mode 100644 index 00000000..59186e6a --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/head/channel.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.channel'|trans }} diff --git a/src/templates/admin/order/show/content/sections/invoices/table/head/issued_at.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/head/issued_at.html.twig new file mode 100644 index 00000000..c6d50b86 --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/head/issued_at.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing_plugin.ui.issued_at'|trans }} diff --git a/src/templates/admin/order/show/content/sections/invoices/table/head/number.html.twig b/src/templates/admin/order/show/content/sections/invoices/table/head/number.html.twig new file mode 100644 index 00000000..d7da088a --- /dev/null +++ b/src/templates/admin/order/show/content/sections/invoices/table/head/number.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.number'|trans }} From 7e51f5204b86b80ad8acae514b0bec5af75444b7 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:45:21 +0200 Subject: [PATCH 07/25] Split the invoices on order shop show to twig hooks and move to templates directory --- .../Order/Shop/_downloadButton.html.twig | 5 --- .../views/Order/Shop/_invoices.html.twig | 45 ------------------- .../views/Order/Shop/fetchInvoices.html.twig | 1 - .../show/summary/invoices/card.html.twig | 4 ++ .../show/summary/invoices/card/body.html.twig | 3 ++ .../invoices/card/body/table.html.twig | 3 ++ .../invoices/card/body/table/body.html.twig | 7 +++ .../card/body/table/body/download.html.twig | 19 ++++++++ .../card/body/table/body/issued_at.html.twig | 3 ++ .../card/body/table/body/number.html.twig | 3 ++ .../invoices/card/body/table/head.html.twig | 5 +++ .../card/body/table/head/actions.html.twig | 1 + .../card/body/table/head/issued_at.html.twig | 1 + .../card/body/table/head/number.html.twig | 1 + .../show/summary/invoices/card/head.html.twig | 3 ++ 15 files changed, 53 insertions(+), 51 deletions(-) delete mode 100644 src/Resources/views/Order/Shop/_downloadButton.html.twig delete mode 100644 src/Resources/views/Order/Shop/_invoices.html.twig delete mode 100644 src/Resources/views/Order/Shop/fetchInvoices.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body/table.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body/table/body.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body/table/body/download.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body/table/body/issued_at.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body/table/body/number.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body/table/head.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body/table/head/actions.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body/table/head/issued_at.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/body/table/head/number.html.twig create mode 100644 src/templates/shop/order/show/summary/invoices/card/head.html.twig diff --git a/src/Resources/views/Order/Shop/_downloadButton.html.twig b/src/Resources/views/Order/Shop/_downloadButton.html.twig deleted file mode 100644 index 84aeccdb..00000000 --- a/src/Resources/views/Order/Shop/_downloadButton.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -{% set path = path('sylius_invoicing_plugin_shop_invoice_download', { 'id': invoice.id }) %} - -{{ buttons.default(path, 'sylius_invoicing_plugin.ui.download_invoice'|trans, invoice.id, 'download') }} diff --git a/src/Resources/views/Order/Shop/_invoices.html.twig b/src/Resources/views/Order/Shop/_invoices.html.twig deleted file mode 100644 index 01ad549f..00000000 --- a/src/Resources/views/Order/Shop/_invoices.html.twig +++ /dev/null @@ -1,45 +0,0 @@ -
-

{{ 'sylius_invoicing_plugin.ui.invoices'|trans }}

- - - - - - - - - - {% for invoice in invoices %} - - - - - - {% endfor %} - -
{{ 'sylius.ui.number'|trans }}{{ 'sylius_invoicing_plugin.ui.issued_at'|trans }}{{ 'sylius.ui.actions'|trans }}
- {{ invoice.number }} - - {{ invoice.issuedAt|format_date }} - - {{ sylius_template_event('sylius_invoicing.shop.order.invoices.list.actions', _context) }} -
-
- - diff --git a/src/Resources/views/Order/Shop/fetchInvoices.html.twig b/src/Resources/views/Order/Shop/fetchInvoices.html.twig deleted file mode 100644 index d835839d..00000000 --- a/src/Resources/views/Order/Shop/fetchInvoices.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ render(url('sylius_invoicing_plugin_shop_order_invoices_partial', {'orderNumber': order.number, 'template': '@SyliusInvoicingPlugin/Order/Shop/_invoices.html.twig'})) }} diff --git a/src/templates/shop/order/show/summary/invoices/card.html.twig b/src/templates/shop/order/show/summary/invoices/card.html.twig new file mode 100644 index 00000000..6f224ede --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card.html.twig @@ -0,0 +1,4 @@ +
+ {% hook 'card' %} +
+ diff --git a/src/templates/shop/order/show/summary/invoices/card/body.html.twig b/src/templates/shop/order/show/summary/invoices/card/body.html.twig new file mode 100644 index 00000000..44429c31 --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body.html.twig @@ -0,0 +1,3 @@ +
+ {% hook 'body' %} +
diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table.html.twig b/src/templates/shop/order/show/summary/invoices/card/body/table.html.twig new file mode 100644 index 00000000..bf647260 --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body/table.html.twig @@ -0,0 +1,3 @@ + + {% hook 'table' %} +
diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/body.html.twig b/src/templates/shop/order/show/summary/invoices/card/body/table/body.html.twig new file mode 100644 index 00000000..e45c4a5d --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body/table/body.html.twig @@ -0,0 +1,7 @@ + + + {% for invoice in hookable_metadata.context.invoices %} + {% hook 'body' with { invoice } %} + {% endfor %} + + diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/body/download.html.twig b/src/templates/shop/order/show/summary/invoices/card/body/table/body/download.html.twig new file mode 100644 index 00000000..ee050ef3 --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body/table/body/download.html.twig @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/body/issued_at.html.twig b/src/templates/shop/order/show/summary/invoices/card/body/table/body/issued_at.html.twig new file mode 100644 index 00000000..ca1bad11 --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body/table/body/issued_at.html.twig @@ -0,0 +1,3 @@ + + {{ hookable_metadata.context.invoice.issuedAt|format_date }} + diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/body/number.html.twig b/src/templates/shop/order/show/summary/invoices/card/body/table/body/number.html.twig new file mode 100644 index 00000000..a4b46f22 --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body/table/body/number.html.twig @@ -0,0 +1,3 @@ + + {{ hookable_metadata.context.invoice.number }} + diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/head.html.twig b/src/templates/shop/order/show/summary/invoices/card/body/table/head.html.twig new file mode 100644 index 00000000..ecab3bde --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body/table/head.html.twig @@ -0,0 +1,5 @@ + + + {% hook 'head' %} + + diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/head/actions.html.twig b/src/templates/shop/order/show/summary/invoices/card/body/table/head/actions.html.twig new file mode 100644 index 00000000..204784dd --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body/table/head/actions.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.actions'|trans }} diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/head/issued_at.html.twig b/src/templates/shop/order/show/summary/invoices/card/body/table/head/issued_at.html.twig new file mode 100644 index 00000000..c6d50b86 --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body/table/head/issued_at.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing_plugin.ui.issued_at'|trans }} diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/head/number.html.twig b/src/templates/shop/order/show/summary/invoices/card/body/table/head/number.html.twig new file mode 100644 index 00000000..d7da088a --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/body/table/head/number.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.number'|trans }} diff --git a/src/templates/shop/order/show/summary/invoices/card/head.html.twig b/src/templates/shop/order/show/summary/invoices/card/head.html.twig new file mode 100644 index 00000000..2812ae02 --- /dev/null +++ b/src/templates/shop/order/show/summary/invoices/card/head.html.twig @@ -0,0 +1,3 @@ +
+ {{ 'sylius_invoicing_plugin.ui.invoices'|trans }} +
From b4972d74a4d5223796b26f25d528719c19eda8b0 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:47:18 +0200 Subject: [PATCH 08/25] refactor shared templates a bit --- .../admin/shared/action/download.html.twig | 28 +++++++++++++++++++ .../admin/shared/action/resend.html.twig | 16 +++++++++++ .../shared/download}/pdf.html.twig | 2 +- .../shared/download}/pdfLayout.html.twig | 0 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/templates/admin/shared/action/download.html.twig create mode 100644 src/templates/admin/shared/action/resend.html.twig rename src/{Resources/views/Invoice/Download => templates/shared/download}/pdf.html.twig (98%) rename src/{Resources/views/Invoice/Download => templates/shared/download}/pdfLayout.html.twig (100%) diff --git a/src/templates/admin/shared/action/download.html.twig b/src/templates/admin/shared/action/download.html.twig new file mode 100644 index 00000000..6f43c19a --- /dev/null +++ b/src/templates/admin/shared/action/download.html.twig @@ -0,0 +1,28 @@ +{% if hookable_metadata.context.invoice is defined %} + {% set invoice = hookable_metadata.context.invoice %} +{% elseif hookable_metadata.context.resource is defined %} + {% set invoice = hookable_metadata.context.resource %} +{% else %} + {% set invoice = data %} +{% endif %} + +{% set path = path('sylius_invoicing_plugin_admin_invoice_download', {'id': invoice.id}) %} + + + + + + + + {{ 'sylius_invoicing_plugin.ui.download_invoice'|trans }} + diff --git a/src/templates/admin/shared/action/resend.html.twig b/src/templates/admin/shared/action/resend.html.twig new file mode 100644 index 00000000..f92e8ec1 --- /dev/null +++ b/src/templates/admin/shared/action/resend.html.twig @@ -0,0 +1,16 @@ +{% from '@SyliusAdmin/shared/helper/icon.html.twig' import icon %} + +{% if hookable_metadata.context.invoice is defined %} + {% set invoice = hookable_metadata.context.invoice %} +{% elseif hookable_metadata.context.resource is defined %} + {% set invoice = hookable_metadata.context.resource %} +{% else %} + {% set invoice = data %} +{% endif %} + +{% set path = path('sylius_invoicing_plugin_admin_invoice_resend', {'id': invoice.id}) %} + + + {{ icon({ icon: 'send', class: 'icon' }) }} + {{ 'sylius_invoicing_plugin.ui.resend_invoice'|trans }} + diff --git a/src/Resources/views/Invoice/Download/pdf.html.twig b/src/templates/shared/download/pdf.html.twig similarity index 98% rename from src/Resources/views/Invoice/Download/pdf.html.twig rename to src/templates/shared/download/pdf.html.twig index 87be0b37..01fa5fb6 100644 --- a/src/Resources/views/Invoice/Download/pdf.html.twig +++ b/src/templates/shared/download/pdf.html.twig @@ -1,4 +1,4 @@ -{% extends '@SyliusInvoicingPlugin/Invoice/Download/pdfLayout.html.twig' %} +{% extends '@SyliusInvoicingPlugin/shared/download/pdfLayout.html.twig' %} {% set shopBillingData = invoice.shopBillingData %} {% set localeCode = invoice.localeCode %} diff --git a/src/Resources/views/Invoice/Download/pdfLayout.html.twig b/src/templates/shared/download/pdfLayout.html.twig similarity index 100% rename from src/Resources/views/Invoice/Download/pdfLayout.html.twig rename to src/templates/shared/download/pdfLayout.html.twig From 5066c4f53d1a2f5171de9b61a2db03aa2b91003a Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:47:38 +0200 Subject: [PATCH 09/25] remove templates/bundles --- .../bundles/SyliusAdminBundle/Security/_content.html.twig | 4 ---- .../templates/bundles/SyliusAdminBundle/_scripts.html.twig | 1 - .../templates/bundles/SyliusAdminBundle/_styles.html.twig | 1 - .../bundles/SyliusShopBundle/Layout/Header/_logo.html.twig | 5 ----- .../templates/bundles/SyliusShopBundle/_scripts.html.twig | 1 - .../templates/bundles/SyliusShopBundle/_styles.html.twig | 1 - 6 files changed, 13 deletions(-) delete mode 100644 tests/Application/templates/bundles/SyliusAdminBundle/Security/_content.html.twig delete mode 100644 tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig delete mode 100644 tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig delete mode 100644 tests/Application/templates/bundles/SyliusShopBundle/Layout/Header/_logo.html.twig delete mode 100644 tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig delete mode 100644 tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/Security/_content.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/Security/_content.html.twig deleted file mode 100644 index 4edbc696..00000000 --- a/tests/Application/templates/bundles/SyliusAdminBundle/Security/_content.html.twig +++ /dev/null @@ -1,4 +0,0 @@ -{% include '@SyliusUi/Security/_login.html.twig' with { - 'action': path('sylius_admin_login_check'), - 'paths': {'logo': asset('build/admin/images/logo.png', 'admin')} -} %} diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig deleted file mode 100644 index f5f98358..00000000 --- a/tests/Application/templates/bundles/SyliusAdminBundle/_scripts.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ encore_entry_script_tags('admin-entry', null, 'admin') }} diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig deleted file mode 100644 index a96144cd..00000000 --- a/tests/Application/templates/bundles/SyliusAdminBundle/_styles.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ encore_entry_link_tags('admin-entry', null, 'admin') }} diff --git a/tests/Application/templates/bundles/SyliusShopBundle/Layout/Header/_logo.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/Layout/Header/_logo.html.twig deleted file mode 100644 index 84b8df56..00000000 --- a/tests/Application/templates/bundles/SyliusShopBundle/Layout/Header/_logo.html.twig +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig deleted file mode 100644 index d1655bb9..00000000 --- a/tests/Application/templates/bundles/SyliusShopBundle/_scripts.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ encore_entry_script_tags('shop-entry', null, 'shop') }} diff --git a/tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig deleted file mode 100644 index fd2c7cb4..00000000 --- a/tests/Application/templates/bundles/SyliusShopBundle/_styles.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ encore_entry_link_tags('shop-entry', null, 'shop') }} From 8010b3f9ae81bcf9c9073236780f6c12041f1059 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:48:15 +0200 Subject: [PATCH 10/25] Add twig component to replace partials --- src/Resources/config/services/twig.xml | 27 +++++++++++ src/Twig/Component/Invoice/ListComponent.php | 46 +++++++++++++++++++ .../shared/components/invoices.html.twig | 1 + 3 files changed, 74 insertions(+) create mode 100644 src/Resources/config/services/twig.xml create mode 100644 src/Twig/Component/Invoice/ListComponent.php create mode 100644 src/templates/shared/components/invoices.html.twig diff --git a/src/Resources/config/services/twig.xml b/src/Resources/config/services/twig.xml new file mode 100644 index 00000000..9f4c0333 --- /dev/null +++ b/src/Resources/config/services/twig.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + diff --git a/src/Twig/Component/Invoice/ListComponent.php b/src/Twig/Component/Invoice/ListComponent.php new file mode 100644 index 00000000..ce23d049 --- /dev/null +++ b/src/Twig/Component/Invoice/ListComponent.php @@ -0,0 +1,46 @@ + $productReviewRepository + */ + public function __construct(private readonly InvoiceRepositoryInterface $invoiceRepository) + { + } + + /** + * @return array|InvoiceInterface[] + */ + #[ExposeInTemplate('invoices')] + public function getInvoices(): array + { + return $this->invoiceRepository->findByOrderNumber($this->order->getNumber()); + } +} diff --git a/src/templates/shared/components/invoices.html.twig b/src/templates/shared/components/invoices.html.twig new file mode 100644 index 00000000..31d029b5 --- /dev/null +++ b/src/templates/shared/components/invoices.html.twig @@ -0,0 +1 @@ +{% hook 'invoices' with { invoices }%} From 45ff7ed9a01dc76ae885b505c47babf173c53eb5 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:50:05 +0200 Subject: [PATCH 11/25] update generator --- src/Resources/config/services/generators.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/config/services/generators.xml b/src/Resources/config/services/generators.xml index a819f479..0410659f 100644 --- a/src/Resources/config/services/generators.xml +++ b/src/Resources/config/services/generators.xml @@ -33,7 +33,7 @@ - @SyliusInvoicingPlugin/Invoice/Download/pdf.html.twig + @SyliusInvoicingPlugin/shared/download/pdf.html.twig %sylius.invoicing.template.logo_file% From 38333a8488681c0771239ba928b234d4504bf20a Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:52:27 +0200 Subject: [PATCH 12/25] Add config for twig hooks at Order shop show page --- .../app/twig_hooks/shop/order/summary.yaml | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/Resources/config/app/twig_hooks/shop/order/summary.yaml diff --git a/src/Resources/config/app/twig_hooks/shop/order/summary.yaml b/src/Resources/config/app/twig_hooks/shop/order/summary.yaml new file mode 100644 index 00000000..8f544c23 --- /dev/null +++ b/src/Resources/config/app/twig_hooks/shop/order/summary.yaml @@ -0,0 +1,56 @@ +sylius_twig_hooks: + hooks: + 'sylius_shop.account.order.show.summary': + invoices: + component: 'sylius_invoicing:invoice:list' + props: + order: '@=_context.order' + priority: 350 + + 'sylius_shop.account.order.show.summary.invoices': + card: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.summary.invoices.card': + head: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/head.html.twig' + priority: 100 + body: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.summary.invoices.card.body': + table: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.summary.invoices.card.body.table': + head: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/head.html.twig' + priority: 100 + body: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/body.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.summary.invoices.card.body.table.head': + number: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/head/number.html.twig' + priority: 200 + issued_at: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/head/issued_at.html.twig' + priority: 100 + actions: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/head/actions.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.summary.invoices.card.body.table.body': + number: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/body/number.html.twig' + priority: 200 + issued_at: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/body/issued_at.html.twig' + priority: 100 + download: + template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/body/download.html.twig' + priority: 0 From 94706dba02f478e422ef8ed6a32171b958c31953 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:53:09 +0200 Subject: [PATCH 13/25] add twig hooks for admin order show page --- .../app/twig_hooks/admin/invoice/show.yaml | 197 ++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 src/Resources/config/app/twig_hooks/admin/invoice/show.yaml diff --git a/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml b/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml new file mode 100644 index 00000000..da194f0f --- /dev/null +++ b/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml @@ -0,0 +1,197 @@ +sylius_twig_hooks: + hooks: + 'sylius_admin.invoice.show.content': + page_body: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.header.title_block': + title: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/header/title_block/title.html.twig' + priority: 100 + actions: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/header/title_block/actions.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.header.title_block.title': + number: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/header/title_block/title/number.html.twig' + priority: 100 + subtitle: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/header/title_block/title/subtitle.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.header.title_block.actions': + back_to_index: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig' + priority: 200 + download: + template: '@SyliusInvoicingPlugin/admin/shared/action/download.html.twig' + priority: 100 + resend: + template: '@SyliusInvoicingPlugin/admin/shared/action/resend.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body': + buyer: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer.html.twig' + priority: 200 + seller: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller.html.twig' + priority: 100 + card: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body.buyer': + first_name: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/first_name.html.twig' + priority: 500 + company: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/company.html.twig' + priority: 400 + street: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/street.html.twig' + priority: 300 + city: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/city.html.twig' + priority: 200 + country_code: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/country_code.html.twig' + priority: 100 + postcode: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/postcode.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body.seller': + company: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/company.html.twig' + priority: 600 + representative: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/representative.html.twig' + priority: 500 + street: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/street.html.twig' + priority: 400 + city: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/city.html.twig' + priority: 300 + tax_id: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/tax_id.html.twig' + priority: 200 + country_code: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/country_code.html.twig' + priority: 100 + postcode: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/postcode.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body.card': + body: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body.html.twig' + priority: 100 + footer: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/footer.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body.card.body': + table: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body.card.body.table': + header: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header.html.twig' + priority: 200 + body: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body.html.twig' + priority: 100 + footer: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body.card.body.table.header': + no: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/no.html.twig' + priority: 900 + name: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/name.html.twig' + priority: 800 + quantity: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/quantity.html.twig' + priority: 700 + unit_net_price: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/unit_net_price.html.twig' + priority: 600 + discounted_unit_net_price: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/discounted_unit_net_price.html.twig' + priority: 500 + net_value: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/net_value.html.twig' + priority: 400 + tax_rate: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/tax_rate.html.twig' + priority: 300 + tax_amount: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/tax_amount.html.twig' + priority: 200 + gross_value: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/gross_value.html.twig' + priority: 100 + currency: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/currency.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body.card.body.table.body': + no: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/no.html.twig' + priority: 900 + name: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/name.html.twig' + priority: 800 + quantity: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/quantity.html.twig' + priority: 700 + unit_net_price: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/unit_net_price.html.twig' + priority: 600 + discounted_unit_net_price: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/discounted_unit_net_price.html.twig' + priority: 500 + net_value: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/net_value.html.twig' + priority: 400 + tax_rate: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/tax_rate.html.twig' + priority: 300 + tax_amount: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/tax_amount.html.twig' + priority: 200 + gross_value: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/gross_value.html.twig' + priority: 100 + currency: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/currency.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body.card.body.table.footer': + net_total: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/net_total.html.twig' + priority: 300 + taxes_total: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/taxes_total.html.twig' + priority: 200 + total: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/total.html.twig' + priority: 100 + tax_items: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/tax_items.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.page_body.card.body.table.footer.tax_items': + tax_rate: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_rate.html.twig' + priority: 100 + tax_item: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_item.html.twig' + priority: 0 From 15287a9c07a9406280f104e37d9b4a57b55c6824 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 14:53:23 +0200 Subject: [PATCH 14/25] Add hooks for invoice admin show page --- .../app/twig_hooks/admin/order/show.yaml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/Resources/config/app/twig_hooks/admin/order/show.yaml diff --git a/src/Resources/config/app/twig_hooks/admin/order/show.yaml b/src/Resources/config/app/twig_hooks/admin/order/show.yaml new file mode 100644 index 00000000..fd567eaf --- /dev/null +++ b/src/Resources/config/app/twig_hooks/admin/order/show.yaml @@ -0,0 +1,58 @@ +sylius_twig_hooks: + hooks: + 'sylius_admin.order.show.content.sections#left': + invoices: + component: 'sylius_invoicing:invoice:list' + props: + order: '@=_context.resource' + priority: -50 + + 'sylius_admin.order.show.content.sections.invoices': + table: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table.html.twig' + priority: 0 + + 'sylius_admin.order.show.content.sections.invoices.table': + head: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/head.html.twig' + priority: 100 + body: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/body.html.twig' + priority: 0 + + 'sylius_admin.order.show.content.sections.invoices.table.head': + number: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/head/number.html.twig' + priority: 300 + channel: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/head/channel.html.twig' + priority: 200 + issued_at: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/head/issued_at.html.twig' + priority: 100 + actions: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/head/actions.html.twig' + priority: 0 + + 'sylius_admin.order.show.content.sections.invoices.table.body': + number: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/body/number.html.twig' + priority: 300 + channel: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/body/channel.html.twig' + priority: 200 + issued_at: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/body/issued_at.html.twig' + priority: 100 + actions: + template: '@SyliusInvoicingPlugin/admin/order/show/content/sections/invoices/table/body/actions.html.twig' + priority: 0 + + 'sylius_admin.order.show.content.sections.invoices.table.body.actions': + download: + template: '@SyliusInvoicingPlugin/admin/shared/action/download.html.twig' + priority: 100 + resend: + template: '@SyliusInvoicingPlugin/admin/shared/action/resend.html.twig' + priority: 0 + From adef0031e2c9e30b61eca47558d967192484b259 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 15:47:39 +0200 Subject: [PATCH 15/25] update build --- .github/workflows/build.yml | 58 ++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79c0c02d..372d0ab4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,18 +12,18 @@ on: jobs: tests: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}, State Machine Adapter ${{ matrix.state_machine_adapter }}" strategy: fail-fast: false matrix: - php: ["8.1", "8.2"] - symfony: ["^5.4.21", "^6.4"] - sylius: ["~1.12.0", "~1.13.0",] + php: ["8.3"] + symfony: ["^6.4"] + sylius: ["2.0.x-dev"] node: ["20.x"] - mysql: ["8.0"] + mysql: ["8.4"] wkhtmltopdf: ["0.12.6-1"] state_machine_adapter: [ "winzou_state_machine", "symfony_workflow" ] @@ -31,31 +31,19 @@ jobs: - php: "8.3" symfony: "^6.4" - sylius: "~1.13.0" + sylius: "2.0.x-dev" node: "20.x" - mysql: "8.0" - wkhtmltopdf: "0.12.6-1" + mysql: "8.4" + wkhtmltopdf: false state_machine_adapter: "symfony_workflow" - - php: "8.2" + php: "8.3" symfony: "^6.4" - sylius: "~1.12.0" + sylius: "2.0.x-dev" node: "20.x" - mysql: "8.0" + mysql: "8.4" wkhtmltopdf: false state_machine_adapter: "winzou_state_machine" - - - php: "8.2" - symfony: "^6.4" - sylius: "~1.13.0" - node: "20.x" - mysql: "8.0" - wkhtmltopdf: false - state_machine_adapter: "symfony_workflow" - - exclude: - - sylius: "~1.12.0" - state_machine_adapter: "symfony_workflow" env: APP_ENV: test @@ -77,7 +65,7 @@ jobs: - name: Setup Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: "${{ matrix.node }}" @@ -94,7 +82,7 @@ jobs: - name: Setup cache for wkhtmltopdf - uses: actions/cache@v3 + uses: actions/cache@v4 id: cache-wkhtmltopdf if: matrix.wkhtmltopdf != false with: @@ -123,7 +111,7 @@ jobs: - name: Cache Composer - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }} @@ -154,7 +142,7 @@ jobs: - name: Cache Yarn - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }} @@ -189,10 +177,9 @@ jobs: name: Run security check run: symfony security:check - - - name: Run analysis - run: composer analyse - if: matrix.sylius != '~1.12.0' +# - +# name: Run analysis +# run: composer analyse - name: Run PHPSpec @@ -204,11 +191,16 @@ jobs: - name: Run Behat - run: vendor/bin/behat --colors --strict -vvv --no-interaction -f progress || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun + run: | + if [ "${{ matrix.wkhtmltopdf }}" != "false" ]; then + vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_edisabled" || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun; + else + vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_enabled" || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun; + fi - name: Upload Behat logs - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: Behat logs From 140eff9d59423cf592a652376720245c9803c6d5 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Fri, 11 Oct 2024 15:47:47 +0200 Subject: [PATCH 16/25] Update behat tests --- tests/Behat/Context/Domain/InvoiceEmailContext.php | 5 ----- tests/Behat/Page/Admin/Invoice/ShowPage.php | 13 ++++++------- tests/Behat/Page/Admin/Order/ShowPage.php | 8 ++++---- tests/Behat/Page/Shop/Order/ShowPage.php | 4 ++-- tests/Behat/Resources/services.xml | 2 +- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/tests/Behat/Context/Domain/InvoiceEmailContext.php b/tests/Behat/Context/Domain/InvoiceEmailContext.php index cea9c914..c3684bfc 100644 --- a/tests/Behat/Context/Domain/InvoiceEmailContext.php +++ b/tests/Behat/Context/Domain/InvoiceEmailContext.php @@ -5,14 +5,9 @@ namespace Tests\Sylius\InvoicingPlugin\Behat\Context\Domain; use Behat\Behat\Context\Context; -use Sylius\Bundle\CoreBundle\Application\Kernel as SyliusKernel; use Sylius\Behat\Service\Checker\EmailCheckerInterface; use Webmozart\Assert\Assert; -if (SyliusKernel::MINOR_VERSION <= 11) { - class_alias('Sylius\Component\Core\Test\Services\EmailCheckerInterface', 'Sylius\Behat\Service\Checker\EmailCheckerInterface'); -} - final class InvoiceEmailContext implements Context { private EmailCheckerInterface $emailChecker; diff --git a/tests/Behat/Page/Admin/Invoice/ShowPage.php b/tests/Behat/Page/Admin/Invoice/ShowPage.php index 871da676..89cc4e3b 100644 --- a/tests/Behat/Page/Admin/Invoice/ShowPage.php +++ b/tests/Behat/Page/Admin/Invoice/ShowPage.php @@ -140,9 +140,7 @@ public function hasTotal(string $total, string $currencyCode): bool public function getChannel(): string { - $items = $this->getDocument()->findAll('css', '.channel > .channel__item'); - - return $items[1]->getText(); + return $this->getElement('channel')->getText(); } public function download(): void @@ -173,17 +171,18 @@ public function hasDownloadButton(): bool protected function getDefinedElements(): array { return array_merge(parent::getDefinedElements(), [ - 'back' => '#back', - 'billing_address' => '#billing-data', + 'back' => '[data-test-back]', + 'billing_address' => '[data-test-billing-data]', + 'channel' => '[data-test-channel]', 'invoice_net_total' => '[data-test-invoice-net-total]', 'invoice_net_total_currency_code' => '[data-test-invoice-net-total-currency-code]', 'invoice_taxes_total' => '[data-test-invoice-taxes-total]', 'invoice_taxes_total_currency_code' => '[data-test-invoice-taxes-total-currency-code]', 'invoice_total' => '[data-test-invoice-total]', 'invoice_total_currency_code' => '[data-test-invoice-total-currency-code]', - 'issued_at' => '#invoice-issued-at', + 'issued_at' => '[data-test-issued-at]', 'paid' => '[data-test-invoice-is-paid]', - 'shop_billing_data' => '#shop-billing-data', + 'shop_billing_data' => '[data-test-shop-billing-data]', 'table' => '.table', ]); } diff --git a/tests/Behat/Page/Admin/Order/ShowPage.php b/tests/Behat/Page/Admin/Order/ShowPage.php index 35487045..df420dda 100644 --- a/tests/Behat/Page/Admin/Order/ShowPage.php +++ b/tests/Behat/Page/Admin/Order/ShowPage.php @@ -16,7 +16,7 @@ public function getRouteName(): string public function countRelatedInvoices(): int { - return count($this->getInvoicesList()) -1; + return count($this->getInvoicesList()); } public function clickOnFirstInvoiceId(): void @@ -30,7 +30,7 @@ public function clickOnFirstInvoiceId(): void public function downloadFirstInvoice(): void { $invoice = $this->getFirstInvoice(); - $invoice->clickLink('Download'); + $invoice->find('css', '[data-test-download-button]')->click(); } public function resendFirstInvoice(): void @@ -60,13 +60,13 @@ public function hasDownloadButtonForInvoice(): bool protected function getDefinedElements(): array { return array_merge(parent::getDefinedElements(), [ - 'invoices' => '#order-invoices', + 'invoices' => '[data-test-invoices]', ]); } private function getFirstInvoice(): NodeElement { - return $this->getInvoicesList()[1]; + return $this->getInvoicesList()[0]; } private function getInvoicesList(): array diff --git a/tests/Behat/Page/Shop/Order/ShowPage.php b/tests/Behat/Page/Shop/Order/ShowPage.php index 57bac4a1..d95581fc 100644 --- a/tests/Behat/Page/Shop/Order/ShowPage.php +++ b/tests/Behat/Page/Shop/Order/ShowPage.php @@ -17,7 +17,7 @@ public function getRouteName(): string public function downloadFirstInvoice(): void { $invoice = $this->getFirstInvoice(); - $invoice->clickLink('Download'); + $invoice->find('css', '[data-test-download-button]')->click(); } public function isPdfFileDownloaded(): bool @@ -41,7 +41,7 @@ public function hasDownloadButtonForInvoice(): bool protected function getDefinedElements(): array { return array_merge(parent::getDefinedElements(), [ - 'invoices' => '#order-invoices', + 'invoices' => '[data-test-invoices]', ]); } diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml index 7bc5b03b..8c8dea88 100644 --- a/tests/Behat/Resources/services.xml +++ b/tests/Behat/Resources/services.xml @@ -11,7 +11,7 @@ - + From 1ffae661dc27dad8311cf4ff148f060e8521ff12 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Sun, 13 Oct 2024 21:53:58 +0200 Subject: [PATCH 17/25] Add missing SyliusTwigExtraBundle to bundles config --- tests/Application/config/bundles.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index 34aa83d6..bc386e5f 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -53,6 +53,7 @@ SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true], BabDev\PagerfantaBundle\BabDevPagerfantaBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], + Sylius\TwigExtra\Symfony\SyliusTwigExtraBundle::class => ['all' => true], Sylius\TwigHooks\SyliusTwigHooksBundle::class => ['all' => true], Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true], Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true], From 97dedd03b2719ee4590898552cf602df15947c24 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Sun, 13 Oct 2024 21:54:13 +0200 Subject: [PATCH 18/25] Add missing parameter to download button hooks --- src/Resources/config/app/twig_hooks/admin/invoice/show.yaml | 1 + src/Resources/config/app/twig_hooks/admin/order/show.yaml | 1 + src/Resources/config/app/twig_hooks/shop/order/summary.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml b/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml index da194f0f..1bf008e2 100644 --- a/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml +++ b/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml @@ -27,6 +27,7 @@ sylius_twig_hooks: priority: 200 download: template: '@SyliusInvoicingPlugin/admin/shared/action/download.html.twig' + enabled: '%sylius_invoicing.pdf_generator.enabled%' priority: 100 resend: template: '@SyliusInvoicingPlugin/admin/shared/action/resend.html.twig' diff --git a/src/Resources/config/app/twig_hooks/admin/order/show.yaml b/src/Resources/config/app/twig_hooks/admin/order/show.yaml index fd567eaf..b33e3e90 100644 --- a/src/Resources/config/app/twig_hooks/admin/order/show.yaml +++ b/src/Resources/config/app/twig_hooks/admin/order/show.yaml @@ -51,6 +51,7 @@ sylius_twig_hooks: 'sylius_admin.order.show.content.sections.invoices.table.body.actions': download: template: '@SyliusInvoicingPlugin/admin/shared/action/download.html.twig' + enabled: '%sylius_invoicing.pdf_generator.enabled%' priority: 100 resend: template: '@SyliusInvoicingPlugin/admin/shared/action/resend.html.twig' diff --git a/src/Resources/config/app/twig_hooks/shop/order/summary.yaml b/src/Resources/config/app/twig_hooks/shop/order/summary.yaml index 8f544c23..29bced92 100644 --- a/src/Resources/config/app/twig_hooks/shop/order/summary.yaml +++ b/src/Resources/config/app/twig_hooks/shop/order/summary.yaml @@ -53,4 +53,5 @@ sylius_twig_hooks: priority: 100 download: template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/body/download.html.twig' + enabled: '%sylius_invoicing.pdf_generator.enabled%' priority: 0 From c53b835dc395e14b0f889e768f51ce69748d12af Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Sun, 13 Oct 2024 22:45:48 +0200 Subject: [PATCH 19/25] Upgrade or remove dependencies that prevents Symfony 7 installation --- .github/workflows/build.yml | 2 +- behat.yml.dist | 4 ---- composer.json | 7 +++---- ..._unable_to_download_invoice_on_admin_order_view.feature | 2 +- ...able_to_download_invoice_on_customer_order_view.feature | 2 +- ..._unable_to_download_invoice_on_its_details_page.feature | 2 +- .../downloading_invoice_on_admin_order_view.feature | 2 +- .../downloading_invoice_on_customer_order_view.feature | 2 +- .../downloading_invoice_on_its_details_page.feature | 2 +- .../saving_invoices_on_server_during_generation.feature | 2 +- 10 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 372d0ab4..d46b07c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -193,7 +193,7 @@ jobs: name: Run Behat run: | if [ "${{ matrix.wkhtmltopdf }}" != "false" ]; then - vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_edisabled" || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun; + vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_disabled" || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun; else vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --tags="~@pdf_enabled" || vendor/bin/behat --colors --strict -vvv --no-interaction -f progress --rerun; fi diff --git a/behat.yml.dist b/behat.yml.dist index b744fe7c..f6a33105 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -45,7 +45,3 @@ default: FriendsOfBehat\SuiteSettingsExtension: paths: - features - - FriendsOfBehat\ExcludeSpecificationsExtension: - features: - - features/managing_invoices/pdf_generation_disabled diff --git a/composer.json b/composer.json index 6973cc5a..8a586ef6 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,6 @@ "require-dev": { "behat/behat": "^3.6.1", "behat/mink-selenium2-driver": "~1.6.0", - "friends-of-behat/exclude-specifications-extension": "^0.3", "friends-of-behat/mink": "^1.8", "friends-of-behat/mink-browserkit-driver": "^1.4", "friends-of-behat/mink-debug-extension": "^2.0", @@ -35,8 +34,8 @@ "friends-of-behat/suite-settings-extension": "^1.0", "friends-of-behat/symfony-extension": "^2.1", "friends-of-behat/variadic-extension": "^1.3", - "matthiasnoback/symfony-config-test": "^4.2", - "matthiasnoback/symfony-dependency-injection-test": "^4.2", + "matthiasnoback/symfony-config-test": "^5.1", + "matthiasnoback/symfony-dependency-injection-test": "^5.0", "phpspec/phpspec": "^7.2", "phpstan/extension-installer": "^1.0", "phpstan/phpstan": "^1.8", @@ -45,7 +44,7 @@ "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", - "sylius-labs/coding-standard": "~4.0.0", + "sylius-labs/coding-standard": "^4.2", "symfony/browser-kit": "^6.4 || ^7.1", "symfony/debug-bundle": "^6.4 || ^7.1", "symfony/dotenv": "^6.4 || ^7.1", diff --git a/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_admin_order_view.feature b/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_admin_order_view.feature index 9255347d..28f94725 100644 --- a/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_admin_order_view.feature +++ b/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_admin_order_view.feature @@ -14,7 +14,7 @@ Feature: Being unable to download an invoice on a single order view And the customer chose "Free" shipping method to "United States" with "Cash on Delivery" payment And I am logged in as an administrator - @ui + @ui @pdf_disabled Scenario: Being unable to download an invoice on a single order view When I view the summary of the order "#00000022" Then I should not be able to download the first invoice diff --git a/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_customer_order_view.feature b/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_customer_order_view.feature index ab8ac947..60b8204d 100644 --- a/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_customer_order_view.feature +++ b/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_customer_order_view.feature @@ -16,7 +16,7 @@ Feature: Being unable to download an invoice on a single order view And for the billing address of "Mazikeen Lilim" in the "Pacific Coast Hwy", "90806" "Los Angeles", "United States" And I chose "Free" shipping method with "Cash on Delivery" payment - @ui + @ui @pdf_disabled Scenario: Being unable to download an invoice on a single order view When I view the summary of the order "#00000666" Then I should not be able to download the first invoice diff --git a/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_its_details_page.feature b/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_its_details_page.feature index b0cc3c7c..d71625f2 100644 --- a/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_its_details_page.feature +++ b/features/managing_invoices/pdf_generation_disabled/being_unable_to_download_invoice_on_its_details_page.feature @@ -17,7 +17,7 @@ Feature: Being unable to download an invoice from its details page And for the billing address of "Mazikeen Lilim" in the "Pacific Coast Hwy", "90806" "Los Angeles", "United States" And the customer chose "UPS" shipping method with "Cash on Delivery" payment - @ui + @ui @pdf_disabled Scenario: Being unable to download an invoice from its details page Given I view the summary of the invoice for order "#00000666" Then I should not be able to download the invoice diff --git a/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_admin_order_view.feature b/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_admin_order_view.feature index 5c81527d..ed0af0f6 100644 --- a/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_admin_order_view.feature +++ b/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_admin_order_view.feature @@ -14,7 +14,7 @@ Feature: Downloading invoices on a single order view And the customer chose "Free" shipping method to "United States" with "Cash on Delivery" payment And I am logged in as an administrator - @ui + @ui @pdf_enabled Scenario: Downloading an invoice on order view When I view the summary of the order "#00000022" And I download the first invoice diff --git a/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_customer_order_view.feature b/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_customer_order_view.feature index c9999699..baa87454 100644 --- a/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_customer_order_view.feature +++ b/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_customer_order_view.feature @@ -16,7 +16,7 @@ Feature: Downloading invoices on a single order view And for the billing address of "Mazikeen Lilim" in the "Pacific Coast Hwy", "90806" "Los Angeles", "United States" And I chose "Free" shipping method with "Cash on Delivery" payment - @ui + @ui @pdf_enabled Scenario: Downloading an invoice on order view When I view the summary of the order "#00000666" And I download the first invoice diff --git a/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_its_details_page.feature b/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_its_details_page.feature index 4c653199..4e5febb1 100644 --- a/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_its_details_page.feature +++ b/features/managing_invoices/pdf_generation_enabled/downloading_invoice_on_its_details_page.feature @@ -17,7 +17,7 @@ Feature: Downloading an invoice from its details page And for the billing address of "Mazikeen Lilim" in the "Pacific Coast Hwy", "90806" "Los Angeles", "United States" And the customer chose "UPS" shipping method with "Cash on Delivery" payment - @ui + @ui @pdf_enabled Scenario: Downloading an invoice Given I view the summary of the invoice for order "#00000666" When I download the invoice diff --git a/features/managing_invoices/pdf_generation_enabled/saving_invoices_on_server_during_generation.feature b/features/managing_invoices/pdf_generation_enabled/saving_invoices_on_server_during_generation.feature index 5d63eb14..94d8718a 100644 --- a/features/managing_invoices/pdf_generation_enabled/saving_invoices_on_server_during_generation.feature +++ b/features/managing_invoices/pdf_generation_enabled/saving_invoices_on_server_during_generation.feature @@ -13,7 +13,7 @@ Feature: Saving invoices on server during generation And the store allows paying with "Cash on Delivery" And channel "United States" has shop billing data set as "Ragnarok", "1100110011", "Pacific Coast Hwy", "90806" "Los Angeles", "United States" - @application + @application @pdf_enabled Scenario: Having invoice saved on the server after the order is placed Given there is a customer "lucy@teamlucifer.com" that placed an order "#00000666" When the customer bought 2 "Angel T-Shirt" products From bd2a7c0c3ece9c71166fb5ae8bec75ffba0d6d07 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Wed, 16 Oct 2024 08:17:15 +0200 Subject: [PATCH 20/25] Review fixes --- .../app/twig_hooks/admin/invoice/show.yaml | 120 +++++++++--------- .../app/twig_hooks/admin/order/show.yaml | 1 - src/Resources/config/config.yml | 2 +- ....html.twig => invoice_generated.html.twig} | 0 .../actions/back_to_index.html.twig | 2 +- .../content/page_body/buyer/company.html.twig | 5 - .../page_body/buyer/first_name.html.twig | 3 - .../page_body/buyer/postcode.html.twig | 3 - .../content/page_body/seller/city.html.twig | 3 - .../page_body/seller/company.html.twig | 3 - .../page_body/seller/country_code.html.twig | 5 - .../page_body/seller/postcode.html.twig | 5 - .../page_body/seller/representative.html.twig | 3 - .../content/page_body/seller/street.html.twig | 3 - .../content/page_body/seller/tax_id.html.twig | 3 - ...page_body.html.twig => sections.html.twig} | 2 +- .../{page_body => sections}/buyer.html.twig | 3 - .../buyer/city.html.twig | 0 .../content/sections/buyer/company.html.twig | 5 + .../buyer/country_code.html.twig | 0 .../sections/buyer/first_name.html.twig | 3 + .../content/sections/buyer/postcode.html.twig | 3 + .../buyer/street.html.twig | 0 .../{page_body => sections}/card.html.twig | 0 .../card/body.html.twig | 0 .../card/body/table.html.twig | 0 .../card/body/table/body.html.twig | 0 .../card/body/table/body/currency.html.twig | 0 .../body/discounted_unit_net_price.html.twig | 0 .../body/table/body/gross_value.html.twig | 0 .../card/body/table/body/name.html.twig | 0 .../card/body/table/body/net_value.html.twig | 0 .../card/body/table/body/no.html.twig | 0 .../card/body/table/body/quantity.html.twig | 0 .../card/body/table/body/tax_amount.html.twig | 0 .../card/body/table/body/tax_rate.html.twig | 0 .../body/table/body/unit_net_price.html.twig | 0 .../card/body/table/footer.html.twig | 0 .../body/table/footer/net_total.html.twig | 0 .../body/table/footer/tax_items.html.twig | 0 .../table/footer/tax_items/tax_item.html.twig | 0 .../table/footer/tax_items/tax_rate.html.twig | 0 .../body/table/footer/taxes_total.html.twig | 0 .../card/body/table/footer/total.html.twig | 0 .../card/body/table/header.html.twig | 0 .../card/body/table/header/currency.html.twig | 0 .../discounted_unit_net_price.html.twig | 0 .../body/table/header/gross_value.html.twig | 0 .../card/body/table/header/name.html.twig | 0 .../body/table/header/net_value.html.twig | 0 .../card/body/table/header/no.html.twig | 0 .../card/body/table/header/quantity.html.twig | 0 .../body/table/header/tax_amount.html.twig | 0 .../card/body/table/header/tax_rate.html.twig | 0 .../table/header/unit_net_price.html.twig | 0 .../card/footer.html.twig | 2 +- .../{page_body => sections}/seller.html.twig | 5 +- .../content/sections/seller/city.html.twig | 3 + .../content/sections/seller/company.html.twig | 3 + .../sections/seller/country_code.html.twig | 5 + .../sections/seller/postcode.html.twig | 5 + .../sections/seller/representative.html.twig | 3 + .../content/sections/seller/street.html.twig | 3 + .../content/sections/seller/tax_id.html.twig | 3 + src/templates/shared/download/pdf.html.twig | 2 +- ...fLayout.html.twig => pdf_layout.html.twig} | 0 .../Application/config/packages/_sylius.yaml | 1 + .../config/packages/validator.yaml | 2 +- .../config/routes/sylius_shop.yaml | 4 +- 69 files changed, 107 insertions(+), 111 deletions(-) rename src/templates/admin/invoice/email/{invoiceGenerated.html.twig => invoice_generated.html.twig} (100%) delete mode 100644 src/templates/admin/invoice/show/content/page_body/buyer/company.html.twig delete mode 100644 src/templates/admin/invoice/show/content/page_body/buyer/first_name.html.twig delete mode 100644 src/templates/admin/invoice/show/content/page_body/buyer/postcode.html.twig delete mode 100644 src/templates/admin/invoice/show/content/page_body/seller/city.html.twig delete mode 100644 src/templates/admin/invoice/show/content/page_body/seller/company.html.twig delete mode 100644 src/templates/admin/invoice/show/content/page_body/seller/country_code.html.twig delete mode 100644 src/templates/admin/invoice/show/content/page_body/seller/postcode.html.twig delete mode 100644 src/templates/admin/invoice/show/content/page_body/seller/representative.html.twig delete mode 100644 src/templates/admin/invoice/show/content/page_body/seller/street.html.twig delete mode 100644 src/templates/admin/invoice/show/content/page_body/seller/tax_id.html.twig rename src/templates/admin/invoice/show/content/{page_body.html.twig => sections.html.twig} (76%) rename src/templates/admin/invoice/show/content/{page_body => sections}/buyer.html.twig (82%) rename src/templates/admin/invoice/show/content/{page_body => sections}/buyer/city.html.twig (100%) create mode 100644 src/templates/admin/invoice/show/content/sections/buyer/company.html.twig rename src/templates/admin/invoice/show/content/{page_body => sections}/buyer/country_code.html.twig (100%) create mode 100644 src/templates/admin/invoice/show/content/sections/buyer/first_name.html.twig create mode 100644 src/templates/admin/invoice/show/content/sections/buyer/postcode.html.twig rename src/templates/admin/invoice/show/content/{page_body => sections}/buyer/street.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/currency.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/discounted_unit_net_price.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/gross_value.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/name.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/net_value.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/no.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/quantity.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/tax_amount.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/tax_rate.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/body/unit_net_price.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/footer.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/footer/net_total.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/footer/tax_items.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/footer/tax_items/tax_item.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/footer/tax_items/tax_rate.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/footer/taxes_total.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/footer/total.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/currency.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/discounted_unit_net_price.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/gross_value.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/name.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/net_value.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/no.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/quantity.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/tax_amount.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/tax_rate.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/body/table/header/unit_net_price.html.twig (100%) rename src/templates/admin/invoice/show/content/{page_body => sections}/card/footer.html.twig (83%) rename src/templates/admin/invoice/show/content/{page_body => sections}/seller.html.twig (81%) create mode 100644 src/templates/admin/invoice/show/content/sections/seller/city.html.twig create mode 100644 src/templates/admin/invoice/show/content/sections/seller/company.html.twig create mode 100644 src/templates/admin/invoice/show/content/sections/seller/country_code.html.twig create mode 100644 src/templates/admin/invoice/show/content/sections/seller/postcode.html.twig create mode 100644 src/templates/admin/invoice/show/content/sections/seller/representative.html.twig create mode 100644 src/templates/admin/invoice/show/content/sections/seller/street.html.twig create mode 100644 src/templates/admin/invoice/show/content/sections/seller/tax_id.html.twig rename src/templates/shared/download/{pdfLayout.html.twig => pdf_layout.html.twig} (100%) diff --git a/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml b/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml index 1bf008e2..29cb5209 100644 --- a/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml +++ b/src/Resources/config/app/twig_hooks/admin/invoice/show.yaml @@ -1,8 +1,8 @@ sylius_twig_hooks: hooks: 'sylius_admin.invoice.show.content': - page_body: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body.html.twig' + sections: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections.html.twig' priority: 0 'sylius_admin.invoice.show.content.header.title_block': @@ -33,166 +33,166 @@ sylius_twig_hooks: template: '@SyliusInvoicingPlugin/admin/shared/action/resend.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body': + 'sylius_admin.invoice.show.content.sections': buyer: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer.html.twig' priority: 200 seller: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller.html.twig' priority: 100 card: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body.buyer': + 'sylius_admin.invoice.show.content.sections.buyer': first_name: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/first_name.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/first_name.html.twig' priority: 500 company: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/company.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/company.html.twig' priority: 400 street: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/street.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/street.html.twig' priority: 300 city: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/city.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/city.html.twig' priority: 200 country_code: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/country_code.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/country_code.html.twig' priority: 100 postcode: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/buyer/postcode.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/postcode.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body.seller': + 'sylius_admin.invoice.show.content.sections.seller': company: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/company.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/company.html.twig' priority: 600 representative: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/representative.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/representative.html.twig' priority: 500 street: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/street.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/street.html.twig' priority: 400 city: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/city.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/city.html.twig' priority: 300 tax_id: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/tax_id.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/tax_id.html.twig' priority: 200 country_code: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/country_code.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/country_code.html.twig' priority: 100 postcode: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/seller/postcode.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/postcode.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body.card': + 'sylius_admin.invoice.show.content.sections.card': body: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body.html.twig' priority: 100 footer: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/footer.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/footer.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body.card.body': + 'sylius_admin.invoice.show.content.sections.card.body': table: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body.card.body.table': + 'sylius_admin.invoice.show.content.sections.card.body.table': header: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header.html.twig' priority: 200 body: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body.html.twig' priority: 100 footer: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body.card.body.table.header': + 'sylius_admin.invoice.show.content.sections.card.body.table.header': no: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/no.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/no.html.twig' priority: 900 name: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/name.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/name.html.twig' priority: 800 quantity: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/quantity.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/quantity.html.twig' priority: 700 unit_net_price: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/unit_net_price.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/unit_net_price.html.twig' priority: 600 discounted_unit_net_price: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/discounted_unit_net_price.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/discounted_unit_net_price.html.twig' priority: 500 net_value: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/net_value.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/net_value.html.twig' priority: 400 tax_rate: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/tax_rate.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/tax_rate.html.twig' priority: 300 tax_amount: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/tax_amount.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/tax_amount.html.twig' priority: 200 gross_value: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/gross_value.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/gross_value.html.twig' priority: 100 currency: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/header/currency.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/currency.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body.card.body.table.body': + 'sylius_admin.invoice.show.content.sections.card.body.table.body': no: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/no.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/no.html.twig' priority: 900 name: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/name.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/name.html.twig' priority: 800 quantity: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/quantity.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/quantity.html.twig' priority: 700 unit_net_price: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/unit_net_price.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/unit_net_price.html.twig' priority: 600 discounted_unit_net_price: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/discounted_unit_net_price.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/discounted_unit_net_price.html.twig' priority: 500 net_value: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/net_value.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/net_value.html.twig' priority: 400 tax_rate: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/tax_rate.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/tax_rate.html.twig' priority: 300 tax_amount: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/tax_amount.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/tax_amount.html.twig' priority: 200 gross_value: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/gross_value.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/gross_value.html.twig' priority: 100 currency: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/body/currency.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/currency.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body.card.body.table.footer': + 'sylius_admin.invoice.show.content.sections.card.body.table.footer': net_total: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/net_total.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer/net_total.html.twig' priority: 300 taxes_total: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/taxes_total.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer/taxes_total.html.twig' priority: 200 total: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/total.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer/total.html.twig' priority: 100 tax_items: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/tax_items.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer/tax_items.html.twig' priority: 0 - 'sylius_admin.invoice.show.content.page_body.card.body.table.footer.tax_items': + 'sylius_admin.invoice.show.content.sections.card.body.table.footer.tax_items': tax_rate: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_rate.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_rate.html.twig' priority: 100 tax_item: - template: '@SyliusInvoicingPlugin/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_item.html.twig' + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_item.html.twig' priority: 0 diff --git a/src/Resources/config/app/twig_hooks/admin/order/show.yaml b/src/Resources/config/app/twig_hooks/admin/order/show.yaml index b33e3e90..a1091ca6 100644 --- a/src/Resources/config/app/twig_hooks/admin/order/show.yaml +++ b/src/Resources/config/app/twig_hooks/admin/order/show.yaml @@ -56,4 +56,3 @@ sylius_twig_hooks: resend: template: '@SyliusInvoicingPlugin/admin/shared/action/resend.html.twig' priority: 0 - diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index e93e0455..ce774cea 100644 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -14,7 +14,7 @@ sylius_mailer: emails: invoice_generated: subject: sylius.emails.invoice_generated.subject - template: "@SyliusInvoicingPlugin/admin/invoice/email/invoiceGenerated.html.twig" + template: "@SyliusInvoicingPlugin/admin/invoice/email/invoice_generated.html.twig" knp_snappy: pdf: diff --git a/src/templates/admin/invoice/email/invoiceGenerated.html.twig b/src/templates/admin/invoice/email/invoice_generated.html.twig similarity index 100% rename from src/templates/admin/invoice/email/invoiceGenerated.html.twig rename to src/templates/admin/invoice/email/invoice_generated.html.twig diff --git a/src/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig b/src/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig index 3a3243e0..f38628a1 100644 --- a/src/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig +++ b/src/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig @@ -1,5 +1,5 @@ {% from '@SyliusAdmin/shared/helper/icon.html.twig' import icon %} - + {{ icon({ icon: 'arrow_back_up', class: 'icon' }) }} diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/company.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer/company.html.twig deleted file mode 100644 index bbe537a9..00000000 --- a/src/templates/admin/invoice/show/content/page_body/buyer/company.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% set billingData = hookable_metadata.context.resource.billingData %} - -{% if billingData.company %} - {{ billingData.company }}
-{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/first_name.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer/first_name.html.twig deleted file mode 100644 index 36df1bae..00000000 --- a/src/templates/admin/invoice/show/content/page_body/buyer/first_name.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% set billingData = hookable_metadata.context.resource.billingData %} - -{{ billingData.firstName }} {{ billingData.lastName }} diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/postcode.html.twig b/src/templates/admin/invoice/show/content/page_body/buyer/postcode.html.twig deleted file mode 100644 index 9cf589d9..00000000 --- a/src/templates/admin/invoice/show/content/page_body/buyer/postcode.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% set billingData = hookable_metadata.context.resource.billingData %} - -{{ billingData.countryCode|sylius_country_name|upper }} {{ billingData.postcode }} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/city.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/city.html.twig deleted file mode 100644 index 849d6ab5..00000000 --- a/src/templates/admin/invoice/show/content/page_body/seller/city.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} - -{% if shopBillingData.city %}{{ shopBillingData.city }}
{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/company.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/company.html.twig deleted file mode 100644 index 50c5b2aa..00000000 --- a/src/templates/admin/invoice/show/content/page_body/seller/company.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} - -{% if shopBillingData.company %}{{ shopBillingData.company }}{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/country_code.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/country_code.html.twig deleted file mode 100644 index c56ed1d3..00000000 --- a/src/templates/admin/invoice/show/content/page_body/seller/country_code.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} - -{% if shopBillingData.countryCode %} - -{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/postcode.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/postcode.html.twig deleted file mode 100644 index 0f1ccb1c..00000000 --- a/src/templates/admin/invoice/show/content/page_body/seller/postcode.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} - -{% if shopBillingData.countryCode and shopBillingData.postcode %} - {{ shopBillingData.countryCode|sylius_country_name|upper }} {{ shopBillingData.postcode }} -{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/representative.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/representative.html.twig deleted file mode 100644 index f8f81f32..00000000 --- a/src/templates/admin/invoice/show/content/page_body/seller/representative.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} - -{% if shopBillingData.representative %}{{ shopBillingData.representative }}{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/street.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/street.html.twig deleted file mode 100644 index 5957193c..00000000 --- a/src/templates/admin/invoice/show/content/page_body/seller/street.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} - -{% if shopBillingData.street %}{{ shopBillingData.street }}
{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/seller/tax_id.html.twig b/src/templates/admin/invoice/show/content/page_body/seller/tax_id.html.twig deleted file mode 100644 index bceca3a3..00000000 --- a/src/templates/admin/invoice/show/content/page_body/seller/tax_id.html.twig +++ /dev/null @@ -1,3 +0,0 @@ -{% set shopBillingData = hookable_metadata.context.resource.shopBillingData %} - -{% if shopBillingData.taxId %}{{ shopBillingData.taxId }}
{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body.html.twig b/src/templates/admin/invoice/show/content/sections.html.twig similarity index 76% rename from src/templates/admin/invoice/show/content/page_body.html.twig rename to src/templates/admin/invoice/show/content/sections.html.twig index f6223340..dd8f10ad 100644 --- a/src/templates/admin/invoice/show/content/page_body.html.twig +++ b/src/templates/admin/invoice/show/content/sections.html.twig @@ -1,7 +1,7 @@
- {% hook 'page_body' %} + {% hook 'sections' %}
diff --git a/src/templates/admin/invoice/show/content/page_body/buyer.html.twig b/src/templates/admin/invoice/show/content/sections/buyer.html.twig similarity index 82% rename from src/templates/admin/invoice/show/content/page_body/buyer.html.twig rename to src/templates/admin/invoice/show/content/sections/buyer.html.twig index 4641ecaf..dc42ef86 100644 --- a/src/templates/admin/invoice/show/content/page_body/buyer.html.twig +++ b/src/templates/admin/invoice/show/content/sections/buyer.html.twig @@ -1,6 +1,3 @@ -{% set invoice = hookable_metadata.context.resource %} -{% set billingData = invoice.billingData %} -
diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/city.html.twig b/src/templates/admin/invoice/show/content/sections/buyer/city.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/buyer/city.html.twig rename to src/templates/admin/invoice/show/content/sections/buyer/city.html.twig diff --git a/src/templates/admin/invoice/show/content/sections/buyer/company.html.twig b/src/templates/admin/invoice/show/content/sections/buyer/company.html.twig new file mode 100644 index 00000000..88cf80c6 --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/buyer/company.html.twig @@ -0,0 +1,5 @@ +{% set billing_data = hookable_metadata.context.resource.billingData %} + +{% if billing_data.company %} + {{ billing_data.company }}
+{% endif %} diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/country_code.html.twig b/src/templates/admin/invoice/show/content/sections/buyer/country_code.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/buyer/country_code.html.twig rename to src/templates/admin/invoice/show/content/sections/buyer/country_code.html.twig diff --git a/src/templates/admin/invoice/show/content/sections/buyer/first_name.html.twig b/src/templates/admin/invoice/show/content/sections/buyer/first_name.html.twig new file mode 100644 index 00000000..3149e9ef --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/buyer/first_name.html.twig @@ -0,0 +1,3 @@ +{% set billing_data = hookable_metadata.context.resource.billingData %} + +{{ billing_data.firstName }} {{ billing_data.lastName }} diff --git a/src/templates/admin/invoice/show/content/sections/buyer/postcode.html.twig b/src/templates/admin/invoice/show/content/sections/buyer/postcode.html.twig new file mode 100644 index 00000000..5b90f5a0 --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/buyer/postcode.html.twig @@ -0,0 +1,3 @@ +{% set billing_data = hookable_metadata.context.resource.billingData %} + +{{ billing_data.countryCode|sylius_country_name|upper }} {{ billing_data.postcode }} diff --git a/src/templates/admin/invoice/show/content/page_body/buyer/street.html.twig b/src/templates/admin/invoice/show/content/sections/buyer/street.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/buyer/street.html.twig rename to src/templates/admin/invoice/show/content/sections/buyer/street.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card.html.twig b/src/templates/admin/invoice/show/content/sections/card.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card.html.twig rename to src/templates/admin/invoice/show/content/sections/card.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body.html.twig b/src/templates/admin/invoice/show/content/sections/card/body.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/currency.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/currency.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/currency.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/currency.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/discounted_unit_net_price.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/discounted_unit_net_price.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/discounted_unit_net_price.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/discounted_unit_net_price.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/gross_value.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/gross_value.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/gross_value.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/gross_value.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/name.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/name.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/name.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/name.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/net_value.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/net_value.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/net_value.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/net_value.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/no.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/no.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/no.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/no.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/quantity.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/quantity.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/quantity.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/quantity.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_amount.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/tax_amount.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_amount.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/tax_amount.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_rate.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/tax_rate.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/tax_rate.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/tax_rate.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/body/unit_net_price.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/body/unit_net_price.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/body/unit_net_price.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/body/unit_net_price.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/footer.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/footer.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/footer.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/net_total.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/footer/net_total.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/footer/net_total.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/footer/net_total.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_item.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_item.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_item.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_item.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_rate.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_rate.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/footer/tax_items/tax_rate.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_rate.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/taxes_total.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/footer/taxes_total.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/footer/taxes_total.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/footer/taxes_total.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/footer/total.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/footer/total.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/footer/total.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/footer/total.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/currency.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/currency.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/currency.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/currency.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/discounted_unit_net_price.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/discounted_unit_net_price.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/discounted_unit_net_price.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/discounted_unit_net_price.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/gross_value.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/gross_value.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/gross_value.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/gross_value.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/name.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/name.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/name.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/name.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/net_value.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/net_value.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/net_value.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/net_value.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/no.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/no.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/no.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/no.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/quantity.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/quantity.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/quantity.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/quantity.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_amount.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/tax_amount.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_amount.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/tax_amount.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_rate.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/tax_rate.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/tax_rate.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/tax_rate.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/body/table/header/unit_net_price.html.twig b/src/templates/admin/invoice/show/content/sections/card/body/table/header/unit_net_price.html.twig similarity index 100% rename from src/templates/admin/invoice/show/content/page_body/card/body/table/header/unit_net_price.html.twig rename to src/templates/admin/invoice/show/content/sections/card/body/table/header/unit_net_price.html.twig diff --git a/src/templates/admin/invoice/show/content/page_body/card/footer.html.twig b/src/templates/admin/invoice/show/content/sections/card/footer.html.twig similarity index 83% rename from src/templates/admin/invoice/show/content/page_body/card/footer.html.twig rename to src/templates/admin/invoice/show/content/sections/card/footer.html.twig index 73dbe0d7..68f03fc6 100644 --- a/src/templates/admin/invoice/show/content/page_body/card/footer.html.twig +++ b/src/templates/admin/invoice/show/content/sections/card/footer.html.twig @@ -2,7 +2,7 @@
{{ 'sylius_invoicing_plugin.ui.payment.paid'|trans }}: - {% if hookable_metadata.context.resource.paymentState() is constant('Sylius\\InvoicingPlugin\\Entity\\InvoiceInterface::PAYMENT_STATE_COMPLETED') %} + {% if hookable_metadata.context.resource.paymentState is constant('Sylius\\InvoicingPlugin\\Entity\\InvoiceInterface::PAYMENT_STATE_COMPLETED') %} {{ 'sylius_invoicing_plugin.ui.payment.yes'|trans }} {% else %} {{ 'sylius_invoicing_plugin.ui.payment.no'|trans }} diff --git a/src/templates/admin/invoice/show/content/page_body/seller.html.twig b/src/templates/admin/invoice/show/content/sections/seller.html.twig similarity index 81% rename from src/templates/admin/invoice/show/content/page_body/seller.html.twig rename to src/templates/admin/invoice/show/content/sections/seller.html.twig index 10a59181..c6f4d0b0 100644 --- a/src/templates/admin/invoice/show/content/page_body/seller.html.twig +++ b/src/templates/admin/invoice/show/content/sections/seller.html.twig @@ -1,7 +1,6 @@ -{% set invoice = hookable_metadata.context.resource %} -{% set shopBillingData = invoice.shopBillingData %} +{% set shop_billing_data = hookable_metadata.context.resource.shopBillingData %} -{% if shopBillingData %} +{% if shop_billing_data %}
diff --git a/src/templates/admin/invoice/show/content/sections/seller/city.html.twig b/src/templates/admin/invoice/show/content/sections/seller/city.html.twig new file mode 100644 index 00000000..bee092b0 --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/seller/city.html.twig @@ -0,0 +1,3 @@ +{% set shop_billing_data = hookable_metadata.context.resource.shopBillingData %} + +{% if shop_billing_data.city %}{{ shop_billing_data.city }}
{% endif %} diff --git a/src/templates/admin/invoice/show/content/sections/seller/company.html.twig b/src/templates/admin/invoice/show/content/sections/seller/company.html.twig new file mode 100644 index 00000000..b0da0fbd --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/seller/company.html.twig @@ -0,0 +1,3 @@ +{% set shop_billing_data = hookable_metadata.context.resource.shopBillingData %} + +{% if shop_billing_data.company %}{{ shop_billing_data.company }}{% endif %} diff --git a/src/templates/admin/invoice/show/content/sections/seller/country_code.html.twig b/src/templates/admin/invoice/show/content/sections/seller/country_code.html.twig new file mode 100644 index 00000000..f5f15bb2 --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/seller/country_code.html.twig @@ -0,0 +1,5 @@ +{% set shop_billing_data = hookable_metadata.context.resource.shopBillingData %} + +{% if shop_billing_data.countryCode %} + +{% endif %} diff --git a/src/templates/admin/invoice/show/content/sections/seller/postcode.html.twig b/src/templates/admin/invoice/show/content/sections/seller/postcode.html.twig new file mode 100644 index 00000000..fedcb1e3 --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/seller/postcode.html.twig @@ -0,0 +1,5 @@ +{% set shop_billing_data = hookable_metadata.context.resource.shopBillingData %} + +{% if shop_billing_data.countryCode and shop_billing_data.postcode %} + {{ shop_billing_data.countryCode|sylius_country_name|upper }} {{ shop_billing_data.postcode }} +{% endif %} diff --git a/src/templates/admin/invoice/show/content/sections/seller/representative.html.twig b/src/templates/admin/invoice/show/content/sections/seller/representative.html.twig new file mode 100644 index 00000000..d174c930 --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/seller/representative.html.twig @@ -0,0 +1,3 @@ +{% set shop_billing_data = hookable_metadata.context.resource.shopBillingData %} + +{% if shop_billing_data.representative %}{{ shop_billing_data.representative }}{% endif %} diff --git a/src/templates/admin/invoice/show/content/sections/seller/street.html.twig b/src/templates/admin/invoice/show/content/sections/seller/street.html.twig new file mode 100644 index 00000000..80f03ec8 --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/seller/street.html.twig @@ -0,0 +1,3 @@ +{% set shop_billing_data = hookable_metadata.context.resource.shopBillingData %} + +{% if shop_billing_data.street %}{{ shop_billing_data.street }}
{% endif %} diff --git a/src/templates/admin/invoice/show/content/sections/seller/tax_id.html.twig b/src/templates/admin/invoice/show/content/sections/seller/tax_id.html.twig new file mode 100644 index 00000000..ab1b0ca9 --- /dev/null +++ b/src/templates/admin/invoice/show/content/sections/seller/tax_id.html.twig @@ -0,0 +1,3 @@ +{% set shop_billing_data = hookable_metadata.context.resource.shopBillingData %} + +{% if shop_billing_data.taxId %}{{ shop_billing_data.taxId }}
{% endif %} diff --git a/src/templates/shared/download/pdf.html.twig b/src/templates/shared/download/pdf.html.twig index 01fa5fb6..b5a4b97e 100644 --- a/src/templates/shared/download/pdf.html.twig +++ b/src/templates/shared/download/pdf.html.twig @@ -1,4 +1,4 @@ -{% extends '@SyliusInvoicingPlugin/shared/download/pdfLayout.html.twig' %} +{% extends '@SyliusInvoicingPlugin/shared/download/pdf_layout.html.twig' %} {% set shopBillingData = invoice.shopBillingData %} {% set localeCode = invoice.localeCode %} diff --git a/src/templates/shared/download/pdfLayout.html.twig b/src/templates/shared/download/pdf_layout.html.twig similarity index 100% rename from src/templates/shared/download/pdfLayout.html.twig rename to src/templates/shared/download/pdf_layout.html.twig diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 94d3f511..c7a1afa8 100644 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -3,6 +3,7 @@ imports: - { resource: "@SyliusShopBundle/Resources/config/app/config.yml" } - { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" } - { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" } + - { resource: "@SyliusPayumBundle/Resources/config/app/config.yaml" } - { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" } parameters: diff --git a/tests/Application/config/packages/validator.yaml b/tests/Application/config/packages/validator.yaml index 61807db6..8ff7da13 100644 --- a/tests/Application/config/packages/validator.yaml +++ b/tests/Application/config/packages/validator.yaml @@ -1,3 +1,3 @@ framework: validation: - enable_annotations: true + enable_attributes: true diff --git a/tests/Application/config/routes/sylius_shop.yaml b/tests/Application/config/routes/sylius_shop.yaml index 9116420d..09c9be63 100644 --- a/tests/Application/config/routes/sylius_shop.yaml +++ b/tests/Application/config/routes/sylius_shop.yaml @@ -5,10 +5,10 @@ sylius_shop: _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ sylius_shop_payum: - resource: "@SyliusShopBundle/Resources/config/routing/payum.yml" + resource: "@SyliusPayumBundle/Resources/config/routing/integrations/sylius_shop.yaml" sylius_shop_default_locale: path: / methods: [GET] defaults: - _controller: sylius.controller.shop.locale_switch::switchAction + _controller: sylius_shop.controller.locale_switch::switchAction From f87b828053075fcbc6ded6cee982ffeec8f98c2c Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Wed, 16 Oct 2024 08:17:22 +0200 Subject: [PATCH 21/25] upgrade file update --- UPGRADE.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index c23bad1f..1ef8cb4b 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,3 +1,10 @@ +### UPGRADE FROM 0.24.X TO 1.0.0 + +1. Support for Sylius 2.0 has been added, it is now the recommended Sylius version to use with InvoicingPlugin. +2. Support for Sylius 1.13 and 1.12 has been dropped, upgrade your application to [Sylius 2.0](https://github.com/Sylius/Sylius/blob/2.0/UPGRADE-2.0.md). +3. Support for PHP has been increased to 8.2 +4. The `sylius_invoicing_plugin_admin_order_invoices_partial` and `sylius_invoicing_plugin_shop_order_invoices_partial` partials have been replaced by `Sylius\InvoicingPlugin\Twig\Component\Invoice\ListComponent` twig component. + ### UPGRADE FROM 0.24.X TO 0.25.0 1. Support for Sylius 1.13 has been added, it is now the recommended Sylius version to use with InvoicingPlugin. From 9952887ce105b93b2ac0e2ca45d19ecff0a3e8c2 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Wed, 16 Oct 2024 08:37:08 +0200 Subject: [PATCH 22/25] Change the build a bit, fix the problem with lack of command name on symfony 7 --- .github/workflows/build.yml | 24 +++--------------------- src/Cli/GenerateInvoicesCommand.php | 1 + 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d46b07c7..cb246cf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,32 +19,14 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.3"] - symfony: ["^6.4"] + php: ["8.2", "8.3"] + symfony: ["^6.4", "^7.1"] sylius: ["2.0.x-dev"] node: ["20.x"] mysql: ["8.4"] - wkhtmltopdf: ["0.12.6-1"] + wkhtmltopdf: ["0.12.6-1", false] state_machine_adapter: [ "winzou_state_machine", "symfony_workflow" ] - include: - - - php: "8.3" - symfony: "^6.4" - sylius: "2.0.x-dev" - node: "20.x" - mysql: "8.4" - wkhtmltopdf: false - state_machine_adapter: "symfony_workflow" - - - php: "8.3" - symfony: "^6.4" - sylius: "2.0.x-dev" - node: "20.x" - mysql: "8.4" - wkhtmltopdf: false - state_machine_adapter: "winzou_state_machine" - env: APP_ENV: test DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" diff --git a/src/Cli/GenerateInvoicesCommand.php b/src/Cli/GenerateInvoicesCommand.php index 71918404..96c172be 100644 --- a/src/Cli/GenerateInvoicesCommand.php +++ b/src/Cli/GenerateInvoicesCommand.php @@ -55,6 +55,7 @@ public function execute(InputInterface $input, OutputInterface $output): int protected function configure(): void { + $this->setName(self::$defaultName); $this->setDescription('Generates invoices for orders placed before InvoicingPlugin installation'); } } From a2ab89e86110799a68cbe746b0940c1f5a64d862 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Wed, 16 Oct 2024 23:00:16 +0200 Subject: [PATCH 23/25] Load winzou config conditionally --- .github/workflows/build.yml | 28 ++++++++++++++-- .../config/app/winzou_state_machine.php | 33 +++++++++++++++++++ src/Resources/config/config.yml | 10 +----- tests/Application/config/bundles.php | 1 - .../config/packages/winzou_state_machine.yaml | 8 ----- tests/Application/src/Kernel.php | 5 +++ tests/Behat/Context/Order/OrderContext.php | 12 ++----- tests/Behat/Resources/services.xml | 2 +- 8 files changed, 69 insertions(+), 30 deletions(-) create mode 100644 src/Resources/config/app/winzou_state_machine.php delete mode 100644 tests/Application/config/packages/winzou_state_machine.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb246cf7..763dea97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,25 @@ jobs: node: ["20.x"] mysql: ["8.4"] wkhtmltopdf: ["0.12.6-1", false] - state_machine_adapter: [ "winzou_state_machine", "symfony_workflow" ] + state_machine_adapter: [ "symfony_workflow" ] + + include: + - + php: "8.3" + symfony: "^7.1" + sylius: "2.0.x-dev" + node: "20.x" + mysql: "8.4" + wkhtmltopdf: "0.12.6-1" + state_machine_adapter: "winzou_state_machine" + - + php: "8.3" + symfony: "^7.1" + sylius: "2.0.x-dev" + node: "20.x" + mysql: "8.4" + wkhtmltopdf: false + state_machine_adapter: "winzou_state_machine" env: APP_ENV: test @@ -84,7 +102,6 @@ jobs: if: matrix.wkhtmltopdf == false run: | mv tests/Application/etc/sylius_invoicing_pdf_generation_disabled.yaml tests/Application/config/packages - sed -i 's/pdf_generation_disabled/pdf_generation_enabled/g' behat.yml.dist - name: Get Composer cache directory @@ -113,6 +130,13 @@ jobs: if: matrix.sylius != '' run: composer require "sylius/sylius:${{ matrix.sylius }}" --no-update --no-scripts --no-interaction + - + name: Require Winzou State Machine + if: "${{ matrix.state_machine_adapter == 'winzou_state_machine' }}" + run: | + composer require winzou/state-machine:^0.4 --no-update + composer require winzou/state-machine-bundle:^0.6 --no-update + - name: Install PHP dependencies run: composer install --no-interaction --no-scripts diff --git a/src/Resources/config/app/winzou_state_machine.php b/src/Resources/config/app/winzou_state_machine.php new file mode 100644 index 00000000..754f5168 --- /dev/null +++ b/src/Resources/config/app/winzou_state_machine.php @@ -0,0 +1,33 @@ +extension('winzou_state_machine', [ + 'sylius_payment' => [ + 'callbacks' => [ + 'after' => [ + 'sylius_invoicing_plugin_payment_complete_producer' => [ + 'on' => ['complete'], + 'do' => ['@sylius_invoicing_plugin.event_producer.order_payment_paid', '__invoke'], + 'args' => ['object'], + ], + ], + ], + ], + ]); + } +}; diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index ce774cea..1e87f1f6 100644 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -1,4 +1,5 @@ imports: + - { resource: "@SyliusInvoicingPlugin/Resources/config/app/winzou_state_machine.php" } - { resource: 'app/twig_hooks/**/*.yaml' } parameters: @@ -20,15 +21,6 @@ knp_snappy: pdf: enabled: true -winzou_state_machine: - sylius_payment: - callbacks: - after: - sylius_invoicing_plugin_payment_complete_producer: - on: ['complete'] - do: ['@sylius_invoicing_plugin.event_producer.order_payment_paid', '__invoke'] - args: ['object'] - sylius_grid: templates: filter: diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php index bc386e5f..84679c8d 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -29,7 +29,6 @@ Sylius\Bundle\CoreBundle\SyliusCoreBundle::class => ['all' => true], Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true], Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], - winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true], Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], diff --git a/tests/Application/config/packages/winzou_state_machine.yaml b/tests/Application/config/packages/winzou_state_machine.yaml deleted file mode 100644 index a3ea2702..00000000 --- a/tests/Application/config/packages/winzou_state_machine.yaml +++ /dev/null @@ -1,8 +0,0 @@ -winzou_state_machine: - sylius_payment: - callbacks: - after: - sylius_invoicing_plugin_payment_complete_producer: - on: ['complete'] - do: ['@sylius_invoicing_plugin.event_producer.order_payment_paid', '__invoke'] - args: ['object'] diff --git a/tests/Application/src/Kernel.php b/tests/Application/src/Kernel.php index 38d1d069..65b6a765 100644 --- a/tests/Application/src/Kernel.php +++ b/tests/Application/src/Kernel.php @@ -25,6 +25,7 @@ use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; use Webmozart\Assert\Assert; +use winzou\Bundle\StateMachineBundle\winzouStateMachineBundle; final class Kernel extends BaseKernel { @@ -47,6 +48,10 @@ public function registerBundles(): iterable foreach ($this->getBundleListFiles() as $file) { yield from $this->registerBundlesFromFile($file); } + + if (class_exists(winzouStateMachineBundle::class)) { + yield new winzouStateMachineBundle(); + } } protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void diff --git a/tests/Behat/Context/Order/OrderContext.php b/tests/Behat/Context/Order/OrderContext.php index 8ce038e9..c815bff2 100644 --- a/tests/Behat/Context/Order/OrderContext.php +++ b/tests/Behat/Context/Order/OrderContext.php @@ -6,20 +6,14 @@ use Behat\Behat\Context\Context; use Doctrine\Persistence\ObjectManager; -use SM\Factory\FactoryInterface as StateMachineFactoryInterface; +use Sylius\Abstraction\StateMachine\StateMachineInterface; use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Payment\PaymentTransitions; final class OrderContext implements Context { - private ObjectManager $objectManager; - - private StateMachineFactoryInterface $stateMachineFactory; - - public function __construct(ObjectManager $objectManager, StateMachineFactoryInterface $stateMachineFactory) + public function __construct(private ObjectManager $objectManager, private StateMachineInterface $stateMachine) { - $this->objectManager = $objectManager; - $this->stateMachineFactory = $stateMachineFactory; } /** @@ -35,7 +29,7 @@ public function orderHasJustBeenPaid(OrderInterface $order): void private function applyPaymentTransitionOnOrder(OrderInterface $order, $transition): void { foreach ($order->getPayments() as $payment) { - $this->stateMachineFactory->get($payment, PaymentTransitions::GRAPH)->apply($transition); + $this->stateMachine->apply($payment, PaymentTransitions::GRAPH, $transition); } } } diff --git a/tests/Behat/Resources/services.xml b/tests/Behat/Resources/services.xml index 8c8dea88..3c9517ab 100644 --- a/tests/Behat/Resources/services.xml +++ b/tests/Behat/Resources/services.xml @@ -42,7 +42,7 @@ - + From 64e939a05201fed37cf988ecbe7c47f770dee297 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Thu, 17 Oct 2024 13:05:55 +0200 Subject: [PATCH 24/25] Config fixes after some changes done to Sylius 2.0 --- tests/Application/config/packages/framework.yaml | 1 + tests/Application/config/packages/security.yaml | 15 +++++++++++++-- .../Application/config/packages/test/_sylius.yaml | 8 ++++++++ tests/Application/config/routes/sylius_shop.yaml | 14 +++++++++++++- .../config/sylius/1.13/packages/_sylius.yaml | 8 -------- 5 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 tests/Application/config/packages/test/_sylius.yaml delete mode 100644 tests/Application/config/sylius/1.13/packages/_sylius.yaml diff --git a/tests/Application/config/packages/framework.yaml b/tests/Application/config/packages/framework.yaml index 9b445011..cbbc8bcb 100644 --- a/tests/Application/config/packages/framework.yaml +++ b/tests/Application/config/packages/framework.yaml @@ -4,3 +4,4 @@ framework: csrf_protection: true session: handler_id: ~ + http_method_override: true diff --git a/tests/Application/config/packages/security.yaml b/tests/Application/config/packages/security.yaml index fce3e181..d010f895 100644 --- a/tests/Application/config/packages/security.yaml +++ b/tests/Application/config/packages/security.yaml @@ -44,7 +44,7 @@ security: stateless: true entry_point: jwt json_login: - check_path: "%sylius.security.new_api_admin_route%/authentication-token" + check_path: "%sylius.security.new_api_admin_route%/administrators/token" username_path: email password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success @@ -57,7 +57,7 @@ security: stateless: true entry_point: jwt json_login: - check_path: "%sylius.security.new_api_shop_route%/authentication-token" + check_path: "%sylius.security.new_api_shop_route%/customers/token" username_path: email password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success @@ -82,6 +82,12 @@ security: enable_csrf: true csrf_parameter: _csrf_shop_security_token csrf_token_id: shop_authenticate + json_login: + check_path: sylius_shop_json_login_check + username_path: _username + password_path: _password + success_handler: sylius.authentication.success_handler + failure_handler: sylius.authentication.failure_handler remember_me: secret: "%env(APP_SECRET)%" name: APP_SHOP_REMEMBER_ME @@ -92,6 +98,10 @@ security: target: sylius_shop_homepage invalidate_session: false + image_resolver: + pattern: ^/media/cache/resolve + security: false + dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false @@ -108,6 +118,7 @@ security: - { path: "%sylius.security.admin_regex%", role: ROLE_ADMINISTRATION_ACCESS } - { path: "%sylius.security.shop_regex%/account", role: ROLE_USER } + - { path: "%sylius.security.new_api_admin_route%/administrators/reset-password", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_admin_regex%/.*", role: ROLE_API_ACCESS } - { path: "%sylius.security.new_api_admin_route%/administrators/token", role: PUBLIC_ACCESS } - { path: "%sylius.security.new_api_user_account_regex%/.*", role: ROLE_USER } diff --git a/tests/Application/config/packages/test/_sylius.yaml b/tests/Application/config/packages/test/_sylius.yaml new file mode 100644 index 00000000..7777224b --- /dev/null +++ b/tests/Application/config/packages/test/_sylius.yaml @@ -0,0 +1,8 @@ +parameters: + test_default_state_machine_adapter: 'symfony_workflow' + test_sylius_state_machine_adapter: '%env(string:default:test_default_state_machine_adapter:TEST_SYLIUS_STATE_MACHINE_ADAPTER)%' + +sylius_state_machine_abstraction: + graphs_to_adapters_mapping: + sylius_payment: '%test_sylius_state_machine_adapter%' + default_adapter: '%test_sylius_state_machine_adapter%' diff --git a/tests/Application/config/routes/sylius_shop.yaml b/tests/Application/config/routes/sylius_shop.yaml index 09c9be63..8e3dd427 100644 --- a/tests/Application/config/routes/sylius_shop.yaml +++ b/tests/Application/config/routes/sylius_shop.yaml @@ -2,13 +2,25 @@ sylius_shop: resource: "@SyliusShopBundle/Resources/config/routing.yml" prefix: /{_locale} requirements: - _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ + _locale: ^[A-Za-z]{2,4}(_([A-Za-z]{4}|[0-9]{3}))?(_([A-Za-z]{2}|[0-9]{3}))?$ sylius_shop_payum: resource: "@SyliusPayumBundle/Resources/config/routing/integrations/sylius_shop.yaml" +sylius_payment_notify: + resource: "@SyliusPaymentBundle/Resources/config/routing/integrations/sylius.yaml" + sylius_shop_default_locale: path: / methods: [GET] defaults: _controller: sylius_shop.controller.locale_switch::switchAction + +# see https://web.dev/change-password-url/ +sylius_shop_request_password_reset_token_redirect: + path: /.well-known/change-password + methods: [GET] + controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction + defaults: + route: sylius_shop_request_password_reset_token + permanent: false diff --git a/tests/Application/config/sylius/1.13/packages/_sylius.yaml b/tests/Application/config/sylius/1.13/packages/_sylius.yaml deleted file mode 100644 index a2043583..00000000 --- a/tests/Application/config/sylius/1.13/packages/_sylius.yaml +++ /dev/null @@ -1,8 +0,0 @@ -parameters: - test_default_state_machine_adapter: 'symfony_workflow' - test_sylius_state_machine_adapter: '%env(string:default:test_default_state_machine_adapter:TEST_SYLIUS_STATE_MACHINE_ADAPTER)%' - -sylius_state_machine_abstraction: - graphs_to_adapters_mapping: - sylius_payment: '%test_sylius_state_machine_adapter%' - default_adapter: '%test_sylius_state_machine_adapter%' From bba54ad2d6fab612412e2af905abd6745b7e4329 Mon Sep 17 00:00:00 2001 From: Kamil Grygierzec Date: Thu, 17 Oct 2024 13:06:38 +0200 Subject: [PATCH 25/25] Fix the twig hooks on order shop show to display the invoices correctly --- .../app/twig_hooks/shop/order/summary.yaml | 38 +++++++++---------- .../summary/invoices/card.html.twig | 0 .../summary/invoices/card/body.html.twig | 0 .../invoices/card/body/table.html.twig | 0 .../invoices/card/body/table/body.html.twig | 0 .../card/body/table/body/download.html.twig | 0 .../card/body/table/body/issued_at.html.twig | 0 .../card/body/table/body/number.html.twig | 0 .../invoices/card/body/table/head.html.twig | 0 .../card/body/table/head/actions.html.twig | 0 .../card/body/table/head/issued_at.html.twig | 0 .../card/body/table/head/number.html.twig | 0 .../summary/invoices/card/head.html.twig | 0 13 files changed, 19 insertions(+), 19 deletions(-) rename src/templates/shop/order/show/{ => content}/summary/invoices/card.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body/table.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body/table/body.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body/table/body/download.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body/table/body/issued_at.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body/table/body/number.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body/table/head.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body/table/head/actions.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body/table/head/issued_at.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/body/table/head/number.html.twig (100%) rename src/templates/shop/order/show/{ => content}/summary/invoices/card/head.html.twig (100%) diff --git a/src/Resources/config/app/twig_hooks/shop/order/summary.yaml b/src/Resources/config/app/twig_hooks/shop/order/summary.yaml index 29bced92..831fa607 100644 --- a/src/Resources/config/app/twig_hooks/shop/order/summary.yaml +++ b/src/Resources/config/app/twig_hooks/shop/order/summary.yaml @@ -1,57 +1,57 @@ sylius_twig_hooks: hooks: - 'sylius_shop.account.order.show.summary': + 'sylius_shop.account.order.show.content.summary': invoices: component: 'sylius_invoicing:invoice:list' props: order: '@=_context.order' priority: 350 - 'sylius_shop.account.order.show.summary.invoices': + 'sylius_shop.account.order.show.content.summary.invoices': card: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card.html.twig' priority: 0 - 'sylius_shop.account.order.show.summary.invoices.card': + 'sylius_shop.account.order.show.content.summary.invoices.card': head: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/head.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/head.html.twig' priority: 100 body: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body.html.twig' priority: 0 - 'sylius_shop.account.order.show.summary.invoices.card.body': + 'sylius_shop.account.order.show.content.summary.invoices.card.body': table: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table.html.twig' priority: 0 - 'sylius_shop.account.order.show.summary.invoices.card.body.table': + 'sylius_shop.account.order.show.content.summary.invoices.card.body.table': head: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/head.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/head.html.twig' priority: 100 body: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/body.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/body.html.twig' priority: 0 - 'sylius_shop.account.order.show.summary.invoices.card.body.table.head': + 'sylius_shop.account.order.show.content.summary.invoices.card.body.table.head': number: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/head/number.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/head/number.html.twig' priority: 200 issued_at: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/head/issued_at.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/head/issued_at.html.twig' priority: 100 actions: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/head/actions.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/head/actions.html.twig' priority: 0 - 'sylius_shop.account.order.show.summary.invoices.card.body.table.body': + 'sylius_shop.account.order.show.content.summary.invoices.card.body.table.body': number: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/body/number.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/body/number.html.twig' priority: 200 issued_at: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/body/issued_at.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/body/issued_at.html.twig' priority: 100 download: - template: '@SyliusInvoicingPlugin/shop/order/show/summary/invoices/card/body/table/body/download.html.twig' + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/body/download.html.twig' enabled: '%sylius_invoicing.pdf_generator.enabled%' priority: 0 diff --git a/src/templates/shop/order/show/summary/invoices/card.html.twig b/src/templates/shop/order/show/content/summary/invoices/card.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body/table.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body/table.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body/table.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/body.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body/table/body.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body/table/body.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body/table/body.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/body/download.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body/table/body/download.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body/table/body/download.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body/table/body/download.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/body/issued_at.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body/table/body/issued_at.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body/table/body/issued_at.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body/table/body/issued_at.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/body/number.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body/table/body/number.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body/table/body/number.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body/table/body/number.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/head.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body/table/head.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body/table/head.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body/table/head.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/head/actions.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body/table/head/actions.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body/table/head/actions.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body/table/head/actions.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/head/issued_at.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body/table/head/issued_at.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body/table/head/issued_at.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body/table/head/issued_at.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/body/table/head/number.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/body/table/head/number.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/body/table/head/number.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/body/table/head/number.html.twig diff --git a/src/templates/shop/order/show/summary/invoices/card/head.html.twig b/src/templates/shop/order/show/content/summary/invoices/card/head.html.twig similarity index 100% rename from src/templates/shop/order/show/summary/invoices/card/head.html.twig rename to src/templates/shop/order/show/content/summary/invoices/card/head.html.twig