From d0d153dfd0fb3c202fe8a0971354293cea6bbea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Horv=C3=A1th?= Date: Wed, 20 Apr 2016 19:36:16 +0200 Subject: [PATCH] Proper composer include and object changes (APPSPEED-107) (#8) * composer autoload and invoice change * use classmap * add some missing classes * allow null bankAccount for entity * non-mandatory supplier and customer * add previously missing methods and missing project attribute --- composer.json | 7 ++++-- src/Clearbooks/Soap/1/0.php | 18 +++++++++++++++ src/Clearbooks/Soap/1/0/Bank/BankAccount.php | 17 ++++++++++++++ src/Clearbooks/Soap/1/0/BankStatementLine.php | 19 +++++++++++++++ .../Soap/1/0/CreditPartialQuery.php | 23 +++++++++++++++++++ src/Clearbooks/Soap/1/0/Entity.php | 6 ++--- src/Clearbooks/Soap/1/0/Invoice.php | 6 +++++ src/Clearbooks/Soap/1/0/Item.php | 5 +++- src/Clearbooks/Soap/1/0/Payment.php | 5 +++- src/Clearbooks/Soap/1/0/ResponseStatus.php | 2 +- 10 files changed, 100 insertions(+), 8 deletions(-) create mode 100644 src/Clearbooks/Soap/1/0/Bank/BankAccount.php create mode 100644 src/Clearbooks/Soap/1/0/BankStatementLine.php create mode 100644 src/Clearbooks/Soap/1/0/CreditPartialQuery.php diff --git a/composer.json b/composer.json index 9554b9e..0077e96 100644 --- a/composer.json +++ b/composer.json @@ -1,3 +1,6 @@ { - "name": "clearbooks/clearbooks-soap-php" -} \ No newline at end of file + "name": "clearbooks/clearbooks-soap-php", + "autoload": { + "classmap": [ "src/" ] + } +} diff --git a/src/Clearbooks/Soap/1/0.php b/src/Clearbooks/Soap/1/0.php index c2130e3..f173dca 100644 --- a/src/Clearbooks/Soap/1/0.php +++ b/src/Clearbooks/Soap/1/0.php @@ -96,6 +96,24 @@ public function createAccountCode( \Clearbooks_Soap_1_0_AccountCodeRequest $code return $this->_call( 'createAccountCode', $code ); } + /** + * @param string $bankAccount + * @param string $statementName + * @param \Clearbooks_Soap_1_0_BankStatementLine[] $statementLines + */ + public function addBankStatementLines( $bankAccount, $statementName, $statementLines ) + { + $this->_call( 'addBankStatementLines', $bankAccount, $statementName, $statementLines ); + } + + /** + * @param \Clearbooks_Soap_1_0_CreditPartialQuery $query + */ + public function writeOffPartial( $query ) + { + $this->_call( 'writeOffPartial', $query ); + } + /** * @param \Clearbooks_Soap_1_0_Entity $entity * @return int diff --git a/src/Clearbooks/Soap/1/0/Bank/BankAccount.php b/src/Clearbooks/Soap/1/0/Bank/BankAccount.php new file mode 100644 index 0000000..b68e02f --- /dev/null +++ b/src/Clearbooks/Soap/1/0/Bank/BankAccount.php @@ -0,0 +1,17 @@ + + * @version 1.0 + */ +class Clearbooks_Soap_1_0_Bank_BankAccount +{ + /** @var string */ + public $name; + + /** @var string */ + public $accountNumber; + + /** @var string */ + public $sortCode; +} +//EOF BankAccount.php \ No newline at end of file diff --git a/src/Clearbooks/Soap/1/0/BankStatementLine.php b/src/Clearbooks/Soap/1/0/BankStatementLine.php new file mode 100644 index 0000000..21d3100 --- /dev/null +++ b/src/Clearbooks/Soap/1/0/BankStatementLine.php @@ -0,0 +1,19 @@ + + * @version 1.0 + * @package Clearbooks + * @subpackage Soap/1/0 + */ +class Clearbooks_Soap_1_0_BankStatementLine +{ + /** @var string */ + public $description; + + /** @var string */ + public $date; + + /** @var float */ + public $amount; +} +//EOF BankStatementLine.php \ No newline at end of file diff --git a/src/Clearbooks/Soap/1/0/CreditPartialQuery.php b/src/Clearbooks/Soap/1/0/CreditPartialQuery.php new file mode 100644 index 0000000..ccc8f86 --- /dev/null +++ b/src/Clearbooks/Soap/1/0/CreditPartialQuery.php @@ -0,0 +1,23 @@ + + * @version 1.0 + * @package Clearbooks + * @subpackage Soap/1/0 + */ +class Clearbooks_Soap_1_0_CreditPartialQuery +{ + /** @var int */ + public $invoiceId; + + /** @var int */ + public $creditId; + + /** @var float */ + public $amountToAllocate; + + /** @var string */ + public $ledger; + +} +//EOF CreditPartialQuery.php \ No newline at end of file diff --git a/src/Clearbooks/Soap/1/0/Entity.php b/src/Clearbooks/Soap/1/0/Entity.php index 937a6d4..79cd6da 100644 --- a/src/Clearbooks/Soap/1/0/Entity.php +++ b/src/Clearbooks/Soap/1/0/Entity.php @@ -8,13 +8,13 @@ class Clearbooks_Soap_1_0_Entity { /** @var \Clearbooks_Soap_1_0_EntityExtra */ - public $supplier; + public $supplier = null; /** @var \Clearbooks_Soap_1_0_EntityExtra */ - public $customer; + public $customer = null; /** @var \Clearbooks_Soap_1_0_BankAccount */ - public $bankAccount; + public $bankAccount = null; /** @var int */ public $id = 0; diff --git a/src/Clearbooks/Soap/1/0/Invoice.php b/src/Clearbooks/Soap/1/0/Invoice.php index 2f8677e..8350bf4 100644 --- a/src/Clearbooks/Soap/1/0/Invoice.php +++ b/src/Clearbooks/Soap/1/0/Invoice.php @@ -34,6 +34,9 @@ class Clearbooks_Soap_1_0_Invoice /** @var \DateTime */ public $dateDue = ''; + /** @var \DateTime */ + public $dateModified = ''; + /** @var \DateTime */ public $dateAccrual = ''; @@ -76,6 +79,9 @@ class Clearbooks_Soap_1_0_Invoice /** @var int */ public $multicurrency = ''; + /** @var float */ + public $fxrate = 0; + /** @var float */ public $gross = 0; diff --git a/src/Clearbooks/Soap/1/0/Item.php b/src/Clearbooks/Soap/1/0/Item.php index 9ea0631..f38389a 100644 --- a/src/Clearbooks/Soap/1/0/Item.php +++ b/src/Clearbooks/Soap/1/0/Item.php @@ -25,5 +25,8 @@ class Clearbooks_Soap_1_0_Item /** @var string */ public $vatRate = '0'; + + /** @var int */ + public $project = 0; } -//EOF Item.php \ No newline at end of file +//EOF Item.php diff --git a/src/Clearbooks/Soap/1/0/Payment.php b/src/Clearbooks/Soap/1/0/Payment.php index f744fbe..84a154f 100644 --- a/src/Clearbooks/Soap/1/0/Payment.php +++ b/src/Clearbooks/Soap/1/0/Payment.php @@ -36,5 +36,8 @@ class Clearbooks_Soap_1_0_Payment /** @var int */ public $bsAccount = 0; + + /** @var int */ + public $fxrate; } -//EOF Payment.php \ No newline at end of file +//EOF Payment.php diff --git a/src/Clearbooks/Soap/1/0/ResponseStatus.php b/src/Clearbooks/Soap/1/0/ResponseStatus.php index ae822ee..17b2e9d 100644 --- a/src/Clearbooks/Soap/1/0/ResponseStatus.php +++ b/src/Clearbooks/Soap/1/0/ResponseStatus.php @@ -11,6 +11,6 @@ class Clearbooks_Soap_1_0_ResponseStatus public $success; /** @var string */ - public $msg = 'Test'; + public $msg = ''; } //EOF ResponseStatus.php \ No newline at end of file