From 583195e13e9189350bc1d83f9e1b7dbe74c48fe6 Mon Sep 17 00:00:00 2001 From: Jonas De Keukelaere Date: Wed, 22 Sep 2021 12:27:04 +0100 Subject: [PATCH] Add vat exception to invoice --- Invoice/Invoice.php | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Invoice/Invoice.php b/Invoice/Invoice.php index b1152bb..fcdc263 100644 --- a/Invoice/Invoice.php +++ b/Invoice/Invoice.php @@ -59,7 +59,7 @@ class Invoice /** * @var string */ - protected $discountDescription; + protected $discountDescription, $vatException; /** * @var bool @@ -404,6 +404,25 @@ public function prepareForSending() $this->prepareForSending = true; } + /** + * @return string + */ + public function getVatException() + { + return $this->vatException; + } + + /** + * @param string $vatException + * @return $this + */ + public function setVatException($vatException) + { + $this->vatException = $vatException; + + return $this; + } + /** * Initialize the object with raw data * @@ -470,6 +489,12 @@ public function toArray($forApi = false) $data['percentage'] = $this->isDiscountAPercentage(); $data['discount_description'] = $this->getDiscountDescription(); } + if ($this->getVatException()) { + $data['vat_exception'] = $this->getVatException(); + if ($this->getVatException() === 'cash_discount') { + $data['vat_description'] = 'btw verlegd'; + } + } $data['items'] = array(); foreach ($this->getItems() as $item) {