Skip to content

Commit

Permalink
Merge pull request #49 from creativestyle/master
Browse files Browse the repository at this point in the history
Add missing filters to Invoice
  • Loading branch information
teiling88 authored Feb 15, 2024
2 parents 280174e + 8ad6a4a commit a3e48f3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/Invoice/InvoiceEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ class InvoiceEntity

public $documentUrl;

public $startDate;

public $endDate;

public const FIELD_MAPPING = [
'INVOICE_ID' => 'invoiceId',
'TYPE' => 'type',
Expand Down Expand Up @@ -183,6 +187,8 @@ class InvoiceEntity
'PAYMENTS' => 'payments',
'PAYMENT_INFO' => 'paymentInfo',
'DOCUMENT_URL' => 'documentUrl',
'START_DATE' => 'startDate',
'END_DATE' => 'endDate',
];

public const XML_FIELD_MAPPING = [
Expand Down Expand Up @@ -240,9 +246,11 @@ class InvoiceEntity
'payments' => 'PAYMENTS',
'paymentInfo' => 'PAYMENT_INFO',
'documentUrl' => 'DOCUMENT_URL',
'startDate' => 'START_DATE',
'endDate' => 'END_DATE',
];

public function __construct(\SimpleXMLElement $data = null)
public function __construct(?\SimpleXMLElement $data = null)
{
if ($data) {
$this->setData($data);
Expand Down
28 changes: 27 additions & 1 deletion src/Invoice/InvoiceSearchStruct.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,17 @@ public function setCustomerIdFilter(int $customerId)
$this->filters['CUSTOMER_ID'] = $customerId;
}

public function setProjectIdFilter(string $month)
/**
* @Deprecated
*/
public function setMonthFilter(string $month)
{
$this->filters['MONTH'] = $month;
}

/**
* @Deprecated
*/
public function setYearFilter(string $year)
{
$this->filters['YEAR'] = $year;
Expand All @@ -47,6 +53,26 @@ public function setEndDueDateFilter(string $endDueDate)
$this->filters['END_DUE_DATE'] = $endDueDate;
}

public function setStartPaidDateFilter(string $startPaidDate)
{
$this->filters['START_PAID_DATE'] = $startPaidDate;
}

public function setEndPaidDateFilter(string $endPaidDate)
{
$this->filters['END_PAID_DATE'] = $endPaidDate;
}

public function setStartDate(string $startDate)
{
$this->filters['START_DATE'] = $startDate;
}

public function setEndDateFilter(string $endDate)
{
$this->filters['END_DATE'] = $endDate;
}

public function setTypeFilter(string $type)
{
$this->filters['TYPE'] = $type;
Expand Down

0 comments on commit a3e48f3

Please sign in to comment.