diff --git a/.github/workflows/build.yml b/.github/workflows/build.yaml similarity index 78% rename from .github/workflows/build.yml rename to .github/workflows/build.yaml index a0067415..ce6718ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yaml @@ -12,60 +12,33 @@ on: jobs: tests: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, ${{ matrix.database == 'mysql' && format('MySQL {0}', matrix.mysql) || matrix.database == 'postgres' && format('PostgreSQL {0}', matrix.postgres) }}, wkhtmltopdf: ${{ matrix.wkhtmltopdf }}, State Machine Adapter ${{ matrix.state_machine_adapter }}" strategy: fail-fast: false matrix: - php: ["8.3"] - symfony: ["^5.4.21", "^6.4"] - sylius: ["~1.13.0", "~1.14.0"] - mysql: ["8.4"] + php: ["8.2", "8.3"] + symfony: ["^6.4", "^7.1"] + sylius: ["~2.0.0"] node: ["20.x"] - postgres: ["15.8"] database: ["mysql", "postgres"] - wkhtmltopdf: ["0.12.6-1"] + mysql: ["8.4"] + postgres: ["15.8"] + wkhtmltopdf: ["0.12.6-1", false] state_machine_adapter: ["symfony_workflow"] include: - - php: "8.1" - symfony: "^6.4" - sylius: "~1.14.0" - database: "mysql" - mysql: "8.4" + php: "8.3" + symfony: "^7.1" + sylius: "~2.0.0" node: "20.x" - wkhtmltopdf: "0.12.6-1" - state_machine_adapter: "symfony_workflow" - - - php: "8.2" - symfony: "^6.4" - sylius: "~1.14.0" database: "mysql" mysql: "8.4" - node: "20.x" wkhtmltopdf: "0.12.6-1" state_machine_adapter: "winzou_state_machine" - - - php: "8.2" - symfony: "^6.4" - sylius: "~1.14.0" - database: "mysql" - mysql: "8.4" - node: "20.x" - wkhtmltopdf: false - state_machine_adapter: "symfony_workflow" - - - php: "8.2" - symfony: "^6.4" - sylius: "~1.14.0" - database: "postgres" - postgres: "15.8" - node: "20.x" - wkhtmltopdf: false - state_machine_adapter: "symfony_workflow" env: APP_ENV: test @@ -135,7 +108,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 @@ -164,6 +136,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 @@ -206,21 +185,13 @@ jobs: name: Load fixtures in test application run: (cd tests/Application && bin/console sylius:fixtures:load -n) - - - name: Validate composer.json - run: composer validate --ansi --strict --no-check-publish - - - - name: Run ECS - run: vendor/bin/ecs check src/ spec/ - - name: Run security check run: symfony security:check - - name: Run PHPStan - run: vendor/bin/phpstan analyse -c phpstan.neon -l max src/ + name: Run analysis + run: composer analyse - name: Run PHPSpec @@ -232,7 +203,12 @@ 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_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 - name: Upload Behat logs diff --git a/CHANGELOG-2.0.md b/CHANGELOG-2.0.md new file mode 100644 index 00000000..5672f625 --- /dev/null +++ b/CHANGELOG-2.0.md @@ -0,0 +1,11 @@ +# CHANGELOG + +### v2.0.0-RC.1 (2024-12-03) + +- [#323](https://github.com/Sylius/InvoicingPlugin/issues/323) Upgrade to 2.0 ([@TheMilek](https://github.com/TheMilek)) +- [#325](https://github.com/Sylius/InvoicingPlugin/issues/325) Reflect Sylius 2.0 Changes ([@Rafikooo](https://github.com/Rafikooo)) +- [#328](https://github.com/Sylius/InvoicingPlugin/issues/328) [Maintenance] Bump twig hooks ([@mpysiak](https://github.com/mpysiak)) +- [#332](https://github.com/Sylius/InvoicingPlugin/issues/332) Bump to stable Sylius 2.0 + minor clean up ([@GSadee](https://github.com/GSadee)) +- [#344](https://github.com/Sylius/InvoicingPlugin/issues/344) Fix translations' keys after upmerge ([@GSadee](https://github.com/GSadee)) +- [#347](https://github.com/Sylius/InvoicingPlugin/issues/347) [CI] Enable composer analyse ([@GSadee](https://github.com/GSadee)) +- [#348](https://github.com/Sylius/InvoicingPlugin/issues/348) Adjust the translations and routes after naming convention changes ([@TheMilek](https://github.com/TheMilek)) diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 6e42b13b..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,213 +0,0 @@ -# CHANGELOG - -### v1.0.0-RC.1 (2024-12-03) - -- [#321](https://github.com/Sylius/InvoicingPlugin/issues/321) [symfony/workflow] Makes workflow event listener loading ([@Prometee](https://github.com/Prometee)) -- [#326](https://github.com/Sylius/InvoicingPlugin/issues/326) Rename LICENCE to LICENSE ([@damonsson](https://github.com/damonsson)) -- [#330](https://github.com/Sylius/InvoicingPlugin/issues/330) [Maintenance] Fix CI builds ([@mpysiak](https://github.com/mpysiak)) -- [#322](https://github.com/Sylius/InvoicingPlugin/issues/322) Update LICENCE ([@damonsson](https://github.com/damonsson)) -- [#327](https://github.com/Sylius/InvoicingPlugin/issues/327) Create LICENSE_OF_TRADEMARK_AND_LOGO ([@damonsson](https://github.com/damonsson)) -- [#331](https://github.com/Sylius/InvoicingPlugin/issues/331) [Maintenance][Refactor] Bump plugin to 1.14 ([@mpysiak](https://github.com/mpysiak)) -- [#333](https://github.com/Sylius/InvoicingPlugin/issues/333) Remove deprecated method + bump to stable Sylius 1.14 + minor clean up ([@GSadee](https://github.com/GSadee)) -- [#329](https://github.com/Sylius/InvoicingPlugin/issues/329) Add German Translations for Invoicing Plugin ([@curler7](https://github.com/curler7)) -- [#334](https://github.com/Sylius/InvoicingPlugin/issues/334) [Behat] Use Chrome instead of Selenium driver ([@GSadee](https://github.com/GSadee)) -- [#335](https://github.com/Sylius/InvoicingPlugin/issues/335) Replace custom DateTimeProvider by Symfony Clock ([@GSadee](https://github.com/GSadee)) -- [#336](https://github.com/Sylius/InvoicingPlugin/issues/336) Remove trademark and logo part from LICENSE file ([@GSadee](https://github.com/GSadee)) -- [#337](https://github.com/Sylius/InvoicingPlugin/issues/337) [CI] Update builds' matrix ([@GSadee](https://github.com/GSadee)) -- [#341](https://github.com/Sylius/InvoicingPlugin/issues/341) Fix and make consistent the translation keys ([@GSadee](https://github.com/GSadee)) -- [#340](https://github.com/Sylius/InvoicingPlugin/issues/340) Minor improvements and clean up ([@GSadee](https://github.com/GSadee)) -- [#339](https://github.com/Sylius/InvoicingPlugin/issues/339) [Admin] Remove unneeded route + grid improvements ([@GSadee](https://github.com/GSadee)) -- [#338](https://github.com/Sylius/InvoicingPlugin/issues/338) [Admin] Replace custom invoice_channel filter with entity filter from GridBundle ([@GSadee](https://github.com/GSadee)) -- [#342](https://github.com/Sylius/InvoicingPlugin/issues/342) Reorganize directory structure ([@GSadee](https://github.com/GSadee)) -- [#345](https://github.com/Sylius/InvoicingPlugin/issues/345) [Admin] Fix translations on Invoice index page ([@GSadee](https://github.com/GSadee)) -- [#343](https://github.com/Sylius/InvoicingPlugin/issues/343) Regenerate migrations and add support for Postgres ([@TheMilek](https://github.com/TheMilek)) -- [#346](https://github.com/Sylius/InvoicingPlugin/issues/346) Refactor services names according to the new convention ([@TheMilek](https://github.com/TheMilek)) -- [#350](https://github.com/Sylius/InvoicingPlugin/issues/350) Upgrade file fixes ([@TheMilek](https://github.com/TheMilek)) -- [#349](https://github.com/Sylius/InvoicingPlugin/issues/349) Make services private by default ([@GSadee](https://github.com/GSadee)) -- [#351](https://github.com/Sylius/InvoicingPlugin/issues/351) Move StateMachineAbstraction config to the proper directory in the test application ([@GSadee](https://github.com/GSadee)) -- [#352](https://github.com/Sylius/InvoicingPlugin/issues/352) Minor services fixes ([@TheMilek](https://github.com/TheMilek)) -- [#353](https://github.com/Sylius/InvoicingPlugin/issues/353) Fix legacy installation ([@GSadee](https://github.com/GSadee)) - -### v0.25.1 (2024-07-01) - -- [#317](https://github.com/Sylius/InvoicingPlugin/issues/317) [Translation] Add missing french translation ([@pierre-grebert](https://github.com/pierre-grebert)) -- [#319](https://github.com/Sylius/InvoicingPlugin/issues/319) OP-301 - Change style on order details ([@SzymonKostrubiec](https://github.com/SzymonKostrubiec)) - -### v0.25.0 (2024-04-26) - -- [#300](https://github.com/Sylius/InvoicingPlugin/issues/300) [Maintenance] Remove wkhtmltopdf binary ([@coldic3](https://github.com/coldic3)) -- [#303](https://github.com/Sylius/InvoicingPlugin/issues/303) [Maintenance] PHP Attributes introduced ([@Rafikooo](https://github.com/Rafikooo)) -- [#304](https://github.com/Sylius/InvoicingPlugin/issues/304) [Maintenance] phpstan upgrade ([@Rafikooo](https://github.com/Rafikooo)) -- [#305](https://github.com/Sylius/InvoicingPlugin/issues/305) [Maintenance] Adjust Messenger env variables ([@GSadee](https://github.com/GSadee)) -- [#299](https://github.com/Sylius/InvoicingPlugin/issues/299) Loosen type check for user, to handle more types of users ([@j92](https://github.com/j92)) -- [#310](https://github.com/Sylius/InvoicingPlugin/issues/310) [Translation] Add missing German translations and update existing ones ([@shochdoerfer](https://github.com/shochdoerfer)) -- [#313](https://github.com/Sylius/InvoicingPlugin/issues/313) [Maintenance] Update copyrights ([@Wojdylak](https://github.com/Wojdylak)) -- [#312](https://github.com/Sylius/InvoicingPlugin/issues/312) Sylius 1.13 update ([@BartoszWojdalowicz](https://github.com/BartoszWojdalowicz)) -- [#314](https://github.com/Sylius/InvoicingPlugin/issues/314) [Maintenance] Enable symfony workflow tests ([@Wojdylak](https://github.com/Wojdylak)) -- [#308](https://github.com/Sylius/InvoicingPlugin/issues/308) [Admin][Translation] fix : use admin locale instead of invoice ([@BastienGoze](https://github.com/BastienGoze)) -- [#307](https://github.com/Sylius/InvoicingPlugin/issues/307) [Translation] fix french translation ([@BastienGoze](https://github.com/BastienGoze)) -- [#309](https://github.com/Sylius/InvoicingPlugin/issues/309) [PDF Template][Translation] Fix translation on pdf template ([@BastienGoze](https://github.com/BastienGoze)) -- [#316](https://github.com/Sylius/InvoicingPlugin/issues/316) Bump Sylius 1.13 to stable v1.13.0 version ([@GSadee](https://github.com/GSadee)) - -### v0.24.0 (2022-11-14) - -- [#290](https://github.com/Sylius/InvoicingPlugin/issues/290) Drop support for Sylius 1.10 ([@GSadee](https://github.com/GSadee)) -- [#291](https://github.com/Sylius/InvoicingPlugin/issues/291) [Behat][Invoice] Fix usage of method checking line items after last changes ([@GSadee](https://github.com/GSadee)) -- [#293](https://github.com/Sylius/InvoicingPlugin/issues/293) [Maintenance] Remove redundant configuration for not supported Sylius 1.10 ([@coldic3](https://github.com/coldic3)) -- [#295](https://github.com/Sylius/InvoicingPlugin/issues/295) [Maintenance] Drop support for Symfony 4.4 ([@coldic3](https://github.com/coldic3)) -- [#294](https://github.com/Sylius/InvoicingPlugin/issues/294) [Maintenance] Add support for Sylius 1.12 with Symfony 5.4 ([@coldic3](https://github.com/coldic3)) -- [#296](https://github.com/Sylius/InvoicingPlugin/issues/296) Add Symfony 6 support ([@coldic3](https://github.com/coldic3), [@GSadee](https://github.com/GSadee)) -- [#297](https://github.com/Sylius/InvoicingPlugin/issues/297) [Templates] Adjust to the new Sylius shop UI styles ([@coldic3](https://github.com/coldic3)) - -### v0.23.1 (2022-09-12) - -- [#291](https://github.com/Sylius/InvoicingPlugin/issues/291) [Behat][Invoice] Fix usage of method checking line items after last changes ([@GSadee](https://github.com/GSadee)) - -### v0.23.0 (2022-09-07) - -- [#282](https://github.com/Sylius/InvoicingPlugin/issues/282) Fix translation on pdf template ([@Orkin](https://github.com/Orkin)) -- [#284](https://github.com/Sylius/InvoicingPlugin/issues/284) Add directory purger before fixtures run ([@AdamKasp](https://github.com/AdamKasp)) -- [#285](https://github.com/Sylius/InvoicingPlugin/issues/285) [Maintenance] Allow flex plugin during plugin installation ([@lchrusciel](https://github.com/lchrusciel)) -- [#286](https://github.com/Sylius/InvoicingPlugin/issues/286) [Maintenance] Fix multi-environment .env files in test application ([@NoResponseMate](https://github.com/NoResponseMate)) -- [#287](https://github.com/Sylius/InvoicingPlugin/issues/287) Unit net price and discounted unit net price on the invoice ([@Rafikooo](https://github.com/Rafikooo), [@Zales0123](https://github.com/Zales0123)) -- [#207](https://github.com/Sylius/InvoicingPlugin/issues/207) Update console command definition to SF 4.4 standards ([@GSadee](https://github.com/GSadee)) -- [#289](https://github.com/Sylius/InvoicingPlugin/issues/289) Fix down method of migration that changes indexes ([@GSadee](https://github.com/GSadee)) - -### v0.22.0 (2022-04-27) - -- [#274](https://github.com/Sylius/InvoicingPlugin/issues/274) [Maintenance] Support PHP 8.1 ([@GSadee](https://github.com/GSadee)) -- [#275](https://github.com/Sylius/InvoicingPlugin/issues/275) [Maintenance] Add TwigToPdfGenerator ([@coldic3](https://github.com/coldic3)) -- [#277](https://github.com/Sylius/InvoicingPlugin/issues/277) [DependencyInjection] Move registering resources to prepend method ([@GSadee](https://github.com/GSadee)) -- [#278](https://github.com/Sylius/InvoicingPlugin/issues/278) Optional parameter to turn off the PDF generation ([@GSadee](https://github.com/GSadee)) -- [#279](https://github.com/Sylius/InvoicingPlugin/issues/279) [GitHub Actions] Include build with PDF generation disabled to the main workflow ([@GSadee](https://github.com/GSadee)) - -### v0.21.0 (2022-03-31) - -- [#271](https://github.com/Sylius/InvoicingPlugin/issues/271) [GitHub Actions] Configure workflow to run on the workflow_dispatch event ([@GSadee](https://github.com/GSadee)) -- [#272](https://github.com/Sylius/InvoicingPlugin/issues/272) Enable local file access in InvoicePdfFileGenerator ([@coldic3](https://github.com/coldic3)) - -### v0.20.0 (2022-02-17) - -- [#270](https://github.com/Sylius/InvoicingPlugin/issues/270) [Maintenance] Support stable Sylius v1.11.0 ([@GSadee](https://github.com/GSadee)) - -### v0.19.0 (2022-01-25) - -- [#249](https://github.com/Sylius/InvoicingPlugin/issues/249) Use PHP 7.4 syntax ([@GSadee](https://github.com/GSadee)) -- [#251](https://github.com/Sylius/InvoicingPlugin/issues/251) New PDF layout ([@kulczy](https://github.com/kulczy)) -- [#252](https://github.com/Sylius/InvoicingPlugin/issues/252) [Behat] Fix type of show page ([@GSadee](https://github.com/GSadee)) -- [#253](https://github.com/Sylius/InvoicingPlugin/issues/253) [Maintenance] Minor installation guide improvements ([@GSadee](https://github.com/GSadee)) -- [#255](https://github.com/Sylius/InvoicingPlugin/issues/255) Added missing french translations ([@Snowbaha](https://github.com/Snowbaha)) -- [#261](https://github.com/Sylius/InvoicingPlugin/issues/261) Drop support for Sylius 1.9 & Symfony 5.2 ([@GSadee](https://github.com/GSadee)) -- [#262](https://github.com/Sylius/InvoicingPlugin/issues/262) [PDF] Fix minor locale code typo ([@GSadee](https://github.com/GSadee)) -- [#256](https://github.com/Sylius/InvoicingPlugin/issues/256) Fix invoice payment state not updating when given order is paid () -- [#210](https://github.com/Sylius/InvoicingPlugin/issues/210) Minor admin ui redesign ([@dmitri](https://github.com/dmitri).[@perunov](https://github.com/perunov)@[@gmail](https://github.com/gmail).[@com](https://github.com/com)) -- [#258](https://github.com/Sylius/InvoicingPlugin/issues/258) fix: compare when name is the same but not variant ([@Snowbaha](https://github.com/Snowbaha)) -- [#266](https://github.com/Sylius/InvoicingPlugin/issues/266) Remove duplicated config for wkhtmltopdf ([@Zales0123](https://github.com/Zales0123)) -- [#263](https://github.com/Sylius/InvoicingPlugin/issues/263) resolve SYLIUS_INVOICING_LOGO_FILE () -- [#267](https://github.com/Sylius/InvoicingPlugin/issues/267) Drop support for PHP 7.4 ([@GSadee](https://github.com/GSadee)) -- [#269](https://github.com/Sylius/InvoicingPlugin/issues/269) Upgrade node in GitHub Actions builds ([@GSadee](https://github.com/GSadee)) -- [#268](https://github.com/Sylius/InvoicingPlugin/issues/268) Drop support for Symfony 5.3 ([@GSadee](https://github.com/GSadee)) - -### v0.18.1 (2021-09-15) - -- [#250](https://github.com/Sylius/InvoicingPlugin/issues/250) [Maintenance] Remove wrong return types ([@lchrusciel](https://github.com/lchrusciel)) - -### v0.18.0 (2021-08-27) - -- [#246](https://github.com/Sylius/InvoicingPlugin/issues/246) [Invoice] Add payment status ([@AdamKasp](https://github.com/AdamKasp), [@Tomanhez](https://github.com/Tomanhez), [@arti0090](https://github.com/arti0090)) -- [#247](https://github.com/Sylius/InvoicingPlugin/issues/247) Update knp snappy file ([@arti0090](https://github.com/arti0090)) -- [#201](https://github.com/Sylius/InvoicingPlugin/issues/201) Fix extended resource entities ([@Prometee](https://github.com/Prometee), [@lchrusciel](https://github.com/lchrusciel)) - -### v0.17.0 (2021-08-06) - -- [#233](https://github.com/Sylius/InvoicingPlugin/issues/233) Upgrade to stable Sylius 1.10 ([@GSadee](https://github.com/GSadee)) -- [#231](https://github.com/Sylius/InvoicingPlugin/issues/231) Save invoices on server during generation ([@Zales0123](https://github.com/Zales0123)) -- [#232](https://github.com/Sylius/InvoicingPlugin/issues/232) Do not require visibility in PHPSpec functions ([@Zales0123](https://github.com/Zales0123)) -- [#230](https://github.com/Sylius/InvoicingPlugin/issues/230) change information on WKHTMLTOPDF_PATH in README ([@DennisdeBest](https://github.com/DennisdeBest)) -- [#238](https://github.com/Sylius/InvoicingPlugin/issues/238) Extract wkhtmltopdf file path to env variable ([@GSadee](https://github.com/GSadee)) -- [#234](https://github.com/Sylius/InvoicingPlugin/issues/234) Rework invoice template on pdf and admin show page ([@Tomanhez](https://github.com/Tomanhez), [@GSadee](https://github.com/GSadee)) -- [#240](https://github.com/Sylius/InvoicingPlugin/issues/240) Remove unneeded TemporaryFilesystem service ([@GSadee](https://github.com/GSadee)) -- [#241](https://github.com/Sylius/InvoicingPlugin/issues/241) Add note to UPGRADE filem about removing TemporaryFilesystem ([@GSadee](https://github.com/GSadee)) - -### v0.16.1 (2021-06-23) - -- [#228](https://github.com/Sylius/InvoicingPlugin/issues/228) Fix sorting and filtering invoices by order in the grid ([@hurricane-voronin](https://github.com/hurricane-voronin)) - -### v0.16.0 (2021-06-18) - -- [#226](https://github.com/Sylius/InvoicingPlugin/issues/226) Relate Invoice with Order ([@Zales0123](https://github.com/Zales0123)) -- [#220](https://github.com/Sylius/InvoicingPlugin/issues/220) Polish translations & invoice download template update ([@mysiar](https://github.com/mysiar), [@GSadee](https://github.com/GSadee)) - -### v0.15.0 (2021-06-02) - -- [#221](https://github.com/Sylius/InvoicingPlugin/issues/221) unify usage of buses ([@SirDomin](https://github.com/SirDomin)) -- [#223](https://github.com/Sylius/InvoicingPlugin/issues/223) Drop support for Sylius 1.8 ([@GSadee](https://github.com/GSadee)) -- [#224](https://github.com/Sylius/InvoicingPlugin/issues/224) Add support for Sylius 1.10 + require PHP ^7.4 || ^8.0 ([@GSadee](https://github.com/GSadee)) -- [#225](https://github.com/Sylius/InvoicingPlugin/issues/225) Bring back easy-coding-standard + apply CS fixes ([@GSadee](https://github.com/GSadee)) - -### v0.14.0 (2021-03-18) - -- [#216](https://github.com/Sylius/InvoicingPlugin/issues/216) toggle doctrine migration ([@arti0090](https://github.com/arti0090)) -- [#217](https://github.com/Sylius/InvoicingPlugin/issues/217) Add gitkeep file to src/Migrations directory stays in code ([@arti0090](https://github.com/arti0090)) -- [#168](https://github.com/Sylius/InvoicingPlugin/issues/168) Define logo-file as parameter ([@BigBadBassMan](https://github.com/BigBadBassMan)) -- [#218](https://github.com/Sylius/InvoicingPlugin/issues/218) Remove twig errors configuration from test application ([@GSadee](https://github.com/GSadee)) - -### v0.13.0 (2021-03-04) - -- [#199](https://github.com/Sylius/InvoicingPlugin/issues/199) Bugfix | Update README file to use new route format ([@stloyd](https://github.com/stloyd)) -- [#202](https://github.com/Sylius/InvoicingPlugin/issues/202) Add translation in invoice PDF file ([@webdudi](https://github.com/webdudi), ) -- [#212](https://github.com/Sylius/InvoicingPlugin/issues/212) Upgrade to Sylius 1.9 ([@Tomanhez](https://github.com/Tomanhez)) -- [#213](https://github.com/Sylius/InvoicingPlugin/issues/213) Minor fix sylius version in composer 1.9RC to 1.9 ([@Tomanhez](https://github.com/Tomanhez)) - -### v0.12.0 (2020-11-16) - -- [#190](https://github.com/Sylius/InvoicingPlugin/issues/190) Add conflict to ^8.3.25 of symplify/package-builder to fix the build ([@Prometee](https://github.com/Prometee)) -- [#187](https://github.com/Sylius/InvoicingPlugin/issues/187) Use Sylius UI instead of Sonata event ([@Prometee](https://github.com/Prometee)) -- [#186](https://github.com/Sylius/InvoicingPlugin/issues/186) [Enhancement] Refactor and deprecate Invoice repository class ([@Prometee](https://github.com/Prometee)) -- [#191](https://github.com/Sylius/InvoicingPlugin/issues/191) Update upgrade to v0.12.0 ([@GSadee](https://github.com/GSadee)) -- [#193](https://github.com/Sylius/InvoicingPlugin/issues/193) Initialize GitHub Actions ([@pamil](https://github.com/pamil)) -- [#194](https://github.com/Sylius/InvoicingPlugin/issues/194) Test InvoicingPlugin via GitHub Actions ([@pamil](https://github.com/pamil)) -- [#195](https://github.com/Sylius/InvoicingPlugin/issues/195) Fix Doctrine/Migrations configuration ([@Zales0123](https://github.com/Zales0123)) -- [#188](https://github.com/Sylius/InvoicingPlugin/issues/188) allow override invoice shop billing data ([@jbcr](https://github.com/jbcr)) -- [#196](https://github.com/Sylius/InvoicingPlugin/issues/196) Bugfix | Update channel filter template to new Symfony format ([@stloyd](https://github.com/stloyd)) -- [#197](https://github.com/Sylius/InvoicingPlugin/issues/197) Bugfix | Update `admin_invoicing` routes to support new Symfony format ([@stloyd](https://github.com/stloyd)) - -### v0.11.0 (2020-09-22) - -- [#178](https://github.com/Sylius/InvoicingPlugin/issues/178) Fix failing InvoicingPlugin build ([@GSadee](https://github.com/GSadee), ) -- [#183](https://github.com/Sylius/InvoicingPlugin/issues/183) Allow for PHP 7.4 & upgrade static analysis ([@pamil](https://github.com/pamil)) -- [#175](https://github.com/Sylius/InvoicingPlugin/issues/175) Switch to Doctrine/Migrations 3.0-alpha ([@pamil](https://github.com/pamil)) -- [#184](https://github.com/Sylius/InvoicingPlugin/issues/184) Remove old migrations + upgrade Sylius to 1.8 ([@GSadee](https://github.com/GSadee)) -- [#185](https://github.com/Sylius/InvoicingPlugin/issues/185) [Docs] Update of UPGRADE file and installation instruction ([@lchrusciel](https://github.com/lchrusciel)) - -### v0.10.1 (2020-01-10) - -- [#167](https://github.com/Sylius/InvoicingPlugin/issues/167) Add missing migration ([@AdamKasp](https://github.com/AdamKasp)) - -### v0.10.0 (2019-12-06) - -- [#156](https://github.com/Sylius/InvoicingPlugin/issues/156) Change test server to Symfony server ([@AdamKasp](https://github.com/AdamKasp)) -- [#161](https://github.com/Sylius/InvoicingPlugin/issues/161) Remove embeddable and replace InvoicingChannel to Channel form Core ([@Tomanhez](https://github.com/Tomanhez)) -- [#165](https://github.com/Sylius/InvoicingPlugin/issues/165) fix(deps): loosen constraint for symfony/messenger ([@Gounlaf](https://github.com/Gounlaf), [@pamil](https://github.com/pamil)) - -### v0.9.0 (2019-10-17) - -- [#97](https://github.com/Sylius/InvoicingPlugin/issues/97) Make entities extendable ([@tautelis](https://github.com/tautelis), [@pamil](https://github.com/pamil)) -- [#124](https://github.com/Sylius/InvoicingPlugin/issues/124) Make invoices and credit memo grid consistent ([@bartoszpietrzak1994](https://github.com/bartoszpietrzak1994)) -- [#125](https://github.com/Sylius/InvoicingPlugin/issues/125) Passing invoice entity to invoice pdf file generator ([@bartoszpietrzak1994](https://github.com/bartoszpietrzak1994)) -- [#126](https://github.com/Sylius/InvoicingPlugin/issues/126) added invoice screenshot ([@doctorx32](https://github.com/doctorx32)) -- [#132](https://github.com/Sylius/InvoicingPlugin/issues/132) Customizations friendly improvements ([@bartoszpietrzak1994](https://github.com/bartoszpietrzak1994)) -- [#133](https://github.com/Sylius/InvoicingPlugin/issues/133) Enhanced conflict section ([@bartoszpietrzak1994](https://github.com/bartoszpietrzak1994)) -- [#134](https://github.com/Sylius/InvoicingPlugin/issues/134) Representative added to invoice shop billing data ([@bartoszpietrzak1994](https://github.com/bartoszpietrzak1994)) -- [#135](https://github.com/Sylius/InvoicingPlugin/issues/135) Fixed typo in service definition ([@kortwotze](https://github.com/kortwotze), [@GSadee](https://github.com/GSadee)) -- [#136](https://github.com/Sylius/InvoicingPlugin/issues/136) Minimise conflicts and require Messenger 4.3 ([@pamil](https://github.com/pamil)) -- [#137](https://github.com/Sylius/InvoicingPlugin/issues/137) Require Symfony ^4.2 and improve autoloading ([@pamil](https://github.com/pamil)) -- [#138](https://github.com/Sylius/InvoicingPlugin/issues/138) Allow to run PHPUnit without arguments and run Behat with strict mode on Travis CI ([@pamil](https://github.com/pamil)) -- [#139](https://github.com/Sylius/InvoicingPlugin/issues/139) Add missing migration ([@pamil](https://github.com/pamil), [@GSadee](https://github.com/GSadee)) -- [#140](https://github.com/Sylius/InvoicingPlugin/issues/140) Hotfix for TestOrderPlacedProducer ([@pamil](https://github.com/pamil)) -- [#141](https://github.com/Sylius/InvoicingPlugin/issues/141) A new way to test generating previous invoices ([@pamil](https://github.com/pamil)) -- [#146](https://github.com/Sylius/InvoicingPlugin/issues/146) [Admin] Unify order link in InvocingPlugin ([@Tomanhez](https://github.com/Tomanhez)) -- [#148](https://github.com/Sylius/InvoicingPlugin/issues/148) Fix GenerateInvoicesCommand selects order without number ([@tom10271](https://github.com/tom10271)) -- [#158](https://github.com/Sylius/InvoicingPlugin/issues/158) Update dependencies ([@pamil](https://github.com/pamil)) -- [#160](https://github.com/Sylius/InvoicingPlugin/issues/160) Add migrations for tests app ([@Tomanhez](https://github.com/Tomanhez)) -- [#162](https://github.com/Sylius/InvoicingPlugin/issues/162) Require GridBundle v1.7+ with embeddables support ([@pamil](https://github.com/pamil)) diff --git a/README.md b/README.md index 644d6528..1f5299d5 100644 --- a/README.md +++ b/README.md @@ -77,25 +77,9 @@ Symfony Flex, it's much quicker! :) ## Extension points -Majority of actions contained in SyliusInvoicingPlugin is executed once an event after changing the state of the Order. +The majority of actions contained in the SyliusInvoicingPlugin are executed after an event related to the change of the Order’s state. -Here is the example for `Winzou State Machine`: - -```yaml -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'] -``` - -Code placed above is a part of configuration placed in `config.yml` file. -You can customize this file by adding new state machine events listeners or editing existing ones. - -Here is the example for Symfony's `workflow`: +Here is an example using Symfony’s workflow: ```xml ``` -Apart from that an Invoice model is treated as a Resource. +Additionally, the Invoice model is treated as a Resource. You can read more about Resources here: . -Hence, template for displaying the list of Invoices is defined in `routing.yml` file: +Hence, the template for displaying the list of Invoices is defined in the `routing.yml` file: ```yaml sylius_invoicing_invoice: diff --git a/UPGRADE-2.0.md b/UPGRADE-2.0.md new file mode 100644 index 00000000..d6b3e604 --- /dev/null +++ b/UPGRADE-2.0.md @@ -0,0 +1,10 @@ +# UPGRADE FROM 1.X TO 2.0 + +1. Support for Sylius 2.0 has been added, it is now the recommended Sylius version to use with InvoicingPlugin. + +1. Support for Sylius 1.X has been dropped, upgrade your application to [Sylius 2.0](https://github.com/Sylius/Sylius/blob/2.0/UPGRADE-2.0.md). + +1. The minimum supported version of PHP has been increased to 8.2. + +1. 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. diff --git a/UPGRADE.md b/UPGRADE.md deleted file mode 100644 index 68d6a33f..00000000 --- a/UPGRADE.md +++ /dev/null @@ -1,245 +0,0 @@ -### UPGRADE FROM 0.25 TO 1.0 - -1. Support for Sylius 1.14 has been added, it is now the recommended Sylius version to use with InvoicingPlugin. - -1. Support for Sylius 1.12 has been dropped, upgrade your application to [Sylius 1.13](https://github.com/Sylius/Sylius/blob/1.13/UPGRADE-1.13.md). - or [Sylius 1.14](https://github.com/Sylius/Sylius/blob/1.14/UPGRADE-1.14.md). - -1. The directories structure has been updated to the current Symfony recommendations: - - `@SyliusInvoicingPlugin/Resources/assets` -> `@SyliusInvoicingPlugin/assets` - - `@SyliusInvoicingPlugin/Resources/config` -> `@SyliusInvoicingPlugin/config` - - `@SyliusInvoicingPlugin/Resources/translations` -> `@SyliusInvoicingPlugin/translations` - - `@SyliusInvoicingPlugin/Resources/views` -> `@SyliusInvoicingPlugin/templates` - - You need to adjust the import of configuration file in your end application: - ```diff - imports: - - - { resource: "@SyliusInvoicingPlugin/Resources/config/config.yml" } - + - { resource: '@SyliusInvoicingPlugin/config/config.yaml' } - ``` - - The routes have been consolidated into a single `config/routes.yaml` file. It is sufficient to import this file instead of defining each route explicitly: - ```yaml - sylius_invoicing: - resource: "@SyliusRefundPlugin/config/routes.yaml" - ``` - - However, if you have customized the routes, you need to adjust the paths to reflect the new structure: - ```diff - - sylius_invoicing_plugin_admin: - - resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/admin_invoicing.yml" - - prefix: /admin - + sylius_invoicing_admin: - + resource: '@SyliusInvoicingPlugin/config/routes/admin.yaml' - + prefix: '/%sylius_admin.path_name%' - - - sylius_invoicing_plugin_shop: - - resource: "@SyliusInvoicingPlugin/Resources/config/app/routing/shop_invoicing.yml" - + sylius_invoicing_shop: - + resource: '@SyliusInvoicingPlugin/config/routes/shop.yaml' - prefix: /{_locale} - requirements: - _locale: ^[a-z]{2}(?:_[A-Z]{2})?$ - ``` - - And the paths to assets and templates if you are using them. - -1. The deprecated method `Sylius\InvoicingPlugin\Entity\InvoiceInterface::orderNumber()` has been removed, - use `Sylius\InvoicingPlugin\Entity\InvoiceInterface::order()` instead. - -1. The `Sylius\InvoicingPlugin\SystemDateTimeProvider` class, `Sylius\InvoicingPlugin\DateTimeProvider` interface - and corresponding `sylius_invoicing_plugin.date_time_provider` service have been removed. - It has been replaced by `clock` service and `Symfony\Component\Clock\ClockInterface` interface. - - Affected classes: - - `Sylius\InvoicingPlugin\Creator\MassInvoicesCreator` - - `Sylius\InvoicingPlugin\EventProducer\OrderPaymentPaidProducer` - - `Sylius\InvoicingPlugin\EventProducer\OrderPlacedProducer` - - `Sylius\InvoicingPlugin\Generator\SequentialInvoiceNumberGenerator` - -1. The translation keys have been changed from `sylius_invoicing_plugin` and `sylius_admin_order_creation` to `sylius_invoicing`. - -1. The `sylius_invoicing_admin_order_show_by_number` route and `Sylius\InvoicingPlugin\Ui\RedirectToOrderShowAction` controller - have been removed and replaced by the `sylius_admin_order_show` route from the Sylius Core. - -1. The following templates have been removed: - - `@SyliusInvoicingPlugin/Invoice/Grid/Field/orderNumber.html.twig` - - `@SyliusInvoicingPlugin/Invoice/Grid/Field/channel.html.twig` - -1. The custom `invoice_channel` filter, its `Sylius\InvoicingPlugin\Grid\Filter\ChannelFilter` class - and `Sylius\InvoicingPlugin\Form\Type\ChannelFilterType` form type have been removed and replaced by - the `entity` filter from GridBundle. - -1. The invoice grid configuration has been updated accordingly to the above changes: - - ```diff - sylius_grid: - - templates: - - filter: - - invoice_channel: '@SyliusInvoicingPlugin/Grid/Filter/channel.html.twig' - grids: - sylius_invoicing_plugin_invoice: - # ... - fields: - # ... - orderNumber: - type: twig - label: sylius.ui.order - - path: order.number - - options: - - template: '@SyliusInvoicingPlugin/Invoice/Grid/Field/orderNumber.html.twig' - + path: order - + options: - + template: "@SyliusAdmin/Order/Grid/Field/number.html.twig" - sortable: order.number - channel: - type: twig - label: sylius.ui.channel - options: - - template: "@SyliusInvoicingPlugin/Invoice/Grid/Field/channel.html.twig" - + template: "@SyliusAdmin/Order/Grid/Field/channel.html.twig" - filters: - # ... - channel: - - type: invoice_channel - + type: entity - label: sylius.ui.channel - + form_options: - + class: "%sylius.model.channel.class%" - # ... - ``` - -1. The naming has been unified throughout the plugin, encompassing the following changes: - -#### Configuration root key change - - ```diff - - sylius_invoicing_plugin: - + sylius_invoicing: - ``` - -#### Routing - -| Old route | New route | -|------------------------------------------------------|-----------------------------------------------| -| sylius_invoicing_plugin_admin_invoice_index | sylius_invoicing_admin_invoice_index | -| sylius_invoicing_plugin_admin_invoice_show | sylius_invoicing_admin_invoice_show | -| sylius_invoicing_plugin_admin_invoice_download | sylius_invoicing_admin_invoice_download | -| sylius_invoicing_plugin_admin_invoice_resend | sylius_invoicing_admin_invoice_resend | -| sylius_invoicing_plugin_admin_order_invoices_partial | sylius_invoicing_admin_order_invoices_partial | -| sylius_invoicing_plugin_shop_invoice_download | sylius_invoicing_shop_invoice_download | -| sylius_invoicing_plugin_shop_order_invoices_partial | sylius_invoicing_shop_order_invoices_partial | - -#### Grids - -| Old grid | New grid | -|---------------------------------|--------------------------| -| sylius_invoicing_plugin_invoice | sylius_invoicing_invoice | - -#### Changed Parameters - -| Old | New | -|------------------------------------------------------------|-----------------------------------------------------| -| default_logo_file | sylius_invoicing.default_logo_file | -| sylius.invoicing.template.logo_file | sylius_invoicing.template.logo_file | -| sylius_invoicing_plugin.controller.billing_data.class | sylius_invoicing.controller.billing_data.class | -| sylius_invoicing_plugin.controller.invoice.class | sylius_invoicing.controller.invoice.class | -| sylius_invoicing_plugin.controller.invoice_sequence.class | sylius_invoicing.controller.invoice_sequence.class | -| sylius_invoicing_plugin.controller.line_item.class | sylius_invoicing.controller.line_item.class | -| sylius_invoicing_plugin.controller.shop_billing_data.class | sylius_invoicing.controller.shop_billing_data.class | -| sylius_invoicing_plugin.controller.tax_item.class | sylius_invoicing.controller.tax_item.class | -| sylius_invoicing_plugin.factory.billing_data.class | sylius_invoicing.factory.billing_data.class | -| sylius_invoicing_plugin.factory.invoice.class | sylius_invoicing.factory.invoice.class | -| sylius_invoicing_plugin.factory.invoice_sequence.class | sylius_invoicing.factory.invoice_sequence.class | -| sylius_invoicing_plugin.factory.line_item.class | sylius_invoicing.factory.line_item.class | -| sylius_invoicing_plugin.factory.shop_billing_data.class | sylius_invoicing.factory.shop_billing_data.class | -| sylius_invoicing_plugin.factory.tax_item.class | sylius_invoicing.factory.tax_item.class | -| sylius_invoicing_plugin.model.billing_data.class | sylius_invoicing.model.billing_data.class | -| sylius_invoicing_plugin.model.invoice.class | sylius_invoicing.model.invoice.class | -| sylius_invoicing_plugin.model.invoice_sequence.class | sylius_invoicing.model.invoice_sequence.class | -| sylius_invoicing_plugin.model.line_item.class | sylius_invoicing.model.line_item.class | -| sylius_invoicing_plugin.model.shop_billing_data.class | sylius_invoicing.model.shop_billing_data.class | -| sylius_invoicing_plugin.model.tax_item.class | sylius_invoicing.model.tax_item.class | -| sylius_invoicing_plugin.repository.invoice.class | sylius_invoicing.repository.invoice.class | - -1. Services have been refactored to align with the [New Naming Convention](https://github.com/Sylius/Sylius/blob/2.0/adr/2024_10_03_services_naming_convention.md): - -#### Changed Services - -| Old id | New id | -|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------| -| sylius_invoicing_plugin.event_listener.workflow.payment.produce_order_payment_paid | sylius_invoicing.event_listener.workflow.payment.produce_order_payment_paid | -| sylius_invoicing_plugin.ui.action.download_invoice | sylius_invoicing.controller.download_invoice | -| sylius_invoicing_plugin.ui.action.resend_invoice | sylius_invoicing.controller.resend_invoice | -| sylius_invoicing_plugin.cli.generate_invoices | sylius_invoicing.cli.generate_invoices | -| sylius_invoicing_plugin.converter.order_item_units_to_line_items | sylius_invoicing.converter.order_item_units_to_line_items | -| sylius_invoicing_plugin.converter.shipping_adjustments_to_line_items | sylius_invoicing.converter.shipping_adjustments_to_line_items | -| sylius_invoicing_plugin.converter.tax_items | sylius_invoicing.converter.tax_items | -| sylius_invoicing_plugin.fixture.example_factory.invoicing_plugin_shop_billing_data | sylius_invoicing.fixture.example_factory.shop_billing_data | -| sylius_invoicing_plugin.fixture.shop_billing_data_fixture | sylius_invoicing.fixture.shop_billing_data | -| Sylius\InvoicingPlugin\Fixture\Listener\InvoicesPurgerListener | sylius_invoicing.fixture.listener.invoices_purger | -| Sylius\InvoicingPlugin\Provider\InvoiceFileProviderInterface | sylius_invoicing.provider.invoice_file | -| Sylius\InvoicingPlugin\Manager\InvoiceFileManagerInterface | sylius_invoicing.manager.invoice_file | -| Sylius\InvoicingPlugin\Provider\UnitNetPriceProviderInterface | sylius_invoicing.provider.unit_net_price | -| Sylius\InvoicingPlugin\Generator\InvoiceFileNameGeneratorInterface | sylius_invoicing.generator.invoice_file_name | -| sylius_invoicing_plugin.generator.invoice_number_generator | sylius_invoicing.generator.invoice_number | -| sylius_invoicing_plugin.generator.invoice_identifier | sylius_invoicing.generator.invoice_identifier | -| sylius_invoicing_plugin.generator.invoice | sylius_invoicing.generator.invoice | -| sylius_invoicing_plugin.generator.invoice_pdf_file | sylius_invoicing.generator.invoice_pdf_file | -| sylius_invoicing_plugin.creator.invoice | sylius_invoicing.creator.invoice | -| sylius_invoicing_plugin.creator.mass_invoices | sylius_invoicing.creator.mass_invoices | -| sylius_invoicing_plugin.generator.pdf_options | sylius_invoicing.generator.pdf_options | -| sylius_invoicing_plugin.generator.twig_to_pdf | sylius_invoicing.generator.twig_to_pdf | -| sylius_invoicing_plugin.event_producer.order_payment_paid | sylius_invoicing.event_producer.order_payment_paid | -| sylius_invoicing_plugin.event_listener.order_placed | sylius_invoicing.listener.order_placed | -| sylius_invoicing_plugin.event_producer.order_placed | sylius_invoicing.event_producer.order_placed | -| sylius_invoicing_plugin.listener.order_payment_paid | sylius_invoicing.listener.order_payment_paid | -| sylius_invoicing_plugin.ui.menu.admin_menu_listener | sylius_invoicing.listener.admin_menu | -| sylius_invoicing_plugin.email.invoice_email_sender | sylius_invoicing.email.invoice_email_sender | -| sylius_invoicing_plugin.command_handler.send_invoice_email | sylius_invoicing.command_handler.send_invoice_email | -| sylius_invoicing_plugin.provider.tax_rate_percentage | sylius_invoicing.provider.tax_rate_percentage | -| sylius_invoicing_plugin.custom_factory.invoice | sylius_invoicing.custom_factory.invoice | -| sylius_invoicing_plugin_security.voter.invoice | sylius_invoicing.security.voter.invoice | -| sylius_invoicing_plugin.controller.invoice | sylius_invoicing.controller.invoice | -| sylius_invoicing_plugin.repository.invoice | sylius_invoicing.repository.invoice | -| sylius_invoicing.factory.invoice | sylius_invoicing.factory.invoice | -| sylius_invoicing_plugin.controller.billing_data | sylius_invoicing.controller.billing_data | -| sylius_invoicing_plugin.repository.billing_data | sylius_invoicing.repository.billing_data | -| sylius_invoicing_plugin.factory.billing_data | sylius_invoicing.factory.billing_data | -| sylius_invoicing_plugin.controller.shop_billing_data | sylius_invoicing.controller.shop_billing_data | -| sylius_invoicing_plugin.repository.shop_billing_data | sylius_invoicing.repository.shop_billing_data | -| sylius_invoicing_plugin.factory.shop_billing_data | sylius_invoicing.factory.shop_billing_data | -| sylius_invoicing_plugin.controller.line_item | sylius_invoicing.controller.line_item | -| sylius_invoicing_plugin.repository.line_item | sylius_invoicing.repository.line_item | -| sylius_invoicing_plugin.factory.line_item | sylius_invoicing.factory.line_item | -| sylius_invoicing_plugin.controller.tax_item | sylius_invoicing.controller.tax_item | -| sylius_invoicing_plugin.repository.tax_item | sylius_invoicing.repository.tax_item | -| sylius_invoicing_plugin.factory.tax_item | sylius_invoicing.factory.tax_item | -| sylius_invoicing_plugin.controller.invoice_sequence | sylius_invoicing.controller.invoice_sequence | -| sylius_invoicing_plugin.repository.invoice_sequence | sylius_invoicing.repository.invoice_sequence | -| sylius_invoicing_plugin.factory.invoice_sequence | sylius_invoicing.factory.invoice_sequence | -| sylius_invoicing_plugin.manager.invoice | sylius_invoicing.manager.invoice | -| sylius_invoicing_plugin.manager.billing_data | sylius_invoicing.manager.billing_data | -| sylius_invoicing_plugin.manager.shop_billing_data | sylius_invoicing.manager.shop_billing_data | -| sylius_invoicing_plugin.manager.line_item | sylius_invoicing.manager.line_item | -| sylius_invoicing_plugin.manager.tax_item | sylius_invoicing.manager.tax_item | -| sylius_invoicing_plugin.manager.invoice_sequence | sylius_invoicing.manager.invoice_sequence | -| sylius_invoicing_plugin.controller_state_machine.invoice | sylius_invoicing.controller_state_machine.invoice | -| sylius_invoicing_plugin.controller_state_machine.billing_data | sylius_invoicing.controller_state_machine.billing_data | -| sylius_invoicing_plugin.controller_state_machine.shop_billing_data | sylius_invoicing.controller_state_machine.shop_billing_data | -| sylius_invoicing_plugin.controller_state_machine.line_item | sylius_invoicing.controller_state_machine.line_item | -| sylius_invoicing_plugin.controller_state_machine.tax_item | sylius_invoicing.controller_state_machine.tax_item | -| sylius_invoicing_plugin.controller_state_machine.invoice_sequence | sylius_invoicing.controller_state_machine.invoice_sequence | - -1. Doctrine migrations have been regenerated, meaning all previous migration files have been removed and their content is now in a single migration file. - To apply the new migration and get rid of the old entries run migrations as usual: - -```bash - bin/console doctrine:migrations:migrate --no-interaction -``` - -1. The visibility of services has been changed to `private` by default. This change enhances the performance - and maintainability of the application and also follows Symfony's best practices for service encapsulation. - - Exceptions: - - Services required by Symfony to be `public` (e.g., controllers, event listeners) remain public. diff --git a/behat.yml.dist b/behat.yml.dist index abd523ea..2d57f4ce 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -35,7 +35,3 @@ default: FriendsOfBehat\SuiteSettingsExtension: paths: - features - - FriendsOfBehat\ExcludeSpecificationsExtension: - features: - - features/managing_invoices/pdf_generation_disabled diff --git a/composer.json b/composer.json index 91bddf9b..1f5f3666 100644 --- a/composer.json +++ b/composer.json @@ -5,53 +5,54 @@ "description": "Invoicing plugin for Sylius.", "license": "MIT", "require": { - "php": "^8.1", - "knplabs/knp-snappy-bundle": "^1.8", - "ramsey/uuid": "^4.0", - "sylius/grid-bundle": "^1.9", - "sylius/resource-bundle": "^1.9", - "sylius/sylius": "~1.13.0 || ~1.14.0", - "symfony/clock": "^6.4", - "symfony/config": "^5.4.21 || ^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" + "php": "^8.2", + "knplabs/knp-snappy-bundle": "^1.10", + "ramsey/uuid": "^4.7", + "sylius/grid-bundle": "^1.13", + "sylius/resource-bundle": "^1.12", + "sylius/sylius": "~2.0.0", + "sylius/twig-hooks": "^0.5", + "symfony/clock": "^6.4 || ^7.1", + "symfony/config": "^6.4 || ^7.1", + "symfony/console": "^6.4 || ^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/behat": "^3.14", "dmore/behat-chrome-extension": "^1.4", "dmore/chrome-mink-driver": "^2.9", - "friends-of-behat/exclude-specifications-extension": "^0.2 || ^0.3", - "friends-of-behat/mink": "^1.8", - "friends-of-behat/mink-browserkit-driver": "^1.4", - "friends-of-behat/mink-debug-extension": "^2.0", - "friends-of-behat/mink-extension": "^2.4", + "friends-of-behat/mink": "^1.11", + "friends-of-behat/mink-browserkit-driver": "^1.6", + "friends-of-behat/mink-debug-extension": "^2.1", + "friends-of-behat/mink-extension": "^2.7", "friends-of-behat/page-object-extension": "^0.3", - "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", - "phpspec/phpspec": "^7.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-doctrine": "^1.3", - "phpstan/phpstan-symfony": "^1.2", + "friends-of-behat/suite-settings-extension": "^1.1", + "friends-of-behat/symfony-extension": "^2.6", + "friends-of-behat/variadic-extension": "^1.6", + "matthiasnoback/symfony-config-test": "^5.1", + "matthiasnoback/symfony-dependency-injection-test": "^5.1", + "phpspec/phpspec": "^7.5", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-doctrine": "^1.5", + "phpstan/phpstan-symfony": "^1.4", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", "sylius-labs/coding-standard": "^4.4", - "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.21 || ^6.0", - "symfony/web-profiler-bundle": "^5.4.21 || ^6.4", - "symfony/webpack-encore-bundle": "^1.15" + "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.2", + "symfony/web-profiler-bundle": "^6.4 || ^7.1" }, "autoload": { "psr-4": { @@ -66,24 +67,28 @@ } }, "scripts": { - "auto-scripts": { - "cache:clear": "symfony-cmd", - "assets:install %PUBLIC_DIR%": "symfony-cmd" - } + "analyse": [ + "@composer validate --strict", + "vendor/bin/phpstan analyse -c phpstan.neon -l max", + "vendor/bin/ecs check src/ spec/" + ], + "fix": [ + "vendor/bin/ecs check --fix src/ spec/" + ] }, "config": { "sort-packages": true, "allow-plugins": { + "symfony/flex": true, "dealerdirect/phpcodesniffer-composer-installer": false, - "php-http/discovery": true, "phpstan/extension-installer": true, - "symfony/flex": true, - "symfony/thanks": false + "symfony/thanks": false, + "php-http/discovery": false } }, "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-main": "2.0-dev" } }, "prefer-stable": true diff --git a/config/config.yaml b/config/config.yaml index 1adae41e..a75863b3 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -1,3 +1,7 @@ +imports: + - { resource: '@SyliusInvoicingPlugin/config/twig_hooks/**/*.yaml' } + - { resource: '@SyliusInvoicingPlugin/config/winzou_state_machine.php' } + parameters: sylius_invoicing.invoice_save_path: "%kernel.project_dir%/private/invoices/" sylius_invoicing.filesystem_adapter.invoice: "sylius_invoicing_invoice" @@ -11,22 +15,16 @@ sylius_mailer: emails: invoice_generated: subject: sylius.emails.invoice_generated.subject - template: "@SyliusInvoicingPlugin/Invoice/Email/invoiceGenerated.html.twig" + template: "@SyliusInvoicingPlugin/admin/invoice/email/invoice_generated.html.twig" knp_snappy: pdf: enabled: true -winzou_state_machine: - sylius_payment: - callbacks: - after: - sylius_invoicing_payment_complete_producer: - on: ['complete'] - do: ['@sylius_invoicing.event_producer.order_payment_paid', '__invoke'] - args: ['object'] - sylius_grid: + templates: + action: + download: '@SyliusInvoicingPlugin/admin/shared/action/download.html.twig' grids: sylius_invoicing_invoice: driver: @@ -45,20 +43,20 @@ sylius_grid: label: sylius.ui.order path: order options: - template: "@SyliusAdmin/Order/Grid/Field/number.html.twig" + template: "@SyliusAdmin/shared/grid/field/order_number.html.twig" sortable: order.number channel: type: twig label: sylius.ui.channel options: - template: "@SyliusAdmin/Order/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.ui.issued_at @@ -87,10 +85,8 @@ sylius_grid: show: type: show download: - type: default - label: sylius_invoicing.ui.download_invoice + type: download enabled: '%sylius_invoicing.pdf_generator.enabled%' - icon: download options: link: route: sylius_invoicing_admin_invoice_download @@ -99,57 +95,13 @@ sylius_grid: resend: type: default label: sylius_invoicing.ui.resend_invoice - icon: send + icon: "tabler:send" options: link: route: sylius_invoicing_admin_invoice_resend parameters: id: resource.id -sylius_ui: - events: - sylius.admin.order.show.summary: - blocks: - sylius_invoicing: - template: '@SyliusInvoicingPlugin/Order/Admin/fetchInvoices.html.twig' - priority: 15 - - sylius.shop.account.order.show.subcontent: - blocks: - sylius_invoicing: - 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/config/routes/admin.yaml b/config/routes/admin.yaml index fb8c2177..ffbc90bd 100644 --- a/config/routes/admin.yaml +++ b/config/routes/admin.yaml @@ -2,7 +2,7 @@ sylius_invoicing_invoice: resource: | alias: sylius_invoicing.invoice section: admin - templates: "@SyliusAdmin\\Crud" + templates: "@SyliusAdmin\\shared\\crud" only: ['index'] grid: sylius_invoicing_invoice permission: true @@ -23,7 +23,7 @@ sylius_invoicing_admin_invoice_show: _sylius: section: admin permission: true - template: "@SyliusInvoicingPlugin/Invoice/show.html.twig" + template: "@SyliusAdmin/shared/crud/show.html.twig" sylius_invoicing_admin_invoice_download: path: /invoices/{id}/download @@ -36,14 +36,3 @@ sylius_invoicing_admin_invoice_resend: methods: [GET] defaults: _controller: sylius_invoicing.controller.resend_invoice - -sylius_invoicing_admin_order_invoices_partial: - path: /_partial/invoices/{orderNumber}/ - methods: [GET] - defaults: - _controller: sylius_invoicing.controller.invoice::indexAction - _sylius: - template: $template - repository: - method: findByOrderNumber - arguments: $orderNumber diff --git a/config/routes/shop.yaml b/config/routes/shop.yaml index 0d80040b..dc3ccc6f 100644 --- a/config/routes/shop.yaml +++ b/config/routes/shop.yaml @@ -3,14 +3,3 @@ sylius_invoicing_shop_invoice_download: methods: [GET] defaults: _controller: sylius_invoicing.controller.download_invoice - -sylius_invoicing_shop_order_invoices_partial: - path: /_partial/invoices/{orderNumber}/ - methods: [GET] - defaults: - _controller: sylius_invoicing.controller.invoice::indexAction - _sylius: - template: $template - repository: - method: findByOrderNumber - arguments: $orderNumber diff --git a/config/services/generators.xml b/config/services/generators.xml index 2c6ec713..cfca0642 100644 --- a/config/services/generators.xml +++ b/config/services/generators.xml @@ -48,7 +48,7 @@ - @SyliusInvoicingPlugin/Invoice/Download/pdf.html.twig + @SyliusInvoicingPlugin/shared/download/pdf.html.twig %sylius_invoicing.template.logo_file% diff --git a/config/services/twig.xml b/config/services/twig.xml new file mode 100644 index 00000000..08d3cda4 --- /dev/null +++ b/config/services/twig.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + diff --git a/config/twig_hooks/admin/invoice/show.yaml b/config/twig_hooks/admin/invoice/show.yaml new file mode 100644 index 00000000..29cb5209 --- /dev/null +++ b/config/twig_hooks/admin/invoice/show.yaml @@ -0,0 +1,198 @@ +sylius_twig_hooks: + hooks: + 'sylius_admin.invoice.show.content': + sections: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections.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' + enabled: '%sylius_invoicing.pdf_generator.enabled%' + priority: 100 + resend: + template: '@SyliusInvoicingPlugin/admin/shared/action/resend.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections': + buyer: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer.html.twig' + priority: 200 + seller: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller.html.twig' + priority: 100 + card: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections.buyer': + first_name: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/first_name.html.twig' + priority: 500 + company: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/company.html.twig' + priority: 400 + street: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/street.html.twig' + priority: 300 + city: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/city.html.twig' + priority: 200 + country_code: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/country_code.html.twig' + priority: 100 + postcode: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/buyer/postcode.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections.seller': + company: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/company.html.twig' + priority: 600 + representative: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/representative.html.twig' + priority: 500 + street: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/street.html.twig' + priority: 400 + city: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/city.html.twig' + priority: 300 + tax_id: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/tax_id.html.twig' + priority: 200 + country_code: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/country_code.html.twig' + priority: 100 + postcode: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/seller/postcode.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections.card': + body: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body.html.twig' + priority: 100 + footer: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/footer.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections.card.body': + table: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections.card.body.table': + header: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header.html.twig' + priority: 200 + body: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body.html.twig' + priority: 100 + footer: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections.card.body.table.header': + no: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/no.html.twig' + priority: 900 + name: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/name.html.twig' + priority: 800 + quantity: + 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/sections/card/body/table/header/unit_net_price.html.twig' + priority: 600 + discounted_unit_net_price: + 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/sections/card/body/table/header/net_value.html.twig' + priority: 400 + tax_rate: + 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/sections/card/body/table/header/tax_amount.html.twig' + priority: 200 + gross_value: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/gross_value.html.twig' + priority: 100 + currency: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/header/currency.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections.card.body.table.body': + no: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/no.html.twig' + priority: 900 + name: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/name.html.twig' + priority: 800 + quantity: + 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/sections/card/body/table/body/unit_net_price.html.twig' + priority: 600 + discounted_unit_net_price: + 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/sections/card/body/table/body/net_value.html.twig' + priority: 400 + tax_rate: + 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/sections/card/body/table/body/tax_amount.html.twig' + priority: 200 + gross_value: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/gross_value.html.twig' + priority: 100 + currency: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/body/currency.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections.card.body.table.footer': + net_total: + 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/sections/card/body/table/footer/taxes_total.html.twig' + priority: 200 + total: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer/total.html.twig' + priority: 100 + tax_items: + template: '@SyliusInvoicingPlugin/admin/invoice/show/content/sections/card/body/table/footer/tax_items.html.twig' + priority: 0 + + 'sylius_admin.invoice.show.content.sections.card.body.table.footer.tax_items': + tax_rate: + 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/sections/card/body/table/footer/tax_items/tax_item.html.twig' + priority: 0 diff --git a/config/twig_hooks/admin/order/show.yaml b/config/twig_hooks/admin/order/show.yaml new file mode 100644 index 00000000..a1091ca6 --- /dev/null +++ b/config/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' + enabled: '%sylius_invoicing.pdf_generator.enabled%' + priority: 100 + resend: + template: '@SyliusInvoicingPlugin/admin/shared/action/resend.html.twig' + priority: 0 diff --git a/config/twig_hooks/shop/order/summary.yaml b/config/twig_hooks/shop/order/summary.yaml new file mode 100644 index 00000000..eea19a29 --- /dev/null +++ b/config/twig_hooks/shop/order/summary.yaml @@ -0,0 +1,57 @@ +sylius_twig_hooks: + hooks: + 'sylius_shop.account.order.show.content.main.summary': + invoices: + component: 'sylius_invoicing:invoice:list' + props: + order: '@=_context.order' + priority: 350 + + 'sylius_shop.account.order.show.content.main.summary.invoices': + card: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.content.main.summary.invoices.card': + head: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/head.html.twig' + priority: 100 + body: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.content.main.summary.invoices.card.body': + table: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.content.main.summary.invoices.card.body.table': + head: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/head.html.twig' + priority: 100 + body: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/body.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.content.main.summary.invoices.card.body.table.head': + number: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/head/number.html.twig' + priority: 200 + issued_at: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/head/issued_at.html.twig' + priority: 100 + actions: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/head/actions.html.twig' + priority: 0 + + 'sylius_shop.account.order.show.content.main.summary.invoices.card.body.table.body': + number: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/body/number.html.twig' + priority: 200 + issued_at: + template: '@SyliusInvoicingPlugin/shop/order/show/content/summary/invoices/card/body/table/body/issued_at.html.twig' + priority: 100 + download: + 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/config/winzou_state_machine.php b/config/winzou_state_machine.php new file mode 100644 index 00000000..05e808c6 --- /dev/null +++ b/config/winzou_state_machine.php @@ -0,0 +1,33 @@ +extension('winzou_state_machine', [ + 'sylius_payment' => [ + 'callbacks' => [ + 'after' => [ + 'sylius_invoicing_payment_complete_producer' => [ + 'on' => ['complete'], + 'do' => ['@sylius_invoicing.event_producer.order_payment_paid', '__invoke'], + 'args' => ['object'], + ], + ], + ], + ], + ]); + } +}; diff --git a/docs/legacy_installation.md b/docs/legacy_installation.md index 4c18a0e4..44171663 100644 --- a/docs/legacy_installation.md +++ b/docs/legacy_installation.md @@ -39,7 +39,7 @@ enabled: true binary: /usr/local/bin/wkhtmltopdf # Change this! :) options: [] - ``` + ``` 1. Apply migrations to your database: diff --git a/docs/screenshot_admin.png b/docs/screenshot_admin.png index ac673e3c..5ee00b33 100644 Binary files a/docs/screenshot_admin.png and b/docs/screenshot_admin.png differ 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 diff --git a/src/DependencyInjection/Compiler/SymfonyClockCompilerPass.php b/src/DependencyInjection/Compiler/SymfonyClockCompilerPass.php deleted file mode 100644 index 872e696b..00000000 --- a/src/DependencyInjection/Compiler/SymfonyClockCompilerPass.php +++ /dev/null @@ -1,32 +0,0 @@ -hasParameter('clock')) { - return; - } - - $container->setDefinition('clock', new Definition(Clock::class)); - } -} diff --git a/src/SyliusInvoicingPlugin.php b/src/SyliusInvoicingPlugin.php index dd2437e1..63ff7b63 100644 --- a/src/SyliusInvoicingPlugin.php +++ b/src/SyliusInvoicingPlugin.php @@ -14,21 +14,12 @@ namespace Sylius\InvoicingPlugin; use Sylius\Bundle\CoreBundle\Application\SyliusPluginTrait; -use Sylius\InvoicingPlugin\DependencyInjection\Compiler\SymfonyClockCompilerPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; final class SyliusInvoicingPlugin extends Bundle { use SyliusPluginTrait; - public function build(ContainerBuilder $container): void - { - parent::build($container); - - $container->addCompilerPass(new SymfonyClockCompilerPass()); - } - public function getPath(): string { return \dirname(__DIR__); diff --git a/src/Twig/Component/Invoice/ListComponent.php b/src/Twig/Component/Invoice/ListComponent.php new file mode 100644 index 00000000..054353f0 --- /dev/null +++ b/src/Twig/Component/Invoice/ListComponent.php @@ -0,0 +1,40 @@ +invoiceRepository->findByOrderNumber($this->order->getNumber()); + } +} diff --git a/templates/Invoice/Admin/_downloadButton.html.twig b/templates/Invoice/Admin/_downloadButton.html.twig deleted file mode 100644 index 77d38468..00000000 --- a/templates/Invoice/Admin/_downloadButton.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -{% set path = path('sylius_invoicing_admin_invoice_download', {'id': invoice.id}) %} - -{{ buttons.default(path, 'sylius_invoicing.ui.download_invoice'|trans, invoice.id, 'download', 'blue') }} diff --git a/templates/Invoice/Admin/_resendButton.html.twig b/templates/Invoice/Admin/_resendButton.html.twig deleted file mode 100644 index b1bd35e0..00000000 --- a/templates/Invoice/Admin/_resendButton.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -{% set path = path('sylius_invoicing_admin_invoice_resend', {'id': invoice.id}) %} - -{{ buttons.default(path, 'sylius_invoicing.ui.resend_invoice'|trans, invoice.id, 'send') }} diff --git a/templates/Invoice/Show/_backButton.html.twig b/templates/Invoice/Show/_backButton.html.twig deleted file mode 100644 index a0e7f049..00000000 --- a/templates/Invoice/Show/_backButton.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -{% set path = path('sylius_invoicing_admin_invoice_index') %} - -{{ buttons.default(path, '', 'back', 'arrow alternate circle left outline') }} diff --git a/templates/Invoice/Show/_billingData.html.twig b/templates/Invoice/Show/_billingData.html.twig deleted file mode 100644 index 444d5b07..00000000 --- a/templates/Invoice/Show/_billingData.html.twig +++ /dev/null @@ -1,17 +0,0 @@ -{% set billingData = invoice.billingData %} - -

