PHPackages                             roshyo/invoice-plugin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. roshyo/invoice-plugin

ActiveSylius-plugin[PDF &amp; Document Generation](/categories/documents)

roshyo/invoice-plugin
=====================

A plugin to generate invoices in Sylius

1.0.1(7y ago)1231MITPHPPHP ^7.1

Since Jun 11Pushed 5y agoCompare

[ Source](https://github.com/Roshyo/SyliusInvoicePlugin)[ Packagist](https://packagist.org/packages/roshyo/invoice-plugin)[ RSS](/packages/roshyo-invoice-plugin/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (20)Versions (3)Used By (0)

sylius-invoice
==============

[](#sylius-invoice)

A Plugin for Sylius to generate invoices

Installation-procedure
======================

[](#installation-procedure)

```
$ composer require behappy/invoice-plugin
```

Informations
------------

[](#informations)

This plugin use Knp Snappy Bundle. Please refer to it's documentation for wkhtmltopdf installation ()

Enable the plugin
-----------------

[](#enable-the-plugin)

Enable those plugins in AppKernel

```
// in app/AppKernel.php
public function registerBundles() {
	$bundles = array(
		// ...
        new Knp\Bundle\SnappyBundle\KnpSnappyBundle(),

        new \BeHappy\SyliusCompanyDataPlugin\BeHappySyliusCompanyDataPlugin(),
        new \BeHappy\SyliusInvoicePlugin\BeHappySyliusInvoicePlugin(),
    );
    // ...
}
```

```
#in app/config/config.yml
imports:
    ...
    - { resource: "@BeHappySyliusCompanyDataPlugin/Resources/config/config.yml" }
    - { resource: "@BeHappySyliusInvoicePlugin/Resources/config/config.yml" }
    ...
```

```
# in routing.yml
...
behappy_company_data_plugin:
    resource: '@BeHappySyliusCompanyDataPlugin/Resources/config/routing.yml'

behappy_invoice_plugin.admin:
    resource: '@BeHappySyliusInvoicePlugin/Resources/config/routes/admin.yml'
    prefix: /admin

behappy_invoice_plugin.shop:
    resource: '@BeHappySyliusInvoicePlugin/Resources/config/routes/shop.yml'
    prefix: /{_locale}/account
    requirements:
        _locale: ^[a-z]{2}(?:_[A-Z]{2})?$
...
```

Generate database
-----------------

[](#generate-database)

Simply launch

```
php bin/console doctrine:schema:update --dump-sql --force
```

You might have tables referring to BeHappySyliusCompanyDataPlugin if you did not enabled it before requiring this plugin

Optional : generate invoices
----------------------------

[](#optional--generate-invoices)

In order to have invoices for previously placed orders, you can run this command :

```
php bin/console behappy:invoices:generate
```

This command will generate invoices for all orders in state FULFILLED with no invoices attached

That's it !
===========

[](#thats-it-)

From now on, each and every time an order is fulfilled, the event listener will create a new invoice and copy (if needed) company data information into a separate table to make them static.

A new block is also displayed in admin under the shipment section of orders that have an invoice linked.

In the account section for your customers, a link is also displayed for every invoice linked to their orders.

Configuration
=============

[](#configuration)

Invoice number
--------------

[](#invoice-number)

By default, invoices will be generated with a 12 digits number filled with 0 (str\_pad(12, '0', STR\_PAD\_LEFT))

You can redefine this length definition by overriding this :

```
# in app/config.yml
parameters:
    ...
    behappy_invoice_plugin.invoice_number.length: 14
    ...
```

Now every invoice will be 14 digits long.

In a near future, this plugin will use a number generator that you'll be free to override according to your needs.

Events
------

[](#events)

During the invoice creation, 2 events are fired with the order as argument.

```
behappy_invoice_plugin.event.invoice.pre_create
behappy_invoice_plugin.event.invoice.post_create
```

You can subscribe to those events and do whatever you need

Override
--------

[](#override)

In order to override the pdf template file, you simply have to create the following file : app/Resources/BeHappySyliusInvoicePlugin/views/Invoice/pdf.html.twig

Thanks
======

[](#thanks)

This plugin is partially inspired by BitBagCommerce/SyliusInvoicingPlugin ().

Feel free to contribute
=======================

[](#feel-free-to-contribute)

You can also ask your questions at the mail address in the composer.json mentioning this package.

Other
=====

[](#other)

You can also check our other packages (including Sylius plugins) at

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

2

Last Release

2885d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b30adb2d219a75752aa612453b95a80b9e0a20f62ad84acb54bf78c08436f8e8?d=identicon)[Roshyo](/maintainers/Roshyo)

---

Top Contributors

[![Roshyo](https://avatars.githubusercontent.com/u/9363039?v=4)](https://github.com/Roshyo "Roshyo (52 commits)")

###  Code Quality

TestsPHPUnit

Code StyleECS

### Embed Badge

![Health badge](/badges/roshyo-invoice-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/roshyo-invoice-plugin/health.svg)](https://phpackages.com/packages/roshyo-invoice-plugin)
```

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[setasign/tfpdf

This class is a modified version of FPDF that adds UTF-8 support. The latest version is based on FPDF 1.85.

426.1M30](/packages/setasign-tfpdf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
