Fixes
This commit is contained in:
parent
0b25641c35
commit
ae27792eac
@ -231,6 +231,17 @@ class Engine
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getTaxPrice()
|
public function getTaxPrice()
|
||||||
|
{
|
||||||
|
if($this->dirty) {
|
||||||
|
$this->calc();
|
||||||
|
}
|
||||||
|
return round(($this->price/100*$this->tax),2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function getCompletePrice()
|
||||||
{
|
{
|
||||||
if($this->dirty) {
|
if($this->dirty) {
|
||||||
$this->calc();
|
$this->calc();
|
||||||
|
|||||||
@ -34,7 +34,8 @@ class PriceMinTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertEquals(2500, $this->engine->getPrice());
|
$this->assertEquals(2500, $this->engine->getPrice());
|
||||||
$this->engine->setTax(19);
|
$this->engine->setTax(19);
|
||||||
$this->assertEquals(2975, $this->engine->getTaxPrice());
|
$this->assertEquals(475, $this->engine->getTaxPrice());
|
||||||
|
$this->assertEquals(2975, $this->engine->getCompletePrice());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testIfCalcReturnsGrenzeWithFormular()
|
public function testIfCalcReturnsGrenzeWithFormular()
|
||||||
@ -50,6 +51,9 @@ class PriceMinTest extends \PHPUnit_Framework_TestCase
|
|||||||
$this->engine->calc();
|
$this->engine->calc();
|
||||||
|
|
||||||
$this->assertEquals(2721.40, $this->engine->getPrice());
|
$this->assertEquals(2721.40, $this->engine->getPrice());
|
||||||
|
$this->engine->setTax(19);
|
||||||
|
$this->assertEquals(517.07, $this->engine->getTaxPrice());
|
||||||
|
$this->assertEquals(3238.47, $this->engine->getCompletePrice());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user