- {{ 'sylius_invoicing.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/templates/Invoice/Show/_breadcrumb.html.twig b/templates/Invoice/Show/_breadcrumb.html.twig deleted file mode 100644 index 657be8f9..00000000 --- a/templates/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.ui.invoices'|trans, url: path('sylius_invoicing_admin_invoice_index') }, - { label: invoice.id, url: path('sylius_invoicing_admin_invoice_show', { 'id': invoice.id }) } -] -%} - -{{ breadcrumb.crumble(breadcrumbs) }} diff --git a/templates/Invoice/Show/_header.html.twig b/templates/Invoice/Show/_header.html.twig deleted file mode 100644 index 62fa1da4..00000000 --- a/templates/Invoice/Show/_header.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -

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

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

- {{ 'sylius_invoicing.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/templates/Invoice/show.html.twig b/templates/Invoice/show.html.twig deleted file mode 100644 index d73b2e39..00000000 --- a/templates/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.ui.no'|trans }}{{ 'sylius.ui.name'|trans }}{{ 'sylius.ui.quantity'|trans }}{{ 'sylius_invoicing.ui.unit_net_price'|trans }}{{ 'sylius_invoicing.ui.discounted_unit_net_price'|trans }}{{ 'sylius_invoicing.ui.net_value'|trans }}{{ 'sylius_invoicing.ui.tax_rate'|trans }}{{ 'sylius_invoicing.ui.tax_amount'|trans }}{{ 'sylius_invoicing.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.ui.net_total'|trans }}: - - {{ '%0.2f'|format(invoice.subtotal/100) }} - - {{ invoice.currencyCode }} -
- {{ 'sylius_invoicing.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.ui.tax_rate'|trans }} - - {{ 'sylius_invoicing.ui.tax_amount'|trans }} - - {{ 'sylius.ui.currency'|trans }} -
- {{ item.label }}: - - {{ '%0.2f'|format(item.amount/100) }} - - {{ invoice.currencyCode }} -
-
-
-
- {{ 'sylius_invoicing.ui.payment.paid'|trans }}: - - {% if invoice.paymentState() is constant('Sylius\\InvoicingPlugin\\Entity\\InvoiceInterface::PAYMENT_STATE_COMPLETED') %} - {{ 'sylius_invoicing.ui.payment.yes'|trans }} - {% else %} - {{ 'sylius_invoicing.ui.payment.no'|trans }} - {% endif %} - -
-
-
-{% endblock %} diff --git a/templates/Order/Admin/_invoices.html.twig b/templates/Order/Admin/_invoices.html.twig deleted file mode 100644 index 93e54612..00000000 --- a/templates/Order/Admin/_invoices.html.twig +++ /dev/null @@ -1,34 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -
-

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

