webforge / accounting
A small library for some basics for invoices
1.0.0
2013-11-18 09:50 UTC
Requires
- webforge/common: 1.7.*@dev
- webforge/types: 1.0.*@dev
Requires (Dev)
- liip/rmt: 0.9.*
- satooshi/php-coveralls: dev-master
- webforge/testplate: 1.*
This package is auto-updated.
Last update: 2024-11-07 02:19:31 UTC
README
A small library for some basics for invoices
Prices
The Webforge\Accounting\Price
class will help you with some calculation basics:
$price = new Price(4284, Price::GROSS, 0.19); $this->assertEquals(4284, $price->getGross()); $this->assertEquals(3600, $price->getNet()); $this->assertEquals(0.19, $price->getTax()); $this->assertEquals(684, $price->getTaxValue()); // = 4284-3600 // or construct it the other way round: $price = new Price(3600, Price::NET, 0.19); $this->assertEquals(4284, $price->getGross()); $this->assertEquals(3600, $price->getNet()); $this->assertEquals(0.19, $price->getTax()); $this->assertEquals(684, $price->getTaxValue()); // = 4284-3600
You can provide prices without taxes:
$price = new Price(4284, Price::GROSS, Price::NO_TAXES); $this->assertEquals(4284, $price->getGross()); $this->assertEquals(4284, $price->getNet()); $this->assertEquals(0, $price->getTax()); $this->assertEquals(0, $price->getTaxValue());