Skip to content

Commit

Permalink
Merge pull request #56 from hannenijhuis/add_properties_to_deals
Browse files Browse the repository at this point in the history
Add missing properties to deal and dealline
  • Loading branch information
carakas committed Aug 14, 2017
2 parents fa910b8 + 35ba4cf commit ce24c67
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
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

0 comments on commit ce24c67

Please sign in to comment.