From cefb08b658fd76c0900d98e73edcda250d449c43 Mon Sep 17 00:00:00 2001 From: Michael Calcinai Date: Tue, 27 Oct 2015 07:09:36 +1300 Subject: [PATCH] Models @ 25e2785 --- .../BankTransfer/FromBankAccount.php | 4 +- .../Accounting/BankTransfer/ToBankAccount.php | 4 +- src/XeroPHP/Models/Accounting/Item.php | 224 ++++++++++++++++++ .../Models/Accounting/Item/Purchase.php | 49 +++- src/XeroPHP/Models/Accounting/Item/Sale.php | 49 +++- .../Models/PayrollUS/PayItem/EarningsType.php | 35 ++- 6 files changed, 336 insertions(+), 29 deletions(-) diff --git a/src/XeroPHP/Models/Accounting/BankTransfer/FromBankAccount.php b/src/XeroPHP/Models/Accounting/BankTransfer/FromBankAccount.php index 7f4f71be..68d5a848 100644 --- a/src/XeroPHP/Models/Accounting/BankTransfer/FromBankAccount.php +++ b/src/XeroPHP/Models/Accounting/BankTransfer/FromBankAccount.php @@ -93,8 +93,8 @@ public static function getSupportedMethods() public static function getProperties() { return array( - 'Code' => array (true, self::PROPERTY_TYPE_STRING, null, false, false), - 'AccountID' => array (true, self::PROPERTY_TYPE_STRING, null, false, false), + 'Code' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), + 'AccountID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), 'Name' => array (false, self::PROPERTY_TYPE_STRING, null, false, false) ); } diff --git a/src/XeroPHP/Models/Accounting/BankTransfer/ToBankAccount.php b/src/XeroPHP/Models/Accounting/BankTransfer/ToBankAccount.php index bc4c90de..36572add 100644 --- a/src/XeroPHP/Models/Accounting/BankTransfer/ToBankAccount.php +++ b/src/XeroPHP/Models/Accounting/BankTransfer/ToBankAccount.php @@ -93,8 +93,8 @@ public static function getSupportedMethods() public static function getProperties() { return array( - 'Code' => array (true, self::PROPERTY_TYPE_STRING, null, false, false), - 'AccountID' => array (true, self::PROPERTY_TYPE_STRING, null, false, false), + 'Code' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), + 'AccountID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), 'Name' => array (false, self::PROPERTY_TYPE_STRING, null, false, false) ); } diff --git a/src/XeroPHP/Models/Accounting/Item.php b/src/XeroPHP/Models/Accounting/Item.php index 2fcc4f03..d768598f 100644 --- a/src/XeroPHP/Models/Accounting/Item.php +++ b/src/XeroPHP/Models/Accounting/Item.php @@ -20,12 +20,47 @@ class Item extends Remote\Object * @property string Code */ + /** + * The inventory asset account for the item. The account must be of type INVENTORY. The + * COGSAccountCode in PurchaseDetails is also required to create a tracked item + * + * @property string InventoryAssetAccountCode + */ + + /** + * The name of the item (max length = 50) + * + * @property string Name + */ + + /** + * Boolean value, defaults to true. When IsSold is true the item will be available on sales + * transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values + * will be nulled. + * + * @property bool IsSold + */ + + /** + * Boolean value, defaults to true. When IsPurchased is true the item is available for purchase + * transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and + * PurchaseDetails values will be nulled. + * + * @property bool IsPurchased + */ + /** * The sales description of the item (max length = 4000) * * @property string Description */ + /** + * The purchase description of the item (max length = 4000) + * + * @property string PurchaseDescription + */ + /** * See Purchases & Sales * @@ -38,6 +73,25 @@ class Item extends Remote\Object * @property Sale[] SalesDetails */ + /** + * True for items that are tracked as inventory. An item will be tracked as inventory if the + * InventoryAssetAccountCode and COGSAccountCode are set. + * + * @property bool IsTrackedAsInventory + */ + + /** + * The value of the item on hand. Calculated using average cost accounting. + * + * @property string TotalCostPool + */ + + /** + * The quantity of the item on hand + * + * @property string QuantityOnHand + */ + /** * Last modified date in UTC format * @@ -118,9 +172,17 @@ public static function getProperties() return array( 'ItemID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), 'Code' => array (true, self::PROPERTY_TYPE_STRING, null, false, false), + 'InventoryAssetAccountCode' => array (true, self::PROPERTY_TYPE_STRING, null, false, false), + 'Name' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), + 'IsSold' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false, false), + 'IsPurchased' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false, false), 'Description' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), + 'PurchaseDescription' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), 'PurchaseDetails' => array (false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\Item\\Purchase', true, false), 'SalesDetails' => array (false, self::PROPERTY_TYPE_OBJECT, 'Accounting\\Item\\Sale', true, false), + 'IsTrackedAsInventory' => array (false, self::PROPERTY_TYPE_BOOLEAN, null, false, false), + 'TotalCostPool' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), + 'QuantityOnHand' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), 'UpdatedDateUTC' => array (false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTime', false, false) ); } @@ -168,6 +230,82 @@ public function setCode($value) return $this; } + /** + * @return string + */ + public function getInventoryAssetAccountCode() + { + return $this->_data['InventoryAssetAccountCode']; + } + + /** + * @param string $value + * @return Item + */ + public function setInventoryAssetAccountCode($value) + { + $this->propertyUpdated('InventoryAssetAccountCode', $value); + $this->_data['InventoryAssetAccountCode'] = $value; + return $this; + } + + /** + * @return string + */ + public function getName() + { + return $this->_data['Name']; + } + + /** + * @param string $value + * @return Item + */ + public function setName($value) + { + $this->propertyUpdated('Name', $value); + $this->_data['Name'] = $value; + return $this; + } + + /** + * @return bool + */ + public function getIsSold() + { + return $this->_data['IsSold']; + } + + /** + * @param bool $value + * @return Item + */ + public function setIsSold($value) + { + $this->propertyUpdated('IsSold', $value); + $this->_data['IsSold'] = $value; + return $this; + } + + /** + * @return bool + */ + public function getIsPurchased() + { + return $this->_data['IsPurchased']; + } + + /** + * @param bool $value + * @return Item + */ + public function setIsPurchased($value) + { + $this->propertyUpdated('IsPurchased', $value); + $this->_data['IsPurchased'] = $value; + return $this; + } + /** * @return string */ @@ -187,6 +325,25 @@ public function setDescription($value) return $this; } + /** + * @return string + */ + public function getPurchaseDescription() + { + return $this->_data['PurchaseDescription']; + } + + /** + * @param string $value + * @return Item + */ + public function setPurchaseDescription($value) + { + $this->propertyUpdated('PurchaseDescription', $value); + $this->_data['PurchaseDescription'] = $value; + return $this; + } + /** * @return Purchase[]|Remote\Collection * Always returns a collection, switch is for type hinting @@ -233,6 +390,63 @@ public function addSalesDetail(Sale $value) return $this; } + /** + * @return bool + */ + public function getIsTrackedAsInventory() + { + return $this->_data['IsTrackedAsInventory']; + } + + /** + * @param bool $value + * @return Item + */ + public function setIsTrackedAsInventory($value) + { + $this->propertyUpdated('IsTrackedAsInventory', $value); + $this->_data['IsTrackedAsInventory'] = $value; + return $this; + } + + /** + * @return string + */ + public function getTotalCostPool() + { + return $this->_data['TotalCostPool']; + } + + /** + * @param string $value + * @return Item + */ + public function setTotalCostPool($value) + { + $this->propertyUpdated('TotalCostPool', $value); + $this->_data['TotalCostPool'] = $value; + return $this; + } + + /** + * @return string + */ + public function getQuantityOnHand() + { + return $this->_data['QuantityOnHand']; + } + + /** + * @param string $value + * @return Item + */ + public function setQuantityOnHand($value) + { + $this->propertyUpdated('QuantityOnHand', $value); + $this->_data['QuantityOnHand'] = $value; + return $this; + } + /** * @return \DateTime */ @@ -241,6 +455,16 @@ public function getUpdatedDateUTC() return $this->_data['UpdatedDateUTC']; } + /** + * @param \DateTime $value + * @return Item + */ + public function setUpdatedDateUTC(\DateTime $value) + { + $this->propertyUpdated('UpdatedDateUTC', $value); + $this->_data['UpdatedDateUTC'] = $value; + return $this; + } } diff --git a/src/XeroPHP/Models/Accounting/Item/Purchase.php b/src/XeroPHP/Models/Accounting/Item/Purchase.php index f506e437..c9280977 100644 --- a/src/XeroPHP/Models/Accounting/Item/Purchase.php +++ b/src/XeroPHP/Models/Accounting/Item/Purchase.php @@ -14,16 +14,16 @@ class Purchase extends Remote\Object */ /** - * Account code to be used for purchased item + * Default account code to be used for purchased/sale. Not applicable to the purchase details of + * tracked items * * @property string AccountCode */ /** - * Used as an override if the default Tax Code for the selected is not correct – see - * TaxTypes. + * Cost of goods sold account. Only applicable to the purchase details of tracked items. * - * @property string TaxType + * @property string COGSAccountCode */ /** @@ -33,6 +33,13 @@ class Purchase extends Remote\Object * @deprecated */ + /** + * Used as an override if the default Tax Code for the selected is not correct – see + * TaxTypes. + * + * @property string TaxType + */ + /** @@ -104,8 +111,9 @@ public static function getProperties() return array( 'UnitPrice' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false), 'AccountCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), - 'TaxType' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false), - 'UpdatedDateUTC' => array (false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTime', false, false) + 'COGSAccountCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), + 'UpdatedDateUTC' => array (false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTime', false, false), + 'TaxType' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false) ); } @@ -155,19 +163,19 @@ public function setAccountCode($value) /** * @return string */ - public function getTaxType() + public function getCOGSAccountCode() { - return $this->_data['TaxType']; + return $this->_data['COGSAccountCode']; } /** * @param string $value * @return Purchase */ - public function setTaxType($value) + public function setCOGSAccountCode($value) { - $this->propertyUpdated('TaxType', $value); - $this->_data['TaxType'] = $value; + $this->propertyUpdated('COGSAccountCode', $value); + $this->_data['COGSAccountCode'] = $value; return $this; } @@ -192,5 +200,24 @@ public function setUpdatedDateUTC(\DateTime $value) return $this; } + /** + * @return string + */ + public function getTaxType() + { + return $this->_data['TaxType']; + } + + /** + * @param string $value + * @return Purchase + */ + public function setTaxType($value) + { + $this->propertyUpdated('TaxType', $value); + $this->_data['TaxType'] = $value; + return $this; + } + } diff --git a/src/XeroPHP/Models/Accounting/Item/Sale.php b/src/XeroPHP/Models/Accounting/Item/Sale.php index c69e6cff..c73f61d8 100644 --- a/src/XeroPHP/Models/Accounting/Item/Sale.php +++ b/src/XeroPHP/Models/Accounting/Item/Sale.php @@ -14,16 +14,16 @@ class Sale extends Remote\Object */ /** - * Account code to be used for purchased item + * Default account code to be used for purchased/sale. Not applicable to the purchase details of + * tracked items * * @property string AccountCode */ /** - * Used as an override if the default Tax Code for the selected is not correct – see - * TaxTypes. + * Cost of goods sold account. Only applicable to the purchase details of tracked items. * - * @property string TaxType + * @property string COGSAccountCode */ /** @@ -33,6 +33,13 @@ class Sale extends Remote\Object * @deprecated */ + /** + * Used as an override if the default Tax Code for the selected is not correct – see + * TaxTypes. + * + * @property string TaxType + */ + /** @@ -104,8 +111,9 @@ public static function getProperties() return array( 'UnitPrice' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false), 'AccountCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), - 'TaxType' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false), - 'UpdatedDateUTC' => array (false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTime', false, false) + 'COGSAccountCode' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), + 'UpdatedDateUTC' => array (false, self::PROPERTY_TYPE_TIMESTAMP, '\\DateTime', false, false), + 'TaxType' => array (false, self::PROPERTY_TYPE_ENUM, null, false, false) ); } @@ -155,19 +163,19 @@ public function setAccountCode($value) /** * @return string */ - public function getTaxType() + public function getCOGSAccountCode() { - return $this->_data['TaxType']; + return $this->_data['COGSAccountCode']; } /** * @param string $value * @return Sale */ - public function setTaxType($value) + public function setCOGSAccountCode($value) { - $this->propertyUpdated('TaxType', $value); - $this->_data['TaxType'] = $value; + $this->propertyUpdated('COGSAccountCode', $value); + $this->_data['COGSAccountCode'] = $value; return $this; } @@ -192,5 +200,24 @@ public function setUpdatedDateUTC(\DateTime $value) return $this; } + /** + * @return string + */ + public function getTaxType() + { + return $this->_data['TaxType']; + } + + /** + * @param string $value + * @return Sale + */ + public function setTaxType($value) + { + $this->propertyUpdated('TaxType', $value); + $this->_data['TaxType'] = $value; + return $this; + } + } diff --git a/src/XeroPHP/Models/PayrollUS/PayItem/EarningsType.php b/src/XeroPHP/Models/PayrollUS/PayItem/EarningsType.php index ad67ab0e..52a34f17 100644 --- a/src/XeroPHP/Models/PayrollUS/PayItem/EarningsType.php +++ b/src/XeroPHP/Models/PayrollUS/PayItem/EarningsType.php @@ -44,14 +44,21 @@ class EarningsType extends Remote\Object */ /** - * Xero identifier + * This property has been removed from the Xero API * * @property string EarningsRateID + * @deprecated + */ + + /** + * Xero identifier + * + * @property string EarningsTypeID */ /** * This is the multiplier used to calculate the rate per unit, based on the employee’s ordinary - * earnings rate. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE + * earnings type. For example, for time and a half enter 1.5. Only applicable if RateType is MULTIPLE * * @property float Multiple */ @@ -126,7 +133,7 @@ public static function getRootNodeName() */ public static function getGUIDProperty() { - return ''; + return 'EarningsTypeID'; } @@ -171,6 +178,7 @@ public static function getProperties() 'RateType' => array (true, self::PROPERTY_TYPE_ENUM, null, false, false), 'TypeOfUnits' => array (true, self::PROPERTY_TYPE_ENUM, null, false, false), 'EarningsRateID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), + 'EarningsTypeID' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), 'Multiple' => array (false, self::PROPERTY_TYPE_FLOAT, null, false, false), 'DoNotAccrueTimeOff' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), 'IsSupplemental' => array (false, self::PROPERTY_TYPE_STRING, null, false, false), @@ -301,6 +309,7 @@ public function setTypeOfUnit($value) /** * @return string + * @deprecated */ public function getEarningsRateID() { @@ -310,6 +319,7 @@ public function getEarningsRateID() /** * @param string $value * @return EarningsType + * @deprecated */ public function setEarningsRateID($value) { @@ -318,6 +328,25 @@ public function setEarningsRateID($value) return $this; } + /** + * @return string + */ + public function getEarningsTypeID() + { + return $this->_data['EarningsTypeID']; + } + + /** + * @param string $value + * @return EarningsType + */ + public function setEarningsTypeID($value) + { + $this->propertyUpdated('EarningsTypeID', $value); + $this->_data['EarningsTypeID'] = $value; + return $this; + } + /** * @return float */