Example #1
0
 private function priceIncludingVat(Article $article) : Money
 {
     if ($article->type() instanceof ArticleTypeNormal) {
         $taxFactor = 1 + $this->country->vat() / 100;
     } else {
         $taxFactor = 1 + $this->country->reducedVat() / 100;
     }
     $price = (int) ($article->price()->amount() * $taxFactor);
     return new Euro($price);
 }
Example #2
0
 public function testHasPrice()
 {
     $article = new Article(new ArticleName('Gummiboot'), new ArticleDescription(''), new Euro(100));
     $this->assertEquals(new Euro(100), $article->price());
 }