odiseoteam/sylius-report-plugin

Plugin for Sylius to make customizable reports.

Installs: 3 228

Dependents: 0

Suggesters: 0

Security: 0

Stars: 22

Watchers: 4

Forks: 4

Open Issues: 4

Type:sylius-plugin


README

Sylius Report Plugin
68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f646973656f7465616d2f73796c6975732d7265706f72742d706c7567696e2e737667 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f646973656f7465616d2f73796c6975732d7265706f72742d706c7567696e2e737667 68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6f646973656f7465616d2f53796c6975735265706f7274506c7567696e2f6d61737465722e737667 68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6f646973656f7465616d2f53796c6975735265706f7274506c7567696e2e737667 68747470733a2f2f706f7365722e707567782e6f72672f6f646973656f7465616d2f73796c6975732d7265706f72742d706c7567696e2f646f776e6c6f616473

badge-partner-by-sylius.png

Description

This plugin add data reports to the Sylius administration interface. It's highly inspired on the old SyliusReportBundle and Report component using it's good architecture.

Now supporting Sylius 1.4+ and Symfony 4.

Premium features!

Do you want advanced features? Take a look at our Report Pro Plugin, an extended version of this one.

Architecture

Basically you have a DataFetcherInterface and RendererInterface interfaces. The first one defines how to fetch the Data according on a configuration provided. And the second one uses the Data returned by the fetcher and returns a rendered view.

Some DataFetchers and Renderers come with this plugin but you can create your own by implementing their interfaces.

Reports admin

Demo

You can see this plugin in action in our Sylius Demo application.

Installation

  1. Run composer require odiseoteam/sylius-report-plugin

  2. Enable the plugin in bundles.php but add it before SyliusResourceBundle like follows:

<?php

return [
    // ...
    Odiseo\SyliusReportPlugin\OdiseoSyliusReportPlugin::class => ['all' => true],
    Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
    // ...
];
  1. Import the plugin configurations
imports:
    - { resource: "@OdiseoSyliusReportPlugin/Resources/config/config.yml" }

This plugin use DoctrineExtensions to create the different DataFetcher's queries. For example you will need to add the Doctrine DQL functions as follows if you are using Mysql:

doctrine:
    orm:
        # ...
        dql:
            datetime_functions:
                date: DoctrineExtensions\Query\Mysql\Date
                month: DoctrineExtensions\Query\Mysql\Month
                year: DoctrineExtensions\Query\Mysql\Year
            numeric_functions:
                round: DoctrineExtensions\Query\Mysql\Round
  1. Add the admin routes
odiseo_sylius_report_plugin_admin:
    resource: "@OdiseoSyliusReportPlugin/Resources/config/routing/admin.yml"
    prefix: /admin
  1. Finish the installation updating the database schema and installing assets
php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
php bin/console sylius:theme:assets:install --symlink

Test the plugin

You can follow the instructions to test this plugins in the proper documentation page: Test the plugin.

Credits

This plugin is maintained by Odiseo. Want us to help you with this plugin or any Sylius project? Contact us on team@odiseo.com.ar.