Skip to content

Commit

Permalink
Merge pull request #4 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 c96ac9a + b329865 commit d4ed9a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Qbil/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +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, 'InvoiceCredit');
$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 @@ -50,6 +51,7 @@ public function __construct(Document $document, bool $includeInvoiceLines = true
}

private $relation;
private $invoiceType;
private $subsidiary;
private $supplierInvoiceNumber;
private $amount;
Expand Down Expand Up @@ -182,6 +184,14 @@ public function getDieselSurcharge()
return $this->dieselSurcharge;
}

/**
* @return mixed
*/
public function getInvoiceType()
{
return $this->invoiceType;
}

public function getAmount()
{
if (!$this->dieselSurcharge || $this->getDieselSurcharge() < 0) {
Expand Down
1 change: 1 addition & 0 deletions src/Qbil/Models/InvoiceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface InvoiceInterface
{
public function addInvoiceLine(InvoiceLineInterface $invoiceLine);
public function getRelation();
public function getInvoiceType();
public function getSubsidiary();
public function getSupplierInvoiceNumber();
public function getAmount();
Expand Down

0 comments on commit d4ed9a4

Please sign in to comment.