diff --git a/src/Qbil/Models/Invoice.php b/src/Qbil/Models/Invoice.php index 172f8d9..5185b7f 100644 --- a/src/Qbil/Models/Invoice.php +++ b/src/Qbil/Models/Invoice.php @@ -15,7 +15,7 @@ class Invoice implements InvoiceInterface public function __construct(Document $document, bool $includeInvoiceLines = true) { $this->relation = Util::extract($document->Parties, 'supplier', 'ExternalId'); - $this->invoiceType = Util::extract($document->HeaderFields, 'creditinvoice'); + $this->creditInvoice = Util::extract($document->HeaderFields, 'creditinvoice'); $this->subsidiary = Util::extract($document->Parties, 'buyer', 'ExternalId'); $this->supplierInvoiceNumber = Util::extract($document->HeaderFields, 'invoicenumber'); $this->amount = Util::extract($document->HeaderFields, 'invoicetotalvatexcludedamount'); @@ -51,7 +51,7 @@ public function __construct(Document $document, bool $includeInvoiceLines = true } private $relation; - private $invoiceType; + private $creditInvoice; private $subsidiary; private $supplierInvoiceNumber; private $amount; @@ -187,9 +187,9 @@ public function getDieselSurcharge() /** * @return mixed */ - public function getInvoiceType() + public function isCreditInvoice() { - return $this->invoiceType; + return 'true' === $this->creditInvoice; } public function getAmount() diff --git a/src/Qbil/Models/InvoiceInterface.php b/src/Qbil/Models/InvoiceInterface.php index 5b643e7..2257388 100644 --- a/src/Qbil/Models/InvoiceInterface.php +++ b/src/Qbil/Models/InvoiceInterface.php @@ -8,7 +8,7 @@ interface InvoiceInterface { public function addInvoiceLine(InvoiceLineInterface $invoiceLine); public function getRelation(); - public function getInvoiceType(); + public function isCreditInvoice(); public function getSubsidiary(); public function getSupplierInvoiceNumber(); public function getAmount();