Skip to content

Commit

Permalink
Merge pull request #6 from QbilSoftware/added-invoice-type
Browse files Browse the repository at this point in the history
+ added invoice type
  • Loading branch information
xersion22 authored Apr 22, 2022
2 parents 79e9362 + 4981310 commit 1d92be5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Qbil/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -51,7 +51,7 @@ public function __construct(Document $document, bool $includeInvoiceLines = true
}

private $relation;
private $invoiceType;
private $creditInvoice;
private $subsidiary;
private $supplierInvoiceNumber;
private $amount;
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/Qbil/Models/InvoiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 1d92be5

Please sign in to comment.