- - - - - - - - - - - {% for invoice in invoices %} - - - - - - {% endfor %} - -
{{ 'sylius.ui.number'|trans }}{{ 'sylius.ui.channel'|trans }}{{ 'sylius_invoicing.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/templates/Order/Admin/fetchInvoices.html.twig b/templates/Order/Admin/fetchInvoices.html.twig deleted file mode 100644 index fde5a916..00000000 --- a/templates/Order/Admin/fetchInvoices.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ render(url('sylius_invoicing_admin_order_invoices_partial', {'orderNumber': order.number, 'template': '@SyliusInvoicingPlugin/Order/Admin/_invoices.html.twig'})) }} diff --git a/templates/Order/Shop/_downloadButton.html.twig b/templates/Order/Shop/_downloadButton.html.twig deleted file mode 100644 index b55586ad..00000000 --- a/templates/Order/Shop/_downloadButton.html.twig +++ /dev/null @@ -1,5 +0,0 @@ -{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %} - -{% set path = path('sylius_invoicing_shop_invoice_download', { 'id': invoice.id }) %} - -{{ buttons.default(path, 'sylius_invoicing.ui.download_invoice'|trans, invoice.id, 'download') }} diff --git a/templates/Order/Shop/_invoices.html.twig b/templates/Order/Shop/_invoices.html.twig deleted file mode 100644 index 14d28602..00000000 --- a/templates/Order/Shop/_invoices.html.twig +++ /dev/null @@ -1,45 +0,0 @@ -
-

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

- - - - - - - - - - {% for invoice in invoices %} - - - - - - {% endfor %} - -
{{ 'sylius.ui.number'|trans }}{{ 'sylius_invoicing.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/templates/Order/Shop/fetchInvoices.html.twig b/templates/Order/Shop/fetchInvoices.html.twig deleted file mode 100644 index 978d4df0..00000000 --- a/templates/Order/Shop/fetchInvoices.html.twig +++ /dev/null @@ -1 +0,0 @@ -{{ render(url('sylius_invoicing_shop_order_invoices_partial', {'orderNumber': order.number, 'template': '@SyliusInvoicingPlugin/Order/Shop/_invoices.html.twig'})) }} diff --git a/templates/Invoice/Email/invoiceGenerated.html.twig b/templates/admin/invoice/email/invoice_generated.html.twig similarity index 100% rename from templates/Invoice/Email/invoiceGenerated.html.twig rename to templates/admin/invoice/email/invoice_generated.html.twig diff --git a/templates/admin/invoice/show/content/header/title_block/actions.html.twig b/templates/admin/invoice/show/content/header/title_block/actions.html.twig new file mode 100644 index 00000000..6dd05642 --- /dev/null +++ b/templates/admin/invoice/show/content/header/title_block/actions.html.twig @@ -0,0 +1,3 @@ +
+ {% hook 'actions' %} +
diff --git a/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig b/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig new file mode 100644 index 00000000..3edcf8d1 --- /dev/null +++ b/templates/admin/invoice/show/content/header/title_block/actions/back_to_index.html.twig @@ -0,0 +1,3 @@ + + {{ ux_icon('tabler:arrow-left', {'class': 'icon'}) }} + diff --git a/templates/admin/invoice/show/content/header/title_block/title.html.twig b/templates/admin/invoice/show/content/header/title_block/title.html.twig new file mode 100644 index 00000000..c80e5593 --- /dev/null +++ b/templates/admin/invoice/show/content/header/title_block/title.html.twig @@ -0,0 +1,5 @@ +
+
+ {% hook 'title' %} +
+
diff --git a/templates/admin/invoice/show/content/header/title_block/title/number.html.twig b/templates/admin/invoice/show/content/header/title_block/title/number.html.twig new file mode 100644 index 00000000..4fb9178a --- /dev/null +++ b/templates/admin/invoice/show/content/header/title_block/title/number.html.twig @@ -0,0 +1,3 @@ +

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

diff --git a/templates/admin/invoice/show/content/header/title_block/title/subtitle.html.twig b/templates/admin/invoice/show/content/header/title_block/title/subtitle.html.twig new file mode 100644 index 00000000..30b57583 --- /dev/null +++ b/templates/admin/invoice/show/content/header/title_block/title/subtitle.html.twig @@ -0,0 +1,20 @@ +{% set invoice = hookable_metadata.context.resource %} + +
+ +
diff --git a/templates/admin/invoice/show/content/sections.html.twig b/templates/admin/invoice/show/content/sections.html.twig new file mode 100644 index 00000000..dd8f10ad --- /dev/null +++ b/templates/admin/invoice/show/content/sections.html.twig @@ -0,0 +1,7 @@ +
+
+
+ {% hook 'sections' %} +
+
+
diff --git a/templates/admin/invoice/show/content/sections/buyer.html.twig b/templates/admin/invoice/show/content/sections/buyer.html.twig new file mode 100644 index 00000000..6e89baa8 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/buyer.html.twig @@ -0,0 +1,16 @@ +
+
+
+
+ {{ 'sylius_invoicing.ui.buyer'|trans }} +
+
+
+
+
+ {% hook 'buyer' %} +
+
+
+
+
diff --git a/templates/admin/invoice/show/content/sections/buyer/city.html.twig b/templates/admin/invoice/show/content/sections/buyer/city.html.twig new file mode 100644 index 00000000..b4a2b489 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/buyer/city.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.resource.billingData.city }}
diff --git a/templates/admin/invoice/show/content/sections/buyer/company.html.twig b/templates/admin/invoice/show/content/sections/buyer/company.html.twig new file mode 100644 index 00000000..88cf80c6 --- /dev/null +++ b/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/templates/admin/invoice/show/content/sections/buyer/country_code.html.twig b/templates/admin/invoice/show/content/sections/buyer/country_code.html.twig new file mode 100644 index 00000000..b5199bea --- /dev/null +++ b/templates/admin/invoice/show/content/sections/buyer/country_code.html.twig @@ -0,0 +1 @@ + diff --git a/templates/admin/invoice/show/content/sections/buyer/first_name.html.twig b/templates/admin/invoice/show/content/sections/buyer/first_name.html.twig new file mode 100644 index 00000000..3149e9ef --- /dev/null +++ b/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/templates/admin/invoice/show/content/sections/buyer/postcode.html.twig b/templates/admin/invoice/show/content/sections/buyer/postcode.html.twig new file mode 100644 index 00000000..5b90f5a0 --- /dev/null +++ b/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/templates/admin/invoice/show/content/sections/buyer/street.html.twig b/templates/admin/invoice/show/content/sections/buyer/street.html.twig new file mode 100644 index 00000000..179ffa5e --- /dev/null +++ b/templates/admin/invoice/show/content/sections/buyer/street.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.resource.billingData.street }}
diff --git a/templates/admin/invoice/show/content/sections/card.html.twig b/templates/admin/invoice/show/content/sections/card.html.twig new file mode 100644 index 00000000..d5e00f32 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card.html.twig @@ -0,0 +1,5 @@ +{% set invoice = hookable_metadata.context.resource %} + +
+ {% hook 'card' %} +
diff --git a/templates/admin/invoice/show/content/sections/card/body.html.twig b/templates/admin/invoice/show/content/sections/card/body.html.twig new file mode 100644 index 00000000..44429c31 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body.html.twig @@ -0,0 +1,3 @@ +
+ {% hook 'body' %} +
diff --git a/templates/admin/invoice/show/content/sections/card/body/table.html.twig b/templates/admin/invoice/show/content/sections/card/body/table.html.twig new file mode 100644 index 00000000..e5e75a2c --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table.html.twig @@ -0,0 +1,5 @@ +
+ + {% hook 'table' %} +
+
diff --git a/templates/admin/invoice/show/content/sections/card/body/table/body.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body.html.twig new file mode 100644 index 00000000..895f6351 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/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/templates/admin/invoice/show/content/sections/card/body/table/body/currency.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/currency.html.twig new file mode 100644 index 00000000..3d2cf821 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/body/currency.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.resource.currencyCode }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/body/discounted_unit_net_price.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/discounted_unit_net_price.html.twig new file mode 100644 index 00000000..8346ff93 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/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/templates/admin/invoice/show/content/sections/card/body/table/body/gross_value.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/gross_value.html.twig new file mode 100644 index 00000000..32f0a20d --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/body/gross_value.html.twig @@ -0,0 +1 @@ +{{ '%0.2f'|format(hookable_metadata.context.item.total/100) }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/body/name.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/name.html.twig new file mode 100644 index 00000000..2d706ddc --- /dev/null +++ b/templates/admin/invoice/show/content/sections/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/templates/admin/invoice/show/content/sections/card/body/table/body/net_value.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/net_value.html.twig new file mode 100644 index 00000000..829fecac --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/body/net_value.html.twig @@ -0,0 +1 @@ +{{ '%0.2f'|format(hookable_metadata.context.item.subtotal/100) }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/body/no.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/no.html.twig new file mode 100644 index 00000000..468618da --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/body/no.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.loop.index }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/body/quantity.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/quantity.html.twig new file mode 100644 index 00000000..99592e6b --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/body/quantity.html.twig @@ -0,0 +1 @@ +{{ hookable_metadata.context.item.quantity }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/body/tax_amount.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/tax_amount.html.twig new file mode 100644 index 00000000..617d43f7 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/body/tax_amount.html.twig @@ -0,0 +1 @@ +{{ '%0.2f'|format(hookable_metadata.context.item.taxTotal/100) }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/body/tax_rate.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/tax_rate.html.twig new file mode 100644 index 00000000..8e8ebd72 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/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/templates/admin/invoice/show/content/sections/card/body/table/body/unit_net_price.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/body/unit_net_price.html.twig new file mode 100644 index 00000000..cf702eb1 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/body/unit_net_price.html.twig @@ -0,0 +1 @@ +{{ '%0.2f'|format(hookable_metadata.context.item.unitPrice/100) }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/footer.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/footer.html.twig new file mode 100644 index 00000000..e9653d75 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/footer.html.twig @@ -0,0 +1,3 @@ + + {% hook 'footer' %} + diff --git a/templates/admin/invoice/show/content/sections/card/body/table/footer/net_total.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/footer/net_total.html.twig new file mode 100644 index 00000000..e7911566 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/footer/net_total.html.twig @@ -0,0 +1,5 @@ + + {{ 'sylius_invoicing.ui.net_total'|trans }}: + {{ '%0.2f'|format(hookable_metadata.context.resource.subtotal/100) }} + {{ hookable_metadata.context.resource.currencyCode }} + diff --git a/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items.html.twig new file mode 100644 index 00000000..9bb60fa8 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items.html.twig @@ -0,0 +1,14 @@ +{% if hookable_metadata.context.resource.taxItems.count() > 0 %} + + {{ 'sylius_invoicing.ui.tax_rate'|trans }} + {{ 'sylius_invoicing.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/tests/Application/gulpfile.babel.js b/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_item.html.twig similarity index 100% rename from tests/Application/gulpfile.babel.js rename to templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_item.html.twig diff --git a/tests/Application/public/media/image/.gitignore b/templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_rate.html.twig similarity index 100% rename from tests/Application/public/media/image/.gitignore rename to templates/admin/invoice/show/content/sections/card/body/table/footer/tax_items/tax_rate.html.twig diff --git a/templates/admin/invoice/show/content/sections/card/body/table/footer/taxes_total.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/footer/taxes_total.html.twig new file mode 100644 index 00000000..e356651c --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/footer/taxes_total.html.twig @@ -0,0 +1,5 @@ + + {{ 'sylius_invoicing.ui.taxes_total'|trans }}: + {{ '%0.2f'|format(hookable_metadata.context.resource.taxesTotal/100) }} + {{ hookable_metadata.context.resource.currencyCode }} + diff --git a/templates/admin/invoice/show/content/sections/card/body/table/footer/total.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/footer/total.html.twig new file mode 100644 index 00000000..3f6791da --- /dev/null +++ b/templates/admin/invoice/show/content/sections/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/templates/admin/invoice/show/content/sections/card/body/table/header.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header.html.twig new file mode 100644 index 00000000..8b3926f5 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header.html.twig @@ -0,0 +1,5 @@ + + + {% hook 'header' %} + + diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/currency.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/currency.html.twig new file mode 100644 index 00000000..bb8d9b9d --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/currency.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.currency'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/discounted_unit_net_price.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/discounted_unit_net_price.html.twig new file mode 100644 index 00000000..bd01e80d --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/discounted_unit_net_price.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing.ui.discounted_unit_net_price'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/gross_value.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/gross_value.html.twig new file mode 100644 index 00000000..cd89f650 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/gross_value.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing.ui.gross_value'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/name.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/name.html.twig new file mode 100644 index 00000000..ec340a10 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/name.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.name'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/net_value.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/net_value.html.twig new file mode 100644 index 00000000..700a84ea --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/net_value.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing.ui.net_value'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/no.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/no.html.twig new file mode 100644 index 00000000..d5232429 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/no.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing.ui.no'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/quantity.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/quantity.html.twig new file mode 100644 index 00000000..2174fe59 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/quantity.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.quantity'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/tax_amount.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/tax_amount.html.twig new file mode 100644 index 00000000..6ea556b8 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/tax_amount.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing.ui.tax_amount'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/tax_rate.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/tax_rate.html.twig new file mode 100644 index 00000000..6e7a4a62 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/tax_rate.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing.ui.tax_rate'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/body/table/header/unit_net_price.html.twig b/templates/admin/invoice/show/content/sections/card/body/table/header/unit_net_price.html.twig new file mode 100644 index 00000000..308c1721 --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/body/table/header/unit_net_price.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing.ui.unit_net_price'|trans }} diff --git a/templates/admin/invoice/show/content/sections/card/footer.html.twig b/templates/admin/invoice/show/content/sections/card/footer.html.twig new file mode 100644 index 00000000..2649cfbc --- /dev/null +++ b/templates/admin/invoice/show/content/sections/card/footer.html.twig @@ -0,0 +1,12 @@ + diff --git a/templates/admin/invoice/show/content/sections/seller.html.twig b/templates/admin/invoice/show/content/sections/seller.html.twig new file mode 100644 index 00000000..cb8ff63b --- /dev/null +++ b/templates/admin/invoice/show/content/sections/seller.html.twig @@ -0,0 +1,20 @@ +{% set shop_billing_data = hookable_metadata.context.resource.shopBillingData %} + +{% if shop_billing_data %} +
+
+
+
+ {{ 'sylius_invoicing.ui.seller'|trans }} +
+
+
+
+
+ {% hook 'seller' %} +
+
+
+
+
+{% endif %} diff --git a/templates/admin/invoice/show/content/sections/seller/city.html.twig b/templates/admin/invoice/show/content/sections/seller/city.html.twig new file mode 100644 index 00000000..bee092b0 --- /dev/null +++ b/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/templates/admin/invoice/show/content/sections/seller/company.html.twig b/templates/admin/invoice/show/content/sections/seller/company.html.twig new file mode 100644 index 00000000..b0da0fbd --- /dev/null +++ b/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/templates/admin/invoice/show/content/sections/seller/country_code.html.twig b/templates/admin/invoice/show/content/sections/seller/country_code.html.twig new file mode 100644 index 00000000..f5f15bb2 --- /dev/null +++ b/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/templates/admin/invoice/show/content/sections/seller/postcode.html.twig b/templates/admin/invoice/show/content/sections/seller/postcode.html.twig new file mode 100644 index 00000000..fedcb1e3 --- /dev/null +++ b/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/templates/admin/invoice/show/content/sections/seller/representative.html.twig b/templates/admin/invoice/show/content/sections/seller/representative.html.twig new file mode 100644 index 00000000..d174c930 --- /dev/null +++ b/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/templates/admin/invoice/show/content/sections/seller/street.html.twig b/templates/admin/invoice/show/content/sections/seller/street.html.twig new file mode 100644 index 00000000..80f03ec8 --- /dev/null +++ b/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/templates/admin/invoice/show/content/sections/seller/tax_id.html.twig b/templates/admin/invoice/show/content/sections/seller/tax_id.html.twig new file mode 100644 index 00000000..ab1b0ca9 --- /dev/null +++ b/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/templates/admin/order/show/content/sections/invoices/table.html.twig b/templates/admin/order/show/content/sections/invoices/table.html.twig new file mode 100644 index 00000000..cb31eea6 --- /dev/null +++ b/templates/admin/order/show/content/sections/invoices/table.html.twig @@ -0,0 +1,10 @@ +
+
+
+ {{ 'sylius_invoicing.ui.invoices'|trans }} +
+
+ + {% hook 'table' %} +
+
diff --git a/templates/admin/order/show/content/sections/invoices/table/body.html.twig b/templates/admin/order/show/content/sections/invoices/table/body.html.twig new file mode 100644 index 00000000..a2121a0e --- /dev/null +++ b/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/templates/admin/order/show/content/sections/invoices/table/body/actions.html.twig b/templates/admin/order/show/content/sections/invoices/table/body/actions.html.twig new file mode 100644 index 00000000..82679abd --- /dev/null +++ b/templates/admin/order/show/content/sections/invoices/table/body/actions.html.twig @@ -0,0 +1,3 @@ + + {% hook 'actions' %} + diff --git a/templates/admin/order/show/content/sections/invoices/table/body/channel.html.twig b/templates/admin/order/show/content/sections/invoices/table/body/channel.html.twig new file mode 100644 index 00000000..51f85b49 --- /dev/null +++ b/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/templates/admin/order/show/content/sections/invoices/table/body/issued_at.html.twig b/templates/admin/order/show/content/sections/invoices/table/body/issued_at.html.twig new file mode 100644 index 00000000..ff38fe43 --- /dev/null +++ b/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/templates/admin/order/show/content/sections/invoices/table/body/number.html.twig b/templates/admin/order/show/content/sections/invoices/table/body/number.html.twig new file mode 100644 index 00000000..a005e16d --- /dev/null +++ b/templates/admin/order/show/content/sections/invoices/table/body/number.html.twig @@ -0,0 +1,3 @@ + + {{ hookable_metadata.context.invoice.number }} + diff --git a/templates/admin/order/show/content/sections/invoices/table/head.html.twig b/templates/admin/order/show/content/sections/invoices/table/head.html.twig new file mode 100644 index 00000000..34449406 --- /dev/null +++ b/templates/admin/order/show/content/sections/invoices/table/head.html.twig @@ -0,0 +1,5 @@ + + + {% hook 'head' %} + + diff --git a/templates/admin/order/show/content/sections/invoices/table/head/actions.html.twig b/templates/admin/order/show/content/sections/invoices/table/head/actions.html.twig new file mode 100644 index 00000000..204784dd --- /dev/null +++ b/templates/admin/order/show/content/sections/invoices/table/head/actions.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.actions'|trans }} diff --git a/templates/admin/order/show/content/sections/invoices/table/head/channel.html.twig b/templates/admin/order/show/content/sections/invoices/table/head/channel.html.twig new file mode 100644 index 00000000..59186e6a --- /dev/null +++ b/templates/admin/order/show/content/sections/invoices/table/head/channel.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.channel'|trans }} diff --git a/templates/admin/order/show/content/sections/invoices/table/head/issued_at.html.twig b/templates/admin/order/show/content/sections/invoices/table/head/issued_at.html.twig new file mode 100644 index 00000000..1d7b6540 --- /dev/null +++ b/templates/admin/order/show/content/sections/invoices/table/head/issued_at.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing.ui.issued_at'|trans }} diff --git a/templates/admin/order/show/content/sections/invoices/table/head/number.html.twig b/templates/admin/order/show/content/sections/invoices/table/head/number.html.twig new file mode 100644 index 00000000..d7da088a --- /dev/null +++ b/templates/admin/order/show/content/sections/invoices/table/head/number.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.number'|trans }} diff --git a/templates/admin/shared/action/download.html.twig b/templates/admin/shared/action/download.html.twig new file mode 100644 index 00000000..539fda01 --- /dev/null +++ b/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_admin_invoice_download', {'id': invoice.id}) %} + + + + + + + + {{ 'sylius_invoicing.ui.download_invoice'|trans }} + diff --git a/templates/admin/shared/action/resend.html.twig b/templates/admin/shared/action/resend.html.twig new file mode 100644 index 00000000..fb93c147 --- /dev/null +++ b/templates/admin/shared/action/resend.html.twig @@ -0,0 +1,14 @@ +{% 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_admin_invoice_resend', {'id': invoice.id}) %} + + + {{ ux_icon('tabler:send', {'class': 'icon'}) }} + {{ 'sylius_invoicing.ui.resend_invoice'|trans }} + diff --git a/templates/shared/components/invoices.html.twig b/templates/shared/components/invoices.html.twig new file mode 100644 index 00000000..31d029b5 --- /dev/null +++ b/templates/shared/components/invoices.html.twig @@ -0,0 +1 @@ +{% hook 'invoices' with { invoices }%} diff --git a/templates/Invoice/Download/pdf.html.twig b/templates/shared/download/pdf.html.twig similarity index 99% rename from templates/Invoice/Download/pdf.html.twig rename to templates/shared/download/pdf.html.twig index d765e3ed..159d7177 100644 --- a/templates/Invoice/Download/pdf.html.twig +++ b/templates/shared/download/pdf.html.twig @@ -1,4 +1,4 @@ -{% extends '@SyliusInvoicingPlugin/Invoice/Download/pdfLayout.html.twig' %} +{% extends '@SyliusInvoicingPlugin/shared/download/pdf_layout.html.twig' %} {% set shopBillingData = invoice.shopBillingData %} {% set localeCode = invoice.localeCode %} diff --git a/templates/Invoice/Download/pdfLayout.html.twig b/templates/shared/download/pdf_layout.html.twig similarity index 100% rename from templates/Invoice/Download/pdfLayout.html.twig rename to templates/shared/download/pdf_layout.html.twig diff --git a/templates/shop/order/show/content/summary/invoices/card.html.twig b/templates/shop/order/show/content/summary/invoices/card.html.twig new file mode 100644 index 00000000..6f224ede --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card.html.twig @@ -0,0 +1,4 @@ +
+ {% hook 'card' %} +
+ diff --git a/templates/shop/order/show/content/summary/invoices/card/body.html.twig b/templates/shop/order/show/content/summary/invoices/card/body.html.twig new file mode 100644 index 00000000..44429c31 --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/body.html.twig @@ -0,0 +1,3 @@ +
+ {% hook 'body' %} +
diff --git a/templates/shop/order/show/content/summary/invoices/card/body/table.html.twig b/templates/shop/order/show/content/summary/invoices/card/body/table.html.twig new file mode 100644 index 00000000..bf647260 --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/body/table.html.twig @@ -0,0 +1,3 @@ + + {% hook 'table' %} +
diff --git a/templates/shop/order/show/content/summary/invoices/card/body/table/body.html.twig b/templates/shop/order/show/content/summary/invoices/card/body/table/body.html.twig new file mode 100644 index 00000000..e45c4a5d --- /dev/null +++ b/templates/shop/order/show/content/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/templates/shop/order/show/content/summary/invoices/card/body/table/body/download.html.twig b/templates/shop/order/show/content/summary/invoices/card/body/table/body/download.html.twig new file mode 100644 index 00000000..1016fc79 --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/body/table/body/download.html.twig @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/templates/shop/order/show/content/summary/invoices/card/body/table/body/issued_at.html.twig b/templates/shop/order/show/content/summary/invoices/card/body/table/body/issued_at.html.twig new file mode 100644 index 00000000..ca1bad11 --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/body/table/body/issued_at.html.twig @@ -0,0 +1,3 @@ + + {{ hookable_metadata.context.invoice.issuedAt|format_date }} + diff --git a/templates/shop/order/show/content/summary/invoices/card/body/table/body/number.html.twig b/templates/shop/order/show/content/summary/invoices/card/body/table/body/number.html.twig new file mode 100644 index 00000000..a4b46f22 --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/body/table/body/number.html.twig @@ -0,0 +1,3 @@ + + {{ hookable_metadata.context.invoice.number }} + diff --git a/templates/shop/order/show/content/summary/invoices/card/body/table/head.html.twig b/templates/shop/order/show/content/summary/invoices/card/body/table/head.html.twig new file mode 100644 index 00000000..ecab3bde --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/body/table/head.html.twig @@ -0,0 +1,5 @@ + + + {% hook 'head' %} + + diff --git a/templates/shop/order/show/content/summary/invoices/card/body/table/head/actions.html.twig b/templates/shop/order/show/content/summary/invoices/card/body/table/head/actions.html.twig new file mode 100644 index 00000000..204784dd --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/body/table/head/actions.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.actions'|trans }} diff --git a/templates/shop/order/show/content/summary/invoices/card/body/table/head/issued_at.html.twig b/templates/shop/order/show/content/summary/invoices/card/body/table/head/issued_at.html.twig new file mode 100644 index 00000000..1d7b6540 --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/body/table/head/issued_at.html.twig @@ -0,0 +1 @@ +{{ 'sylius_invoicing.ui.issued_at'|trans }} diff --git a/templates/shop/order/show/content/summary/invoices/card/body/table/head/number.html.twig b/templates/shop/order/show/content/summary/invoices/card/body/table/head/number.html.twig new file mode 100644 index 00000000..d7da088a --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/body/table/head/number.html.twig @@ -0,0 +1 @@ +{{ 'sylius.ui.number'|trans }} diff --git a/templates/shop/order/show/content/summary/invoices/card/head.html.twig b/templates/shop/order/show/content/summary/invoices/card/head.html.twig new file mode 100644 index 00000000..a7d4cbb3 --- /dev/null +++ b/templates/shop/order/show/content/summary/invoices/card/head.html.twig @@ -0,0 +1,3 @@ +
+ {{ 'sylius_invoicing.ui.invoices'|trans }} +
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 03139abe..d915105f 100644 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -29,12 +29,6 @@ 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], @@ -46,7 +40,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], @@ -56,7 +50,13 @@ 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\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], + Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true], + Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true], Sylius\Abstraction\StateMachine\SyliusStateMachineAbstractionBundle::class => ['all' => true], + Symfony\UX\Icons\UXIconsBundle::class => ['all' => true], ]; diff --git a/tests/Application/config/packages/_sylius.yaml b/tests/Application/config/packages/_sylius.yaml index 71fdda2e..4fbc0d1f 100644 --- a/tests/Application/config/packages/_sylius.yaml +++ b/tests/Application/config/packages/_sylius.yaml @@ -1,13 +1,11 @@ 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/config/config.yaml" } - + - { resource: "@SyliusPayumBundle/Resources/config/app/config.yaml" } - { 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/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/http_discovery.yaml b/tests/Application/config/packages/http_discovery.yaml new file mode 100644 index 00000000..2a789e73 --- /dev/null +++ b/tests/Application/config/packages/http_discovery.yaml @@ -0,0 +1,10 @@ +services: + Psr\Http\Message\RequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ResponseFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\ServerRequestFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\StreamFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UploadedFileFactoryInterface: '@http_discovery.psr17_factory' + Psr\Http\Message\UriFactoryInterface: '@http_discovery.psr17_factory' + + http_discovery.psr17_factory: + class: Http\Discovery\Psr17Factory 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..af38e750 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 @@ -18,6 +17,7 @@ security: context: admin pattern: "%sylius.security.admin_regex%" provider: sylius_admin_user_provider + user_checker: security.user_checker.chain.admin form_login: provider: sylius_admin_user_provider login_path: sylius_admin_login @@ -39,26 +39,28 @@ security: path: sylius_admin_logout target: sylius_admin_login - new_api_admin_user: - pattern: "%sylius.security.new_api_admin_regex%/.*" + api_admin: + pattern: "%sylius.security.api_admin_regex%/.*" provider: sylius_api_admin_user_provider + user_checker: security.user_checker.chain.api_admin stateless: true entry_point: jwt json_login: - check_path: "%sylius.security.new_api_admin_route%/authentication-token" + check_path: "%sylius.security.api_admin_route%/administrators/token" username_path: email password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success failure_handler: lexik_jwt_authentication.handler.authentication_failure jwt: true - new_api_shop_user: - pattern: "%sylius.security.new_api_shop_regex%/.*" + api_shop: + pattern: "%sylius.security.api_shop_regex%/.*" provider: sylius_api_shop_user_provider + user_checker: security.user_checker.chain.api_shop stateless: true entry_point: jwt json_login: - check_path: "%sylius.security.new_api_shop_route%/authentication-token" + check_path: "%sylius.security.api_shop_route%/customers/token" username_path: email password_path: password success_handler: lexik_jwt_authentication.handler.authentication_success @@ -70,6 +72,7 @@ security: context: shop pattern: "%sylius.security.shop_regex%" provider: sylius_shop_user_provider + user_checker: security.user_checker.chain.shop form_login: success_handler: sylius.authentication.success_handler failure_handler: sylius.authentication.failure_handler @@ -83,6 +86,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 @@ -93,16 +102,15 @@ 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 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 +122,9 @@ 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_user_account_regex%/.*", role: ROLE_USER } - - { path: "%sylius.security.new_api_shop_route%/authentication-token", role: PUBLIC_ACCESS } - - { path: "%sylius.security.new_api_shop_regex%/.*", role: PUBLIC_ACCESS } + - { path: "%sylius.security.api_admin_route%/administrators/reset-password", role: PUBLIC_ACCESS } + - { path: "%sylius.security.api_admin_regex%/.*", role: ROLE_API_ACCESS } + - { path: "%sylius.security.api_admin_route%/administrators/token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.api_shop_account_regex%/.*", role: ROLE_USER } + - { path: "%sylius.security.api_shop_route%/customers/token", role: PUBLIC_ACCESS } + - { path: "%sylius.security.api_shop_regex%/.*", role: PUBLIC_ACCESS } diff --git a/tests/Application/config/packages/sylius_state_machine_abstraction.yaml b/tests/Application/config/packages/sylius_state_machine_abstraction.yaml deleted file mode 100644 index a2043583..00000000 --- a/tests/Application/config/packages/sylius_state_machine_abstraction.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%' 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/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/packages/winzou_state_machine.yaml b/tests/Application/config/packages/winzou_state_machine.yaml deleted file mode 100644 index 1e3fba4e..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_payment_complete_producer: - on: ['complete'] - do: ['@sylius_invoicing.event_producer.order_payment_paid', '__invoke'] - args: ['object'] diff --git a/tests/Application/config/routes/sylius_api.yaml b/tests/Application/config/routes/sylius_api.yaml index ae01ffce..a7504e86 100644 --- a/tests/Application/config/routes/sylius_api.yaml +++ b/tests/Application/config/routes/sylius_api.yaml @@ -1,3 +1,3 @@ sylius_api: resource: "@SyliusApiBundle/Resources/config/routing.yml" - prefix: "%sylius.security.new_api_route%" + prefix: "%sylius.security.api_route%" diff --git a/tests/Application/config/routes/sylius_shop.yaml b/tests/Application/config/routes/sylius_shop.yaml index 9116420d..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: "@SyliusShopBundle/Resources/config/routing/payum.yml" + 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.controller.shop.locale_switch::switchAction + _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/package.json b/tests/Application/package.json index d7847319..d0538e4c 100644 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -1,68 +1,20 @@ { - "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" - }, - "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" - }, - "engines": { - "node": "^18 || ^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" + "dependencies": { + "@sylius-ui/admin": "file:../../vendor/sylius/sylius/src/Sylius/Bundle/AdminBundle", + "@sylius-ui/shop": "file:../../vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle", + "@symfony/ux-autocomplete": "file:../../vendor/symfony/ux-autocomplete/assets", + "@symfony/ux-live-component": "file:../../vendor/symfony/ux-live-component/assets" }, - "author": "Paweł Jędrzejewski", - "license": "MIT" + "devDependencies": { + "@hotwired/stimulus": "^3.0.0", + "@symfony/stimulus-bridge": "^3.2.0", + "@symfony/webpack-encore": "^5.0.1", + "tom-select": "^2.2.2" + } } 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/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 @@ -
- - Sylius logo - -
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') }} 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]; 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/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/Page/Admin/Invoice/ShowPage.php b/tests/Behat/Page/Admin/Invoice/ShowPage.php index 63548a0a..92d176e7 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 d73d5bb6..5f34059a 100644 --- a/tests/Behat/Resources/services.xml +++ b/tests/Behat/Resources/services.xml @@ -10,8 +10,8 @@ - - + +
@@ -42,7 +42,7 @@ - +