PHPackages                             remp/crm-invoices-module - 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. remp/crm-invoices-module

ActiveLibrary

remp/crm-invoices-module
========================

CRM Invoices Module

4.4.0(5mo ago)045.0k↓11.4%21MITPHPPHP ^8.1

Since May 8Pushed 5mo ago5 watchersCompare

[ Source](https://github.com/remp2020/crm-invoices-module)[ Packagist](https://packagist.org/packages/remp/crm-invoices-module)[ Docs](https://remp2030.com)[ RSS](/packages/remp-crm-invoices-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (78)Used By (1)

CRM Invoices Module
===================

[](#crm-invoices-module)

[![Translation status @ Weblate](https://camo.githubusercontent.com/8809d790df1f1e9b61233d27cdad68253fe1c0b479146af33c1600419598d6bf/68747470733a2f2f686f737465642e7765626c6174652e6f72672f776964676574732f72656d702d63726d2f2d2f696e766f696365732d6d6f64756c652f7376672d62616467652e737667)](https://hosted.weblate.org/projects/remp-crm/invoices-module/)

Invoices module is an extension to [Payments module](https://github.com/remp2020/crm-payments-module) to provide invoices for confirmed payments. You can customize the layout of invoices based on the section below.

For invoice to be generated, user needs to provide an invoice address. This is requested on the success page of the payment and can be changed in the [customer zone](/invoices/invoices/invoice-details) any time.

Invoices are always generated on the fly - system doesn't store generated PDFs for later use. If the template changes, template of older invoices might change too. Invoice data used for generation are stored at the time of first generation and never change. Therefore the template can change, but data won't.

Due to the EU legislation, users are allowed to request invoice generation (if it wasn't generated automatically) only within 15-day period after the payment was made. Other cases need to be handled manually by you and your accounting team.

Installing module
-----------------

[](#installing-module)

We recommend using Composer for installation and update management.

```
composer require remp/crm-invoices-module
```

### Enabling module

[](#enabling-module)

Add installed extension to your `app/config/config.neon` file.

```
extensions:
	- Crm\InvoicesModule\DI\InvoicesModuleExtension
```

### Scheduled commands

[](#scheduled-commands)

Module doesn't provide any commands, that should be scheduled for execution periodically.

### Service commands

[](#service-commands)

Module might provide service commands to be run in the deployed environment. Mostly to handle internal changes and to prevent direct manipulation with the database. You can display required and optional arguments by using `--help` switch when running the command.

Invoice module provides:

- `invoice:send`: To manually send an invoice based on payment's variable symbol.

Invoice numbering
-----------------

[](#invoice-numbering)

By default CRM generates invoice numbers with monthly sequences (each month within year has its own sequence) and based on the service delivery date (effectively payment date).

You can override the way how invoice number sequence is generated by adding your own implementation of [`InvoiceNumberInterface`](./src/Models/InvoiceNumberInterface.php) and overriding the default implementation in your `config.neon`:

```
services:
	# ...
	invoiceNumber: Crm\FooModule\Repository\InvoiceNumber
```

Invoice templates
-----------------

[](#invoice-templates)

Invoice generator uses `.latte` template to generate an invoice PDF. By default the module uses simple and generic layout that we prepared. You can see the [source of the layout](./src/Models/Generator/templates/invoice/default.latte).

In the example you can see that presenter provides you with `$invoice` variable. Invoice is generated based on *payment* and reference to *invoice* is stored as `invoice_id` attribute of *payment*. Invoice's reference back to payment is `variable_symbol`, though it's only indirect and not guaranteed (no foreign keys are present).

Each invoice has a reference to *invoice number* which is a list of unique generated string identifiers guaranteed to maintain order based on `delivery_date` for the purposes of accounting. You can read the *number* by accessing `$invoice->invoice_number->number`.

Here's the list of attributes *invoice* provides:

NameValueNullableDescriptionid*Integer*noInternal invoice identifier.invoice\_number\_id*Integer*noReference to invoice number.variable\_symbol*String*noPublic payment identifier.buyer\_name*String*yesName of buyer. Populated from buyer's *invoice* address.buyer\_address*String*yesStreet of buyer. Populated from buyer's *invoice* address.buyer\_zip*String*yesZIP code of buyer. Populated from buyer's *invoice* address.buyer\_city*String*yesCity of buyer. Populated from buyer's *invoice* address.buyer\_country\_id*Integer*noReference to system country. Populated from buyer's *invoice* address.buyer\_id*String*yesIdentifier of buyer's company (usually number provided by IRS). Populated from buyer's *invoice* address.buyer\_tax\_id*String*yesCompany's tax identification (usually number provided by IRS). Populated from buyer's *invoice* address.buyer\_vat\_id*String*yesCompany's VAT identification (usually number provided by IRS). Populated from buyer's *invoice* address.supplier\_name*String*yesName of supplier. Populated from application configuration (see `/admin/config-admin`).supplier\_address*String*yesStreet of supplier. Populated from application configuration (see `/admin/config-admin`).supplier\_zip*String*yesZIP code of supplier. Populated from application configuration (see `/admin/config-admin`).supplier\_city*String*yesCity of supplier. Populated from application configuration (see `/admin/config-admin`).supplier\_country\_id*Integer*noReference to system country. Populated from application configuration (see `/admin/config-admin`).supplier\_id*String*yesIdentifier of supplier's company (usually number provided by IRS). Populated from application configuration (see `/admin/config-admin`).supplier\_tax\_id*String*yesCompany's tax identification (usually number provided by IRS). Populated from application configuration (see `/admin/config-admin`).supplier\_vat\_id*String*yesCompany's VAT identification (usually number provided by IRS). Populated from application configuration (see `/admin/config-admin`).created\_date*DateTime*noDate when invoice was generated.delivery\_date*DateTime*noDate when product was delivered to customer.payment\_date*DateTime*noDate when payment was confirmed.On top of these, application configuration allows you to set some extra values that can be used in invoice template. You can always create your own config fields within one of your module seeders - see [Config seeder](./src/Seeders/ConfigsSeeder.php)of Invoice module as an example.

This configuration values are system wide and can be fetched with `$config->get('foo')` - replace `foo` with one of the following options:

NameValueDescriptionsupplier\_bank\_account\_number*String*Your bank number.supplier\_bank\_name*String*Your bank name.supplier\_iban*String*Your IBAN.supplier\_swift*String*Your Swift/BIC.contact\_email*String*Public contact to your company in case of issues.business\_register\_detail*String*Business registration details (i.e. registration file reference)Invoice items are fetchable with `$invoice->related('invoice_items')`. Items are generated based on payment items present at the time of invoice first generation. From that point, items are saved separately. Here's the list of attributes each *invoice item* provides:

NameValueNullableDescriptionid*Integer*noInternal invoice item identifier.invoice\_id*Integer*noReference to invoice.text*String*noItem text. Populated from payment item name, might have been extended by extra information (e.g. subscription start/end date).count*Integer*noNumber of items sold.price*Decimal*noUnit price of item.vat*Integer*noVAT rate used for sell.currency*String*noText-based currency (e.g. EUR).If you want to use your own layout, prepare your own template with the use of variables described above. Once it's ready, add following snippet to your `app/config/config.local.neon` file (alter as needed):

```
invoiceGenerator:
	setup:
		- setTemplateFile('%appDir%/modules/FooModule/templates/invoices/foo.latte')
```

The snippet tells to invoice generator to use template provided at given path instead of default template.

Attaching invoices to email notifications
-----------------------------------------

[](#attaching-invoices-to-email-notifications)

PDF invoice is attached by default to each email notification containing reference to a payment (as a parameter in `NotificationEvent`). In addition, this notification has to be emitted as a result of processing of a specific trigger (Hermes message) by the application. Typically, this happens when a Hermes message triggers a scenario (see [ScenariosModule](https://github.com/remp2020/crm-scenarios-module/) for details) that emits a `NotificationEvent` (this is done by *Email node*).

To limit which Hermes messages shall be accepted when attaching an invoice (see `PreNotificationEventHandler` for implementation details), add the following configuration to your `config.local.neon` file, listing allowed Hermes message types:

```
invoicesPreNotificationEventHandler:
    setup:
        - enableForNotificationHermesTypes('new-subscription', 'payment-status-change', 'some-other-hermes-message')
```

Components
----------

[](#components)

**DownloadReceiptButton**

Frontend/Admin download payment receipt button.

[![alt text](docs/download_receipt_button.png "Download receipt button")](docs/download_receipt_button.png)

[Source code](https://github.com/remp2020/crm-invoices-module/blob/master/src/Components/DownloadReceiptButton/DownloadReceiptButton.php)

[How to use](https://github.com/remp2020/crm-invoices-module/blob/a9b3730588507276109f1f61e80e60021e27fff2/src/InvoicesModule.php#L39)

**InvoiceButton**

Frontend/Admin download payment invoice button.

[![alt text](docs/download_invoice_button.png "Download invoice button")](docs/download_invoice_button.png)

[Source code](https://github.com/remp2020/crm-invoices-module/blob/master/src/Components/InvoiceButton/InvoiceButton.php)

[How to use](https://github.com/remp2020/crm-invoices-module/blob/a9b3730588507276109f1f61e80e60021e27fff2/src/InvoicesModule.php#L34)

**InvoiceLabel**

User details payments listing invoice label.

[![alt text](docs/invoice_label.png "Download receipt button")](docs/invoice_label.png)

[Source code](https://github.com/remp2020/crm-invoices-module/blob/a9b3730588507276109f1f61e80e60021e27fff2/src/components/InvoiceLabel/InvoiceLabel.php#L1)

[How to use](https://github.com/remp2020/crm-invoices-module/blob/a9b3730588507276109f1f61e80e60021e27fff2/src/InvoicesModule.php#L55)

**PaymentSuccessInvoiceWidget**

Widget for downloading invoice from payments success page.

[![alt text](docs/payment_success_invoice.png "Download receipt button")](docs/payment_success_invoice.png)

[Source code](https://github.com/remp2020/crm-invoices-module/blob/a9b3730588507276109f1f61e80e60021e27fff2/src/components/PaymentSuccessInvoiceWidget/PaymentSuccessInvoiceWidget.php#L1)

[How to use](https://github.com/remp2020/crm-invoices-module/blob/a9b3730588507276109f1f61e80e60021e27fff2/src/InvoicesModule.php#L51)

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance72

Regular maintenance activity

Popularity29

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~31 days

Recently: every ~42 days

Total

77

Last Release

165d ago

Major Versions

0.38.0 → 1.0.0-beta22022-02-11

0.39.0 → 1.0.02022-03-30

1.2.0 → 2.0.02022-08-25

2.11.0 → 3.0.02024-01-22

3.7.0 → 4.0.02025-04-02

PHP version history (5 changes)0.3.0PHP ^7.2

0.29.0PHP ^7.3

0.36.0PHP ^7.4

2.0.0PHP ^8.0

3.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c733f9bd683c3814197d8a532b7da1ba1f631bb1efe1cde5f064feab1e24877?d=identicon)[rootpd](/maintainers/rootpd)

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

![](https://www.gravatar.com/avatar/2c30fdbc85cda35b94f7f59399918193a0289152281abcef344ec9ee82864177?d=identicon)[markoph](/maintainers/markoph)

---

Top Contributors

[![markoph](https://avatars.githubusercontent.com/u/6843562?v=4)](https://github.com/markoph "markoph (85 commits)")[![rootpd](https://avatars.githubusercontent.com/u/812909?v=4)](https://github.com/rootpd "rootpd (71 commits)")[![miroc](https://avatars.githubusercontent.com/u/1230714?v=4)](https://github.com/miroc "miroc (28 commits)")[![zoldia](https://avatars.githubusercontent.com/u/1526070?v=4)](https://github.com/zoldia "zoldia (23 commits)")[![lubos-michalik](https://avatars.githubusercontent.com/u/63700066?v=4)](https://github.com/lubos-michalik "lubos-michalik (20 commits)")[![Matefko](https://avatars.githubusercontent.com/u/22897457?v=4)](https://github.com/Matefko "Matefko (11 commits)")[![burithetech](https://avatars.githubusercontent.com/u/3502143?v=4)](https://github.com/burithetech "burithetech (7 commits)")[![weblate](https://avatars.githubusercontent.com/u/1607653?v=4)](https://github.com/weblate "weblate (3 commits)")[![tomaj](https://avatars.githubusercontent.com/u/446736?v=4)](https://github.com/tomaj "tomaj (3 commits)")[![davidkvasnovsky](https://avatars.githubusercontent.com/u/12381721?v=4)](https://github.com/davidkvasnovsky "davidkvasnovsky (1 commits)")[![nakashu](https://avatars.githubusercontent.com/u/1550659?v=4)](https://github.com/nakashu "nakashu (1 commits)")

### Embed Badge

![Health badge](/badges/remp-crm-invoices-module/health.svg)

```
[![Health](https://phpackages.com/badges/remp-crm-invoices-module/health.svg)](https://phpackages.com/packages/remp-crm-invoices-module)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[carlos-meneses/laravel-mpdf

Laravel Mpdf: Using Mpdf in Laravel to generate Pdfs.

4403.1M7](/packages/carlos-meneses-laravel-mpdf)[kartik-v/yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.

1605.5M84](/packages/kartik-v-yii2-mpdf)[contributte/pdf

Pdf response extension for Nette Framework

43967.8k2](/packages/contributte-pdf)

PHPackages © 2026

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