PHPackages                             2lenet/invoice-bundle - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. 2lenet/invoice-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

2lenet/invoice-bundle
=====================

Invoice Bundle

3.1.0(2y ago)121MITPHPPHP ^8.1

Since Aug 28Pushed 2y agoCompare

[ Source](https://github.com/2lenet/InvoiceBundle)[ Packagist](https://packagist.org/packages/2lenet/invoice-bundle)[ Docs](https://github.com/2lenet/InvoiceBundle)[ RSS](/packages/2lenet-invoice-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (16)Versions (2)Used By (0)

InvoiceBundle v2
================

[](#invoicebundle-v2)

This bundle is useful to manage invoice in your project.

Installation
------------

[](#installation)

To install the bundle:

```
composer require 2le/invoice-bundle

```

Configuration
-------------

[](#configuration)

To configure the bundle, in the doctrine service configuration file ("config/packages/doctrine.yaml"), you have to define which entity will get the role of customer.

For exemple, if you want to use your `User` entity, you will add this block at the end of file :

```
config/packages/doctrine.yaml:
    ...
    orm:
        ...
        resolve_target_entities:
            Lle\InvoiceBundle\Model\CustomerInterface: App\Entity\User
            Lle\InvoiceBundle\Model\ProductInterface: App\Entity\Product
            Lle\InvoiceBundle\Model\CustomerInterface: App\Entity\Guest
            Lle\InvoiceBundle\Model\ProductInterface: App\Entity\InvoiceProduct
            Lle\InvoiceBundle\Model\SellerInterface: App\Entity\Establishment
            Lle\InvoiceBundle\Model\InvoiceInterface: App\Entity\Invoice
            Lle\InvoiceBundle\Model\InvoiceLineInterface: App\Entity\InvoiceLine
            Lle\InvoiceBundle\Model\PaymentInterface: App\Entity\Payment
            Lle\InvoiceBundle\Model\PaymentConditionInterface: App\Entity\PaymentCondition
            Lle\InvoiceBundle\Model\PaymentTypeInterface: App\Entity\PaymentType
            Lle\InvoiceBundle\Model\VatRateInterface: App\Entity\VatRate
```

Then, when the bundle expect a CustomerInterface you can pass an user. Once this listener is configured, Doctrine will know how to replace the customer interface. And that's the same for the Product entity.

> To get more info about relationships with abstract classes and interfaces, you can check official Symfony Documentation [here](https://symfony.com/doc/current/doctrine/resolve_target_entity.html)

Do not forget to implement methods on your entity using bundle traits and add your custom needs.

```
class Invoice implements InvoiceInterface
{
    use InvoiceTrait;

    ...
}
```

#### PDF Parameter

[](#pdf-parameter)

Use PdfGenerator To export invoice in PDF, you have to define paramater in the file "config/packages/lle\_invoice.yaml". For example, you can define parameter like that :

```
lle_invoice:
  # Relative path to image (png or jpg) from root directory
  logo: 'public/image/image.jpg'
  header: 'header \n address'
  footer: 'footer \n info'
```

logo: Path of image to put on Invoice header

The other fields concern the company who made fixtures.

Usage
-----

[](#usage)

In this bundle, there are several services : InvoiceManager, InvoiceLineManager, InvoiceExporter, InvoicePDF. You can use all of them with Dependency Injection. You can use EasyAdmin or EasyAdminPlus to manage this entity.

### Invoice Manager

[](#invoice-manager)

InvoiceManager is a service that let you generate a draft invoice or validate an invoice.

#### Generate a draft invoice

[](#generate-a-draft-invoice)

A draft invoice is an invoice with pre-filled fields.

Example:

```
    public function index(InvoiceManager $invoiceManager): Response
    {
        ...
        // To get a draft Invoice
        $invoiceManager->generate();
        ...
    }
```

But if you want to get more pre-filled fields, you can pass an entity that **implements** CustomerInterface :

```
    public function index(InvoiceManager $invoiceManager): Response
    {
        ...
        // Entity User implements CustomerInterface in this example
        $invoiceManager->generate($user);
        ...
    }
```

#### Validate an invoice

[](#validate-an-invoice)

If you want to validate an invoice, you can use the InvoiceManager. Validate an Invoice set the invoice number, puts current date and set status to "Validate".

Example:

```
    public function index(InvoiceManager $invoiceManager): Response
    {
        ...
        $invoiceManager->validate($invoice);
        ...
    }
```

Then, you can persist your entity or do whatever you want.

### Invoice Exporter

[](#invoice-exporter)

You can export one or more invoice in csv format.

Example:

```
    public function index(InvoiceExporter $invoiceExporter, Invoice $invoice): Response
    {
        ...
        $invoiceExporter->export([$invoice]);
        ...
    }
```

You can choose the filename with: export(\[$invoice1, $invoice2\], 'invoice\_export.csv');

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

Unknown

Total

1

Last Release

991d ago

### Community

Maintainers

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

---

Top Contributors

[![sebheitzmann](https://avatars.githubusercontent.com/u/2197902?v=4)](https://github.com/sebheitzmann "sebheitzmann (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/2lenet-invoice-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/2lenet-invoice-bundle/health.svg)](https://phpackages.com/packages/2lenet-invoice-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[barryvdh/laravel-form-bridge

This packages integrates Symfony Form Component in Laravel.

163354.8k1](/packages/barryvdh-laravel-form-bridge)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)

PHPackages © 2026

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