Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing properties to deal and dealline #56

Merged
merged 3 commits into from
Aug 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Deals/Deal.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ class Deal
*/
private $reasonRefused;

/**
* @var integer
*/
private $optionalContactId;

/**
* @param integer $id
*/
Expand Down Expand Up @@ -348,6 +353,22 @@ public function setReasonRefused($reasonRefused)
$this->reasonRefused = $reasonRefused;
}

/**
* @return integer
*/
public function getOptionalContactId()
{
return $this->optionalContactId;
}

/**
* @param integer $optionalContactId
*/
public function setOptionalContactPersonId($optionalContactId)
{
$this->optionalContactId = $optionalContactId;
}

/**
* Is this deal linked to a contact or a company
*
Expand Down Expand Up @@ -421,6 +442,9 @@ public function toArrayForApi($add = true)
if ($this->getReasonRefused()) {
$return['reason_refused'] = $this->getReasonRefused();
}
if ($this->getOptionalContactId()) {
$return['optional_contact_id'] = $this->getOptionalContactId();
}
if ($this->getCustomFields()) {
foreach ($this->getCustomFields() as $fieldID => $fieldValue) {
$return['custom_field_' . $fieldID] = $fieldValue;
Expand Down
24 changes: 24 additions & 0 deletions Deals/DealLine.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class DealLine
*/
private $vat;

/**
* @var string
*/
private $subtitle;

/**
* @param float $amount
*/
Expand Down Expand Up @@ -88,6 +93,22 @@ public function getVat()
return $this->vat;
}

/**
* @param string $subtitle
*/
public function setSubtitle($subtitle)
{
$this->subtitle = $subtitle;
}

/**
* @return string
*/
public function getSubtitle()
{
return $this->subtitle;
}

/**
* This method will convert a deal to an array that can be used for an
* API-request
Expand All @@ -102,6 +123,9 @@ public function toArrayForApi($index = 1)
$return['price_' . $index] = $this->getPrice();
$return['amount_' . $index] = $this->getAmount();
$return['vat_' . $index] = $this->getVat();
if($this->getSubtitle()) {
$return['subtitle_' . $index] = $this->getSubtitle();
}

return $return;
}
Expand Down
16 changes: 16 additions & 0 deletions Teamleader.php
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,22 @@ public function invoicesSendInvoice(Invoice $invoice, $to, $subject, $text)
);
}

/**
* Getting information about bookkeeping accounts
*
* @param int $sys_department_id
* @return array
*/
public function invoicesGetBookkeepingAccounts($sys_department_id)
{
return $this->doCall(
'getBookkeepingAccounts.php',
array(
'sys_department_id' => $sys_department_id,
)
);
}

/**
* Adds a subscription
*
Expand Down