Skip to content

Commit

Permalink
Merge branch '1.0' into 2.0
Browse files Browse the repository at this point in the history
* 1.0:
  Update docs
  update upgrade file
  Grids
  Routes
  Replace the sylius_invoicing_plugin prefix with sylius_invoicing
  • Loading branch information
GSadee committed Nov 25, 2024
2 parents 1fa568c + ae6a529 commit 86d4105
Show file tree
Hide file tree
Showing 22 changed files with 136 additions and 122 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ You can read more about Resources here:
Hence, the template for displaying the list of Invoices is defined in the `routing.yml` file:
```yaml
sylius_invoicing_plugin_invoice:
sylius_invoicing_invoice:
resource: |
alias: sylius_invoicing_plugin.invoice
alias: sylius_invoicing.invoice
section: admin
templates: "@SyliusAdmin\\Crud"
only: ['index']
grid: sylius_invoicing_plugin_invoice
grid: sylius_invoicing_invoice
permission: true
vars:
all:
Expand Down
18 changes: 9 additions & 9 deletions config/admin_routes.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
sylius_invoicing_plugin_invoice:
sylius_invoicing_invoice:
resource: |
alias: sylius_invoicing_plugin.invoice
alias: sylius_invoicing.invoice
section: admin
templates: "@SyliusAdmin\\shared\\crud"
only: ['index']
grid: sylius_invoicing_plugin_invoice
grid: sylius_invoicing_invoice
permission: true
vars:
all:
Expand All @@ -15,24 +15,24 @@ sylius_invoicing_plugin_invoice:
icon: inbox
type: sylius.resource

sylius_invoicing_plugin_admin_invoice_show:
sylius_invoicing_admin_invoice_show:
path: /invoices/{id}
methods: [GET]
defaults:
_controller: sylius_invoicing_plugin.controller.invoice::showAction
_controller: sylius_invoicing.controller.invoice::showAction
_sylius:
section: admin
permission: true
template: "@SyliusAdmin/shared/crud/show.html.twig"

sylius_invoicing_plugin_admin_invoice_download:
sylius_invoicing_admin_invoice_download:
path: /invoices/{id}/download
methods: [GET]
defaults:
_controller: sylius_invoicing_plugin.ui.action.download_invoice
_controller: sylius_invoicing.controller.download_invoice

sylius_invoicing_plugin_admin_invoice_resend:
sylius_invoicing_admin_invoice_resend:
path: /invoices/{id}/resend
methods: [GET]
defaults:
_controller: sylius_invoicing_plugin.ui.action.resend_invoice
_controller: sylius_invoicing.controller.resend_invoice
8 changes: 4 additions & 4 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ sylius_grid:
action:
download: '@SyliusInvoicingPlugin/admin/shared/action/download.html.twig'
grids:
sylius_invoicing_plugin_invoice:
sylius_invoicing_invoice:
driver:
name: doctrine/orm
options:
class: '%sylius_invoicing_plugin.model.invoice.class%'
class: '%sylius_invoicing.model.invoice.class%'
sorting:
issuedAt: desc
fields:
Expand Down Expand Up @@ -89,7 +89,7 @@ sylius_grid:
enabled: '%sylius_invoicing.pdf_generator.enabled%'
options:
link:
route: sylius_invoicing_plugin_admin_invoice_download
route: sylius_invoicing_admin_invoice_download
parameters:
id: resource.id
resend:
Expand All @@ -98,7 +98,7 @@ sylius_grid:
icon: "tabler:send"
options:
link:
route: sylius_invoicing_plugin_admin_invoice_resend
route: sylius_invoicing_admin_invoice_resend
parameters:
id: resource.id

Expand Down
38 changes: 22 additions & 16 deletions config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,52 @@
<services>
<defaults public="true" />

<service id="sylius_invoicing_plugin.email.invoice_email_sender" class="Sylius\InvoicingPlugin\Email\InvoiceEmailSender">
<service id="sylius_invoicing.email.invoice_email_sender" class="Sylius\InvoicingPlugin\Email\InvoiceEmailSender">
<argument type="service" id="sylius.email_sender" />
<argument type="service" id="Sylius\InvoicingPlugin\Provider\InvoiceFileProviderInterface" />
<argument type="service" id="sylius_invoicing.provider.invoice_file" />
<argument>%sylius_invoicing.pdf_generator.enabled%</argument>
</service>
<service id="Sylius\InvoicingPlugin\Email\InvoiceEmailSenderInterface" alias="sylius_invoicing.email.invoice_email_sender" />

<service id="sylius_invoicing_plugin.command_handler.send_invoice_email" class="Sylius\InvoicingPlugin\CommandHandler\SendInvoiceEmailHandler">
<argument type="service" id="sylius_invoicing_plugin.repository.invoice" />
<service id="sylius_invoicing.command_handler.send_invoice_email" class="Sylius\InvoicingPlugin\CommandHandler\SendInvoiceEmailHandler">
<argument type="service" id="sylius_invoicing.repository.invoice" />
<argument type="service" id="sylius.repository.order" />
<argument type="service" id="sylius_invoicing_plugin.email.invoice_email_sender" />
<argument type="service" id="sylius_invoicing.email.invoice_email_sender" />
<tag name="messenger.message_handler" />
</service>

<service id="sylius_invoicing_plugin_security.voter.invoice" class="Sylius\InvoicingPlugin\Security\Voter\InvoiceVoter">
<service id="sylius_invoicing.security.voter.invoice" class="Sylius\InvoicingPlugin\Security\Voter\InvoiceVoter">
<argument type="service" id="sylius.repository.order" />
<tag name="security.voter" />
</service>

<service id="sylius_invoicing_plugin.provider.tax_rate_percentage" class="Sylius\InvoicingPlugin\Provider\TaxRatePercentageProvider" />
<service id="sylius_invoicing.provider.tax_rate_percentage" class="Sylius\InvoicingPlugin\Provider\TaxRatePercentageProvider" />
<service id="Sylius\InvoicingPlugin\Provider\TaxRatePercentageProviderInterface" alias="sylius_invoicing.provider.tax_rate_percentage" />

<service id="sylius_invoicing_plugin.custom_factory.invoice" class="Sylius\InvoicingPlugin\Factory\InvoiceFactory">
<argument>%sylius_invoicing_plugin.model.invoice.class%</argument>
<argument type="service" id="sylius_invoicing_plugin.factory.shop_billing_data" />
<service id="sylius_invoicing.custom_factory.invoice" class="Sylius\InvoicingPlugin\Factory\InvoiceFactory">
<argument>%sylius_invoicing.model.invoice.class%</argument>
<argument type="service" id="sylius_invoicing.factory.shop_billing_data" />
</service>
<service id="Sylius\InvoicingPlugin\Factory\InvoiceFactoryInterface" alias="sylius_invoicing.custom_factory.invoice" />

<service id="Sylius\InvoicingPlugin\Manager\InvoiceFileManagerInterface" class="Sylius\InvoicingPlugin\Manager\InvoiceFileManager">
<service id="sylius_invoicing.manager.invoice_file" class="Sylius\InvoicingPlugin\Manager\InvoiceFileManager">
<argument type="service" id="gaufrette.sylius_invoicing_invoice_filesystem" />
</service>
<service id="Sylius\InvoicingPlugin\Manager\InvoiceFileManagerInterface" alias="sylius_invoicing.manager.invoice_file" />

<service id="Sylius\InvoicingPlugin\Provider\InvoiceFileProviderInterface" class="Sylius\InvoicingPlugin\Provider\InvoiceFileProvider">
<argument type="service" id="Sylius\InvoicingPlugin\Generator\InvoiceFileNameGeneratorInterface" />
<service id="sylius_invoicing.provider.invoice_file" class="Sylius\InvoicingPlugin\Provider\InvoiceFileProvider">
<argument type="service" id="sylius_invoicing.generator.invoice_file_name" />
<argument type="service" id="gaufrette.sylius_invoicing_invoice_filesystem" />
<argument type="service" id="sylius_invoicing_plugin.generator.invoice_pdf_file" />
<argument type="service" id="Sylius\InvoicingPlugin\Manager\InvoiceFileManagerInterface" />
<argument type="service" id="sylius_invoicing.generator.invoice_pdf_file" />
<argument type="service" id="sylius_invoicing.manager.invoice_file" />
<argument>%sylius_invoicing.invoice_save_path%</argument>
</service>
<service id="Sylius\InvoicingPlugin\Provider\InvoiceFileProviderInterface" alias="sylius_invoicing.provider.invoice_file" />

<service
id="Sylius\InvoicingPlugin\Provider\UnitNetPriceProviderInterface"
id="sylius_invoicing.provider.unit_net_price"
class="Sylius\InvoicingPlugin\Provider\UnitNetPriceProvider"
/>
<service id="Sylius\InvoicingPlugin\Provider\UnitNetPriceProviderInterface" alias="sylius_invoicing.provider.unit_net_price" />
</services>
</container>
12 changes: 6 additions & 6 deletions config/services/actions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<services>
<defaults public="true" />

<service id="sylius_invoicing_plugin.ui.action.download_invoice" class="Sylius\InvoicingPlugin\Ui\Action\DownloadInvoiceAction">
<argument type="service" id="sylius_invoicing_plugin.repository.invoice" />
<service id="sylius_invoicing.controller.download_invoice" class="Sylius\InvoicingPlugin\Ui\Action\DownloadInvoiceAction">
<argument type="service" id="sylius_invoicing.repository.invoice" />
<argument type="service" id="security.authorization_checker" />
<argument type="service" id="Sylius\InvoicingPlugin\Provider\InvoiceFileProviderInterface" />
<argument type="service" id="sylius_invoicing.provider.invoice_file" />
<argument>%sylius_invoicing.pdf_generator.enabled%</argument>
</service>

<service id="sylius_invoicing_plugin.ui.action.resend_invoice" class="Sylius\InvoicingPlugin\Ui\Action\Admin\ResendInvoiceAction">
<argument type="service" id="sylius_invoicing_plugin.repository.invoice" />
<argument type="service" id="sylius_invoicing_plugin.email.invoice_email_sender" />
<service id="sylius_invoicing.controller.resend_invoice" class="Sylius\InvoicingPlugin\Ui\Action\Admin\ResendInvoiceAction">
<argument type="service" id="sylius_invoicing.repository.invoice" />
<argument type="service" id="sylius_invoicing.email.invoice_email_sender" />
<argument type="service" id="sylius.repository.order" />
<argument type="service" id="router" />
<argument type="service" id="request_stack" />
Expand Down
4 changes: 2 additions & 2 deletions config/services/cli.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<services>
<defaults public="true" />

<service id="sylius_invoicing_plugin.cli.generate_invoices" class="Sylius\InvoicingPlugin\Cli\GenerateInvoicesCommand">
<argument type="service" id="sylius_invoicing_plugin.creator.mass_invoices" />
<service id="sylius_invoicing.cli.generate_invoices" class="Sylius\InvoicingPlugin\Cli\GenerateInvoicesCommand">
<argument type="service" id="sylius_invoicing.creator.mass_invoices" />
<argument type="service" id="sylius.repository.order" />
<tag name="console.command" />
</service>
Expand Down
21 changes: 11 additions & 10 deletions config/services/converters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
<services>
<defaults public="true" />

<service id="sylius_invoicing_plugin.converter.order_item_units_to_line_items" class="Sylius\InvoicingPlugin\Converter\OrderItemUnitsToLineItemsConverter">
<argument type="service" id="sylius_invoicing_plugin.provider.tax_rate_percentage" />
<argument type="service" id="sylius_invoicing_plugin.factory.line_item" />
<argument type="service" id="Sylius\InvoicingPlugin\Provider\UnitNetPriceProviderInterface" />
<service id="sylius_invoicing.converter.order_item_units_to_line_items" class="Sylius\InvoicingPlugin\Converter\OrderItemUnitsToLineItemsConverter">
<argument type="service" id="sylius_invoicing.provider.tax_rate_percentage" />
<argument type="service" id="sylius_invoicing.factory.line_item" />
<argument type="service" id="sylius_invoicing.provider.unit_net_price" />
</service>

<service id="sylius_invoicing_plugin.converter.shipping_adjustments_to_line_items" class="Sylius\InvoicingPlugin\Converter\ShippingAdjustmentsToLineItemsConverter">
<argument type="service" id="sylius_invoicing_plugin.provider.tax_rate_percentage" />
<argument type="service" id="sylius_invoicing_plugin.factory.line_item" />
<service id="sylius_invoicing.converter.shipping_adjustments_to_line_items" class="Sylius\InvoicingPlugin\Converter\ShippingAdjustmentsToLineItemsConverter">
<argument type="service" id="sylius_invoicing.provider.tax_rate_percentage" />
<argument type="service" id="sylius_invoicing.factory.line_item" />
</service>

<service id="sylius_invoicing_plugin.converter.tax_items" class="Sylius\InvoicingPlugin\Converter\TaxItemsConverter">
<argument type="service" id="sylius_invoicing_plugin.provider.tax_rate_percentage" />
<argument type="service" id="sylius_invoicing_plugin.factory.tax_item" />
<service id="sylius_invoicing.converter.tax_items" class="Sylius\InvoicingPlugin\Converter\TaxItemsConverter">
<argument type="service" id="sylius_invoicing.provider.tax_rate_percentage" />
<argument type="service" id="sylius_invoicing.factory.tax_item" />
</service>
<service id="Sylius\InvoicingPlugin\Converter\TaxItemsConverterInterface" alias="sylius_invoicing.converter.tax_items" />
</services>
</container>
8 changes: 4 additions & 4 deletions config/services/fixtures.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
<services>
<defaults public="true" />

<service id="sylius_invoicing_plugin.fixture.example_factory.invoicing_plugin_shop_billing_data" class="Sylius\InvoicingPlugin\Fixture\Factory\ShopBillingDataExampleFactory">
<service id="sylius_invoicing.fixture.example_factory.invoicing_plugin_shop_billing_data" class="Sylius\InvoicingPlugin\Fixture\Factory\ShopBillingDataExampleFactory">
<argument id="sylius.repository.channel" type="service"/>
<argument id="sylius.factory.shop_billing_data" type="service"/>
</service>

<service id="sylius_invoicing_plugin.fixture.shop_billing_data_fixture" class="Sylius\InvoicingPlugin\Fixture\ShopBillingDataFixture">
<service id="sylius_invoicing.fixture.shop_billing_data" class="Sylius\InvoicingPlugin\Fixture\ShopBillingDataFixture">
<argument id="sylius.manager.channel" type="service"/>
<argument id="sylius_invoicing_plugin.fixture.example_factory.invoicing_plugin_shop_billing_data" type="service"/>
<argument id="sylius_invoicing.fixture.example_factory.invoicing_plugin_shop_billing_data" type="service"/>
<tag name="sylius_fixtures.fixture"/>
</service>

<service id="Sylius\InvoicingPlugin\Fixture\Listener\InvoicesPurgerListener">
<service id="sylius_invoicing.fixture.listener.invoices_purger" class="Sylius\InvoicingPlugin\Fixture\Listener\InvoicesPurgerListener">
<argument type="service" id="filesystem" />
<argument>%sylius_invoicing.invoice_save_path%</argument>
<tag name="sylius_fixtures.listener" />
Expand Down
Loading

0 comments on commit 86d4105

Please sign in to comment.