diff --git a/src/QUI/ERP/Accounting/Article.php b/src/QUI/ERP/Accounting/Article.php index 08d4f0730b96cbaec7f24dc882e590a0ae610b6d..89d9107710cdcc18b3d9be672e672707e05fca2b 100644 --- a/src/QUI/ERP/Accounting/Article.php +++ b/src/QUI/ERP/Accounting/Article.php @@ -146,6 +146,7 @@ public function __construct($attributes = []) $defaults = [ 'id', 'articleNo', + 'gtin', 'title', 'description', 'unitPrice', @@ -265,6 +266,20 @@ public function getArticleNo() return ''; } + /** + * Return the GTIN Number, if the article has one + * + * @return string + */ + public function getGTIN(): string + { + if (isset($this->attributes['gtin'])) { + return $this->attributes['gtin']; + } + + return ''; + } + /** * Returns the article title * @@ -686,6 +701,7 @@ public function toArray(): array 'id' => $this->getId(), 'title' => $this->getTitle(), 'articleNo' => $this->getArticleNo(), + 'gtin' => $this->getGTIN(), 'description' => $this->getDescription(), 'unitPrice' => $this->getUnitPrice()->value(), 'displayPrice' => $this->displayPrice(),