PHPackages                             rezzza/accounting - 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. rezzza/accounting

ActiveStandalone[Utility &amp; Helpers](/categories/utility)

rezzza/accounting
=================

Accounting utilities

v1.0.2(10y ago)2215.3k8MITPHPPHP &gt;=5.3.2

Since May 6Pushed 10y ago6 watchersCompare

[ Source](https://github.com/rezzza/accounting)[ Packagist](https://packagist.org/packages/rezzza/accounting)[ Docs](https://github.com/rezzza/accounting)[ RSS](/packages/rezzza-accounting/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

Accounting [![Version](https://camo.githubusercontent.com/386c73ee252001f3098c43eefe69d2b8175fd8a26f8b58474b1c3bbf6c72eaeb/68747470733a2f2f706f7365722e707567782e6f72672f72657a7a7a612f6163636f756e74696e672f76657273696f6e2e706e67)](https://packagist.org/packages/rezzza/accounting) [![Build Status](https://camo.githubusercontent.com/a9074ba6deba7a14575326caa1da70b18347bada7263936fe0a04f2b89a480e2/68747470733a2f2f7472617669732d63692e6f72672f72657a7a7a612f6163636f756e74696e672e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/rezzza/accounting) [![SensioLabsInsight](https://camo.githubusercontent.com/262d6d82b4c487f549ecc4feb485004fe78bc3a969ddf19590cf96464e5f5678/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f63626362303563352d633430662d346239362d383637622d6634646531653964643230392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/cbcb05c5-c40f-4b96-867b-f4de1e9dd209)
===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#accounting---)

Accounting lib is your modern comp(t)anion for general accounting in PHP.

Validators
----------

[](#validators)

### Vat

[](#vat)

The lib provides 2 Vat validators:

- VatValidator: for all knwon Vat numbers systems.
- ViesValidator: for european Vat numbers only.

Formatters
----------

[](#formatters)

### Vat

[](#vat-1)

TODO

### IBAN

[](#iban)

TODO

Operations
----------

[](#operations)

### Pain point

[](#pain-point)

Accounting operations are sometimes subjected to bugs. Why? Because they're made of sets of arithmetic computations, but if they use mathematics, it's with their own rules about rounding results, managing currencies specific number of fraction digits and so on... this is why you should use this lib ;)

### Benefits

[](#benefits)

- Computations are made in the exact order you want (damn, don't compute this tax before this operation!).
- Number of fractions of each currency is respected.
- Rounding rules are applied the right way in each computation.
- Last but not least, you can develop you own sets of operations and apply them like computation templates. You just have to decorate your results after that, pretty easy ;)

### Example

[](#example)

```
$resultsSet = new OperationSetResult(array(
    'discount_rate' => new Percentage(10),   // Our special discount rate for that lucky guy
    'vat_rate'      => new Percentage(19.6), // French VAT rate
));

$f  = new Factory();
$os = new OperationSet(
    array(
        'price_discounted' => new Operation(
            new Reference\Reference('price_excl_taxes'),
            Operation::MINORATE,
            new Reference\Reference('discount_rate')
        ),
        'price_incl_taxes' => new Operation(
            $f->value(new Reference\Reference('price_discounted')),
            Operation::MAJORATE,
            new Reference\Reference('vat_rate')
        ),
    ),
    $resultsSet
);

$os
    ->getResultsSet()
    ->add(new Price(100, 'EUR'), 'price_excl_taxes');
$os->compute();

echo sprintf("%s\n", $os->getResultsSet());
```

```
discount_rate: 10%
vat_rate: 19.6%
price_excl_taxes: 100€
price_discounted: 100€ minorate by 10% => 90€ \ 10€
price_incl_taxes: 90€ majorate by 19.6% => 107.64€ \ 17.64€

```

### Same thing but with Japan Yen (0 decimal fractions currency)

[](#same-thing-but-with-japan-yen-0-decimal-fractions-currency)

```
[...]

$os
    ->getResultsSet()
    ->add(new Price(100, 'EUR'), 'price_excl_taxes');
$os->compute();

echo sprintf("%s\n", $os->getResultsSet());
```

```
discount_rate: 10%
vat_rate: 19.6%
price_excl_taxes: 100¥JP
price_discounted: 100¥JP minorate by 10% => 90¥JP \ 10¥JP
price_incl_taxes: 90¥JP majorate by 19.6% => 108¥JP \ 18¥JP

```

Twig extension
--------------

[](#twig-extension)

You have to define this extension as service:

```

```

```
{{ "FR1337133713371337133713371"|iban }}
{{ "FR133  7133713371337133713371"|iban }}

{# will output FR13 3713 3713 3713 3713 3713 371 #}
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 53.8% 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 ~294 days

Total

3

Last Release

3850d ago

### Community

Maintainers

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

---

Top Contributors

[![shouze](https://avatars.githubusercontent.com/u/54712?v=4)](https://github.com/shouze "shouze (14 commits)")[![stephpy](https://avatars.githubusercontent.com/u/232744?v=4)](https://github.com/stephpy "stephpy (9 commits)")[![tyx](https://avatars.githubusercontent.com/u/245494?v=4)](https://github.com/tyx "tyx (3 commits)")

---

Tags

utilitiesAccounting

### Embed Badge

![Health badge](/badges/rezzza-accounting/health.svg)

```
[![Health](https://phpackages.com/badges/rezzza-accounting/health.svg)](https://phpackages.com/packages/rezzza-accounting)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[sulu/sulu

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

1.3k1.4M196](/packages/sulu-sulu)[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[azuracast/azuracast

The AzuraCast self-hosted web radio station management suite.

3.9k27.8k](/packages/azuracast-azuracast)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)[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.

3691.3k16](/packages/netgen-layouts-core)

PHPackages © 2026

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