2017 © Pedro Peláez
 

library price-calculator

Library for easier price calculation using VAT and discount.

image

sunfoxcz/price-calculator

Library for easier price calculation using VAT and discount.

  • Wednesday, March 14, 2018
  • by sunfoxcz
  • Repository
  • 2 Watchers
  • 2 Stars
  • 1,810 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 6 % Grown

The README.md

Price calculator library

, (*1)

, (*2)

Library for easier price calculation using VAT and discount., (*3)

Installation

composer require sunfoxcz/price-calculator

Usage

<?php declare(strict_types=1);

use Sunfox\PriceCalculator\Discount\PercentDiscount;
use Sunfox\PriceCalculator\PriceCalculator;

/* @var Sunfox\PriceCalculator\PriceCalculatorResult $calc */
$calc = (new PriceCalculator)
    ->setBasePrice(1983.48)
    ->setDiscount(new PercentDiscount(10.0))
    ->setVatRate(21.0)
    ->calculate();

$calc->getBasePrice(); // price without VAT and discount
$calc->getDiscount();  // discount in percent without VAT
$calc->getPrice();     // price after discount without VAT
$calc->getVatRate();   // VAT rate in percent
$calc->getVat();       // VAT value
$calc->getPriceVat();  // price after discount with VAT
$calc->toArray();      // Ger results as array

$calc->getCalculator(); // Sunfox\PriceCalculator\PriceCalculator

The Versions

14/03 2018

dev-master

9999999-dev

Library for easier price calculation using VAT and discount.

  Sources   Download

MIT

The Requires

 

The Development Requires

calculator calculation vat tax price discount dph reduction

14/03 2018

v0.4.0

0.4.0.0

Library for easier price calculation using VAT and discount.

  Sources   Download

MIT

The Requires

 

The Development Requires

calculator calculation vat tax price discount dph reduction

19/01 2017

v0.3.0

0.3.0.0

Library for easier price calculation using VAT and discount.

  Sources   Download

MIT

The Requires

 

The Development Requires

calculator calculation vat tax price discount dph reduction

10/12 2015

v0.2.0

0.2.0.0

Library for easier price calculation using VAT and discount.

  Sources   Download

MIT

The Requires

 

The Development Requires

calculator calculation vat tax price discount dph reduction

23/07 2015

v0.1.0

0.1.0.0

Library for easier price calculation using VAT and discount.

  Sources   Download

MIT

The Requires

 

The Development Requires

calculator calculation vat tax price discount dph reduction