diff --git a/src/Qbil/Models/Invoice.php b/src/Qbil/Models/Invoice.php index a4e62c0..135f405 100644 --- a/src/Qbil/Models/Invoice.php +++ b/src/Qbil/Models/Invoice.php @@ -3,12 +3,11 @@ * Created by PhpStorm. * User: faizan * Date: 11/12/18 - * Time: 4:03 PM + * Time: 4:03 PM. */ namespace Qbil\ReadSoftOnline\Models; - class Invoice { public function __construct(Document $document) @@ -23,6 +22,7 @@ public function __construct(Document $document) $this->currency = $this->extract($document->HeaderFields, 'invoicecurrency'); $this->theirVatRegistration = $this->extract($document->HeaderFields, 'suppliervatregistrationnumber'); $this->ourVatRegistration = $this->extract($document->HeaderFields, 'CustomerVATRegistrationNumber'); + $this->orderNumber = $this->extract($document->HeaderFields, 'invoiceordernumber'); foreach (array_column($this->extract($document->Tables, 'LineItem', 'TableRows'), 'ItemFields') as $line) { $invoiceLine = new InvoiceLine( @@ -47,6 +47,7 @@ public function __construct(Document $document) private $currency; private $theirVatRegistration; private $ourVatRegistration; + private $orderNumber; private $invoiceLines = []; public function addInvoiceLine(InvoiceLine $invoiceLine) @@ -146,4 +147,12 @@ private function extract(array $property, $key, $subKey = 'Text') { return $property[array_search($key, array_column($property, 'Type'))][$subKey]; } -} \ No newline at end of file + + /** + * @return mixed + */ + public function getOrder() + { + return $this->orderNumber; + } +}