diff --git a/src/XeroPHP/Models/Accounting/Overpayment.php b/src/XeroPHP/Models/Accounting/Overpayment.php index 4aa30e5c..12f78d19 100644 --- a/src/XeroPHP/Models/Accounting/Overpayment.php +++ b/src/XeroPHP/Models/Accounting/Overpayment.php @@ -5,7 +5,7 @@ use XeroPHP\Remote; use XeroPHP\Models\Accounting\BankTransaction\LineItem; -use XeroPHP\Models\Accounting\CreditNote\Allocation; +use XeroPHP\Models\Accounting\Overpayment\Allocation; class Overpayment extends Remote\Object { @@ -172,7 +172,8 @@ public static function getAPIStem(){ */ public static function getSupportedMethods(){ return array( - Remote\Request::METHOD_GET + Remote\Request::METHOD_GET, + Remote\Request::METHOD_PUT ); } @@ -204,7 +205,7 @@ public static function getProperties(){ 'OverpaymentID' => array (false, self::PROPERTY_TYPE_STRING, null, false), 'CurrencyRate' => array (false, self::PROPERTY_TYPE_FLOAT, null, false), 'RemainingCredit' => array (false, self::PROPERTY_TYPE_STRING, null, false), - 'Allocations' => array (false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\CreditNote\\Allocation', true), + 'Allocations' => array (false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\Overpayment\\Allocation', true), 'HasAttachments' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false) ); } diff --git a/src/XeroPHP/Models/Accounting/Overpayment/Allocation.php b/src/XeroPHP/Models/Accounting/Overpayment/Allocation.php new file mode 100644 index 00000000..3cd66e54 --- /dev/null +++ b/src/XeroPHP/Models/Accounting/Overpayment/Allocation.php @@ -0,0 +1,151 @@ + 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; + } + + +} \ No newline at end of file diff --git a/src/XeroPHP/Models/Accounting/Prepayment.php b/src/XeroPHP/Models/Accounting/Prepayment.php index 853159b3..308cdcd2 100644 --- a/src/XeroPHP/Models/Accounting/Prepayment.php +++ b/src/XeroPHP/Models/Accounting/Prepayment.php @@ -5,7 +5,7 @@ use XeroPHP\Remote; use XeroPHP\Models\Accounting\BankTransaction\LineItem; -use XeroPHP\Models\Accounting\CreditNote\Allocation; +use XeroPHP\Models\Accounting\Prepayment\Allocation; class Prepayment extends Remote\Object { @@ -172,7 +172,8 @@ public static function getAPIStem(){ */ public static function getSupportedMethods(){ return array( - Remote\Request::METHOD_GET + Remote\Request::METHOD_GET, + Remote\Request::METHOD_PUT ); } @@ -204,7 +205,7 @@ public static function getProperties(){ 'PrepaymentID' => array (false, self::PROPERTY_TYPE_STRING, null, false), 'CurrencyRate' => array (false, self::PROPERTY_TYPE_FLOAT, null, false), 'RemainingCredit' => array (false, self::PROPERTY_TYPE_STRING, null, false), - 'Allocations' => array (false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\CreditNote\\Allocation', true), + 'Allocations' => array (false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\Prepayment\\Allocation', true), 'HasAttachments' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false) ); } diff --git a/src/XeroPHP/Models/Accounting/Prepayment/Allocation.php b/src/XeroPHP/Models/Accounting/Prepayment/Allocation.php new file mode 100644 index 00000000..b81ca522 --- /dev/null +++ b/src/XeroPHP/Models/Accounting/Prepayment/Allocation.php @@ -0,0 +1,151 @@ + 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; + } + + +} \ No newline at end of file