BeHappyCommunication / SyliusInvoicePlugin

A Plugin for Sylius to generate invoices (! deprecated, use sylius/invoicing-plugin instead)
MIT License
13 stars 3 forks source link

New block in BackOffice is not showing up #1

Closed aimeric closed 6 years ago

aimeric commented 6 years ago

Hi,

I'm using Sylius 1.1.0-DEV , I have install and configure your bundle, but the new block in BackOffice and the new button in customer's account are not showing up.

config.yml

imports:
    - { resource: '@BehappyInvoicePlugin/Resources/config/app/config.yml' }

twig:
    paths:
        '%kernel.project_dir%/vendor/behappy/invoice-plugin/src/Resources/views': BehappyInvoice

routing.yml

behappy_invoice_admin:
    resource: "@BehappyInvoicePlugin/Resources/config/app/routing_admin.yml"
    prefix: /admin

behappy_invoice_shop:
    resource: "@BehappyInvoicePlugin/Resources/config/app/routing_shop.yml"
    prefix: /{_locale}/account
    requirements:
        _locale: ^[a-z]{2}(?:_[A-Z]{2})?$

Do you can any idea how to fix this issue ?

Roshyo commented 6 years ago

I've upgraded to Sylius 1.1.0-DEV and everything is ok. I'll investigate to see if I can reproduce it.

Roshyo commented 6 years ago

Can you try to access to one of your order in front (customer account) with an URI like this : http://{domain}/app_dev.php/{locale}/account/orders/{order_number}/invoice

The same path as viewing an order with just /invoice at the end

aimeric commented 6 years ago

I have tried with the following url : http://127.0.0.1/sylius/web/app_dev.php/fr_FR/account/orders/000000061/invoice

and I have the following error:


Symfony\Component\HttpKernel\Exception\BadRequestHttpException:

Order not fulfilled

  at vendor/behappy/invoice-plugin/src/Controller/InvoiceController.php:68
  at Behappy\InvoicePlugin\Controller\InvoiceController->renderAction(object(Request))
  at call_user_func_array(array(object(InvoiceController), 'renderAction'), array(object(Request)))
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:153)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:169)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (web/app_dev.php:42)
Roshyo commented 6 years ago

Yeah ok. That's not a bug. In order to see an invoice, the order has to be in the state : OrderInterface::STATE_FULFILLED

Try to put an order in this state, and the blocks will appear.

aimeric commented 6 years ago

It works, It wasn't showing because my order was in STATE_NEW . Thank you so much Roshyo.