-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for Over/Prepayments March 17th release.
- Loading branch information
Showing
4 changed files
with
310 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
151 changes: 151 additions & 0 deletions
151
src/XeroPHP/Models/Accounting/Overpayment/Allocation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<?php | ||
|
||
namespace XeroPHP\Models\Accounting\Overpayment; | ||
|
||
use XeroPHP\Remote; | ||
|
||
use XeroPHP\Models\Accounting\Invoice; | ||
|
||
class Allocation extends Remote\Object { | ||
|
||
/** | ||
* the invoice the overpayment is being allocated against | ||
* | ||
* @property Invoice Invoice | ||
*/ | ||
|
||
/** | ||
* the amount being applied to the invoice | ||
* | ||
* @property float AppliedAmount | ||
*/ | ||
|
||
/** | ||
* the date the overpayment is applied YYYY-MM-DD (read-only). This will be the latter of the invoice | ||
* date and the overpayment date. | ||
* | ||
* @property \DateTime Date | ||
*/ | ||
|
||
|
||
|
||
/* | ||
* Get the resource uri of the class (Contacts) etc | ||
* | ||
* @return string | ||
*/ | ||
public static function getResourceURI(){ | ||
return null; | ||
} | ||
|
||
|
||
/* | ||
* Get the root node name. Just the unqualified classname | ||
* | ||
* @return string | ||
*/ | ||
public static function getRootNodeName(){ | ||
return 'Allocation'; | ||
} | ||
|
||
|
||
/* | ||
* Get the guid property | ||
* | ||
* @return string | ||
*/ | ||
public static function getGUIDProperty(){ | ||
return ''; | ||
} | ||
|
||
|
||
/** | ||
* Get the stem of the API (core.xro) etc | ||
* | ||
* @return string|null | ||
*/ | ||
public static function getAPIStem(){ | ||
return Remote\URL::API_CORE; | ||
} | ||
|
||
|
||
/* | ||
* Get the supported methods | ||
*/ | ||
public static function getSupportedMethods(){ | ||
return array( | ||
); | ||
} | ||
|
||
/** | ||
* | ||
* Get the properties of the object. Indexed by constants | ||
* [0] - Mandatory | ||
* [1] - Type | ||
* [2] - PHP type | ||
* [3] - Is an Array | ||
* | ||
* @return array | ||
*/ | ||
public static function getProperties(){ | ||
return array( | ||
'Invoice' => array (false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\Invoice', false), | ||
'AppliedAmount' => array (false, self::PROPERTY_TYPE_FLOAT, null, false), | ||
'Date' => array (false, self::PROPERTY_TYPE_DATE, '\\DateTime', false) | ||
); | ||
} | ||
|
||
|
||
/** | ||
* @return Invoice | ||
*/ | ||
public function getInvoice(){ | ||
return $this->_data['Invoice']; | ||
} | ||
|
||
/** | ||
* @param Invoice $value | ||
* @return Allocation | ||
*/ | ||
public function setInvoice(Invoice $value){ | ||
$this->propertyUpdated('Invoice', $value); | ||
$this->_data['Invoice'] = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return float | ||
*/ | ||
public function getAppliedAmount(){ | ||
return $this->_data['AppliedAmount']; | ||
} | ||
|
||
/** | ||
* @param float $value | ||
* @return Allocation | ||
*/ | ||
public function setAppliedAmount($value){ | ||
$this->propertyUpdated('AppliedAmount', $value); | ||
$this->_data['AppliedAmount'] = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return \DateTime | ||
*/ | ||
public function getDate(){ | ||
return $this->_data['Date']; | ||
} | ||
|
||
/** | ||
* @param \DateTime $value | ||
* @return Allocation | ||
*/ | ||
public function setDate(\DateTime $value){ | ||
$this->propertyUpdated('Date', $value); | ||
$this->_data['Date'] = $value; | ||
return $this; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
151 changes: 151 additions & 0 deletions
151
src/XeroPHP/Models/Accounting/Prepayment/Allocation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
<?php | ||
|
||
namespace XeroPHP\Models\Accounting\Prepayment; | ||
|
||
use XeroPHP\Remote; | ||
|
||
use XeroPHP\Models\Accounting\Invoice; | ||
|
||
class Allocation extends Remote\Object { | ||
|
||
/** | ||
* the invoice the prepayment is being allocated against | ||
* | ||
* @property Invoice Invoice | ||
*/ | ||
|
||
/** | ||
* the amount being applied to the invoice | ||
* | ||
* @property float AppliedAmount | ||
*/ | ||
|
||
/** | ||
* the date the prepayment is applied YYYY-MM-DD (read-only). This will be the latter of the invoice | ||
* date and the prepayment date. | ||
* | ||
* @property \DateTime Date | ||
*/ | ||
|
||
|
||
|
||
/* | ||
* Get the resource uri of the class (Contacts) etc | ||
* | ||
* @return string | ||
*/ | ||
public static function getResourceURI(){ | ||
return null; | ||
} | ||
|
||
|
||
/* | ||
* Get the root node name. Just the unqualified classname | ||
* | ||
* @return string | ||
*/ | ||
public static function getRootNodeName(){ | ||
return 'Allocation'; | ||
} | ||
|
||
|
||
/* | ||
* Get the guid property | ||
* | ||
* @return string | ||
*/ | ||
public static function getGUIDProperty(){ | ||
return ''; | ||
} | ||
|
||
|
||
/** | ||
* Get the stem of the API (core.xro) etc | ||
* | ||
* @return string|null | ||
*/ | ||
public static function getAPIStem(){ | ||
return Remote\URL::API_CORE; | ||
} | ||
|
||
|
||
/* | ||
* Get the supported methods | ||
*/ | ||
public static function getSupportedMethods(){ | ||
return array( | ||
); | ||
} | ||
|
||
/** | ||
* | ||
* Get the properties of the object. Indexed by constants | ||
* [0] - Mandatory | ||
* [1] - Type | ||
* [2] - PHP type | ||
* [3] - Is an Array | ||
* | ||
* @return array | ||
*/ | ||
public static function getProperties(){ | ||
return array( | ||
'Invoice' => array (false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\Invoice', false), | ||
'AppliedAmount' => array (false, self::PROPERTY_TYPE_FLOAT, null, false), | ||
'Date' => array (false, self::PROPERTY_TYPE_DATE, '\\DateTime', false) | ||
); | ||
} | ||
|
||
|
||
/** | ||
* @return Invoice | ||
*/ | ||
public function getInvoice(){ | ||
return $this->_data['Invoice']; | ||
} | ||
|
||
/** | ||
* @param Invoice $value | ||
* @return Allocation | ||
*/ | ||
public function setInvoice(Invoice $value){ | ||
$this->propertyUpdated('Invoice', $value); | ||
$this->_data['Invoice'] = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return float | ||
*/ | ||
public function getAppliedAmount(){ | ||
return $this->_data['AppliedAmount']; | ||
} | ||
|
||
/** | ||
* @param float $value | ||
* @return Allocation | ||
*/ | ||
public function setAppliedAmount($value){ | ||
$this->propertyUpdated('AppliedAmount', $value); | ||
$this->_data['AppliedAmount'] = $value; | ||
return $this; | ||
} | ||
|
||
/** | ||
* @return \DateTime | ||
*/ | ||
public function getDate(){ | ||
return $this->_data['Date']; | ||
} | ||
|
||
/** | ||
* @param \DateTime $value | ||
* @return Allocation | ||
*/ | ||
public function setDate(\DateTime $value){ | ||
$this->propertyUpdated('Date', $value); | ||
$this->_data['Date'] = $value; | ||
return $this; | ||
} | ||
|
||
|
||
} |