Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
Add vat exception to invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas De Keukelaere committed Sep 22, 2021
1 parent 8f87a36 commit 583195e
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion Invoice/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Invoice
/**
* @var string
*/
protected $discountDescription;
protected $discountDescription, $vatException;

/**
* @var bool
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 583195e

Please sign in to comment.