From 5a11836e37258af449de450bb66b382dc4312b85 Mon Sep 17 00:00:00 2001 From: Sandor Teglas Date: Fri, 1 Apr 2016 10:01:23 +0300 Subject: [PATCH] Extended the Remote Product with a new property called vatPercent that stores the VAT percent included in the product price that is always a gross price. --- Model/Remote/Product/Product.php | 27 ++++++++++++++++++- .../Remote/Product/RemoteProductInterface.php | 21 ++++++++++++--- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/Model/Remote/Product/Product.php b/Model/Remote/Product/Product.php index 9d0ee46..7d70327 100644 --- a/Model/Remote/Product/Product.php +++ b/Model/Remote/Product/Product.php @@ -6,7 +6,7 @@ * @author Sandor Teglas * @copyright Copyright (c) 2016 Storm Storez Srl-d * @license Proprietary - * @version 2016-03-07 + * @version 2016-04-01 * @since 2016-02-25 */ @@ -26,6 +26,9 @@ class Product implements RemoteProductInterface /** @var int */ protected $price; + /** @var int */ + protected $vatPercent; + /** @var int */ protected $catalogPrice; @@ -59,6 +62,28 @@ public function getPrice() return $this->price; } + /** + * Set the VAT percent included in gross price. + * + * @param int $vatPercent + * + * @return static Returns a reference to itself + */ + public function setVatPercent($vatPercent) + { + $this->vatPercent = $vatPercent; + + return $this; + } + + /** + * @inheritdoc + */ + public function getVatPercent() + { + return $this->vatPercent; + } + /** * Set the product's catalog price * diff --git a/Model/Remote/Product/RemoteProductInterface.php b/Model/Remote/Product/RemoteProductInterface.php index e7019e6..a2a6aaa 100644 --- a/Model/Remote/Product/RemoteProductInterface.php +++ b/Model/Remote/Product/RemoteProductInterface.php @@ -6,7 +6,7 @@ * @author Sandor Teglas * @copyright Copyright (c) 2016 Storm Storez Srl-d * @license Proprietary - * @version 2016-03-07 + * @version 2016-04-01 * @since 2016-02-25 */ @@ -20,20 +20,35 @@ interface RemoteProductInterface extends TranslatableInterface, ImageableInterfa { /** - * Set the product's price + * Set the product's gross price * * @param int $price */ public function setPrice($price); /** - * Returns the product's price + * Returns the product's gross price * * @return int */ public function getPrice(); + /** + * Set the VAT percent included in gross price. + * + * @param int $vatPercent + */ + public function setVatPercent($vatPercent); + + /** + * Returns the VAT percent included in gross price. + * + * @return int + */ + public function getVatPercent(); + + /** * Set the product's catalog price *