diff --git a/src/Activity.php b/src/Activity.php index 594aaf99..a6cc3f7f 100644 --- a/src/Activity.php +++ b/src/Activity.php @@ -5,7 +5,7 @@ use PhpTwinfield\Fields\BehaviourField; use PhpTwinfield\Fields\CodeField; use PhpTwinfield\Fields\InUseField; -use PhpTwinfield\Fields\Level1234\DimensionTypeField; +use PhpTwinfield\Fields\Level1234\DimensionType\TypeField; use PhpTwinfield\Fields\NameField; use PhpTwinfield\Fields\OfficeField; use PhpTwinfield\Fields\ShortNameField; @@ -23,13 +23,13 @@ class Activity extends BaseObject { use BehaviourField; use CodeField; - use DimensionTypeField; use InUseField; use NameField; use OfficeField; use ShortNameField; use StatusField; use TouchedField; + use TypeField; use UIDField; use VatCodeField; @@ -37,7 +37,7 @@ class Activity extends BaseObject public function __construct() { - $this->setTypeFromCode('ACT'); + $this->setTypeFromString('ACT'); $this->setProjects(new ActivityProjects); } diff --git a/src/ApiConnectors/BaseApiConnector.php b/src/ApiConnectors/BaseApiConnector.php index 10ddeb88..f613e40d 100644 --- a/src/ApiConnectors/BaseApiConnector.php +++ b/src/ApiConnectors/BaseApiConnector.php @@ -232,4 +232,4 @@ public function mapListAll(string $className, $data, array $objectListAllTags): return $objects; } -} +} \ No newline at end of file diff --git a/src/ApiConnectors/InvoiceApiConnector.php b/src/ApiConnectors/InvoiceApiConnector.php index 7fbec112..5012bbdf 100644 --- a/src/ApiConnectors/InvoiceApiConnector.php +++ b/src/ApiConnectors/InvoiceApiConnector.php @@ -119,7 +119,7 @@ public function listAll( $invoiceListAllTags = array( 0 => 'setInvoiceNumber', 1 => 'setInvoiceAmountFromFloat', - 2 => 'setCustomerFromCode', + 2 => 'setCustomerFromString', 3 => 'setCustomerName', 4 => 'setDebitCreditFromString', ); diff --git a/src/ApiConnectors/OfficeApiConnector.php b/src/ApiConnectors/OfficeApiConnector.php index cc7be08b..534dfdd3 100644 --- a/src/ApiConnectors/OfficeApiConnector.php +++ b/src/ApiConnectors/OfficeApiConnector.php @@ -92,7 +92,7 @@ public function listAll( $officeListAllTags = array( 0 => 'setCode', 1 => 'setName', - 2 => 'setCountryCode', + 2 => 'setCountryCodeFromString', 3 => 'setVatPeriod', 4 => 'setVatFirstQuarterStartsIn', ); diff --git a/src/Article.php b/src/Article.php index 8dd71d7a..ce600a12 100644 --- a/src/Article.php +++ b/src/Article.php @@ -8,8 +8,8 @@ use PhpTwinfield\Fields\Invoice\Article\AllowChangeUnitsPriceField; use PhpTwinfield\Fields\Invoice\Article\AllowChangeVatCodeField; use PhpTwinfield\Fields\Invoice\Article\AllowDecimalQuantityField; -use PhpTwinfield\Fields\Invoice\Article\ArticlePercentageField; -use PhpTwinfield\Fields\Invoice\Article\ArticleTypeField; +use PhpTwinfield\Fields\Invoice\Article\PercentageField; +use PhpTwinfield\Fields\Invoice\Article\TypeField; use PhpTwinfield\Fields\Invoice\Article\UnitNamePluralField; use PhpTwinfield\Fields\Invoice\Article\UnitNameSingularField; use PhpTwinfield\Fields\Invoice\PerformanceTypeField; @@ -30,14 +30,14 @@ class Article extends BaseObject use AllowChangeVatCodeField; use AllowDecimalQuantityField; use AllowDiscountOrPremiumField; - use ArticlePercentageField; - use ArticleTypeField; use CodeField; use NameField; use OfficeField; + use PercentageField; use PerformanceTypeField; use ShortNameField; use StatusField; + use TypeField; use UnitNamePluralField; use UnitNameSingularField; use VatCodeField; diff --git a/src/ArticleLine.php b/src/ArticleLine.php index 42e5f81b..b5109166 100644 --- a/src/ArticleLine.php +++ b/src/ArticleLine.php @@ -5,8 +5,8 @@ use PhpTwinfield\Fields\FreeText3Field; use PhpTwinfield\Fields\IDField; use PhpTwinfield\Fields\InUseField; -use PhpTwinfield\Fields\Invoice\Article\ArticleLineFreeText1Field; -use PhpTwinfield\Fields\Invoice\Article\ArticleLineFreeText2Field; +use PhpTwinfield\Fields\Invoice\Article\FreeText1Field; +use PhpTwinfield\Fields\Invoice\Article\FreeText2Field; use PhpTwinfield\Fields\Invoice\Article\SubCodeField; use PhpTwinfield\Fields\Invoice\UnitsField; use PhpTwinfield\Fields\Invoice\UnitsPriceExclField; @@ -21,8 +21,8 @@ */ class ArticleLine extends BaseObject { - use ArticleLineFreeText1Field; - use ArticleLineFreeText2Field; + use FreeText1Field; + use FreeText2Field; use FreeText3Field; use IDField; use InUseField; diff --git a/src/CostCenter.php b/src/CostCenter.php index d649ec58..0a1fa227 100644 --- a/src/CostCenter.php +++ b/src/CostCenter.php @@ -5,7 +5,7 @@ use PhpTwinfield\Fields\BehaviourField; use PhpTwinfield\Fields\CodeField; use PhpTwinfield\Fields\InUseField; -use PhpTwinfield\Fields\Level1234\DimensionTypeField; +use PhpTwinfield\Fields\Level1234\DimensionType\TypeField; use PhpTwinfield\Fields\NameField; use PhpTwinfield\Fields\OfficeField; use PhpTwinfield\Fields\ShortNameField; @@ -22,17 +22,17 @@ class CostCenter extends BaseObject { use BehaviourField; use CodeField; - use DimensionTypeField; use InUseField; use NameField; use OfficeField; use ShortNameField; use StatusField; use TouchedField; + use TypeField; use UIDField; public function __construct() { - $this->setTypeFromCode('KPL'); + $this->setTypeFromString('KPL'); } } diff --git a/src/Customer.php b/src/Customer.php index 0b6b6801..8d891e14 100644 --- a/src/Customer.php +++ b/src/Customer.php @@ -5,12 +5,12 @@ use PhpTwinfield\Fields\BehaviourField; use PhpTwinfield\Fields\CodeField; use PhpTwinfield\Fields\InUseField; +use PhpTwinfield\Fields\Level1234\BeginPeriodField; use PhpTwinfield\Fields\Level1234\BeginYearField; -use PhpTwinfield\Fields\Level1234\DimensionGroupField; -use PhpTwinfield\Fields\Level1234\DimensionTypeField; +use PhpTwinfield\Fields\Level1234\DimensionGroup\GroupField; +use PhpTwinfield\Fields\Level1234\DimensionType\TypeField; +use PhpTwinfield\Fields\Level1234\EndPeriodField; use PhpTwinfield\Fields\Level1234\EndYearField; -use PhpTwinfield\Fields\Level1234\GeneralLedgerBeginPeriodField; -use PhpTwinfield\Fields\Level1234\GeneralLedgerEndPeriodField; use PhpTwinfield\Fields\Level1234\Level2\Customer\DiscountArticleField; use PhpTwinfield\Fields\Level1234\Level2\Customer\DiscountArticleIDField; use PhpTwinfield\Fields\Level1234\Level2\PaymentConditionDiscountDaysField; @@ -31,16 +31,15 @@ */ class Customer extends BaseObject { + use BeginPeriodField; use BeginYearField; use BehaviourField; use CodeField; - use DimensionGroupField; - use DimensionTypeField; use DiscountArticleField; use DiscountArticleIDField; + use EndPeriodField; use EndYearField; - use GeneralLedgerBeginPeriodField; - use GeneralLedgerEndPeriodField; + use GroupField; use InUseField; use NameField; use OfficeField; @@ -51,6 +50,7 @@ class Customer extends BaseObject use ShortNameField; use StatusField; use TouchedField; + use TypeField; use UIDField; use WebsiteField; @@ -66,7 +66,7 @@ public function __construct() $this->setBeginYear(0); $this->setEndPeriod(0); $this->setEndYear(0); - $this->setTypeFromCode('DEB'); + $this->setTypeFromString('DEB'); $this->setCreditManagement(new CustomerCreditManagement); $this->setFinancials(new CustomerFinancials); diff --git a/src/CustomerAddress.php b/src/CustomerAddress.php index 4884d488..9e3c7b93 100644 --- a/src/CustomerAddress.php +++ b/src/CustomerAddress.php @@ -3,7 +3,6 @@ namespace PhpTwinfield; use PhpTwinfield\Fields\IDField; -use PhpTwinfield\Fields\Level1234\Level2\AddressTypeField; use PhpTwinfield\Fields\Level1234\Level2\CityField; use PhpTwinfield\Fields\Level1234\Level2\CountryField; use PhpTwinfield\Fields\Level1234\Level2\DefaultField; @@ -17,6 +16,7 @@ use PhpTwinfield\Fields\Level1234\Level2\PostcodeField; use PhpTwinfield\Fields\Level1234\Level2\TelefaxField; use PhpTwinfield\Fields\Level1234\Level2\TelephoneField; +use PhpTwinfield\Fields\Level1234\Level2\TypeField; use PhpTwinfield\Fields\NameField; /** @@ -25,7 +25,6 @@ */ class CustomerAddress extends BaseObject { - use AddressTypeField; use CityField; use CountryField; use DefaultField; @@ -41,4 +40,5 @@ class CustomerAddress extends BaseObject use PostcodeField; use TelefaxField; use TelephoneField; + use TypeField; } \ No newline at end of file diff --git a/src/CustomerChildValidation.php b/src/CustomerChildValidation.php index b06bff43..36789b57 100644 --- a/src/CustomerChildValidation.php +++ b/src/CustomerChildValidation.php @@ -4,7 +4,7 @@ use PhpTwinfield\Fields\ElementValueField; use PhpTwinfield\Fields\Level1234\LevelField; -use PhpTwinfield\Fields\Level1234\GeneralLedgerTypeField; +use PhpTwinfield\Fields\Level1234\TypeField; /** * @see https://c3.twinfield.com/webservices/documentation/#/ApiReference/Masters/Customers @@ -14,5 +14,5 @@ class CustomerChildValidation extends BaseObject { use ElementValueField; use LevelField; - use GeneralLedgerTypeField; + use TypeField; } diff --git a/src/CustomerCollectMandate.php b/src/CustomerCollectMandate.php index 1bcf0d91..7860d69e 100644 --- a/src/CustomerCollectMandate.php +++ b/src/CustomerCollectMandate.php @@ -2,8 +2,8 @@ namespace PhpTwinfield; -use PhpTwinfield\Fields\Level1234\Level2\Customer\CollectMandateIDField; use PhpTwinfield\Fields\Level1234\Level2\Customer\FirstRunDateField; +use PhpTwinfield\Fields\Level1234\Level2\Customer\IDField; use PhpTwinfield\Fields\Level1234\Level2\Customer\SignatureDateField; /** @@ -12,7 +12,7 @@ */ class CustomerCollectMandate extends BaseObject { - use CollectMandateIDField; use FirstRunDateField; + use IDField; use SignatureDateField; } diff --git a/src/CustomerCreditManagement.php b/src/CustomerCreditManagement.php index 9a3aefb2..ddb1addd 100644 --- a/src/CustomerCreditManagement.php +++ b/src/CustomerCreditManagement.php @@ -9,7 +9,7 @@ use PhpTwinfield\Fields\Level1234\Level2\Customer\BlockedLockedField; use PhpTwinfield\Fields\Level1234\Level2\Customer\BlockedModifiedField; use PhpTwinfield\Fields\Level1234\Level2\Customer\CommentField; -use PhpTwinfield\Fields\Level1234\Level2\Customer\CustomerFreeText1Field; +use PhpTwinfield\Fields\Level1234\Level2\Customer\FreeText1Field; use PhpTwinfield\Fields\Level1234\Level2\Customer\ReminderEmailField; use PhpTwinfield\Fields\Level1234\Level2\Customer\ResponsibleUserField; use PhpTwinfield\Fields\Level1234\Level2\Customer\SendReminderField; @@ -25,7 +25,7 @@ class CustomerCreditManagement extends BaseObject use BlockedLockedField; use BlockedModifiedField; use CommentField; - use CustomerFreeText1Field; + use FreeText1Field; use FreeText2Field; use FreeText3Field; use ReminderEmailField; diff --git a/src/DimensionGroupDimension.php b/src/DimensionGroupDimension.php index 3825b7f4..a43ee168 100644 --- a/src/DimensionGroupDimension.php +++ b/src/DimensionGroupDimension.php @@ -2,8 +2,8 @@ namespace PhpTwinfield; -use PhpTwinfield\Fields\Level1234\DimensionGroup\DimensionCodeField; -use PhpTwinfield\Fields\Level1234\DimensionTypeField; +use PhpTwinfield\Fields\Level1234\DimensionGroup\CodeField; +use PhpTwinfield\Fields\Level1234\DimensionType\TypeField; /** * @see https://c3.twinfield.com/webservices/documentation/#/ApiReference/Masters/DimensionGroups @@ -11,6 +11,6 @@ */ class DimensionGroupDimension extends BaseObject { - use DimensionCodeField; - use DimensionTypeField; + use CodeField; + use TypeField; } diff --git a/src/DimensionTypeLevels.php b/src/DimensionTypeLevels.php index 124a1480..c1a23b36 100644 --- a/src/DimensionTypeLevels.php +++ b/src/DimensionTypeLevels.php @@ -2,8 +2,8 @@ namespace PhpTwinfield; -use PhpTwinfield\Fields\Level1234\DimensionType\DimensionTypeFinancialsField; -use PhpTwinfield\Fields\Level1234\DimensionType\DimensionTypeTimeField; +use PhpTwinfield\Fields\Level1234\DimensionType\FinancialsField; +use PhpTwinfield\Fields\Level1234\DimensionType\TimeField; /** * @see https://c3.twinfield.com/webservices/documentation/#/ApiReference/Masters/DimensionTypes @@ -11,6 +11,6 @@ */ class DimensionTypeLevels extends BaseObject { - use DimensionTypeFinancialsField; - use DimensionTypeTimeField; + use FinancialsField; + use TimeField; } diff --git a/src/DomDocuments/ActivitiesDocument.php b/src/DomDocuments/ActivitiesDocument.php index 65723afb..2e87cc38 100644 --- a/src/DomDocuments/ActivitiesDocument.php +++ b/src/DomDocuments/ActivitiesDocument.php @@ -44,21 +44,21 @@ public function addActivity(Activity $activity) $activityElement->appendChild($this->createNodeWithTextContent('code', $activity->getCode())); $activityElement->appendChild($this->createNodeWithTextContent('name', $activity->getName())); - $activityElement->appendChild($this->createNodeWithTextContent('office', $activity->getOfficeToCode())); + $activityElement->appendChild($this->createNodeWithTextContent('office', $activity->getOfficeToString())); $activityElement->appendChild($this->createNodeWithTextContent('shortname', $activity->getShortName())); - $activityElement->appendChild($this->createNodeWithTextContent('type', $activity->getTypeToCode())); + $activityElement->appendChild($this->createNodeWithTextContent('type', $activity->getTypeToString())); $financialsElement = $this->createElement('financials'); $activityElement->appendChild($financialsElement); - $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $activity->getVatCodeToCode())); + $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $activity->getVatCodeToString())); $projects = $activity->getProjects(); $projectsElement = $this->createElement('projects'); $activityElement->appendChild($projectsElement); - $inheritArray = array('authoriser' => 'getAuthoriserToCode', 'billable' => 'getBillableToString', 'customer' => 'getCustomerToCode', 'rate' => 'getRateToCode'); + $inheritArray = array('authoriser' => 'getAuthoriserToString', 'billable' => 'getBillableToString', 'customer' => 'getCustomerToString', 'rate' => 'getRateToString'); foreach ($inheritArray as $inheritVar => $method) { $methodLocked = "get" . ucfirst($inheritVar) . "Locked"; @@ -98,7 +98,7 @@ public function addActivity(Activity $activity) $quantitiesElement->appendChild($quantityElement); $quantityElement->appendChild($this->createNodeWithTextContent('label', $quantity->getLabel())); - $quantityElement->appendChild($this->createNodeWithTextContent('rate', $quantity->getRateToCode())); + $quantityElement->appendChild($this->createNodeWithTextContent('rate', $quantity->getRateToString())); $quantityElement->appendChild($this->createNodeWithTextContent('billable', $quantity->getBillableToString(), $quantity, array('locked' => 'getBillableLockedToString'))); $quantityElement->appendChild($this->createNodeWithTextContent('mandatory', $quantity->getMandatoryToString())); } diff --git a/src/DomDocuments/ArticlesDocument.php b/src/DomDocuments/ArticlesDocument.php index c1a7cd73..a3c2f39b 100644 --- a/src/DomDocuments/ArticlesDocument.php +++ b/src/DomDocuments/ArticlesDocument.php @@ -52,7 +52,7 @@ public function addArticle(Article $article) $headerElement->appendChild($this->createNodeWithTextContent('allowdecimalquantity', $article->getAllowDecimalQuantityToString())); $headerElement->appendChild($this->createNodeWithTextContent('allowdiscountorpremium', $article->getAllowDiscountOrPremiumToString())); $headerElement->appendChild($this->createNodeWithTextContent('code', $article->getCode())); - $headerElement->appendChild($this->createNodeWithTextContent('office', $article->getOfficeToCode())); + $headerElement->appendChild($this->createNodeWithTextContent('office', $article->getOfficeToString())); $headerElement->appendChild($this->createNodeWithTextContent('name', $article->getName())); $headerElement->appendChild($this->createNodeWithTextContent('percentage', $article->getPercentageToString())); $headerElement->appendChild($this->createNodeWithTextContent('performancetype', $article->getPerformanceType())); @@ -60,7 +60,7 @@ public function addArticle(Article $article) $headerElement->appendChild($this->createNodeWithTextContent('type', $article->getType())); $headerElement->appendChild($this->createNodeWithTextContent('unitnameplural', $article->getUnitNamePlural())); $headerElement->appendChild($this->createNodeWithTextContent('unitnamesingular', $article->getUnitNameSingular())); - $headerElement->appendChild($this->createNodeWithTextContent('vatcode', $article->getVatCodeToCode())); + $headerElement->appendChild($this->createNodeWithTextContent('vatcode', $article->getVatCodeToString())); //Clear VAT code in case of a discount/premium article with percentage set to true to prevent errors if ($article->getType() != "normal" && $article->getPercentage() == true) { @@ -92,8 +92,8 @@ public function addArticle(Article $article) $lineElement->setAttribute('status', $status); } - $lineElement->appendChild($this->createNodeWithTextContent('freetext1', $line->getFreeText1ToCode())); - $lineElement->appendChild($this->createNodeWithTextContent('freetext2', $line->getFreeText2ToCode())); + $lineElement->appendChild($this->createNodeWithTextContent('freetext1', $line->getFreeText1ToString())); + $lineElement->appendChild($this->createNodeWithTextContent('freetext2', $line->getFreeText2ToString())); $lineElement->appendChild($this->createNodeWithTextContent('freetext3', $line->getFreeText3())); $lineElement->appendChild($this->createNodeWithTextContent('name', $line->getName())); $lineElement->appendChild($this->createNodeWithTextContent('shortname', $line->getShortName())); diff --git a/src/DomDocuments/AssetMethodsDocument.php b/src/DomDocuments/AssetMethodsDocument.php index 6d25378f..7459b797 100644 --- a/src/DomDocuments/AssetMethodsDocument.php +++ b/src/DomDocuments/AssetMethodsDocument.php @@ -41,7 +41,7 @@ public function addAssetMethod(AssetMethod $assetMethod) $assetMethodElement->appendChild($this->createNodeWithTextContent('depreciatereconciliation', $assetMethod->getDepreciateReconciliation())); $assetMethodElement->appendChild($this->createNodeWithTextContent('name', $assetMethod->getName())); $assetMethodElement->appendChild($this->createNodeWithTextContent('nrofperiods', $assetMethod->getNrOfPeriods())); - $assetMethodElement->appendChild($this->createNodeWithTextContent('office', $assetMethod->getOfficeToCode())); + $assetMethodElement->appendChild($this->createNodeWithTextContent('office', $assetMethod->getOfficeToString())); $assetMethodElement->appendChild($this->createNodeWithTextContent('percentage', $assetMethod->getPercentage())); $assetMethodElement->appendChild($this->createNodeWithTextContent('shortname', $assetMethod->getShortName())); @@ -50,22 +50,22 @@ public function addAssetMethod(AssetMethod $assetMethod) $balanceAccountsElement = $this->createElement('balanceaccounts'); $assetMethodElement->appendChild($balanceAccountsElement); - $balanceAccountsElement->appendChild($this->createNodeWithTextContent('assetstoactivate', $balanceAccounts->getAssetsToActivateToCode())); - $balanceAccountsElement->appendChild($this->createNodeWithTextContent('depreciation', $balanceAccounts->getDepreciationToCode())); - $balanceAccountsElement->appendChild($this->createNodeWithTextContent('depreciationgroup', $balanceAccounts->getDepreciationGroupToCode())); - $balanceAccountsElement->appendChild($this->createNodeWithTextContent('purchasevalue', $balanceAccounts->getPurchaseValueToCode())); - $balanceAccountsElement->appendChild($this->createNodeWithTextContent('purchasevaluegroup', $balanceAccounts->getPurchaseValueGroupToCode())); - $balanceAccountsElement->appendChild($this->createNodeWithTextContent('reconciliation', $balanceAccounts->getReconciliationToCode())); - $balanceAccountsElement->appendChild($this->createNodeWithTextContent('tobeinvoiced', $balanceAccounts->getToBeInvoicedToCode())); + $balanceAccountsElement->appendChild($this->createNodeWithTextContent('assetstoactivate', $balanceAccounts->getAssetsToActivateToString())); + $balanceAccountsElement->appendChild($this->createNodeWithTextContent('depreciation', $balanceAccounts->getDepreciationToString())); + $balanceAccountsElement->appendChild($this->createNodeWithTextContent('depreciationgroup', $balanceAccounts->getDepreciationGroupToString())); + $balanceAccountsElement->appendChild($this->createNodeWithTextContent('purchasevalue', $balanceAccounts->getPurchaseValueToString())); + $balanceAccountsElement->appendChild($this->createNodeWithTextContent('purchasevaluegroup', $balanceAccounts->getPurchaseValueGroupToString())); + $balanceAccountsElement->appendChild($this->createNodeWithTextContent('reconciliation', $balanceAccounts->getReconciliationToString())); + $balanceAccountsElement->appendChild($this->createNodeWithTextContent('tobeinvoiced', $balanceAccounts->getToBeInvoicedToString())); $profitLossAccounts = $assetMethod->getProfitLossAccounts(); $profitLossAccountsElement = $this->createElement('profitlossaccounts'); $assetMethodElement->appendChild($profitLossAccountsElement); - $profitLossAccountsElement->appendChild($this->createNodeWithTextContent('depreciation', $profitLossAccounts->getDepreciationToCode())); - $profitLossAccountsElement->appendChild($this->createNodeWithTextContent('reconciliation', $profitLossAccounts->getReconciliationToCode())); - $profitLossAccountsElement->appendChild($this->createNodeWithTextContent('sales', $profitLossAccounts->getSalesToCode())); + $profitLossAccountsElement->appendChild($this->createNodeWithTextContent('depreciation', $profitLossAccounts->getDepreciationToString())); + $profitLossAccountsElement->appendChild($this->createNodeWithTextContent('reconciliation', $profitLossAccounts->getReconciliationToString())); + $profitLossAccountsElement->appendChild($this->createNodeWithTextContent('sales', $profitLossAccounts->getSalesToString())); $freeTexts = $assetMethod->getFreeTexts(); diff --git a/src/DomDocuments/CostCentersDocument.php b/src/DomDocuments/CostCentersDocument.php index ac22394b..81dc3d8d 100644 --- a/src/DomDocuments/CostCentersDocument.php +++ b/src/DomDocuments/CostCentersDocument.php @@ -44,7 +44,7 @@ public function addCostCenter(CostCenter $costCenter) $costCenterElement->appendChild($this->createNodeWithTextContent('code', $costCenter->getCode())); $costCenterElement->appendChild($this->createNodeWithTextContent('name', $costCenter->getName())); - $costCenterElement->appendChild($this->createNodeWithTextContent('office', $costCenter->getOfficeToCode())); - $costCenterElement->appendChild($this->createNodeWithTextContent('type', $costCenter->getTypeToCode())); + $costCenterElement->appendChild($this->createNodeWithTextContent('office', $costCenter->getOfficeToString())); + $costCenterElement->appendChild($this->createNodeWithTextContent('type', $costCenter->getTypeToString())); } } diff --git a/src/DomDocuments/CurrenciesDocument.php b/src/DomDocuments/CurrenciesDocument.php index 260c372f..a92ec65f 100644 --- a/src/DomDocuments/CurrenciesDocument.php +++ b/src/DomDocuments/CurrenciesDocument.php @@ -44,7 +44,7 @@ public function addCurrency(Currency $currency) $currencyElement->appendChild($this->createNodeWithTextContent('code', $currency->getCode())); $currencyElement->appendChild($this->createNodeWithTextContent('name', $currency->getName())); - $currencyElement->appendChild($this->createNodeWithTextContent('office', $currency->getOfficeToCode())); + $currencyElement->appendChild($this->createNodeWithTextContent('office', $currency->getOfficeToString())); $currencyElement->appendChild($this->createNodeWithTextContent('shortname', $currency->getShortName())); $rates = $currency->getRates(); diff --git a/src/DomDocuments/CustomersDocument.php b/src/DomDocuments/CustomersDocument.php index 8ca18d2a..2820abc4 100644 --- a/src/DomDocuments/CustomersDocument.php +++ b/src/DomDocuments/CustomersDocument.php @@ -48,9 +48,9 @@ public function addCustomer(Customer $customer) $customerElement->appendChild($this->createNodeWithTextContent('endperiod', $customer->getEndPeriod())); $customerElement->appendChild($this->createNodeWithTextContent('endyear', $customer->getEndYear())); $customerElement->appendChild($this->createNodeWithTextContent('name', $customer->getName())); - $customerElement->appendChild($this->createNodeWithTextContent('office', $customer->getOfficeToCode())); + $customerElement->appendChild($this->createNodeWithTextContent('office', $customer->getOfficeToString())); $customerElement->appendChild($this->createNodeWithTextContent('shortname', $customer->getShortName())); - $customerElement->appendChild($this->createNodeWithTextContent('type', $customer->getTypeToCode())); + $customerElement->appendChild($this->createNodeWithTextContent('type', $customer->getTypeToString())); $customerElement->appendChild($this->createNodeWithTextContent('website', $customer->getWebsite())); $financials = $customer->getFinancials(); @@ -64,9 +64,9 @@ public function addCustomer(Customer $customer) $financialsElement->appendChild($this->createNodeWithTextContent('ebillmail', $financials->getEBillMail())); $financialsElement->appendChild($this->createNodeWithTextContent('meansofpayment', $financials->getMeansOfPayment())); $financialsElement->appendChild($this->createNodeWithTextContent('payavailable', $financials->getPayAvailableToString())); - $financialsElement->appendChild($this->createNodeWithTextContent('paycode', $financials->getPayCodeToCode())); - $financialsElement->appendChild($this->createNodeWithTextContent('substitutewith', $financials->getSubstituteWithToCode())); - $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $financials->getVatCodeToCode())); + $financialsElement->appendChild($this->createNodeWithTextContent('paycode', $financials->getPayCodeToString())); + $financialsElement->appendChild($this->createNodeWithTextContent('substitutewith', $financials->getSubstituteWithToString())); + $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $financials->getVatCodeToString())); $collectMandate = $financials->getCollectMandate(); @@ -105,14 +105,14 @@ public function addCustomer(Customer $customer) $creditManagementElement->appendChild($this->createNodeWithTextContent('freetext2', $creditManagement->getFreeText2())); $creditManagementElement->appendChild($this->createNodeWithTextContent('freetext3', $creditManagement->getFreeText3())); $creditManagementElement->appendChild($this->createNodeWithTextContent('reminderemail', $creditManagement->getReminderEmail())); - $creditManagementElement->appendChild($this->createNodeWithTextContent('responsibleuser', $creditManagement->getResponsibleUserToCode())); + $creditManagementElement->appendChild($this->createNodeWithTextContent('responsibleuser', $creditManagement->getResponsibleUserToString())); $creditManagementElement->appendChild($this->createNodeWithTextContent('sendreminder', $creditManagement->getSendReminder())); // Make invoicing element $invoicingElement = $this->createElement('invoicing'); $customerElement->appendChild($invoicingElement); - $invoicingElement->appendChild($this->createNodeWithTextContent('discountarticle', $customer->getDiscountArticleToCode())); + $invoicingElement->appendChild($this->createNodeWithTextContent('discountarticle', $customer->getDiscountArticleToString())); $addresses = $customer->getAddresses(); @@ -146,7 +146,7 @@ public function addCustomer(Customer $customer) } $addressElement->appendChild($this->createNodeWithTextContent('city', $address->getCity())); - $addressElement->appendChild($this->createNodeWithTextContent('country', $address->getCountryToCode())); + $addressElement->appendChild($this->createNodeWithTextContent('country', $address->getCountryToString())); $addressElement->appendChild($this->createNodeWithTextContent('email', $address->getEmail())); $addressElement->appendChild($this->createNodeWithTextContent('field1', $address->getField1())); $addressElement->appendChild($this->createNodeWithTextContent('field2', $address->getField2())); @@ -187,8 +187,8 @@ public function addCustomer(Customer $customer) } $bankAddressElement = $this->createElement('address'); - $bankAddressElement->appendChild($this->createNodeWithTextContent('field2', $bank->getField2())); - $bankAddressElement->appendChild($this->createNodeWithTextContent('field3', $bank->getField3())); + $bankAddressElement->appendChild($this->createNodeWithTextContent('field2', $bank->getAddressField2())); + $bankAddressElement->appendChild($this->createNodeWithTextContent('field3', $bank->getAddressField3())); $bankElement->appendChild($bankAddressElement); $bankElement->appendChild($this->createNodeWithTextContent('ascription', $bank->getAscription())); @@ -196,7 +196,7 @@ public function addCustomer(Customer $customer) $bankElement->appendChild($this->createNodeWithTextContent('bankname', $bank->getBankName())); $bankElement->appendChild($this->createNodeWithTextContent('biccode', $bank->getBicCode())); $bankElement->appendChild($this->createNodeWithTextContent('city', $bank->getCity())); - $bankElement->appendChild($this->createNodeWithTextContent('country', $bank->getCountryToCode())); + $bankElement->appendChild($this->createNodeWithTextContent('country', $bank->getCountryToString())); $bankElement->appendChild($this->createNodeWithTextContent('iban', $bank->getIban())); $bankElement->appendChild($this->createNodeWithTextContent('natbiccode', $bank->getNatBicCode())); $bankElement->appendChild($this->createNodeWithTextContent('postcode', $bank->getPostcode())); @@ -210,7 +210,7 @@ public function addCustomer(Customer $customer) $remittanceAdviceElement->appendChild($this->createNodeWithTextContent('sendmail', $customer->getRemittanceAdviceSendMail())); $remittanceAdviceElement->appendChild($this->createNodeWithTextContent('sendtype', $customer->getRemittanceAdviceSendType())); - $group = $customer->getGroupToCode(); + $group = $customer->getGroupToString(); if (!empty($group)) { $groupsElement = $this->createElement('groups'); @@ -244,7 +244,7 @@ public function addCustomer(Customer $customer) } $postingRuleElement->appendChild($this->createNodeWithTextContent('amount', $postingRule->getAmountToFloat())); - $postingRuleElement->appendChild($this->createNodeWithTextContent('currency', $postingRule->getCurrencyToCode())); + $postingRuleElement->appendChild($this->createNodeWithTextContent('currency', $postingRule->getCurrencyToString())); $postingRuleElement->appendChild($this->createNodeWithTextContent('description', $postingRule->getDescription())); $postingRuleLines = $postingRule->getLines(); @@ -260,13 +260,13 @@ public function addCustomer(Customer $customer) $postingRuleLineElement = $this->createElement('line'); $postingRuleLinesElement->appendChild($postingRuleLineElement); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension1', $postingRuleLine->getDimension1ToCode())); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension2', $postingRuleLine->getDimension2ToCode())); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension3', $postingRuleLine->getDimension3ToCode())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension1', $postingRuleLine->getDimension1ToString())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension2', $postingRuleLine->getDimension2ToString())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension3', $postingRuleLine->getDimension3ToString())); $postingRuleLineElement->appendChild($this->createNodeWithTextContent('description', $postingRuleLine->getDescription())); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('office', $postingRuleLine->getOfficeToCode())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('office', $postingRuleLine->getOfficeToString())); $postingRuleLineElement->appendChild($this->createNodeWithTextContent('ratio', $postingRuleLine->getRatio())); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('vatcode', $postingRuleLine->getVatCodeToCode())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('vatcode', $postingRuleLine->getVatCodeToString())); } } } diff --git a/src/DomDocuments/DimensionGroupsDocument.php b/src/DomDocuments/DimensionGroupsDocument.php index cd178d35..c33ebae9 100644 --- a/src/DomDocuments/DimensionGroupsDocument.php +++ b/src/DomDocuments/DimensionGroupsDocument.php @@ -44,7 +44,7 @@ public function addDimensionGroup(DimensionGroup $dimensionGroup) $dimensionGroupElement->appendChild($this->createNodeWithTextContent('code', $dimensionGroup->getCode())); $dimensionGroupElement->appendChild($this->createNodeWithTextContent('name', $dimensionGroup->getName())); - $dimensionGroupElement->appendChild($this->createNodeWithTextContent('office', $dimensionGroup->getOfficeToCode())); + $dimensionGroupElement->appendChild($this->createNodeWithTextContent('office', $dimensionGroup->getOfficeToString())); $dimensionGroupElement->appendChild($this->createNodeWithTextContent('shortname', $dimensionGroup->getShortName())); $dimensions = $dimensionGroup->getDimensions(); @@ -60,8 +60,8 @@ public function addDimensionGroup(DimensionGroup $dimensionGroup) $dimensionElement = $this->createElement('dimension'); $dimensionsElement->appendChild($dimensionElement); - $dimensionElement->appendChild($this->createNodeWithTextContent('code', $dimension->getCodeToCode())); - $dimensionElement->appendChild($this->createNodeWithTextContent('type', $dimension->getTypeToCode())); + $dimensionElement->appendChild($this->createNodeWithTextContent('code', $dimension->getCodeToString())); + $dimensionElement->appendChild($this->createNodeWithTextContent('type', $dimension->getTypeToString())); } } } diff --git a/src/DomDocuments/DimensionTypesDocument.php b/src/DomDocuments/DimensionTypesDocument.php index b89c35c2..4b46bb4a 100644 --- a/src/DomDocuments/DimensionTypesDocument.php +++ b/src/DomDocuments/DimensionTypesDocument.php @@ -39,7 +39,7 @@ public function addDimensionType(DimensionType $dimensionType) $dimensionTypeElement->appendChild($this->createNodeWithTextContent('code', $dimensionType->getCode())); $dimensionTypeElement->appendChild($this->createNodeWithTextContent('mask', $dimensionType->getMask())); $dimensionTypeElement->appendChild($this->createNodeWithTextContent('name', $dimensionType->getName())); - $dimensionTypeElement->appendChild($this->createNodeWithTextContent('office', $dimensionType->getOfficeToCode())); + $dimensionTypeElement->appendChild($this->createNodeWithTextContent('office', $dimensionType->getOfficeToString())); $dimensionTypeElement->appendChild($this->createNodeWithTextContent('shortname', $dimensionType->getShortName())); $address = $dimensionType->getAddress(); diff --git a/src/DomDocuments/FixedAssetsDocument.php b/src/DomDocuments/FixedAssetsDocument.php index 8349f318..c0bb4449 100644 --- a/src/DomDocuments/FixedAssetsDocument.php +++ b/src/DomDocuments/FixedAssetsDocument.php @@ -44,8 +44,8 @@ public function addFixedAsset(FixedAsset $fixedAsset) $fixedAssetElement->appendChild($this->createNodeWithTextContent('code', $fixedAsset->getCode())); $fixedAssetElement->appendChild($this->createNodeWithTextContent('name', $fixedAsset->getName())); - $fixedAssetElement->appendChild($this->createNodeWithTextContent('office', $fixedAsset->getOfficeToCode())); - $fixedAssetElement->appendChild($this->createNodeWithTextContent('type', $fixedAsset->getTypeToCode())); + $fixedAssetElement->appendChild($this->createNodeWithTextContent('office', $fixedAsset->getOfficeToString())); + $fixedAssetElement->appendChild($this->createNodeWithTextContent('type', $fixedAsset->getTypeToString())); $financials = $fixedAsset->getFinancials(); @@ -53,8 +53,8 @@ public function addFixedAsset(FixedAsset $fixedAsset) $fixedAssetElement->appendChild($financialsElement); $financialsElement->appendChild($this->createNodeWithTextContent('substitutionlevel', $financials->getSubstitutionLevel())); - $financialsElement->appendChild($this->createNodeWithTextContent('substitutewith', $financials->getSubstituteWithToCode())); - $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $financials->getVatCodeToCode())); + $financialsElement->appendChild($this->createNodeWithTextContent('substitutewith', $financials->getSubstituteWithToString())); + $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $financials->getVatCodeToString())); $fixedAssets = $fixedAsset->getFixedAssets(); @@ -68,7 +68,7 @@ public function addFixedAsset(FixedAsset $fixedAsset) $fixedAssetsElement->appendChild($this->createNodeWithTextContent('freetext4', $fixedAssets->getFreeText4())); $fixedAssetsElement->appendChild($this->createNodeWithTextContent('freetext5', $fixedAssets->getFreeText5())); $fixedAssetsElement->appendChild($this->createNodeWithTextContent('lastdepreciation', $fixedAssets->getLastDepreciation())); - $fixedAssetsElement->appendChild($this->createNodeWithTextContent('method', $fixedAssets->getMethodToCode())); + $fixedAssetsElement->appendChild($this->createNodeWithTextContent('method', $fixedAssets->getMethodToString())); $fixedAssetsElement->appendChild($this->createNodeWithTextContent('nrofperiods', $fixedAssets->getNrOfPeriods())); $fixedAssetsElement->appendChild($this->createNodeWithTextContent('percentage', $fixedAssets->getPercentage())); $fixedAssetsElement->appendChild($this->createNodeWithTextContent('purchasedate', $fixedAssets->getPurchaseDateToString())); @@ -90,20 +90,20 @@ public function addFixedAsset(FixedAsset $fixedAsset) $transactionLinesElement->appendChild($transactionLineElement); $transactionLineElement->appendChild($this->createNodeWithTextContent('amount', $transactionLine->getAmountToFloat())); - $transactionLineElement->appendChild($this->createNodeWithTextContent('code', $transactionLine->getCodeToCode())); - $transactionLineElement->appendChild($this->createNodeWithTextContent('dim1', $transactionLine->getDim1ToCode())); - $transactionLineElement->appendChild($this->createNodeWithTextContent('dim2', $transactionLine->getDim2ToCode())); - $transactionLineElement->appendChild($this->createNodeWithTextContent('dim3', $transactionLine->getDim3ToCode())); - $transactionLineElement->appendChild($this->createNodeWithTextContent('dim4', $transactionLine->getDim4ToCode())); - $transactionLineElement->appendChild($this->createNodeWithTextContent('dim5', $transactionLine->getDim5ToCode())); - $transactionLineElement->appendChild($this->createNodeWithTextContent('dim6', $transactionLine->getDim6ToCode())); + $transactionLineElement->appendChild($this->createNodeWithTextContent('code', $transactionLine->getCodeToString())); + $transactionLineElement->appendChild($this->createNodeWithTextContent('dim1', $transactionLine->getDim1ToString())); + $transactionLineElement->appendChild($this->createNodeWithTextContent('dim2', $transactionLine->getDim2ToString())); + $transactionLineElement->appendChild($this->createNodeWithTextContent('dim3', $transactionLine->getDim3ToString())); + $transactionLineElement->appendChild($this->createNodeWithTextContent('dim4', $transactionLine->getDim4ToString())); + $transactionLineElement->appendChild($this->createNodeWithTextContent('dim5', $transactionLine->getDim5ToString())); + $transactionLineElement->appendChild($this->createNodeWithTextContent('dim6', $transactionLine->getDim6ToString())); $transactionLineElement->appendChild($this->createNodeWithTextContent('line', $transactionLine->getLine())); $transactionLineElement->appendChild($this->createNodeWithTextContent('number', $transactionLine->getNumber())); $transactionLineElement->appendChild($this->createNodeWithTextContent('period', $transactionLine->getPeriod())); } } - $group = $fixedAsset->getGroupToCode(); + $group = $fixedAsset->getGroupToString(); if (!empty($group)) { $groupsElement = $this->createElement('groups'); diff --git a/src/DomDocuments/GeneralLedgersDocument.php b/src/DomDocuments/GeneralLedgersDocument.php index 823ba6e5..3f3b1205 100644 --- a/src/DomDocuments/GeneralLedgersDocument.php +++ b/src/DomDocuments/GeneralLedgersDocument.php @@ -48,9 +48,9 @@ public function addGeneralLedger(GeneralLedger $generalLedger) $generalLedgerElement->appendChild($this->createNodeWithTextContent('endperiod', $generalLedger->getEndPeriod())); $generalLedgerElement->appendChild($this->createNodeWithTextContent('endyear', $generalLedger->getEndYear())); $generalLedgerElement->appendChild($this->createNodeWithTextContent('name', $generalLedger->getName())); - $generalLedgerElement->appendChild($this->createNodeWithTextContent('office', $generalLedger->getOfficeToCode())); + $generalLedgerElement->appendChild($this->createNodeWithTextContent('office', $generalLedger->getOfficeToString())); $generalLedgerElement->appendChild($this->createNodeWithTextContent('shortname', $generalLedger->getShortName())); - $generalLedgerElement->appendChild($this->createNodeWithTextContent('type', $generalLedger->getTypeToCode())); + $generalLedgerElement->appendChild($this->createNodeWithTextContent('type', $generalLedger->getTypeToString())); $financials = $generalLedger->getFinancials(); @@ -60,7 +60,7 @@ public function addGeneralLedger(GeneralLedger $generalLedger) $financialsElement->appendChild($this->createNodeWithTextContent('accounttype', $financials->getAccountType())); $financialsElement->appendChild($this->createNodeWithTextContent('matchtype', $financials->getMatchType())); $financialsElement->appendChild($this->createNodeWithTextContent('subanalyse', $financials->getSubAnalyse())); - $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $financials->getVatCodeToCode())); + $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $financials->getVatCodeToString())); $childValidations = $financials->getChildValidations(); @@ -76,7 +76,7 @@ public function addGeneralLedger(GeneralLedger $generalLedger) } } - $group = $generalLedger->getGroupToCode(); + $group = $generalLedger->getGroupToString(); if (!empty($group)) { $groupsElement = $this->createElement('groups'); diff --git a/src/DomDocuments/InvoicesDocument.php b/src/DomDocuments/InvoicesDocument.php index f3001edb..144a2e0d 100644 --- a/src/DomDocuments/InvoicesDocument.php +++ b/src/DomDocuments/InvoicesDocument.php @@ -54,9 +54,9 @@ public function addInvoice(Invoice $invoice, $connection) $headerElement->setAttribute('raisewarning', $raiseWarning); } - $headerElement->appendChild($this->createNodeWithTextContent('bank', $invoice->getBankToCode())); - $headerElement->appendChild($this->createNodeWithTextContent('currency', $invoice->getCurrencyToCode())); - $headerElement->appendChild($this->createNodeWithTextContent('customer', $invoice->getCustomerToCode())); + $headerElement->appendChild($this->createNodeWithTextContent('bank', $invoice->getBankToString())); + $headerElement->appendChild($this->createNodeWithTextContent('currency', $invoice->getCurrencyToString())); + $headerElement->appendChild($this->createNodeWithTextContent('customer', $invoice->getCustomerToString())); $headerElement->appendChild($this->createNodeWithTextContent('deliveraddressnumber', $invoice->getDeliverAddressNumber())); $headerElement->appendChild($this->createNodeWithTextContent('duedate', $invoice->getDueDateToString())); $headerElement->appendChild($this->createNodeWithTextContent('footertext', $invoice->getFooterText())); @@ -64,14 +64,14 @@ public function addInvoice(Invoice $invoice, $connection) $headerElement->appendChild($this->createNodeWithTextContent('invoiceaddressnumber', $invoice->getInvoiceAddressNumber())); $headerElement->appendChild($this->createNodeWithTextContent('invoicedate', $invoice->getInvoiceDateToString())); $headerElement->appendChild($this->createNodeWithTextContent('invoicenumber', $invoice->getInvoiceNumber())); - $headerElement->appendChild($this->createNodeWithTextContent('invoicetype', $invoice->getInvoiceTypeToCode())); - $headerElement->appendChild($this->createNodeWithTextContent('office', $invoice->getOfficeToCode())); + $headerElement->appendChild($this->createNodeWithTextContent('invoicetype', $invoice->getInvoiceTypeToString())); + $headerElement->appendChild($this->createNodeWithTextContent('office', $invoice->getOfficeToString())); $headerElement->appendChild($this->createNodeWithTextContent('paymentmethod', $invoice->getPaymentMethod())); $headerElement->appendChild($this->createNodeWithTextContent('period', $invoice->getPeriod())); $headerElement->appendChild($this->createNodeWithTextContent('status', $invoice->getStatus())); $invoiceTypeApiConnector = new \PhpTwinfield\ApiConnectors\InvoiceTypeApiConnector($connection); - $invoiceVatType = $invoiceTypeApiConnector->getInvoiceTypeVatType($invoice->getInvoiceTypeToCode()); + $invoiceVatType = $invoiceTypeApiConnector->getInvoiceTypeVatType($invoice->getInvoiceTypeToString()); $articleApiConnector = new \PhpTwinfield\ApiConnectors\ArticleApiConnector($connection); @@ -95,16 +95,16 @@ public function addInvoice(Invoice $invoice, $connection) } $lineElement->appendChild($this->createNodeWithTextContent('allowdiscountorpremium', $line->getAllowDiscountOrPremiumToString())); - $lineElement->appendChild($this->createNodeWithTextContent('article', $line->getArticleToCode())); + $lineElement->appendChild($this->createNodeWithTextContent('article', $line->getArticleToString())); $lineElement->appendChild($this->createNodeWithTextContent('description', $line->getDescription())); - $lineElement->appendChild($this->createNodeWithTextContent('dim1', $line->getDim1ToCode())); + $lineElement->appendChild($this->createNodeWithTextContent('dim1', $line->getDim1ToString())); $lineElement->appendChild($this->createNodeWithTextContent('freetext1', $line->getFreeText1())); $lineElement->appendChild($this->createNodeWithTextContent('freetext2', $line->getFreeText2())); $lineElement->appendChild($this->createNodeWithTextContent('freetext3', $line->getFreeText3())); $lineElement->appendChild($this->createNodeWithTextContent('performancedate', $line->getPerformanceDateToString())); $lineElement->appendChild($this->createNodeWithTextContent('performancetype', $line->getPerformanceType())); $lineElement->appendChild($this->createNodeWithTextContent('quantity', $line->getQuantity())); - $lineElement->appendChild($this->createNodeWithTextContent('subarticle', $line->getSubArticleToSubCode())); + $lineElement->appendChild($this->createNodeWithTextContent('subarticle', $line->getSubArticleToString())); $lineElement->appendChild($this->createNodeWithTextContent('units', $line->getUnits())); if ($invoiceVatType == 'inclusive') { @@ -113,10 +113,10 @@ public function addInvoice(Invoice $invoice, $connection) $lineElement->appendChild($this->createNodeWithTextContent('unitspriceexcl', $line->getUnitsPriceExclToFloat())); } - $article = $articleApiConnector->get($line->getArticleToCode(), $invoice->getOffice()); + $article = $articleApiConnector->get($line->getArticleToString(), $invoice->getOffice()); if ($article->getAllowChangeVatCode() == true) { - $lineElement->appendChild($this->createNodeWithTextContent('vatcode', $line->getVatCodeToCode())); + $lineElement->appendChild($this->createNodeWithTextContent('vatcode', $line->getVatCodeToString())); } } } diff --git a/src/DomDocuments/ProjectsDocument.php b/src/DomDocuments/ProjectsDocument.php index eae6beed..8bacf77e 100644 --- a/src/DomDocuments/ProjectsDocument.php +++ b/src/DomDocuments/ProjectsDocument.php @@ -44,21 +44,21 @@ public function addProject(Project $project) $projectElement->appendChild($this->createNodeWithTextContent('code', $project->getCode())); $projectElement->appendChild($this->createNodeWithTextContent('name', $project->getName())); - $projectElement->appendChild($this->createNodeWithTextContent('office', $project->getOfficeToCode())); + $projectElement->appendChild($this->createNodeWithTextContent('office', $project->getOfficeToString())); $projectElement->appendChild($this->createNodeWithTextContent('shortname', $project->getShortName())); - $projectElement->appendChild($this->createNodeWithTextContent('type', $project->getTypeToCode())); + $projectElement->appendChild($this->createNodeWithTextContent('type', $project->getTypeToString())); $financialsElement = $this->createElement('financials'); $projectElement->appendChild($financialsElement); - $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $project->getVatCodeToCode())); + $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $project->getVatCodeToString())); $projects = $project->getProjects(); $projectsElement = $this->createElement('projects'); $projectElement->appendChild($projectsElement); - $inheritArray = array('authoriser' => 'getAuthoriserToCode', 'billable' => 'getBillableToString', 'customer' => 'getCustomerToCode', 'rate' => 'getRateToCode'); + $inheritArray = array('authoriser' => 'getAuthoriserToString', 'billable' => 'getBillableToString', 'customer' => 'getCustomerToString', 'rate' => 'getRateToString'); foreach ($inheritArray as $inheritVar => $method) { $methodLocked = "get" . ucfirst($inheritVar) . "Locked"; @@ -98,7 +98,7 @@ public function addProject(Project $project) $quantitiesElement->appendChild($quantityElement); $quantityElement->appendChild($this->createNodeWithTextContent('label', $quantity->getLabel())); - $quantityElement->appendChild($this->createNodeWithTextContent('rate', $quantity->getRateToCode())); + $quantityElement->appendChild($this->createNodeWithTextContent('rate', $quantity->getRateToString())); $quantityElement->appendChild($this->createNodeWithTextContent('billable', $quantity->getBillableToString(), $quantity, array('locked' => 'getBillableLockedToString'))); $quantityElement->appendChild($this->createNodeWithTextContent('mandatory', $quantity->getMandatoryToString())); } diff --git a/src/DomDocuments/RatesDocument.php b/src/DomDocuments/RatesDocument.php index 1c2cac53..4ca1346f 100644 --- a/src/DomDocuments/RatesDocument.php +++ b/src/DomDocuments/RatesDocument.php @@ -43,9 +43,9 @@ public function addRate(Rate $rate) } $rateElement->appendChild($this->createNodeWithTextContent('code', $rate->getCode())); - $rateElement->appendChild($this->createNodeWithTextContent('currency', $rate->getCurrencyToCode())); + $rateElement->appendChild($this->createNodeWithTextContent('currency', $rate->getCurrencyToString())); $rateElement->appendChild($this->createNodeWithTextContent('name', $rate->getName())); - $rateElement->appendChild($this->createNodeWithTextContent('office', $rate->getOfficeToCode())); + $rateElement->appendChild($this->createNodeWithTextContent('office', $rate->getOfficeToString())); $rateElement->appendChild($this->createNodeWithTextContent('shortname', $rate->getShortName())); $rateElement->appendChild($this->createNodeWithTextContent('type', $rate->getType())); $rateElement->appendChild($this->createNodeWithTextContent('unit', $rate->getUnit())); diff --git a/src/DomDocuments/SuppliersDocument.php b/src/DomDocuments/SuppliersDocument.php index f15d5705..04804b5c 100644 --- a/src/DomDocuments/SuppliersDocument.php +++ b/src/DomDocuments/SuppliersDocument.php @@ -48,9 +48,9 @@ public function addSupplier(Supplier $supplier) $supplierElement->appendChild($this->createNodeWithTextContent('endperiod', $supplier->getEndPeriod())); $supplierElement->appendChild($this->createNodeWithTextContent('endyear', $supplier->getEndYear())); $supplierElement->appendChild($this->createNodeWithTextContent('name', $supplier->getName())); - $supplierElement->appendChild($this->createNodeWithTextContent('office', $supplier->getOfficeToCode())); + $supplierElement->appendChild($this->createNodeWithTextContent('office', $supplier->getOfficeToString())); $supplierElement->appendChild($this->createNodeWithTextContent('shortname', $supplier->getShortName())); - $supplierElement->appendChild($this->createNodeWithTextContent('type', $supplier->getTypeToCode())); + $supplierElement->appendChild($this->createNodeWithTextContent('type', $supplier->getTypeToString())); $supplierElement->appendChild($this->createNodeWithTextContent('website', $supplier->getWebsite())); $financials = $supplier->getFinancials(); @@ -61,10 +61,10 @@ public function addSupplier(Supplier $supplier) $financialsElement->appendChild($this->createNodeWithTextContent('duedays', $financials->getDueDays())); $financialsElement->appendChild($this->createNodeWithTextContent('meansofpayment', $financials->getMeansOfPayment())); $financialsElement->appendChild($this->createNodeWithTextContent('payavailable', $financials->getPayAvailableToString())); - $financialsElement->appendChild($this->createNodeWithTextContent('paycode', $financials->getPayCodeToCode())); + $financialsElement->appendChild($this->createNodeWithTextContent('paycode', $financials->getPayCodeToString())); $financialsElement->appendChild($this->createNodeWithTextContent('relationsreference', $financials->getRelationsReference())); - $financialsElement->appendChild($this->createNodeWithTextContent('substitutewith', $financials->getSubstituteWithToCode())); - $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $financials->getVatCodeToCode())); + $financialsElement->appendChild($this->createNodeWithTextContent('substitutewith', $financials->getSubstituteWithToString())); + $financialsElement->appendChild($this->createNodeWithTextContent('vatcode', $financials->getVatCodeToString())); $childValidations = $financials->getChildValidations(); @@ -112,7 +112,7 @@ public function addSupplier(Supplier $supplier) } $addressElement->appendChild($this->createNodeWithTextContent('city', $address->getCity())); - $addressElement->appendChild($this->createNodeWithTextContent('country', $address->getCountryToCode())); + $addressElement->appendChild($this->createNodeWithTextContent('country', $address->getCountryToString())); $addressElement->appendChild($this->createNodeWithTextContent('email', $address->getEmail())); $addressElement->appendChild($this->createNodeWithTextContent('field1', $address->getField1())); $addressElement->appendChild($this->createNodeWithTextContent('field2', $address->getField2())); @@ -159,8 +159,8 @@ public function addSupplier(Supplier $supplier) } $bankAddressElement = $this->createElement('address'); - $bankAddressElement->appendChild($this->createNodeWithTextContent('field2', $bank->getField2())); - $bankAddressElement->appendChild($this->createNodeWithTextContent('field3', $bank->getField3())); + $bankAddressElement->appendChild($this->createNodeWithTextContent('field2', $bank->getAddressField2())); + $bankAddressElement->appendChild($this->createNodeWithTextContent('field3', $bank->getAddressField3())); $bankElement->appendChild($bankAddressElement); $bankElement->appendChild($this->createNodeWithTextContent('ascription', $bank->getAscription())); @@ -168,7 +168,7 @@ public function addSupplier(Supplier $supplier) $bankElement->appendChild($this->createNodeWithTextContent('bankname', $bank->getBankName())); $bankElement->appendChild($this->createNodeWithTextContent('biccode', $bank->getBicCode())); $bankElement->appendChild($this->createNodeWithTextContent('city', $bank->getCity())); - $bankElement->appendChild($this->createNodeWithTextContent('country', $bank->getCountryToCode())); + $bankElement->appendChild($this->createNodeWithTextContent('country', $bank->getCountryToString())); $bankElement->appendChild($this->createNodeWithTextContent('iban', $bank->getIban())); $bankElement->appendChild($this->createNodeWithTextContent('natbiccode', $bank->getNatBicCode())); $bankElement->appendChild($this->createNodeWithTextContent('postcode', $bank->getPostcode())); @@ -182,7 +182,7 @@ public function addSupplier(Supplier $supplier) $remittanceAdviceElement->appendChild($this->createNodeWithTextContent('sendmail', $supplier->getRemittanceAdviceSendMail())); $remittanceAdviceElement->appendChild($this->createNodeWithTextContent('sendtype', $supplier->getRemittanceAdviceSendType())); - $group = $supplier->getGroupToCode(); + $group = $supplier->getGroupToString(); if (!empty($group)) { $groupsElement = $this->createElement('groups'); @@ -216,7 +216,7 @@ public function addSupplier(Supplier $supplier) } $postingRuleElement->appendChild($this->createNodeWithTextContent('amount', $postingRule->getAmountToFloat())); - $postingRuleElement->appendChild($this->createNodeWithTextContent('currency', $postingRule->getCurrencyToCode())); + $postingRuleElement->appendChild($this->createNodeWithTextContent('currency', $postingRule->getCurrencyToString())); $postingRuleElement->appendChild($this->createNodeWithTextContent('description', $postingRule->getDescription())); $postingRuleLines = $postingRule->getLines(); @@ -232,13 +232,13 @@ public function addSupplier(Supplier $supplier) $postingRuleLineElement = $this->createElement('line'); $postingRuleLinesElement->appendChild($postingRuleLineElement); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension1', $postingRuleLine->getDimension1ToCode())); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension2', $postingRuleLine->getDimension2ToCode())); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension3', $postingRuleLine->getDimension3ToCode())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension1', $postingRuleLine->getDimension1ToString())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension2', $postingRuleLine->getDimension2ToString())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('dimension3', $postingRuleLine->getDimension3ToString())); $postingRuleLineElement->appendChild($this->createNodeWithTextContent('description', $postingRuleLine->getDescription())); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('office', $postingRuleLine->getOfficeToCode())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('office', $postingRuleLine->getOfficeToString())); $postingRuleLineElement->appendChild($this->createNodeWithTextContent('ratio', $postingRuleLine->getRatio())); - $postingRuleLineElement->appendChild($this->createNodeWithTextContent('vatcode', $postingRuleLine->getVatCodeToCode())); + $postingRuleLineElement->appendChild($this->createNodeWithTextContent('vatcode', $postingRuleLine->getVatCodeToString())); } } } diff --git a/src/DomDocuments/VatCodesDocument.php b/src/DomDocuments/VatCodesDocument.php index ea924e43..f2573a0a 100644 --- a/src/DomDocuments/VatCodesDocument.php +++ b/src/DomDocuments/VatCodesDocument.php @@ -83,9 +83,9 @@ public function addVatCode(VatCode $vatCode) $accountElement->setAttribute('id', $id); } - $accountElement->appendChild($this->createNodeWithTextContent('dim1', $account->getDim1ToCode())); - $accountElement->appendChild($this->createNodeWithTextContent('group', $account->getGroupToCode())); - $accountElement->appendChild($this->createNodeWithTextContent('groupcountry', $account->getGroupCountryToCode())); + $accountElement->appendChild($this->createNodeWithTextContent('dim1', $account->getDim1ToString())); + $accountElement->appendChild($this->createNodeWithTextContent('group', $account->getGroupToString())); + $accountElement->appendChild($this->createNodeWithTextContent('groupcountry', $account->getGroupCountryToString())); $accountElement->appendChild($this->createNodeWithTextContent('linetype', $account->getLineType())); $accountElement->appendChild($this->createNodeWithTextContent('percentage', $account->getPercentage())); } diff --git a/src/Enums/GeneralLedgerType.php b/src/Enums/ChildValidationType.php similarity index 52% rename from src/Enums/GeneralLedgerType.php rename to src/Enums/ChildValidationType.php index 1c474865..e8aa812d 100644 --- a/src/Enums/GeneralLedgerType.php +++ b/src/Enums/ChildValidationType.php @@ -1,17 +1,17 @@ -assetsToActivate; } - public function getAssetsToActivateToCode(): ?string + public function getAssetsToActivateToString(): ?string { if ($this->getAssetsToActivate() != null) { return $this->assetsToActivate->getCode(); @@ -45,7 +45,7 @@ public function setAssetsToActivate(?GeneralLedger $assetsToActivate): self * @return $this * @throws Exception */ - public function setAssetsToActivateFromCode(?string $assetsToActivateCode) + public function setAssetsToActivateFromString(?string $assetsToActivateCode) { $assetsToActivate = new GeneralLedger(); $assetsToActivate->setCode($assetsToActivateCode); diff --git a/src/Fields/AssetMethod/DepreciationField.php b/src/Fields/AssetMethod/DepreciationField.php index 64f10f1c..84cdb7e4 100644 --- a/src/Fields/AssetMethod/DepreciationField.php +++ b/src/Fields/AssetMethod/DepreciationField.php @@ -22,7 +22,7 @@ public function getDepreciation(): ?GeneralLedger return $this->depreciation; } - public function getDepreciationToCode(): ?string + public function getDepreciationToString(): ?string { if ($this->getDepreciation() != null) { return $this->depreciation->getCode(); @@ -45,7 +45,7 @@ public function setDepreciation(?GeneralLedger $depreciation): self * @return $this * @throws Exception */ - public function setDepreciationFromCode(?string $depreciationCode) + public function setDepreciationFromString(?string $depreciationCode) { $depreciation = new GeneralLedger(); $depreciation->setCode($depreciationCode); diff --git a/src/Fields/AssetMethod/DepreciationGroupField.php b/src/Fields/AssetMethod/DepreciationGroupField.php index 0b547b1c..4a7fe10b 100644 --- a/src/Fields/AssetMethod/DepreciationGroupField.php +++ b/src/Fields/AssetMethod/DepreciationGroupField.php @@ -22,7 +22,7 @@ public function getDepreciationGroup(): ?DimensionGroup return $this->depreciationGroup; } - public function getDepreciationGroupToCode(): ?string + public function getDepreciationGroupToString(): ?string { if ($this->getDepreciationGroup() != null) { return $this->depreciationGroup->getCode(); @@ -45,7 +45,7 @@ public function setDepreciationGroup(?DimensionGroup $depreciationGroup): self * @return $this * @throws Exception */ - public function setDepreciationGroupFromCode(?string $depreciationGroupCode) + public function setDepreciationGroupFromString(?string $depreciationGroupCode) { $depreciationGroup = new DimensionGroup(); $depreciationGroup->setCode($depreciationGroupCode); diff --git a/src/Fields/AssetMethod/PurchaseValueField.php b/src/Fields/AssetMethod/PurchaseValueField.php index 68875c3f..82fb62bc 100644 --- a/src/Fields/AssetMethod/PurchaseValueField.php +++ b/src/Fields/AssetMethod/PurchaseValueField.php @@ -22,7 +22,7 @@ public function getPurchaseValue(): ?GeneralLedger return $this->purchaseValue; } - public function getPurchaseValueToCode(): ?string + public function getPurchaseValueToString(): ?string { if ($this->getPurchaseValue() != null) { return $this->purchaseValue->getCode(); @@ -45,7 +45,7 @@ public function setPurchaseValue(?GeneralLedger $purchaseValue): self * @return $this * @throws Exception */ - public function setPurchaseValueFromCode(?string $purchaseValueCode) + public function setPurchaseValueFromString(?string $purchaseValueCode) { $purchaseValue = new GeneralLedger(); $purchaseValue->setCode($purchaseValueCode); diff --git a/src/Fields/AssetMethod/PurchaseValueGroupField.php b/src/Fields/AssetMethod/PurchaseValueGroupField.php index d930b332..404f7aca 100644 --- a/src/Fields/AssetMethod/PurchaseValueGroupField.php +++ b/src/Fields/AssetMethod/PurchaseValueGroupField.php @@ -22,7 +22,7 @@ public function getPurchaseValueGroup(): ?DimensionGroup return $this->purchaseValueGroup; } - public function getPurchaseValueGroupToCode(): ?string + public function getPurchaseValueGroupToString(): ?string { if ($this->getPurchaseValueGroup() != null) { return $this->purchaseValueGroup->getCode(); @@ -45,7 +45,7 @@ public function setPurchaseValueGroup(?DimensionGroup $purchaseValueGroup): self * @return $this * @throws Exception */ - public function setPurchaseValueGroupFromCode(?string $purchaseValueGroupCode) + public function setPurchaseValueGroupFromString(?string $purchaseValueGroupCode) { $purchaseValueGroup = new DimensionGroup(); $purchaseValueGroup->setCode($purchaseValueGroupCode); diff --git a/src/Fields/AssetMethod/ReconciliationField.php b/src/Fields/AssetMethod/ReconciliationField.php index c5a7b05c..0e10916e 100644 --- a/src/Fields/AssetMethod/ReconciliationField.php +++ b/src/Fields/AssetMethod/ReconciliationField.php @@ -22,7 +22,7 @@ public function getReconciliation(): ?GeneralLedger return $this->reconciliation; } - public function getReconciliationToCode(): ?string + public function getReconciliationToString(): ?string { if ($this->getReconciliation() != null) { return $this->reconciliation->getCode(); @@ -45,7 +45,7 @@ public function setReconciliation(?GeneralLedger $reconciliation): self * @return $this * @throws Exception */ - public function setReconciliationFromCode(?string $reconciliationCode) + public function setReconciliationFromString(?string $reconciliationCode) { $reconciliation = new GeneralLedger(); $reconciliation->setCode($reconciliationCode); diff --git a/src/Fields/AssetMethod/SalesField.php b/src/Fields/AssetMethod/SalesField.php index c5a8230c..d69dcd8b 100644 --- a/src/Fields/AssetMethod/SalesField.php +++ b/src/Fields/AssetMethod/SalesField.php @@ -22,7 +22,7 @@ public function getSales(): ?GeneralLedger return $this->sales; } - public function getSalesToCode(): ?string + public function getSalesToString(): ?string { if ($this->getSales() != null) { return $this->sales->getCode(); @@ -45,7 +45,7 @@ public function setSales(?GeneralLedger $sales): self * @return $this * @throws Exception */ - public function setSalesFromCode(?string $salesCode) + public function setSalesFromString(?string $salesCode) { $sales = new GeneralLedger(); $sales->setCode($salesCode); diff --git a/src/Fields/AssetMethod/ToBeInvoicedField.php b/src/Fields/AssetMethod/ToBeInvoicedField.php index 08b3c69b..e7269e3a 100644 --- a/src/Fields/AssetMethod/ToBeInvoicedField.php +++ b/src/Fields/AssetMethod/ToBeInvoicedField.php @@ -22,7 +22,7 @@ public function getToBeInvoiced(): ?GeneralLedger return $this->toBeInvoiced; } - public function getToBeInvoicedToCode(): ?string + public function getToBeInvoicedToString(): ?string { if ($this->getToBeInvoiced() != null) { return $this->toBeInvoiced->getCode(); @@ -45,7 +45,7 @@ public function setToBeInvoiced(?GeneralLedger $toBeInvoiced): self * @return $this * @throws Exception */ - public function setToBeInvoicedFromCode(?string $toBeInvoicedCode) + public function setToBeInvoicedFromString(?string $toBeInvoicedCode) { $toBeInvoiced = new GeneralLedger(); $toBeInvoiced->setCode($toBeInvoicedCode); diff --git a/src/Fields/CurrencyField.php b/src/Fields/CurrencyField.php index 8ed0bc20..00d84aff 100644 --- a/src/Fields/CurrencyField.php +++ b/src/Fields/CurrencyField.php @@ -22,7 +22,7 @@ public function getCurrency(): ?Currency return $this->currency; } - public function getCurrencyToCode(): ?string + public function getCurrencyToString(): ?string { if ($this->getCurrency() != null) { return $this->currency->getCode(); @@ -45,7 +45,7 @@ public function setCurrency(?Currency $currency): self * @return $this * @throws Exception */ - public function setCurrencyFromCode(?string $currencyCode) + public function setCurrencyFromString(?string $currencyCode) { $currency = new Currency(); $currency->setCode($currencyCode); diff --git a/src/Fields/CustomerField.php b/src/Fields/CustomerField.php index 07ca6942..f724be2b 100644 --- a/src/Fields/CustomerField.php +++ b/src/Fields/CustomerField.php @@ -22,7 +22,7 @@ public function getCustomer(): ?Customer return $this->customer; } - public function getCustomerToCode(): ?string + public function getCustomerToString(): ?string { if ($this->getCustomer() != null) { return $this->customer->getCode(); @@ -45,7 +45,7 @@ public function setCustomer(?Customer $customer): self * @return $this * @throws Exception */ - public function setCustomerFromCode(?string $customerCode) + public function setCustomerFromString(?string $customerCode) { $customer = new Customer(); $customer->setCode($customerCode); diff --git a/src/Fields/Dim1Field.php b/src/Fields/Dim1Field.php index 6038ee17..70a67115 100644 --- a/src/Fields/Dim1Field.php +++ b/src/Fields/Dim1Field.php @@ -22,7 +22,7 @@ public function getDim1(): ?GeneralLedger return $this->dim1; } - public function getDim1ToCode(): ?string + public function getDim1ToString(): ?string { if ($this->getDim1() != null) { return $this->dim1->getCode(); @@ -45,7 +45,7 @@ public function setDim1(?GeneralLedger $dim1): self * @return $this * @throws Exception */ - public function setDim1FromCode(?string $dim1Code) + public function setDim1FromString(?string $dim1Code) { $dim1 = new GeneralLedger(); $dim1->setCode($dim1Code); diff --git a/src/Fields/Invoice/Article/ArticleLineFreeText1Field.php b/src/Fields/Invoice/Article/FreeText1Field.php similarity index 82% rename from src/Fields/Invoice/Article/ArticleLineFreeText1Field.php rename to src/Fields/Invoice/Article/FreeText1Field.php index 28e58215..c23b6034 100644 --- a/src/Fields/Invoice/Article/ArticleLineFreeText1Field.php +++ b/src/Fields/Invoice/Article/FreeText1Field.php @@ -1,54 +1,54 @@ -freeText1; - } - - public function getFreeText1ToCode(): ?string - { - if ($this->getFreeText1() != null) { - return $this->freeText1->getCode(); - } else { - return null; - } - } - - /** - * @return $this - */ - public function setFreeText1(?GeneralLedger $freeText1): self - { - $this->freeText1 = $freeText1; - return $this; - } - - /** - * @param string|null $freeText1Code - * @return $this - * @throws Exception - */ - public function setFreeText1FromCode(?string $freeText1Code) - { - $freeText1 = new GeneralLedger(); - $freeText1->setCode($freeText1Code); - return $this->setFreeText1($freeText1); - } -} +freeText1; + } + + public function getFreeText1ToString(): ?string + { + if ($this->getFreeText1() != null) { + return $this->freeText1->getCode(); + } else { + return null; + } + } + + /** + * @return $this + */ + public function setFreeText1(?GeneralLedger $freeText1): self + { + $this->freeText1 = $freeText1; + return $this; + } + + /** + * @param string|null $freeText1Code + * @return $this + * @throws Exception + */ + public function setFreeText1FromString(?string $freeText1Code) + { + $freeText1 = new GeneralLedger(); + $freeText1->setCode($freeText1Code); + return $this->setFreeText1($freeText1); + } +} diff --git a/src/Fields/Invoice/Article/ArticleLineFreeText2Field.php b/src/Fields/Invoice/Article/FreeText2Field.php similarity index 82% rename from src/Fields/Invoice/Article/ArticleLineFreeText2Field.php rename to src/Fields/Invoice/Article/FreeText2Field.php index 084df49e..fc800bb2 100644 --- a/src/Fields/Invoice/Article/ArticleLineFreeText2Field.php +++ b/src/Fields/Invoice/Article/FreeText2Field.php @@ -1,54 +1,54 @@ -freeText2; - } - - public function getFreeText2ToCode(): ?string - { - if ($this->getFreeText2() != null) { - return $this->freeText2->getCode(); - } else { - return null; - } - } - - /** - * @return $this - */ - public function setFreeText2(?CostCenter $freeText2): self - { - $this->freeText2 = $freeText2; - return $this; - } - - /** - * @param string|null $freeText2Code - * @return $this - * @throws Exception - */ - public function setFreeText2FromCode(?string $freeText2Code) - { - $freeText2 = new CostCenter(); - $freeText2->setCode($freeText2Code); - return $this->setFreeText2($freeText2); - } -} +freeText2; + } + + public function getFreeText2ToString(): ?string + { + if ($this->getFreeText2() != null) { + return $this->freeText2->getCode(); + } else { + return null; + } + } + + /** + * @return $this + */ + public function setFreeText2(?CostCenter $freeText2): self + { + $this->freeText2 = $freeText2; + return $this; + } + + /** + * @param string|null $freeText2Code + * @return $this + * @throws Exception + */ + public function setFreeText2FromString(?string $freeText2Code) + { + $freeText2 = new CostCenter(); + $freeText2->setCode($freeText2Code); + return $this->setFreeText2($freeText2); + } +} diff --git a/src/Fields/Invoice/Article/ArticlePercentageField.php b/src/Fields/Invoice/Article/PercentageField.php similarity index 89% rename from src/Fields/Invoice/Article/ArticlePercentageField.php rename to src/Fields/Invoice/Article/PercentageField.php index 6c09aa80..272de3c8 100644 --- a/src/Fields/Invoice/Article/ArticlePercentageField.php +++ b/src/Fields/Invoice/Article/PercentageField.php @@ -1,47 +1,47 @@ -percentage; - } - - public function getPercentageToString(): ?string - { - return ($this->getPercentage()) ? 'true' : 'false'; - } - - /** - * @param bool $percentage - * @return $this - */ - public function setPercentage(?bool $percentage): self - { - $this->percentage = $percentage; - return $this; - } - - /** - * @param string|null $percentageString - * @return $this - * @throws Exception - */ - public function setPercentageFromString(?string $percentageString) - { - return $this->setPercentage(filter_var($percentageString, FILTER_VALIDATE_BOOLEAN)); - } +percentage; + } + + public function getPercentageToString(): ?string + { + return ($this->getPercentage()) ? 'true' : 'false'; + } + + /** + * @param bool $percentage + * @return $this + */ + public function setPercentage(?bool $percentage): self + { + $this->percentage = $percentage; + return $this; + } + + /** + * @param string|null $percentageString + * @return $this + * @throws Exception + */ + public function setPercentageFromString(?string $percentageString) + { + return $this->setPercentage(filter_var($percentageString, FILTER_VALIDATE_BOOLEAN)); + } } \ No newline at end of file diff --git a/src/Fields/Invoice/Article/ArticleTypeField.php b/src/Fields/Invoice/Article/TypeField.php similarity index 88% rename from src/Fields/Invoice/Article/ArticleTypeField.php rename to src/Fields/Invoice/Article/TypeField.php index 19bac60c..cbfb6b4f 100644 --- a/src/Fields/Invoice/Article/ArticleTypeField.php +++ b/src/Fields/Invoice/Article/TypeField.php @@ -1,41 +1,41 @@ -type; - } - - /** - * @param ArticleType|null $type - * @return $this - */ - public function setType(?ArticleType $type): self - { - $this->type = $type; - return $this; - } - - /** - * @param string|null $typeString - * @return $this - * @throws Exception - */ - public function setTypeFromString(?string $typeString) - { - return $this->setType(new ArticleType((string)$typeString)); - } +type; + } + + /** + * @param ArticleType|null $type + * @return $this + */ + public function setType(?ArticleType $type): self + { + $this->type = $type; + return $this; + } + + /** + * @param string|null $typeString + * @return $this + * @throws Exception + */ + public function setTypeFromString(?string $typeString) + { + return $this->setType(new ArticleType((string)$typeString)); + } } \ No newline at end of file diff --git a/src/Fields/Invoice/ArticleField.php b/src/Fields/Invoice/ArticleField.php index c15d26f9..477bda88 100644 --- a/src/Fields/Invoice/ArticleField.php +++ b/src/Fields/Invoice/ArticleField.php @@ -22,7 +22,7 @@ public function getArticle(): ?Article return $this->article; } - public function getArticleToCode(): ?string + public function getArticleToString(): ?string { if ($this->getArticle() != null) { return $this->article->getCode(); @@ -45,7 +45,7 @@ public function setArticle(?Article $article): self * @return $this * @throws Exception */ - public function setArticleFromCode(?string $articleCode) + public function setArticleFromString(?string $articleCode) { $article = new Article(); $article->setCode($articleCode); diff --git a/src/Fields/Invoice/BankField.php b/src/Fields/Invoice/BankField.php index c1fd1d8b..ba1f0564 100644 --- a/src/Fields/Invoice/BankField.php +++ b/src/Fields/Invoice/BankField.php @@ -22,7 +22,7 @@ public function getBank(): ?CashBankBook return $this->bank; } - public function getBankToCode(): ?string + public function getBankToString(): ?string { if ($this->getBank() != null) { return $this->bank->getCode(); @@ -45,7 +45,7 @@ public function setBank(?CashBankBook $bank): self * @return $this * @throws Exception */ - public function setBankFromCode(?string $bankCode) + public function setBankFromString(?string $bankCode) { $bank = new CashBankBook(); $bank->setCode($bankCode); diff --git a/src/Fields/Invoice/InvoiceDebitCreditField.php b/src/Fields/Invoice/DebitCreditField.php similarity index 88% rename from src/Fields/Invoice/InvoiceDebitCreditField.php rename to src/Fields/Invoice/DebitCreditField.php index 68dd2c13..1091fb58 100644 --- a/src/Fields/Invoice/InvoiceDebitCreditField.php +++ b/src/Fields/Invoice/DebitCreditField.php @@ -1,41 +1,41 @@ -debitCredit; - } - - /** - * @param InvoiceDebitCredit|null $debitCredit - * @return $this - */ - public function setDebitCredit(?InvoiceDebitCredit $debitCredit): self - { - $this->debitCredit = $debitCredit; - return $this; - } - - /** - * @param string|null $debitCreditString - * @return $this - * @throws Exception - */ - public function setDebitCreditFromString(?string $debitCreditString) - { - return $this->setDebitCredit(new InvoiceDebitCredit((string)$debitCreditString)); - } +debitCredit; + } + + /** + * @param InvoiceDebitCredit|null $debitCredit + * @return $this + */ + public function setDebitCredit(?InvoiceDebitCredit $debitCredit): self + { + $this->debitCredit = $debitCredit; + return $this; + } + + /** + * @param string|null $debitCreditString + * @return $this + * @throws Exception + */ + public function setDebitCreditFromString(?string $debitCreditString) + { + return $this->setDebitCredit(new InvoiceDebitCredit((string)$debitCreditString)); + } } \ No newline at end of file diff --git a/src/Fields/Invoice/InvoiceTypeField.php b/src/Fields/Invoice/InvoiceTypeField.php index 3b72eb4c..abc3eb30 100644 --- a/src/Fields/Invoice/InvoiceTypeField.php +++ b/src/Fields/Invoice/InvoiceTypeField.php @@ -22,7 +22,7 @@ public function getInvoiceType(): ?InvoiceType return $this->invoiceType; } - public function getInvoiceTypeToCode(): ?string + public function getInvoiceTypeToString(): ?string { if ($this->getInvoiceType() != null) { return $this->invoiceType->getCode(); @@ -45,7 +45,7 @@ public function setInvoiceType(?InvoiceType $invoiceType): self * @return $this * @throws Exception */ - public function setInvoiceTypeFromCode(?string $invoiceTypeCode) + public function setInvoiceTypeFromString(?string $invoiceTypeCode) { $invoiceType = new InvoiceType(); $invoiceType->setCode($invoiceTypeCode); diff --git a/src/Fields/Invoice/InvoiceStatusField.php b/src/Fields/Invoice/StatusField.php similarity index 88% rename from src/Fields/Invoice/InvoiceStatusField.php rename to src/Fields/Invoice/StatusField.php index 337de4ed..55f935c1 100644 --- a/src/Fields/Invoice/InvoiceStatusField.php +++ b/src/Fields/Invoice/StatusField.php @@ -1,41 +1,41 @@ -status; - } - - /** - * @param InvoiceStatus|null $status - * @return $this - */ - public function setStatus(?InvoiceStatus $status): self - { - $this->status = $status; - return $this; - } - - /** - * @param string|null $statusString - * @return $this - * @throws Exception - */ - public function setStatusFromString(?string $statusString) - { - return $this->setStatus(new InvoiceStatus((string)$statusString)); - } +status; + } + + /** + * @param InvoiceStatus|null $status + * @return $this + */ + public function setStatus(?InvoiceStatus $status): self + { + $this->status = $status; + return $this; + } + + /** + * @param string|null $statusString + * @return $this + * @throws Exception + */ + public function setStatusFromString(?string $statusString) + { + return $this->setStatus(new InvoiceStatus((string)$statusString)); + } } \ No newline at end of file diff --git a/src/Fields/Invoice/SubArticleField.php b/src/Fields/Invoice/SubArticleField.php index fab4ff83..a256d967 100644 --- a/src/Fields/Invoice/SubArticleField.php +++ b/src/Fields/Invoice/SubArticleField.php @@ -22,7 +22,7 @@ public function getSubArticle(): ?ArticleLine return $this->subArticle; } - public function getSubArticleToSubCode(): ?string + public function getSubArticleToString(): ?string { if ($this->getSubArticle() != null) { return $this->subArticle->getSubCode(); @@ -45,7 +45,7 @@ public function setSubArticle(?ArticleLine $subArticle): self * @return $this * @throws Exception */ - public function setSubArticleFromSubCode(?string $subArticleCode) + public function setSubArticleFromString(?string $subArticleCode) { $subArticle = new ArticleLine(); $subArticle->setSubCode($subArticleCode); diff --git a/src/Fields/Level1234/GeneralLedgerBeginPeriodField.php b/src/Fields/Level1234/BeginPeriodField.php similarity index 89% rename from src/Fields/Level1234/GeneralLedgerBeginPeriodField.php rename to src/Fields/Level1234/BeginPeriodField.php index 2ab7379c..72108980 100644 --- a/src/Fields/Level1234/GeneralLedgerBeginPeriodField.php +++ b/src/Fields/Level1234/BeginPeriodField.php @@ -1,32 +1,32 @@ -beginPeriod; - } - - /** - * @param null|int $beginPeriod - * @return $this - */ - public function setBeginPeriod(?int $beginPeriod): self - { - $this->beginPeriod = $beginPeriod; - return $this; - } +beginPeriod; + } + + /** + * @param null|int $beginPeriod + * @return $this + */ + public function setBeginPeriod(?int $beginPeriod): self + { + $this->beginPeriod = $beginPeriod; + return $this; + } } \ No newline at end of file diff --git a/src/Fields/Level1234/DimensionGroup/DimensionCodeField.php b/src/Fields/Level1234/DimensionGroup/CodeField.php similarity index 82% rename from src/Fields/Level1234/DimensionGroup/DimensionCodeField.php rename to src/Fields/Level1234/DimensionGroup/CodeField.php index e8d04f02..3ddea308 100644 --- a/src/Fields/Level1234/DimensionGroup/DimensionCodeField.php +++ b/src/Fields/Level1234/DimensionGroup/CodeField.php @@ -1,54 +1,54 @@ -code; - } - - public function getCodeToCode(): ?string - { - if ($this->getCode() != null) { - return $this->code->getCode(); - } else { - return null; - } - } - - /** - * @return $this - */ - public function setCode($code): self - { - $this->code = $code; - return $this; - } - - /** - * @param string|null $codeCode - * @return $this - * @throws Exception - */ - public function setCodeFromCode(?string $codeCode) - { - $code = new Dummy(); - $code->setCode($codeCode); - return $this->setCode($code); - } -} +code; + } + + public function getCodeToString(): ?string + { + if ($this->getCode() != null) { + return $this->code->getCode(); + } else { + return null; + } + } + + /** + * @return $this + */ + public function setCode($code): self + { + $this->code = $code; + return $this; + } + + /** + * @param string|null $codeCode + * @return $this + * @throws Exception + */ + public function setCodeFromString(?string $codeCode) + { + $code = new Dummy(); + $code->setCode($codeCode); + return $this->setCode($code); + } +} diff --git a/src/Fields/Level1234/DimensionGroupField.php b/src/Fields/Level1234/DimensionGroup/GroupField.php similarity index 79% rename from src/Fields/Level1234/DimensionGroupField.php rename to src/Fields/Level1234/DimensionGroup/GroupField.php index 9876915a..05d4dc5c 100644 --- a/src/Fields/Level1234/DimensionGroupField.php +++ b/src/Fields/Level1234/DimensionGroup/GroupField.php @@ -1,54 +1,54 @@ -group; - } - - public function getGroupToCode(): ?string - { - if ($this->getGroup() != null) { - return $this->group->getCode(); - } else { - return null; - } - } - - /** - * @return $this - */ - public function setGroup(?DimensionGroup $group): self - { - $this->group = $group; - return $this; - } - - /** - * @param string|null $groupCode - * @return $this - * @throws Exception - */ - public function setGroupFromCode(?string $groupCode) - { - $group = new DimensionGroup(); - $group->setCode($groupCode); - return $this->setGroup($group); - } -} +group; + } + + public function getGroupToString(): ?string + { + if ($this->getGroup() != null) { + return $this->group->getCode(); + } else { + return null; + } + } + + /** + * @return $this + */ + public function setGroup(?DimensionGroup $group): self + { + $this->group = $group; + return $this; + } + + /** + * @param string|null $groupCode + * @return $this + * @throws Exception + */ + public function setGroupFromString(?string $groupCode) + { + $group = new DimensionGroup(); + $group->setCode($groupCode); + return $this->setGroup($group); + } +} diff --git a/src/Fields/Level1234/DimensionType/DimensionTypeFinancialsField.php b/src/Fields/Level1234/DimensionType/FinancialsField.php similarity index 82% rename from src/Fields/Level1234/DimensionType/DimensionTypeFinancialsField.php rename to src/Fields/Level1234/DimensionType/FinancialsField.php index 9c309887..3b0725a0 100644 --- a/src/Fields/Level1234/DimensionType/DimensionTypeFinancialsField.php +++ b/src/Fields/Level1234/DimensionType/FinancialsField.php @@ -1,32 +1,32 @@ -financials; - } - - /** - * @param null|int $financials - * @return $this - */ - public function setFinancials(?int $financials): self - { - $this->financials = $financials; - return $this; - } +financials; + } + + /** + * @param null|int $financials + * @return $this + */ + public function setFinancials(?int $financials): self + { + $this->financials = $financials; + return $this; + } } \ No newline at end of file diff --git a/src/Fields/Level1234/DimensionType/DimensionTypeTimeField.php b/src/Fields/Level1234/DimensionType/TimeField.php similarity index 83% rename from src/Fields/Level1234/DimensionType/DimensionTypeTimeField.php rename to src/Fields/Level1234/DimensionType/TimeField.php index fc821496..aeae646e 100644 --- a/src/Fields/Level1234/DimensionType/DimensionTypeTimeField.php +++ b/src/Fields/Level1234/DimensionType/TimeField.php @@ -1,32 +1,32 @@ -time; - } - - /** - * @param null|int $time - * @return $this - */ - public function setTime(?int $time): self - { - $this->time = $time; - return $this; - } +time; + } + + /** + * @param null|int $time + * @return $this + */ + public function setTime(?int $time): self + { + $this->time = $time; + return $this; + } } \ No newline at end of file diff --git a/src/Fields/Level1234/DimensionTypeField.php b/src/Fields/Level1234/DimensionType/TypeField.php similarity index 80% rename from src/Fields/Level1234/DimensionTypeField.php rename to src/Fields/Level1234/DimensionType/TypeField.php index bf08779a..ec0d9ed6 100644 --- a/src/Fields/Level1234/DimensionTypeField.php +++ b/src/Fields/Level1234/DimensionType/TypeField.php @@ -1,54 +1,54 @@ -type; - } - - public function getTypeToCode(): ?string - { - if ($this->getType() != null) { - return $this->type->getCode(); - } else { - return null; - } - } - - /** - * @return $this - */ - public function setType(?DimensionType $type): self - { - $this->type = $type; - return $this; - } - - /** - * @param string|null $typeCode - * @return $this - * @throws Exception - */ - public function setTypeFromCode(?string $typeCode) - { - $type = new DimensionType(); - $type->setCode($typeCode); - return $this->setType($type); - } -} +type; + } + + public function getTypeToString(): ?string + { + if ($this->getType() != null) { + return $this->type->getCode(); + } else { + return null; + } + } + + /** + * @return $this + */ + public function setType(?DimensionType $type): self + { + $this->type = $type; + return $this; + } + + /** + * @param string|null $typeCode + * @return $this + * @throws Exception + */ + public function setTypeFromString(?string $typeCode) + { + $type = new DimensionType(); + $type->setCode($typeCode); + return $this->setType($type); + } +} diff --git a/src/Fields/Level1234/GeneralLedgerEndPeriodField.php b/src/Fields/Level1234/EndPeriodField.php similarity index 89% rename from src/Fields/Level1234/GeneralLedgerEndPeriodField.php rename to src/Fields/Level1234/EndPeriodField.php index 8dd91d39..ecb23732 100644 --- a/src/Fields/Level1234/GeneralLedgerEndPeriodField.php +++ b/src/Fields/Level1234/EndPeriodField.php @@ -1,32 +1,32 @@ -endPeriod; - } - - /** - * @param null|int $endPeriod - * @return $this - */ - public function setEndPeriod(?int $endPeriod): self - { - $this->endPeriod = $endPeriod; - return $this; - } +endPeriod; + } + + /** + * @param null|int $endPeriod + * @return $this + */ + public function setEndPeriod(?int $endPeriod): self + { + $this->endPeriod = $endPeriod; + return $this; + } } \ No newline at end of file diff --git a/src/Fields/Level1234/Level2/AddressField2Field.php b/src/Fields/Level1234/Level2/AddressField2Field.php index f973ab74..d32eae16 100644 --- a/src/Fields/Level1234/Level2/AddressField2Field.php +++ b/src/Fields/Level1234/Level2/AddressField2Field.php @@ -10,23 +10,23 @@ trait AddressField2Field * * @var string|null */ - private $field2; + private $addressField2; /** * @return null|string */ - public function getField2(): ?string + public function getAddressField2(): ?string { - return $this->field2; + return $this->addressField2; } /** - * @param null|string $field2 + * @param null|string $addressField2 * @return $this */ - public function setField2(?string $field2): self + public function setAddressField2(?string $addressField2): self { - $this->field2 = $field2; + $this->addressField2 = $addressField2; return $this; } } \ No newline at end of file diff --git a/src/Fields/Level1234/Level2/AddressField3Field.php b/src/Fields/Level1234/Level2/AddressField3Field.php index f6c2e887..80b2b037 100644 --- a/src/Fields/Level1234/Level2/AddressField3Field.php +++ b/src/Fields/Level1234/Level2/AddressField3Field.php @@ -10,23 +10,23 @@ trait AddressField3Field * * @var string|null */ - private $field3; + private $addressField3; /** * @return null|string */ - public function getField3(): ?string + public function getAddressField3(): ?string { - return $this->field3; + return $this->addressField3; } /** - * @param null|string $field3 + * @param null|string $addressField3 * @return $this */ - public function setField3(?string $field3): self + public function setAddressField3(?string $addressField3): self { - $this->field3 = $field3; + $this->addressField3 = $addressField3; return $this; } } \ No newline at end of file diff --git a/src/Fields/Level1234/Level2/CountryField.php b/src/Fields/Level1234/Level2/CountryField.php index 96cab4ab..36a110fa 100644 --- a/src/Fields/Level1234/Level2/CountryField.php +++ b/src/Fields/Level1234/Level2/CountryField.php @@ -22,7 +22,7 @@ public function getCountry(): ?Country return $this->country; } - public function getCountryToCode(): ?string + public function getCountryToString(): ?string { if ($this->getCountry() != null) { return $this->country->getCode(); @@ -45,7 +45,7 @@ public function setCountry(?Country $country): self * @return $this * @throws Exception */ - public function setCountryFromCode(?string $countryCode) + public function setCountryFromString(?string $countryCode) { $country = new Country(); $country->setCode($countryCode); diff --git a/src/Fields/Level1234/Level2/Customer/DiscountArticleField.php b/src/Fields/Level1234/Level2/Customer/DiscountArticleField.php index d9408e6e..3516143d 100644 --- a/src/Fields/Level1234/Level2/Customer/DiscountArticleField.php +++ b/src/Fields/Level1234/Level2/Customer/DiscountArticleField.php @@ -22,7 +22,7 @@ public function getDiscountArticle(): ?Article return $this->discountArticle; } - public function getDiscountArticleToCode(): ?string + public function getDiscountArticleToString(): ?string { if ($this->getDiscountArticle() != null) { return $this->discountArticle->getCode(); @@ -45,7 +45,7 @@ public function setDiscountArticle(?Article $discountArticle): self * @return $this * @throws Exception */ - public function setDiscountArticleFromCode(?string $discountArticleCode) + public function setDiscountArticleFromString(?string $discountArticleCode) { $discountArticle = new Article(); $discountArticle->setCode($discountArticleCode); diff --git a/src/Fields/Level1234/Level2/Customer/CustomerFreeText1Field.php b/src/Fields/Level1234/Level2/Customer/FreeText1Field.php similarity index 92% rename from src/Fields/Level1234/Level2/Customer/CustomerFreeText1Field.php rename to src/Fields/Level1234/Level2/Customer/FreeText1Field.php index b13b0b31..5788c0b1 100644 --- a/src/Fields/Level1234/Level2/Customer/CustomerFreeText1Field.php +++ b/src/Fields/Level1234/Level2/Customer/FreeText1Field.php @@ -1,47 +1,47 @@ -freeText1; - } - - public function getFreeText1ToString(): ?string - { - return ($this->getFreeText1()) ? 'true' : 'false'; - } - - /** - * @param bool $freeText1 - * @return $this - */ - public function setFreeText1(?bool $freeText1): self - { - $this->freeText1 = $freeText1; - return $this; - } - - /** - * @param string|null $freeText1String - * @return $this - * @throws Exception - */ - public function setFreeText1FromString(?string $freeText1String) - { - return $this->setFreeText1(filter_var($freeText1String, FILTER_VALIDATE_BOOLEAN)); - } +freeText1; + } + + public function getFreeText1ToString(): ?string + { + return ($this->getFreeText1()) ? 'true' : 'false'; + } + + /** + * @param bool $freeText1 + * @return $this + */ + public function setFreeText1(?bool $freeText1): self + { + $this->freeText1 = $freeText1; + return $this; + } + + /** + * @param string|null $freeText1String + * @return $this + * @throws Exception + */ + public function setFreeText1FromString(?string $freeText1String) + { + return $this->setFreeText1(filter_var($freeText1String, FILTER_VALIDATE_BOOLEAN)); + } } \ No newline at end of file diff --git a/src/Fields/Level1234/Level2/Customer/CollectMandateIDField.php b/src/Fields/Level1234/Level2/Customer/IDField.php similarity index 89% rename from src/Fields/Level1234/Level2/Customer/CollectMandateIDField.php rename to src/Fields/Level1234/Level2/Customer/IDField.php index ecedddbd..362b58fb 100644 --- a/src/Fields/Level1234/Level2/Customer/CollectMandateIDField.php +++ b/src/Fields/Level1234/Level2/Customer/IDField.php @@ -1,32 +1,32 @@ -ID; - } - - /** - * @param null|string $ID - * @return $this - */ - public function setID(?string $ID): self - { - $this->ID = $ID; - return $this; - } +ID; + } + + /** + * @param null|string $ID + * @return $this + */ + public function setID(?string $ID): self + { + $this->ID = $ID; + return $this; + } } \ No newline at end of file diff --git a/src/Fields/Level1234/Level2/Customer/ResponsibleUserField.php b/src/Fields/Level1234/Level2/Customer/ResponsibleUserField.php index 23003a9c..51bdeeec 100644 --- a/src/Fields/Level1234/Level2/Customer/ResponsibleUserField.php +++ b/src/Fields/Level1234/Level2/Customer/ResponsibleUserField.php @@ -22,7 +22,7 @@ public function getResponsibleUser(): ?User return $this->responsibleUser; } - public function getResponsibleUserToCode(): ?string + public function getResponsibleUserToString(): ?string { if ($this->getResponsibleUser() != null) { return $this->responsibleUser->getCode(); @@ -45,7 +45,7 @@ public function setResponsibleUser(?User $responsibleUser): self * @return $this * @throws Exception */ - public function setResponsibleUserFromCode(?string $responsibleUserCode) + public function setResponsibleUserFromString(?string $responsibleUserCode) { $responsibleUser = new User(); $responsibleUser->setCode($responsibleUserCode); diff --git a/src/Fields/Level1234/Level2/Dimension1Field.php b/src/Fields/Level1234/Level2/Dimension1Field.php index 50549417..d1b60a56 100644 --- a/src/Fields/Level1234/Level2/Dimension1Field.php +++ b/src/Fields/Level1234/Level2/Dimension1Field.php @@ -22,7 +22,7 @@ public function getDimension1(): ?GeneralLedger return $this->dimension1; } - public function getDimension1ToCode(): ?string + public function getDimension1ToString(): ?string { if ($this->getDimension1() != null) { return $this->dimension1->getCode(); @@ -45,7 +45,7 @@ public function setDimension1(?GeneralLedger $dimension1): self * @return $this * @throws Exception */ - public function setDimension1FromCode(?string $dimension1Code) + public function setDimension1FromString(?string $dimension1Code) { $dimension1 = new GeneralLedger(); $dimension1->setCode($dimension1Code); diff --git a/src/Fields/Level1234/Level2/Dimension2Field.php b/src/Fields/Level1234/Level2/Dimension2Field.php index 29374a84..810a2e75 100644 --- a/src/Fields/Level1234/Level2/Dimension2Field.php +++ b/src/Fields/Level1234/Level2/Dimension2Field.php @@ -22,7 +22,7 @@ public function getDimension2(): ?CostCenter return $this->dimension2; } - public function getDimension2ToCode(): ?string + public function getDimension2ToString(): ?string { if ($this->getDimension2() != null) { return $this->dimension2->getCode(); @@ -45,7 +45,7 @@ public function setDimension2(?CostCenter $dimension2): self * @return $this * @throws Exception */ - public function setDimension2FromCode(?string $dimension2Code) + public function setDimension2FromString(?string $dimension2Code) { $dimension2 = new CostCenter(); $dimension2->setCode($dimension2Code); diff --git a/src/Fields/Level1234/Level2/Dimension3Field.php b/src/Fields/Level1234/Level2/Dimension3Field.php index 3e97dcf5..2afe81c6 100644 --- a/src/Fields/Level1234/Level2/Dimension3Field.php +++ b/src/Fields/Level1234/Level2/Dimension3Field.php @@ -22,7 +22,7 @@ public function getDimension3() return $this->dimension3; } - public function getDimension3ToCode(): ?string + public function getDimension3ToString(): ?string { if ($this->getDimension3() != null) { return $this->dimension3->getCode(); @@ -45,7 +45,7 @@ public function setDimension3($dimension3): self * @return $this * @throws Exception */ - public function setDimension3FromCode(?string $dimension3Code) + public function setDimension3FromString(?string $dimension3Code) { $dimension3 = new Dummy(); $dimension3->setCode($dimension3Code); diff --git a/src/Fields/Level1234/Level2/PayCodeField.php b/src/Fields/Level1234/Level2/PayCodeField.php index c50dd6f3..34c7590e 100644 --- a/src/Fields/Level1234/Level2/PayCodeField.php +++ b/src/Fields/Level1234/Level2/PayCodeField.php @@ -22,7 +22,7 @@ public function getPayCode(): ?PayCode return $this->payCode; } - public function getPayCodeToCode(): ?string + public function getPayCodeToString(): ?string { if ($this->getPayCode() != null) { return $this->payCode->getCode(); @@ -45,7 +45,7 @@ public function setPayCode(?PayCode $payCode): self * @return $this * @throws Exception */ - public function setPayCodeFromCode(?string $payCodeCode) + public function setPayCodeFromString(?string $payCodeCode) { $payCode = new PayCode(); $payCode->setCode($payCodeCode); diff --git a/src/Fields/Level1234/Level2/AddressTypeField.php b/src/Fields/Level1234/Level2/TypeField.php similarity index 89% rename from src/Fields/Level1234/Level2/AddressTypeField.php rename to src/Fields/Level1234/Level2/TypeField.php index d850d4c0..ff76023a 100644 --- a/src/Fields/Level1234/Level2/AddressTypeField.php +++ b/src/Fields/Level1234/Level2/TypeField.php @@ -1,41 +1,41 @@ -type; - } - - /** - * @param AddressType|null $type - * @return $this - */ - public function setType(?AddressType $type): self - { - $this->type = $type; - return $this; - } - - /** - * @param string|null $typeString - * @return $this - * @throws Exception - */ - public function setTypeFromString(?string $typeString) - { - return $this->setType(new AddressType((string)$typeString)); - } +type; + } + + /** + * @param AddressType|null $type + * @return $this + */ + public function setType(?AddressType $type): self + { + $this->type = $type; + return $this; + } + + /** + * @param string|null $typeString + * @return $this + * @throws Exception + */ + public function setTypeFromString(?string $typeString) + { + return $this->setType(new AddressType((string)$typeString)); + } } \ No newline at end of file diff --git a/src/Fields/Level1234/Level34/AuthoriserField.php b/src/Fields/Level1234/Level34/AuthoriserField.php index c2720aa5..8b7b667d 100644 --- a/src/Fields/Level1234/Level34/AuthoriserField.php +++ b/src/Fields/Level1234/Level34/AuthoriserField.php @@ -22,7 +22,7 @@ public function getAuthoriser(): ?User return $this->authoriser; } - public function getAuthoriserToCode(): ?string + public function getAuthoriserToString(): ?string { if ($this->getAuthoriser() != null) { return $this->authoriser->getCode(); @@ -45,7 +45,7 @@ public function setAuthoriser(?User $authoriser): self * @return $this * @throws Exception */ - public function setAuthoriserFromCode(?string $authoriserCode) + public function setAuthoriserFromString(?string $authoriserCode) { $authoriser = new User(); $authoriser->setCode($authoriserCode); diff --git a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetCodeField.php b/src/Fields/Level1234/Level34/FixedAsset/CodeField.php similarity index 84% rename from src/Fields/Level1234/Level34/FixedAsset/FixedAssetCodeField.php rename to src/Fields/Level1234/Level34/FixedAsset/CodeField.php index 6bd027cb..55151704 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetCodeField.php +++ b/src/Fields/Level1234/Level34/FixedAsset/CodeField.php @@ -1,40 +1,40 @@ -code; - } - - public function getCodeToCode(): ?string - { - if ($this->getCode() != null) { - return $this->code->getCode(); - } else { - return null; - } - } - - /** - * @return $this - */ - public function setCode($code): self - { - $this->code = $code; - return $this; - } -} +code; + } + + public function getCodeToString(): ?string + { + if ($this->getCode() != null) { + return $this->code->getCode(); + } else { + return null; + } + } + + /** + * @return $this + */ + public function setCode($code): self + { + $this->code = $code; + return $this; + } +} diff --git a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetCodeLockedField.php b/src/Fields/Level1234/Level34/FixedAsset/CodeLockedField.php similarity index 88% rename from src/Fields/Level1234/Level34/FixedAsset/FixedAssetCodeLockedField.php rename to src/Fields/Level1234/Level34/FixedAsset/CodeLockedField.php index 12e88646..25111b1a 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetCodeLockedField.php +++ b/src/Fields/Level1234/Level34/FixedAsset/CodeLockedField.php @@ -1,47 +1,47 @@ -codeLocked; - } - - public function getCodeLockedToString(): ?string - { - return ($this->getCodeLocked()) ? 'true' : 'false'; - } - - /** - * @param bool $codeLocked - * @return $this - */ - public function setCodeLocked(?bool $codeLocked): self - { - $this->codeLocked = $codeLocked; - return $this; - } - - /** - * @param string|null $codeLockedString - * @return $this - * @throws Exception - */ - public function setCodeLockedFromString(?string $codeLockedString) - { - return $this->setCodeLocked(filter_var($codeLockedString, FILTER_VALIDATE_BOOLEAN)); - } +codeLocked; + } + + public function getCodeLockedToString(): ?string + { + return ($this->getCodeLocked()) ? 'true' : 'false'; + } + + /** + * @param bool $codeLocked + * @return $this + */ + public function setCodeLocked(?bool $codeLocked): self + { + $this->codeLocked = $codeLocked; + return $this; + } + + /** + * @param string|null $codeLockedString + * @return $this + * @throws Exception + */ + public function setCodeLockedFromString(?string $codeLockedString) + { + return $this->setCodeLocked(filter_var($codeLockedString, FILTER_VALIDATE_BOOLEAN)); + } } \ No newline at end of file diff --git a/src/Fields/Level1234/Level34/FixedAsset/Dim2Field.php b/src/Fields/Level1234/Level34/FixedAsset/Dim2Field.php index 13f159fe..ae919497 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/Dim2Field.php +++ b/src/Fields/Level1234/Level34/FixedAsset/Dim2Field.php @@ -22,7 +22,7 @@ public function getDim2() return $this->dim2; } - public function getDim2ToCode(): ?string + public function getDim2ToString(): ?string { if ($this->getDim2() != null) { return $this->dim2->getCode(); @@ -45,7 +45,7 @@ public function setDim2($dim2): self * @return $this * @throws Exception */ - public function setDim2FromCode(?string $dim2Code) + public function setDim2FromString(?string $dim2Code) { $dim2 = new Dummy(); $dim2->setCode($dim2Code); diff --git a/src/Fields/Level1234/Level34/FixedAsset/Dim3Field.php b/src/Fields/Level1234/Level34/FixedAsset/Dim3Field.php index c1540d66..71b36d14 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/Dim3Field.php +++ b/src/Fields/Level1234/Level34/FixedAsset/Dim3Field.php @@ -22,7 +22,7 @@ public function getDim3() return $this->dim3; } - public function getDim3ToCode(): ?string + public function getDim3ToString(): ?string { if ($this->getDim3() != null) { return $this->dim3->getCode(); @@ -45,7 +45,7 @@ public function setDim3($dim3): self * @return $this * @throws Exception */ - public function setDim3FromCode(?string $dim3Code) + public function setDim3FromString(?string $dim3Code) { $dim3 = new Dummy(); $dim3->setCode($dim3Code); diff --git a/src/Fields/Level1234/Level34/FixedAsset/Dim4Field.php b/src/Fields/Level1234/Level34/FixedAsset/Dim4Field.php index 763114a4..228faea0 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/Dim4Field.php +++ b/src/Fields/Level1234/Level34/FixedAsset/Dim4Field.php @@ -22,7 +22,7 @@ public function getDim4() return $this->dim4; } - public function getDim4ToCode(): ?string + public function getDim4ToString(): ?string { if ($this->getDim4() != null) { return $this->dim4->getCode(); @@ -45,7 +45,7 @@ public function setDim4($dim4): self * @return $this * @throws Exception */ - public function setDim4FromCode(?string $dim4Code) + public function setDim4FromString(?string $dim4Code) { $dim4 = new Dummy(); $dim4->setCode($dim4Code); diff --git a/src/Fields/Level1234/Level34/FixedAsset/Dim5Field.php b/src/Fields/Level1234/Level34/FixedAsset/Dim5Field.php index 126c8bb1..c66489e7 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/Dim5Field.php +++ b/src/Fields/Level1234/Level34/FixedAsset/Dim5Field.php @@ -22,7 +22,7 @@ public function getDim5() return $this->dim5; } - public function getDim5ToCode(): ?string + public function getDim5ToString(): ?string { if ($this->getDim5() != null) { return $this->dim5->getCode(); @@ -45,7 +45,7 @@ public function setDim5($dim5): self * @return $this * @throws Exception */ - public function setDim5FromCode(?string $dim5Code) + public function setDim5FromString(?string $dim5Code) { $dim5 = new Dummy(); $dim5->setCode($dim5Code); diff --git a/src/Fields/Level1234/Level34/FixedAsset/Dim6Field.php b/src/Fields/Level1234/Level34/FixedAsset/Dim6Field.php index 60a3a70d..cbe05420 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/Dim6Field.php +++ b/src/Fields/Level1234/Level34/FixedAsset/Dim6Field.php @@ -22,7 +22,7 @@ public function getDim6() return $this->dim6; } - public function getDim6ToCode(): ?string + public function getDim6ToString(): ?string { if ($this->getDim6() != null) { return $this->dim6->getCode(); @@ -45,7 +45,7 @@ public function setDim6($dim6): self * @return $this * @throws Exception */ - public function setDim6FromCode(?string $dim6Code) + public function setDim6FromString(?string $dim6Code) { $dim6 = new Dummy(); $dim6->setCode($dim6Code); diff --git a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetsMethodField.php b/src/Fields/Level1234/Level34/FixedAsset/MethodField.php similarity index 80% rename from src/Fields/Level1234/Level34/FixedAsset/FixedAssetsMethodField.php rename to src/Fields/Level1234/Level34/FixedAsset/MethodField.php index abead77b..7da4a172 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetsMethodField.php +++ b/src/Fields/Level1234/Level34/FixedAsset/MethodField.php @@ -1,54 +1,54 @@ -method; - } - - public function getMethodToCode(): ?string - { - if ($this->getMethod() != null) { - return $this->method->getCode(); - } else { - return null; - } - } - - /** - * @return $this - */ - public function setMethod(?AssetMethod $method): self - { - $this->method = $method; - return $this; - } - - /** - * @param string|null $methodCode - * @return $this - * @throws Exception - */ - public function setMethodFromCode(?string $methodCode) - { - $method = new AssetMethod(); - $method->setCode($methodCode); - return $this->setMethod($method); - } -} +method; + } + + public function getMethodToString(): ?string + { + if ($this->getMethod() != null) { + return $this->method->getCode(); + } else { + return null; + } + } + + /** + * @return $this + */ + public function setMethod(?AssetMethod $method): self + { + $this->method = $method; + return $this; + } + + /** + * @param string|null $methodCode + * @return $this + * @throws Exception + */ + public function setMethodFromString(?string $methodCode) + { + $method = new AssetMethod(); + $method->setCode($methodCode); + return $this->setMethod($method); + } +} diff --git a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetsMethodLockedField.php b/src/Fields/Level1234/Level34/FixedAsset/MethodLockedField.php similarity index 88% rename from src/Fields/Level1234/Level34/FixedAsset/FixedAssetsMethodLockedField.php rename to src/Fields/Level1234/Level34/FixedAsset/MethodLockedField.php index 88ecb0f6..4f4fe26a 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetsMethodLockedField.php +++ b/src/Fields/Level1234/Level34/FixedAsset/MethodLockedField.php @@ -1,47 +1,47 @@ -methodLocked; - } - - public function getMethodLockedToString(): ?string - { - return ($this->getMethodLocked()) ? 'true' : 'false'; - } - - /** - * @param bool $methodLocked - * @return $this - */ - public function setMethodLocked(?bool $methodLocked): self - { - $this->methodLocked = $methodLocked; - return $this; - } - - /** - * @param string|null $methodLockedString - * @return $this - * @throws Exception - */ - public function setMethodLockedFromString(?string $methodLockedString) - { - return $this->setMethodLocked(filter_var($methodLockedString, FILTER_VALIDATE_BOOLEAN)); - } +methodLocked; + } + + public function getMethodLockedToString(): ?string + { + return ($this->getMethodLocked()) ? 'true' : 'false'; + } + + /** + * @param bool $methodLocked + * @return $this + */ + public function setMethodLocked(?bool $methodLocked): self + { + $this->methodLocked = $methodLocked; + return $this; + } + + /** + * @param string|null $methodLockedString + * @return $this + * @throws Exception + */ + public function setMethodLockedFromString(?string $methodLockedString) + { + return $this->setMethodLocked(filter_var($methodLockedString, FILTER_VALIDATE_BOOLEAN)); + } } \ No newline at end of file diff --git a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetsStatusField.php b/src/Fields/Level1234/Level34/FixedAsset/StatusField.php similarity index 88% rename from src/Fields/Level1234/Level34/FixedAsset/FixedAssetsStatusField.php rename to src/Fields/Level1234/Level34/FixedAsset/StatusField.php index 107f4736..f260cbb6 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetsStatusField.php +++ b/src/Fields/Level1234/Level34/FixedAsset/StatusField.php @@ -1,41 +1,41 @@ -status; - } - - /** - * @param FixedAssetsStatus|null $status - * @return $this - */ - public function setStatus(?FixedAssetsStatus $status): self - { - $this->status = $status; - return $this; - } - - /** - * @param string|null $statusString - * @return $this - * @throws Exception - */ - public function setStatusFromString(?string $statusString) - { - return $this->setStatus(new FixedAssetsStatus((string)$statusString)); - } +status; + } + + /** + * @param FixedAssetsStatus|null $status + * @return $this + */ + public function setStatus(?FixedAssetsStatus $status): self + { + $this->status = $status; + return $this; + } + + /** + * @param string|null $statusString + * @return $this + * @throws Exception + */ + public function setStatusFromString(?string $statusString) + { + return $this->setStatus(new FixedAssetsStatus((string)$statusString)); + } } \ No newline at end of file diff --git a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetsStatusLockedField.php b/src/Fields/Level1234/Level34/FixedAsset/StatusLockedField.php similarity index 88% rename from src/Fields/Level1234/Level34/FixedAsset/FixedAssetsStatusLockedField.php rename to src/Fields/Level1234/Level34/FixedAsset/StatusLockedField.php index c85db61c..e9d0d743 100644 --- a/src/Fields/Level1234/Level34/FixedAsset/FixedAssetsStatusLockedField.php +++ b/src/Fields/Level1234/Level34/FixedAsset/StatusLockedField.php @@ -1,47 +1,47 @@ -statusLocked; - } - - public function getStatusLockedToString(): ?string - { - return ($this->getStatusLocked()) ? 'true' : 'false'; - } - - /** - * @param bool $statusLocked - * @return $this - */ - public function setStatusLocked(?bool $statusLocked): self - { - $this->statusLocked = $statusLocked; - return $this; - } - - /** - * @param string|null $statusLockedString - * @return $this - * @throws Exception - */ - public function setStatusLockedFromString(?string $statusLockedString) - { - return $this->setStatusLocked(filter_var($statusLockedString, FILTER_VALIDATE_BOOLEAN)); - } +statusLocked; + } + + public function getStatusLockedToString(): ?string + { + return ($this->getStatusLocked()) ? 'true' : 'false'; + } + + /** + * @param bool $statusLocked + * @return $this + */ + public function setStatusLocked(?bool $statusLocked): self + { + $this->statusLocked = $statusLocked; + return $this; + } + + /** + * @param string|null $statusLockedString + * @return $this + * @throws Exception + */ + public function setStatusLockedFromString(?string $statusLockedString) + { + return $this->setStatusLocked(filter_var($statusLockedString, FILTER_VALIDATE_BOOLEAN)); + } } \ No newline at end of file diff --git a/src/Fields/Level1234/SubstituteWithField.php b/src/Fields/Level1234/SubstituteWithField.php index 2862ee11..3c2c95b8 100644 --- a/src/Fields/Level1234/SubstituteWithField.php +++ b/src/Fields/Level1234/SubstituteWithField.php @@ -22,7 +22,7 @@ public function getSubstituteWith() return $this->substituteWith; } - public function getSubstituteWithToCode(): ?string + public function getSubstituteWithToString(): ?string { if ($this->getSubstituteWith() != null) { return $this->substituteWith->getCode(); @@ -45,7 +45,7 @@ public function setSubstituteWith($substituteWith): self * @return $this * @throws Exception */ - public function setSubstituteWithFromCode(?string $substituteWithCode) + public function setSubstituteWithFromString(?string $substituteWithCode) { $substituteWith = new Dummy(); $substituteWith->setCode($substituteWithCode); diff --git a/src/Fields/Level1234/GeneralLedgerTypeField.php b/src/Fields/Level1234/TypeField.php similarity index 55% rename from src/Fields/Level1234/GeneralLedgerTypeField.php rename to src/Fields/Level1234/TypeField.php index 60d80a82..b6a9f523 100644 --- a/src/Fields/Level1234/GeneralLedgerTypeField.php +++ b/src/Fields/Level1234/TypeField.php @@ -1,41 +1,41 @@ -type; - } - - /** - * @param GeneralLedgerType|null $type - * @return $this - */ - public function setType(?GeneralLedgerType $type): self - { - $this->type = $type; - return $this; - } - - /** - * @param string|null $typeString - * @return $this - * @throws Exception - */ - public function setTypeFromString(?string $typeString) - { - return $this->setType(new GeneralLedgerType((string)$typeString)); - } +type; + } + + /** + * @param ChildValidationType|null $type + * @return $this + */ + public function setType(?ChildValidationType $type): self + { + $this->type = $type; + return $this; + } + + /** + * @param string|null $typeString + * @return $this + * @throws Exception + */ + public function setTypeFromString(?string $typeString) + { + return $this->setType(new ChildValidationType((string)$typeString)); + } } \ No newline at end of file diff --git a/src/Fields/Office/CountryCodeField.php b/src/Fields/Office/CountryCodeField.php index e9b1d432..3b18fe44 100644 --- a/src/Fields/Office/CountryCodeField.php +++ b/src/Fields/Office/CountryCodeField.php @@ -2,31 +2,53 @@ namespace PhpTwinfield\Fields\Office; +use PhpTwinfield\Country; + +/** + * The country + * Used by: Office + * + * @package PhpTwinfield\Traits + */ trait CountryCodeField { /** - * Country code field - * Used by: Office - * - * @var string|null + * @var Country|null */ private $countryCode; - /** - * @return null|string - */ - public function getCountryCode(): ?string + public function getCountryCode(): ?Country { return $this->countryCode; } + public function getCountryCodeToString(): ?string + { + if ($this->getCountryCode() != null) { + return $this->countryCode->getCode(); + } else { + return null; + } + } + /** - * @param null|string $countryCode * @return $this */ - public function setCountryCode(?string $countryCode): self + public function setCountryCode(?Country $countryCode): self { $this->countryCode = $countryCode; return $this; } + + /** + * @param string|null $countryCode + * @return $this + * @throws Exception + */ + public function setCountryCodeFromString(?string $countryCode) + { + $countryCode = new Country(); + $countryCode->setCode($countryCode); + return $this->setCountryCode($countryCode); + } } \ No newline at end of file diff --git a/src/Fields/OfficeField.php b/src/Fields/OfficeField.php index 1de4efd1..bb147f7e 100644 --- a/src/Fields/OfficeField.php +++ b/src/Fields/OfficeField.php @@ -21,7 +21,7 @@ public function getOffice(): ?Office return $this->office; } - public function getOfficeToCode(): ?string + public function getOfficeToString(): ?string { if ($this->getOffice() != null) { return $this->office->getCode(); @@ -44,7 +44,7 @@ public function setOffice(?Office $office): self * @return $this * @throws Exception */ - public function setOfficeFromCode(?string $officeCode) + public function setOfficeFromString(?string $officeCode) { $office = new Office(); $office->setCode($officeCode); diff --git a/src/Fields/RateField.php b/src/Fields/RateField.php index 2b5bb755..d40b7d12 100644 --- a/src/Fields/RateField.php +++ b/src/Fields/RateField.php @@ -22,7 +22,7 @@ public function getRate(): ?Rate return $this->rate; } - public function getRateToCode(): ?string + public function getRateToString(): ?string { if ($this->getRate() != null) { return $this->rate->getCode(); @@ -45,7 +45,7 @@ public function setRate(?Rate $rate): self * @return $this * @throws Exception */ - public function setRateFromCode(?string $rateCode) + public function setRateFromString(?string $rateCode) { $rate = new Rate(); $rate->setCode($rateCode); diff --git a/src/Fields/UserField.php b/src/Fields/UserField.php index a8c756b1..e0fddfc8 100644 --- a/src/Fields/UserField.php +++ b/src/Fields/UserField.php @@ -22,7 +22,7 @@ public function getUser(): ?User return $this->user; } - public function getUserToCode(): ?string + public function getUserToString(): ?string { if ($this->getUser() != null) { return $this->user->getCode(); @@ -45,7 +45,7 @@ public function setUser(?User $user): self * @return $this * @throws Exception */ - public function setUserFromCode(?string $userCode) + public function setUserFromString(?string $userCode) { $user = new User(); $user->setCode($userCode); diff --git a/src/Fields/VatCode/VatGroupCountryField.php b/src/Fields/VatCode/GroupCountryField.php similarity index 82% rename from src/Fields/VatCode/VatGroupCountryField.php rename to src/Fields/VatCode/GroupCountryField.php index 85813667..8489e9b6 100644 --- a/src/Fields/VatCode/VatGroupCountryField.php +++ b/src/Fields/VatCode/GroupCountryField.php @@ -1,54 +1,54 @@ -groupCountry; - } - - public function getGroupCountryToCode(): ?string - { - if ($this->getGroupCountry() != null) { - return $this->groupCountry->getCode(); - } else { - return null; - } - } - - /** - * @return $this - */ - public function setGroupCountry(?Country $groupCountry): self - { - $this->groupCountry = $groupCountry; - return $this; - } - - /** - * @param string|null $groupCountryCode - * @return $this - * @throws Exception - */ - public function setGroupCountryFromCode(?string $groupCountryCode) - { - $groupCountry = new Country(); - $groupCountry->setCode($groupCountryCode); - return $this->setGroupCountry($groupCountry); - } +groupCountry; + } + + public function getGroupCountryToString(): ?string + { + if ($this->getGroupCountry() != null) { + return $this->groupCountry->getCode(); + } else { + return null; + } + } + + /** + * @return $this + */ + public function setGroupCountry(?Country $groupCountry): self + { + $this->groupCountry = $groupCountry; + return $this; + } + + /** + * @param string|null $groupCountryCode + * @return $this + * @throws Exception + */ + public function setGroupCountryFromString(?string $groupCountryCode) + { + $groupCountry = new Country(); + $groupCountry->setCode($groupCountryCode); + return $this->setGroupCountry($groupCountry); + } } \ No newline at end of file diff --git a/src/Fields/VatCode/VatGroupField.php b/src/Fields/VatCode/GroupField.php similarity index 82% rename from src/Fields/VatCode/VatGroupField.php rename to src/Fields/VatCode/GroupField.php index a8f15ce2..8b7bef8a 100644 --- a/src/Fields/VatCode/VatGroupField.php +++ b/src/Fields/VatCode/GroupField.php @@ -1,54 +1,54 @@ -group; - } - - public function getGroupToCode(): ?string - { - if ($this->getGroup() != null) { - return $this->group->getCode(); - } else { - return null; - } - } - - /** - * @return $this - */ - public function setGroup(?VatGroup $group): self - { - $this->group = $group; - return $this; - } - - /** - * @param string|null $groupCode - * @return $this - * @throws Exception - */ - public function setGroupFromCode(?string $groupCode) - { - $group = new VatGroup(); - $group->setCode($groupCode); - return $this->setGroup($group); - } +group; + } + + public function getGroupToString(): ?string + { + if ($this->getGroup() != null) { + return $this->group->getCode(); + } else { + return null; + } + } + + /** + * @return $this + */ + public function setGroup(?VatGroup $group): self + { + $this->group = $group; + return $this; + } + + /** + * @param string|null $groupCode + * @return $this + * @throws Exception + */ + public function setGroupFromString(?string $groupCode) + { + $group = new VatGroup(); + $group->setCode($groupCode); + return $this->setGroup($group); + } } \ No newline at end of file diff --git a/src/Fields/VatCode/LineTypeField.php b/src/Fields/VatCode/LineTypeField.php index 2cc5c26c..d291c235 100644 --- a/src/Fields/VatCode/LineTypeField.php +++ b/src/Fields/VatCode/LineTypeField.php @@ -12,20 +12,20 @@ trait LineTypeField * * @var LineType|null */ - private $linetype; + private $lineType; public function getLineType(): ?LineType { - return $this->linetype; + return $this->lineType; } /** * @param LineType|null $linetype * @return $this */ - public function setLineType(?LineType $linetype): self + public function setLineType(?LineType $lineType): self { - $this->linetype = $linetype; + $this->lineType = $lineType; return $this; } diff --git a/src/Fields/VatCode/VatCodeTypeField.php b/src/Fields/VatCode/TypeField.php similarity index 91% rename from src/Fields/VatCode/VatCodeTypeField.php rename to src/Fields/VatCode/TypeField.php index a77ba16e..d685c0c1 100644 --- a/src/Fields/VatCode/VatCodeTypeField.php +++ b/src/Fields/VatCode/TypeField.php @@ -1,41 +1,41 @@ -type; - } - - /** - * @param VatType|null $type - * @return $this - */ - public function setType(?VatType $type): self - { - $this->type = $type; - return $this; - } - - /** - * @param string|null $typeString - * @return $this - * @throws Exception - */ - public function setTypeFromString(?string $typeString) - { - return $this->setType(new VatType((string)$typeString)); - } +type; + } + + /** + * @param VatType|null $type + * @return $this + */ + public function setType(?VatType $type): self + { + $this->type = $type; + return $this; + } + + /** + * @param string|null $typeString + * @return $this + * @throws Exception + */ + public function setTypeFromString(?string $typeString) + { + return $this->setType(new VatType((string)$typeString)); + } } \ No newline at end of file diff --git a/src/Fields/VatCodeField.php b/src/Fields/VatCodeField.php index 64ec772f..a5d1a5da 100644 --- a/src/Fields/VatCodeField.php +++ b/src/Fields/VatCodeField.php @@ -22,7 +22,7 @@ public function getVatCode(): ?VatCode return $this->vatCode; } - public function getVatCodeToCode(): ?string + public function getVatCodeToString(): ?string { if ($this->getVatCode() != null) { return $this->vatCode->getCode(); @@ -45,7 +45,7 @@ public function setVatCode(?VatCode $vatCode): self * @return $this * @throws Exception */ - public function setVatCodeFromCode(?string $vatCodeCode) + public function setVatCodeFromString(?string $vatCodeCode) { $vatCode = new VatCode(); $vatCode->setCode($vatCodeCode); diff --git a/src/FixedAsset.php b/src/FixedAsset.php index 122b21c8..19cbc5b5 100644 --- a/src/FixedAsset.php +++ b/src/FixedAsset.php @@ -5,8 +5,8 @@ use PhpTwinfield\Fields\BehaviourField; use PhpTwinfield\Fields\CodeField; use PhpTwinfield\Fields\InUseField; -use PhpTwinfield\Fields\Level1234\DimensionGroupField; -use PhpTwinfield\Fields\Level1234\DimensionTypeField; +use PhpTwinfield\Fields\Level1234\DimensionGroup\GroupField; +use PhpTwinfield\Fields\Level1234\DimensionType\TypeField; use PhpTwinfield\Fields\NameField; use PhpTwinfield\Fields\OfficeField; use PhpTwinfield\Fields\ShortNameField; @@ -23,22 +23,22 @@ class FixedAsset extends BaseObject { use BehaviourField; use CodeField; - use DimensionGroupField; - use DimensionTypeField; + use GroupField; use InUseField; use NameField; use OfficeField; use ShortNameField; use StatusField; use TouchedField; + use TypeField; use UIDField; private $financials; private $fixedAssets; - + public function __construct() { - $this->setTypeFromCode('AST'); + $this->setTypeFromString('AST'); $this->setFinancials(new FixedAssetFinancials); $this->setFixedAssets(new FixedAssetFixedAssets); } diff --git a/src/FixedAssetFixedAssets.php b/src/FixedAssetFixedAssets.php index 2f8351f7..5427e477 100644 --- a/src/FixedAssetFixedAssets.php +++ b/src/FixedAssetFixedAssets.php @@ -7,10 +7,6 @@ use PhpTwinfield\Fields\FreeText3Field; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\BeginPeriodField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\BeginPeriodLockedField; -use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FixedAssetsMethodField; -use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FixedAssetsMethodLockedField; -use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FixedAssetsStatusField; -use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FixedAssetsStatusLockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FreeText1LockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FreeText2LockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FreeText3LockedField; @@ -20,6 +16,8 @@ use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FreeText5LockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\LastDepreciationField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\LastDepreciationLockedField; +use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\MethodField; +use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\MethodLockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\NrOfPeriodsInheritedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\NrOfPeriodsLockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\PercentageLockedField; @@ -29,6 +27,8 @@ use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\ResidualValueLockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\SellDateField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\SellDateLockedField; +use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\StatusField; +use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\StatusLockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\StopValueField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\StopValueLockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\TransactionLinesLockedField; @@ -43,10 +43,6 @@ class FixedAssetFixedAssets extends BaseObject { use BeginPeriodField; use BeginPeriodLockedField; - use FixedAssetsMethodField; - use FixedAssetsMethodLockedField; - use FixedAssetsStatusField; - use FixedAssetsStatusLockedField; use FreeText1Field; use FreeText1LockedField; use FreeText2Field; @@ -59,6 +55,8 @@ class FixedAssetFixedAssets extends BaseObject use FreeText5LockedField; use LastDepreciationField; use LastDepreciationLockedField; + use MethodField; + use MethodLockedField; use NrOfPeriodsField; use NrOfPeriodsInheritedField; use NrOfPeriodsLockedField; @@ -70,6 +68,8 @@ class FixedAssetFixedAssets extends BaseObject use ResidualValueLockedField; use SellDateField; use SellDateLockedField; + use StatusField; + use StatusLockedField; use StopValueField; use StopValueLockedField; use TransactionLinesLockedField; diff --git a/src/FixedAssetTransactionLine.php b/src/FixedAssetTransactionLine.php index 1a91c152..ead21e7c 100644 --- a/src/FixedAssetTransactionLine.php +++ b/src/FixedAssetTransactionLine.php @@ -5,6 +5,8 @@ use PhpTwinfield\Fields\Dim1Field; use PhpTwinfield\Fields\Level1234\AmountField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\AmountLockedField; +use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\CodeField; +use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\CodeLockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\Dim1LockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\Dim2Field; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\Dim2LockedField; @@ -16,8 +18,6 @@ use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\Dim5LockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\Dim6Field; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\Dim6LockedField; -use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FixedAssetCodeField; -use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\FixedAssetCodeLockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\LineField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\LineLockedField; use PhpTwinfield\Fields\Level1234\Level34\FixedAsset\NumberField; @@ -33,6 +33,8 @@ class FixedAssetTransactionLine extends BaseObject { use AmountField; use AmountLockedField; + use CodeField; + use CodeLockedField; use Dim1Field; use Dim1LockedField; use Dim2Field; @@ -45,8 +47,6 @@ class FixedAssetTransactionLine extends BaseObject use Dim5LockedField; use Dim6Field; use Dim6LockedField; - use FixedAssetCodeField; - use FixedAssetCodeLockedField; use LineField; use LineLockedField; use NumberField; diff --git a/src/GeneralLedger.php b/src/GeneralLedger.php index 2776d2bb..76973c4e 100644 --- a/src/GeneralLedger.php +++ b/src/GeneralLedger.php @@ -5,12 +5,12 @@ use PhpTwinfield\Fields\BehaviourField; use PhpTwinfield\Fields\CodeField; use PhpTwinfield\Fields\InUseField; +use PhpTwinfield\Fields\Level1234\BeginPeriodField; use PhpTwinfield\Fields\Level1234\BeginYearField; -use PhpTwinfield\Fields\Level1234\DimensionGroupField; -use PhpTwinfield\Fields\Level1234\DimensionTypeField; +use PhpTwinfield\Fields\Level1234\DimensionGroup\GroupField; +use PhpTwinfield\Fields\Level1234\DimensionType\TypeField; +use PhpTwinfield\Fields\Level1234\EndPeriodField; use PhpTwinfield\Fields\Level1234\EndYearField; -use PhpTwinfield\Fields\Level1234\GeneralLedgerBeginPeriodField; -use PhpTwinfield\Fields\Level1234\GeneralLedgerEndPeriodField; use PhpTwinfield\Fields\NameField; use PhpTwinfield\Fields\OfficeField; use PhpTwinfield\Fields\ShortNameField; @@ -25,20 +25,20 @@ */ class GeneralLedger extends BaseObject { + use BeginPeriodField; use BeginYearField; use BehaviourField; use CodeField; - use DimensionGroupField; - use DimensionTypeField; + use EndPeriodField; use EndYearField; - use GeneralLedgerBeginPeriodField; - use GeneralLedgerEndPeriodField; + use GroupField; use InUseField; use NameField; use OfficeField; use ShortNameField; use StatusField; use TouchedField; + use TypeField; use UIDField; private $financials; diff --git a/src/GeneralLedgerChildValidation.php b/src/GeneralLedgerChildValidation.php index 876800af..8becf6a4 100644 --- a/src/GeneralLedgerChildValidation.php +++ b/src/GeneralLedgerChildValidation.php @@ -4,7 +4,7 @@ use PhpTwinfield\Fields\ElementValueField; use PhpTwinfield\Fields\Level1234\LevelField; -use PhpTwinfield\Fields\Level1234\GeneralLedgerTypeField; +use PhpTwinfield\Fields\Level1234\TypeField; /** * @see https://c3.twinfield.com/webservices/documentation/#/ApiReference/Masters/BalanceSheets @@ -14,5 +14,5 @@ class GeneralLedgerChildValidation extends BaseObject { use ElementValueField; use LevelField; - use GeneralLedgerTypeField; + use TypeField; } diff --git a/src/Invoice.php b/src/Invoice.php index e4851d0a..55b8968b 100644 --- a/src/Invoice.php +++ b/src/Invoice.php @@ -6,6 +6,7 @@ use PhpTwinfield\Fields\Invoice\BankField; use PhpTwinfield\Fields\Invoice\CalculateOnlyField; use PhpTwinfield\Fields\Invoice\CustomerNameField; +use PhpTwinfield\Fields\Invoice\DebitCreditField; use PhpTwinfield\Fields\Invoice\DeliverAddressNumberField; use PhpTwinfield\Fields\Invoice\DueDateField; use PhpTwinfield\Fields\Invoice\FinancialCodeField; @@ -15,13 +16,12 @@ use PhpTwinfield\Fields\Invoice\InvoiceAddressNumberField; use PhpTwinfield\Fields\Invoice\InvoiceAmountField; use PhpTwinfield\Fields\Invoice\InvoiceDateField; -use PhpTwinfield\Fields\Invoice\InvoiceDebitCreditField; use PhpTwinfield\Fields\Invoice\InvoiceNumberField; use PhpTwinfield\Fields\Invoice\InvoiceTypeField; -use PhpTwinfield\Fields\Invoice\InvoiceStatusField; use PhpTwinfield\Fields\Invoice\PaymentMethodField; use PhpTwinfield\Fields\Invoice\PerformanceDateField; use PhpTwinfield\Fields\Invoice\RaiseWarningField; +use PhpTwinfield\Fields\Invoice\StatusField; use PhpTwinfield\Fields\OfficeField; use PhpTwinfield\Fields\PeriodField; @@ -52,6 +52,7 @@ class Invoice extends BaseObject use CurrencyField; use CustomerField; use CustomerNameField; + use DebitCreditField; use DeliverAddressNumberField; use DueDateField; use FinancialCodeField; @@ -61,15 +62,14 @@ class Invoice extends BaseObject use InvoiceAddressNumberField; use InvoiceAmountField; use InvoiceDateField; - use InvoiceDebitCreditField; use InvoiceNumberField; use InvoiceTypeField; - use InvoiceStatusField; use OfficeField; use PaymentMethodField; use PerformanceDateField; use PeriodField; use RaiseWarningField; + use StatusField; private $totals; private $lines = []; diff --git a/src/Mappers/ArticleMapper.php b/src/Mappers/ArticleMapper.php index 7370fbcc..3df96711 100644 --- a/src/Mappers/ArticleMapper.php +++ b/src/Mappers/ArticleMapper.php @@ -91,8 +91,8 @@ public static function map(Response $response) $articleLine->setStatusFromString($lineElement->getAttribute('status')); // Set the article line elements - $articleLine->setFreeText1(self::parseObjectAttribute('GeneralLedger', $articleLine, $lineElement, 'freetext1', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) - ->setFreeText2(self::parseObjectAttribute('CostCenter', $articleLine, $lineElement, 'freetext2', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) + $articleLine->setFreeText1(self::parseObjectAttribute('GeneralLedger', $articleLine, $lineElement, 'freetext1', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) + ->setFreeText2(self::parseObjectAttribute('CostCenter', $articleLine, $lineElement, 'freetext2', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) ->setFreeText3(self::getField($articleLine, $lineElement, 'freetext3')) ->setUnits(self::getField($articleLine, $lineElement, 'units')) ->setName(self::getField($articleLine, $lineElement, 'name')) diff --git a/src/Mappers/AssetMethodMapper.php b/src/Mappers/AssetMethodMapper.php index cc6df732..6a88c8c6 100644 --- a/src/Mappers/AssetMethodMapper.php +++ b/src/Mappers/AssetMethodMapper.php @@ -65,13 +65,13 @@ public static function map(Response $response) // Set the asset method balance account elements from the balance accounts element $assetMethodBalanceAccounts - ->setAssetsToActivate(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'assetstoactivate', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) - ->setDepreciation(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'depreciation', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) + ->setAssetsToActivate(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'assetstoactivate', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) + ->setDepreciation(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'depreciation', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) ->setDepreciationGroup(self::parseObjectAttribute('DimensionGroup', $assetMethodBalanceAccounts, $balanceAccountsElement, 'depreciationgroup', array('name' => 'setName', 'shortname' => 'setShortName'))) - ->setPurchaseValue(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'purchasevalue', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) + ->setPurchaseValue(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'purchasevalue', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) ->setPurchaseValueGroup(self::parseObjectAttribute('DimensionGroup', $assetMethodBalanceAccounts, $balanceAccountsElement, 'purchasevaluegroup', array('name' => 'setName', 'shortname' => 'setShortName'))) - ->setReconciliation(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'reconciliation', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) - ->setToBeInvoiced(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'tobeinvoiced', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))); + ->setReconciliation(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'reconciliation', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) + ->setToBeInvoiced(self::parseObjectAttribute('GeneralLedger', $assetMethodBalanceAccounts, $balanceAccountsElement, 'tobeinvoiced', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))); // Set the custom class to the assetmethod $assetmethod->setBalanceAccounts($assetMethodBalanceAccounts); @@ -86,9 +86,9 @@ public static function map(Response $response) // Set the asset method profit loss account elements from the profit loss accounts element $assetMethodProfitLossAccounts - ->setDepreciation(self::parseObjectAttribute('GeneralLedger', $assetMethodProfitLossAccounts, $profitLossAccountsElement, 'depreciation', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) - ->setReconciliation(self::parseObjectAttribute('GeneralLedger', $assetMethodProfitLossAccounts, $profitLossAccountsElement, 'reconciliation', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) - ->setSales(self::parseObjectAttribute('GeneralLedger', $assetMethodProfitLossAccounts, $profitLossAccountsElement, 'sales', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))); + ->setDepreciation(self::parseObjectAttribute('GeneralLedger', $assetMethodProfitLossAccounts, $profitLossAccountsElement, 'depreciation', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) + ->setReconciliation(self::parseObjectAttribute('GeneralLedger', $assetMethodProfitLossAccounts, $profitLossAccountsElement, 'reconciliation', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) + ->setSales(self::parseObjectAttribute('GeneralLedger', $assetMethodProfitLossAccounts, $profitLossAccountsElement, 'sales', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))); // Set the custom class to the assetmethod $assetmethod->setProfitLossAccounts($assetMethodProfitLossAccounts); diff --git a/src/Mappers/BaseMapper.php b/src/Mappers/BaseMapper.php index 0e3dd969..823ae2ba 100644 --- a/src/Mappers/BaseMapper.php +++ b/src/Mappers/BaseMapper.php @@ -218,4 +218,4 @@ protected static function parseObjectAttribute(string $className, $object, \DOME return $object2; } -} +} \ No newline at end of file diff --git a/src/Mappers/CustomerMapper.php b/src/Mappers/CustomerMapper.php index 86599edc..24456def 100644 --- a/src/Mappers/CustomerMapper.php +++ b/src/Mappers/CustomerMapper.php @@ -85,7 +85,7 @@ public static function map(Response $response) ->setPayCode(self::parseObjectAttribute('PayCode', $customerFinancials, $financialsElement, 'paycode', array('name' => 'setName', 'shortname' => 'setShortName'))) ->setSubAnalyse(self::parseEnumAttribute('SubAnalyse', self::getField($customerFinancials, $financialsElement, 'subanalyse'))) ->setSubstitutionLevel(self::getField($customerFinancials, $financialsElement, 'substitutionlevel')) - ->setSubstituteWith(self::parseObjectAttribute('UnknownDimension', $customerFinancials, $financialsElement, 'substitutewith', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) + ->setSubstituteWith(self::parseObjectAttribute('UnknownDimension', $customerFinancials, $financialsElement, 'substitutewith', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) ->setVatCode(self::parseObjectAttribute('VatCode', $customerFinancials, $financialsElement, 'vatcode', array('name' => 'setName', 'shortname' => 'setShortName', 'type' => 'setTypeFromString'))); // Set the financials elements from the financials element attributes @@ -127,7 +127,7 @@ public static function map(Response $response) // Set the child validation elements from the child validation element en element attributes $customerChildValidation->setLevel($childValidationElement->getAttribute('level')) - ->setType(self::parseEnumAttribute('GeneralLedgerType', $childValidationElement->getAttribute('type'))) + ->setType(self::parseEnumAttribute('ChildValidationType', $childValidationElement->getAttribute('type'))) ->setElementValue($childValidationElement->textContent); // Add the child validation to the customer financials class @@ -237,14 +237,14 @@ public static function map(Response $response) ->setID($bankElement->getAttribute('id')); // Set the bank elements from the bank element - $customerBank->setAscription(self::getField($customerBank, $bankElement, 'ascription')) - ->setAccountNumber(self::getField($customerBank, $bankElement, 'accountnumber')) + $customerBank->setAccountNumber(self::getField($customerBank, $bankElement, 'accountnumber')) + ->setAddressField2(self::getField($customerBank, $bankElement, 'field2')) + ->setAddressField3(self::getField($customerBank, $bankElement, 'field3')) + ->setAscription(self::getField($customerBank, $bankElement, 'ascription')) ->setBankName(self::getField($customerBank, $bankElement, 'bankname')) ->setBicCode(self::getField($customerBank, $bankElement, 'biccode')) ->setCity(self::getField($customerBank, $bankElement, 'city')) ->setCountry(self::parseObjectAttribute('Country', $customerBank, $bankElement, 'country', array('name' => 'setName', 'shortname' => 'setShortName'))) - ->setField2(self::getField($customerBank, $bankElement, 'field2')) - ->setField3(self::getField($customerBank, $bankElement, 'field3')) ->setIban(self::getField($customerBank, $bankElement, 'iban')) ->setNatBicCode(self::getField($customerBank, $bankElement, 'natbiccode')) ->setPostcode(self::getField($customerBank, $bankElement, 'postcode')) @@ -295,9 +295,9 @@ public static function map(Response $response) // Set the line elements from the line element $customerLine->setDescription(self::getField($customerLine, $lineElement, 'description')) - ->setDimension1(self::parseObjectAttribute('GeneralLedger', $customerLine, $lineElement, 'dimension1', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) - ->setDimension2(self::parseObjectAttribute('CostCenter', $customerLine, $lineElement, 'dimension2', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) - ->setDimension3(self::parseObjectAttribute('UnknownDimension', $customerLine, $lineElement, 'dimension3', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) + ->setDimension1(self::parseObjectAttribute('GeneralLedger', $customerLine, $lineElement, 'dimension1', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) + ->setDimension2(self::parseObjectAttribute('CostCenter', $customerLine, $lineElement, 'dimension2', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) + ->setDimension3(self::parseObjectAttribute('UnknownDimension', $customerLine, $lineElement, 'dimension3', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) ->setOffice(self::parseObjectAttribute('Office', $customerLine, $lineElement, 'office', array('name' => 'setName', 'shortname' => 'setShortName'))) ->setRatio(self::getField($customerLine, $lineElement, 'ratio')) ->setVatCode(self::parseObjectAttribute('VatCode', $customerLine, $lineElement, 'vatcode', array('name' => 'setName', 'shortname' => 'setShortName', 'type' => 'setTypeFromString'))); diff --git a/src/Mappers/FixedAssetMapper.php b/src/Mappers/FixedAssetMapper.php index 35b57fd8..1431327b 100644 --- a/src/Mappers/FixedAssetMapper.php +++ b/src/Mappers/FixedAssetMapper.php @@ -64,7 +64,7 @@ public static function map(Response $response) ->setMatchType(self::parseEnumAttribute('MatchType', self::getField($fixedAssetFinancials, $financialsElement, 'matchtype'))) ->setSubAnalyse(self::parseEnumAttribute('SubAnalyse', self::getField($fixedAssetFinancials, $financialsElement, 'subanalyse'))) ->setSubstitutionLevel(self::getField($fixedAssetFinancials, $financialsElement, 'substitutionlevel')) - ->setSubstituteWith(self::parseObjectAttribute('CostCenter', $fixedAssetFinancials, $financialsElement, 'substitutewith', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) + ->setSubstituteWith(self::parseObjectAttribute('CostCenter', $fixedAssetFinancials, $financialsElement, 'substitutewith', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) ->setVatCode(self::parseObjectAttribute('VatCode', $fixedAssetFinancials, $financialsElement, 'vatcode')); // Set the financials elements from the financials element attributes diff --git a/src/Mappers/GeneralLedgerMapper.php b/src/Mappers/GeneralLedgerMapper.php index 5631505a..db531390 100644 --- a/src/Mappers/GeneralLedgerMapper.php +++ b/src/Mappers/GeneralLedgerMapper.php @@ -88,7 +88,7 @@ public static function map(Response $response) // Set the child validation elements from the child validation element en element attributes $generalLedgerChildValidation->setLevel($childValidationElement->getAttribute('level')); - $generalLedgerChildValidation->setType(self::parseEnumAttribute('GeneralLedgerType', $childValidationElement->getAttribute('type'))); + $generalLedgerChildValidation->setType(self::parseEnumAttribute('ChildValidationType', $childValidationElement->getAttribute('type'))); $generalLedgerChildValidation->setElementValue($childValidationElement->textContent); // Add the child validation to the general ledger financials class diff --git a/src/Mappers/InvoiceMapper.php b/src/Mappers/InvoiceMapper.php index 07b9a0b1..6cb896e7 100644 --- a/src/Mappers/InvoiceMapper.php +++ b/src/Mappers/InvoiceMapper.php @@ -100,7 +100,7 @@ public static function map(Response $response) ->setPerformanceDate(self::parseDateAttribute(self::getField($invoiceLine, $lineElement, 'performancedate'))) ->setPerformanceType(self::parseEnumAttribute('PerformanceType', self::getField($invoiceLine, $lineElement, 'performancetype'))) ->setQuantity(self::getField($invoiceLine, $lineElement, 'quantity')) - ->setSubArticleFromSubCode(self::getField($invoiceLine, $lineElement, 'subarticle')) + ->setSubArticleFromString(self::getField($invoiceLine, $lineElement, 'subarticle')) ->setUnits(self::getField($invoiceLine, $lineElement, 'units')) ->setUnitsPriceExcl(self::parseMoneyAttribute(self::getField($invoiceLine, $lineElement, 'unitspriceexcl'))) ->setUnitsPriceInc(self::parseMoneyAttribute(self::getField($invoiceLine, $lineElement, 'unitspriceinc'))) diff --git a/src/Mappers/MatchSetMapper.php b/src/Mappers/MatchSetMapper.php index f2ec2a04..9caf2d47 100644 --- a/src/Mappers/MatchSetMapper.php +++ b/src/Mappers/MatchSetMapper.php @@ -77,4 +77,4 @@ private static function getMatchValueFrom(\DOMElement $lineElement): ?Money // TODO: Perhaps not hard code this to EUR, but the element doesn't seem to contain a currency return Util::parseMoney($matchValue, new Currency('EUR')); } -} +} \ No newline at end of file diff --git a/src/Mappers/SupplierMapper.php b/src/Mappers/SupplierMapper.php index 8d67eb46..5d0e4b41 100644 --- a/src/Mappers/SupplierMapper.php +++ b/src/Mappers/SupplierMapper.php @@ -77,7 +77,7 @@ public static function map(Response $response) ->setRelationsReference(self::getField($supplierFinancials, $financialsElement, 'relationsreference')) ->setSubAnalyse(self::parseEnumAttribute('SubAnalyse', self::getField($supplierFinancials, $financialsElement, 'subanalyse'))) ->setSubstitutionLevel(self::getField($supplierFinancials, $financialsElement, 'substitutionlevel')) - ->setSubstituteWith(self::parseObjectAttribute('UnknownDimension', $supplierFinancials, $financialsElement, 'substitutewith', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) + ->setSubstituteWith(self::parseObjectAttribute('UnknownDimension', $supplierFinancials, $financialsElement, 'substitutewith', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) ->setVatCode(self::parseObjectAttribute('VatCode', $supplierFinancials, $financialsElement, 'vatcode', array('name' => 'setName', 'shortname' => 'setShortName', 'type' => 'setTypeFromString'))); // Set the financials elements from the financials element attributes @@ -100,7 +100,7 @@ public static function map(Response $response) // Set the child validation elements from the child validation element en element attributes $supplierChildValidation->setLevel($childValidationElement->getAttribute('level')) - ->setType(self::parseEnumAttribute('GeneralLedgerType', $childValidationElement->getAttribute('type'))) + ->setType(self::parseEnumAttribute('ChildValidationType', $childValidationElement->getAttribute('type'))) ->setElementValue($childValidationElement->textContent); // Add the child validation to the supplier financials class @@ -184,14 +184,14 @@ public static function map(Response $response) ->setID($bankElement->getAttribute('id')); // Set the bank elements from the bank element - $supplierBank->setAscription(self::getField($supplierBank, $bankElement, 'ascription')) - ->setAccountNumber(self::getField($supplierBank, $bankElement, 'accountnumber')) + $supplierBank->setAccountNumber(self::getField($supplierBank, $bankElement, 'accountnumber')) + ->setAddressField2(self::getField($supplierBank, $bankElement, 'field2')) + ->setAddressField3(self::getField($supplierBank, $bankElement, 'field3')) + ->setAscription(self::getField($supplierBank, $bankElement, 'ascription')) ->setBankName(self::getField($supplierBank, $bankElement, 'bankname')) ->setBicCode(self::getField($supplierBank, $bankElement, 'biccode')) ->setCity(self::getField($supplierBank, $bankElement, 'city')) ->setCountry(self::parseObjectAttribute('Country', $supplierBank, $bankElement, 'country', array('name' => 'setName', 'shortname' => 'setShortName'))) - ->setField2(self::getField($supplierBank, $bankElement, 'field2')) - ->setField3(self::getField($supplierBank, $bankElement, 'field3')) ->setIban(self::getField($supplierBank, $bankElement, 'iban')) ->setNatBicCode(self::getField($supplierBank, $bankElement, 'natbiccode')) ->setPostcode(self::getField($supplierBank, $bankElement, 'postcode')) @@ -242,9 +242,9 @@ public static function map(Response $response) // Set the line elements from the line element $supplierLine->setDescription(self::getField($supplierLine, $lineElement, 'description')) - ->setDimension1(self::parseObjectAttribute('GeneralLedger', $supplierLine, $lineElement, 'dimension1', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) - ->setDimension2(self::parseObjectAttribute('CostCenter', $supplierLine, $lineElement, 'dimension2', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) - ->setDimension3(self::parseObjectAttribute('UnknownDimension', $supplierLine, $lineElement, 'dimension3', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) + ->setDimension1(self::parseObjectAttribute('GeneralLedger', $supplierLine, $lineElement, 'dimension1', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) + ->setDimension2(self::parseObjectAttribute('CostCenter', $supplierLine, $lineElement, 'dimension2', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) + ->setDimension3(self::parseObjectAttribute('UnknownDimension', $supplierLine, $lineElement, 'dimension3', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) ->setOffice(self::parseObjectAttribute('Office', $supplierLine, $lineElement, 'office', array('name' => 'setName', 'shortname' => 'setShortName'))) ->setRatio(self::getField($supplierLine, $lineElement, 'ratio')) ->setVatCode(self::parseObjectAttribute('VatCode', $supplierLine, $lineElement, 'vatcode', array('name' => 'setName', 'shortname' => 'setShortName', 'type' => 'setTypeFromString'))); diff --git a/src/Mappers/VatCodeMapper.php b/src/Mappers/VatCodeMapper.php index d852a64d..a2f8ce49 100644 --- a/src/Mappers/VatCodeMapper.php +++ b/src/Mappers/VatCodeMapper.php @@ -89,7 +89,7 @@ public static function map(Response $response) $vatCodeAccount->setID($accountElement->getAttribute('id')); // Set the vat code percentage account elements from the account element - $vatCodeAccount->setDim1(self::parseObjectAttribute('GeneralLedger', $vatCodeAccount, $accountElement, 'dim1', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromCode'))) + $vatCodeAccount->setDim1(self::parseObjectAttribute('GeneralLedger', $vatCodeAccount, $accountElement, 'dim1', array('name' => 'setName', 'shortname' => 'setShortName', 'dimensiontype' => 'setTypeFromString'))) ->setGroup(self::parseObjectAttribute('VatGroup', $vatCodeAccount, $accountElement, 'group', array('name' => 'setName', 'shortname' => 'setShortName'))) ->setGroupCountry(self::parseObjectAttribute('Country', $vatCodeAccount, $accountElement, 'groupcountry', array('name' => 'setName', 'shortname' => 'setShortName'))) ->setLineType(self::parseEnumAttribute('LineType', self::getField($vatCodeAccount, $accountElement, 'linetype'))) diff --git a/src/Project.php b/src/Project.php index 947189c7..a55b0495 100644 --- a/src/Project.php +++ b/src/Project.php @@ -5,7 +5,7 @@ use PhpTwinfield\Fields\BehaviourField; use PhpTwinfield\Fields\CodeField; use PhpTwinfield\Fields\InUseField; -use PhpTwinfield\Fields\Level1234\DimensionTypeField; +use PhpTwinfield\Fields\Level1234\DimensionType\TypeField; use PhpTwinfield\Fields\NameField; use PhpTwinfield\Fields\OfficeField; use PhpTwinfield\Fields\ShortNameField; @@ -23,13 +23,13 @@ class Project extends BaseObject { use BehaviourField; use CodeField; - use DimensionTypeField; use InUseField; use NameField; use OfficeField; use ShortNameField; use StatusField; use TouchedField; + use TypeField; use UIDField; use VatCodeField; @@ -37,7 +37,7 @@ class Project extends BaseObject public function __construct() { - $this->setTypeFromCode('PRJ'); + $this->setTypeFromString('PRJ'); $this->setProjects(new ProjectProjects); } diff --git a/src/Supplier.php b/src/Supplier.php index 254901fb..51d8fdb8 100644 --- a/src/Supplier.php +++ b/src/Supplier.php @@ -5,12 +5,12 @@ use PhpTwinfield\Fields\BehaviourField; use PhpTwinfield\Fields\CodeField; use PhpTwinfield\Fields\InUseField; +use PhpTwinfield\Fields\Level1234\BeginPeriodField; use PhpTwinfield\Fields\Level1234\BeginYearField; -use PhpTwinfield\Fields\Level1234\DimensionGroupField; -use PhpTwinfield\Fields\Level1234\DimensionTypeField; +use PhpTwinfield\Fields\Level1234\DimensionGroup\GroupField; +use PhpTwinfield\Fields\Level1234\DimensionType\TypeField; +use PhpTwinfield\Fields\Level1234\EndPeriodField; use PhpTwinfield\Fields\Level1234\EndYearField; -use PhpTwinfield\Fields\Level1234\GeneralLedgerBeginPeriodField; -use PhpTwinfield\Fields\Level1234\GeneralLedgerEndPeriodField; use PhpTwinfield\Fields\Level1234\Level2\PaymentConditionDiscountDaysField; use PhpTwinfield\Fields\Level1234\Level2\PaymentConditionDiscountPercentageField; use PhpTwinfield\Fields\Level1234\Level2\RemittanceAdviceSendMailField; @@ -31,16 +31,15 @@ */ class Supplier extends BaseObject { + use BeginPeriodField; use BeginYearField; use BehaviourField; use BlockedAccountPaymentConditionsIncludeVatField; use BlockedAccountPaymentConditionsPercentageField; use CodeField; - use DimensionGroupField; - use DimensionTypeField; + use EndPeriodField; use EndYearField; - use GeneralLedgerBeginPeriodField; - use GeneralLedgerEndPeriodField; + use GroupField; use InUseField; use NameField; use OfficeField; @@ -51,6 +50,7 @@ class Supplier extends BaseObject use ShortNameField; use StatusField; use TouchedField; + use TypeField; use UIDField; use WebsiteField; @@ -65,7 +65,7 @@ public function __construct() $this->setBeginYear(0); $this->setEndPeriod(0); $this->setEndYear(0); - $this->setTypeFromCode('CRD'); + $this->setTypeFromString('CRD'); $this->setFinancials(new SupplierFinancials); } diff --git a/src/SupplierAddress.php b/src/SupplierAddress.php index 71e714da..6bc0b9e4 100644 --- a/src/SupplierAddress.php +++ b/src/SupplierAddress.php @@ -3,7 +3,6 @@ namespace PhpTwinfield; use PhpTwinfield\Fields\IDField; -use PhpTwinfield\Fields\Level1234\Level2\AddressTypeField; use PhpTwinfield\Fields\Level1234\Level2\CityField; use PhpTwinfield\Fields\Level1234\Level2\CountryField; use PhpTwinfield\Fields\Level1234\Level2\DefaultField; @@ -17,6 +16,7 @@ use PhpTwinfield\Fields\Level1234\Level2\PostcodeField; use PhpTwinfield\Fields\Level1234\Level2\TelefaxField; use PhpTwinfield\Fields\Level1234\Level2\TelephoneField; +use PhpTwinfield\Fields\Level1234\Level2\TypeField; use PhpTwinfield\Fields\NameField; /** @@ -25,7 +25,6 @@ */ class SupplierAddress extends BaseObject { - use AddressTypeField; use CityField; use CountryField; use DefaultField; @@ -41,4 +40,5 @@ class SupplierAddress extends BaseObject use PostcodeField; use TelefaxField; use TelephoneField; + use TypeField; } diff --git a/src/SupplierChildValidation.php b/src/SupplierChildValidation.php index 63891886..65fd0b83 100644 --- a/src/SupplierChildValidation.php +++ b/src/SupplierChildValidation.php @@ -4,7 +4,7 @@ use PhpTwinfield\Fields\ElementValueField; use PhpTwinfield\Fields\Level1234\LevelField; -use PhpTwinfield\Fields\Level1234\GeneralLedgerTypeField; +use PhpTwinfield\Fields\Level1234\TypeField; /** * @see https://c3.twinfield.com/webservices/documentation/#/ApiReference/Masters/Suppliers @@ -14,5 +14,5 @@ class SupplierChildValidation extends BaseObject { use ElementValueField; use LevelField; - use GeneralLedgerTypeField; + use TypeField; } diff --git a/src/SupplierPostingRule.php b/src/SupplierPostingRule.php index c582859e..d080956a 100644 --- a/src/SupplierPostingRule.php +++ b/src/SupplierPostingRule.php @@ -21,7 +21,7 @@ class SupplierPostingRule extends BaseObject use StatusField; private $lines = []; - + public function getLines() { return $this->lines; diff --git a/src/VatCode.php b/src/VatCode.php index 0e4815e3..6b9db814 100644 --- a/src/VatCode.php +++ b/src/VatCode.php @@ -12,7 +12,7 @@ use PhpTwinfield\Fields\TouchedField; use PhpTwinfield\Fields\UIDField; use PhpTwinfield\Fields\UserField; -use PhpTwinfield\Fields\VatCode\VatCodeTypeField; +use PhpTwinfield\Fields\VatCode\TypeField; /** * Class VatCode @@ -29,9 +29,9 @@ class VatCode extends BaseObject use ShortNameField; use StatusField; use TouchedField; + use TypeField; use UIDField; use UserField; - use VatCodeTypeField; private $percentages = []; diff --git a/src/VatCodeAccount.php b/src/VatCodeAccount.php index ddc4dcd5..aeebc52d 100644 --- a/src/VatCodeAccount.php +++ b/src/VatCodeAccount.php @@ -5,9 +5,9 @@ use PhpTwinfield\Fields\IDField; use PhpTwinfield\Fields\Dim1Field; use PhpTwinfield\Fields\PercentageField; +use PhpTwinfield\Fields\VatCode\GroupCountryField; +use PhpTwinfield\Fields\VatCode\GroupField; use PhpTwinfield\Fields\VatCode\LineTypeField; -use PhpTwinfield\Fields\VatCode\VatGroupCountryField; -use PhpTwinfield\Fields\VatCode\VatGroupField; /** * @see https://c3.twinfield.com/webservices/documentation/#/ApiReference/Masters/VAT @@ -17,8 +17,8 @@ class VatCodeAccount extends BaseObject { use IDField; use Dim1Field; + use GroupCountryField; + use GroupField; use LineTypeField; use PercentageField; - use VatGroupCountryField; - use VatGroupField; } diff --git a/tests/IntegrationTests/CustomerIntegrationTest.php b/tests/IntegrationTests/CustomerIntegrationTest.php index f3822006..4c4f5b46 100644 --- a/tests/IntegrationTests/CustomerIntegrationTest.php +++ b/tests/IntegrationTests/CustomerIntegrationTest.php @@ -52,8 +52,8 @@ public function testGetCustomerWorks() $customer = $this->customerApiConnector->get('CODE', $this->office); $this->assertInstanceOf(Customer::class, $customer); - $this->assertSame('001', $customer->getOfficeToCode()); - $this->assertSame('DEB', $customer->getTypeToCode()); + $this->assertSame('001', $customer->getOfficeToString()); + $this->assertSame('DEB', $customer->getTypeToString()); $this->assertSame('Customer 0', $customer->getName()); $this->assertSame('http://www.example.com', $customer->getWebsite()); @@ -61,9 +61,9 @@ public function testGetCustomerWorks() $financials = $customer->getFinancials(); $this->assertSame(30, $financials->getDueDays()); $this->assertSame(true, $financials->getPayAvailable()); - $this->assertSame('SEPANLDD', $financials->getPayCodeToCode()); + $this->assertSame('SEPANLDD', $financials->getPayCodeToString()); $this->assertSame(false, $financials->getEBilling()); - $this->assertSame('VN', $financials->getVatCodeToCode()); + $this->assertSame('VN', $financials->getVatCodeToString()); // Collect Mandate $collectMandate = $financials->getCollectMandate(); @@ -84,7 +84,7 @@ public function testGetCustomerWorks() $this->assertSame($ReflectObject->getConstant('INVOICE'), (string)$address->getType()); $this->assertSame(true, $address->getDefault()); $this->assertSame('Customer 0', $address->getName()); - $this->assertSame('NL', $address->getCountryToCode()); + $this->assertSame('NL', $address->getCountryToString()); $this->assertSame('Place', $address->getCity()); $this->assertSame('1000', $address->getPostcode()); $this->assertSame('010-123452000', $address->getTelephone()); @@ -112,13 +112,13 @@ public function testGetCustomerWorks() $this->assertSame('ABN Amro', $bank->getBankName()); $this->assertSame('ABNANL2A', $bank->getBicCode()); $this->assertSame('Place', $bank->getCity()); - $this->assertSame('NL', $bank->getCountryToCode()); + $this->assertSame('NL', $bank->getCountryToString()); $this->assertSame('NL02ABNA0123456789', $bank->getIban()); $this->assertNull($bank->getNatBicCode()); $this->assertNull($bank->getPostcode()); $this->assertNull($bank->getState()); - $this->assertNull($bank->getField2()); - $this->assertNull($bank->getField3()); + $this->assertNull($bank->getAddressField2()); + $this->assertNull($bank->getAddressField3()); $this->assertSame('1097', $customer->getCode()); $this->assertSame('c5027760-476e-4081-85fb-351c983aea54', $customer->getUID()); @@ -134,7 +134,7 @@ public function testGetCustomerWorks() // Creditmanagement $creditmanagement = $customer->getCreditManagement(); - $this->assertNull($creditmanagement->getResponsibleUserToCode()); + $this->assertNull($creditmanagement->getResponsibleUserToString()); $this->assertSame(0.00, $creditmanagement->getBaseCreditLimitToFloat()); $ReflectObject = new \ReflectionClass('\PhpTwinfield\Enums\SendReminder'); $this->assertSame($ReflectObject->getConstant('TRUE'), (string)$creditmanagement->getSendReminder()); @@ -178,7 +178,7 @@ public function testSendCustomerWorks() $financials = new CustomerFinancials(); $financials->setDueDays(30); $financials->setPayAvailable(true); - $financials->setPayCodeFromCode('SEPANLDD'); + $financials->setPayCodeFromString('SEPANLDD'); $collectMandate = new CustomerCollectMandate(); $collectMandate->setID(1); @@ -193,7 +193,7 @@ public function testSendCustomerWorks() $address->setTypeFromString('invoice'); $address->setDefault(true); $address->setName('Customer 0'); - $address->setCountryFromCode('NL'); + $address->setCountryFromString('NL'); $address->setCity('Place'); $address->setPostcode('1000'); $address->setTelephone('010-123452000'); @@ -208,12 +208,12 @@ public function testSendCustomerWorks() $bank->setDefault(true); $bank->setAscription('Customer 1'); $bank->setAccountNumber('123456789'); - $bank->setField2(''); - $bank->setField3(''); + $bank->setAddressField2(''); + $bank->setAddressField3(''); $bank->setBankName('ABN Amro'); $bank->setBicCode('ABNANL2A'); $bank->setCity('Place'); - $bank->setCountryFromCode('NL'); + $bank->setCountryFromString('NL'); $bank->setIban('NL02ABNA0123456789'); $bank->setNatBicCode(''); $bank->setPostcode(''); diff --git a/tests/IntegrationTests/InvoiceIntegrationTest.php b/tests/IntegrationTests/InvoiceIntegrationTest.php index 91f8933c..cb100051 100644 --- a/tests/IntegrationTests/InvoiceIntegrationTest.php +++ b/tests/IntegrationTests/InvoiceIntegrationTest.php @@ -65,15 +65,15 @@ public function testGetConceptInvoiceWorks() $this->assertInstanceOf(Invoice::class, $invoice); $this->assertEquals(Office::fromCode("11024"), $invoice->getOffice()); - $this->assertSame('FACTUUR', $invoice->getInvoiceTypeToCode()); + $this->assertSame('FACTUUR', $invoice->getInvoiceTypeToString()); $this->assertSame(5, $invoice->getInvoiceNumber()); $this->assertSame('20120831', $invoice->getInvoiceDateToString()); - $this->assertSame('BNK', $invoice->getBankToCode()); + $this->assertSame('BNK', $invoice->getBankToString()); $this->assertSame(1, $invoice->getInvoiceAddressNumber()); $this->assertSame(1, $invoice->getDeliverAddressNumber()); - $this->assertSame('1000', $invoice->getCustomerToCode()); + $this->assertSame('1000', $invoice->getCustomerToString()); $this->assertSame('2012/08', $invoice->getPeriod()); - $this->assertSame('EUR', $invoice->getCurrencyToCode()); + $this->assertSame('EUR', $invoice->getCurrencyToString()); $ReflectObject = new \ReflectionClass('\PhpTwinfield\Enums\InvoiceStatus'); $this->assertSame($ReflectObject->getConstant('CONCEPT'), (string)$invoice->getStatus()); $ReflectObject = new \ReflectionClass('\PhpTwinfield\Enums\PaymentMethod'); @@ -89,8 +89,8 @@ public function testGetConceptInvoiceWorks() $invoiceLine = $invoiceLines['1']; $this->assertSame(1, $invoiceLine->getID()); - $this->assertSame('0', $invoiceLine->getArticleToCode()); - $this->assertSame('118', $invoiceLine->getSubArticleToSubCode()); + $this->assertSame('0', $invoiceLine->getArticleToString()); + $this->assertSame('118', $invoiceLine->getSubArticleToString()); $this->assertSame(1, $invoiceLine->getQuantity()); $this->assertSame(1, $invoiceLine->getUnits()); $this->assertSame(true, $invoiceLine->getAllowDiscountOrPremium()); @@ -99,7 +99,7 @@ public function testGetConceptInvoiceWorks() $this->assertSame(0.00, $invoiceLine->getVatValueToFloat()); $this->assertSame(15.00, $invoiceLine->getValueIncToFloat()); $this->assertSame(15.00, $invoiceLine->getUnitsPriceExclToFloat()); - $this->assertSame('8020', $invoiceLine->getDim1ToCode()); + $this->assertSame('8020', $invoiceLine->getDim1ToString()); $invoiceVatLines = $invoice->getVatLines(); $this->assertCount(1, $invoiceVatLines); @@ -107,7 +107,7 @@ public function testGetConceptInvoiceWorks() /** @var InvoiceVatLine $invoiceVatLine */ $invoiceVatLine = current($invoiceVatLines); - $this->assertSame('VN', $invoiceLine->getVatCodeToCode()); + $this->assertSame('VN', $invoiceLine->getVatCodeToString()); $this->assertSame(0.00, $invoiceLine->getVatValueToFloat()); $this->assertNull($invoiceLine->getPerformanceType()); $this->assertNull($invoiceLine->getPerformanceDateToString()); @@ -133,15 +133,15 @@ public function testGetFinalInvoiceWorks() $this->assertInstanceOf(Invoice::class, $invoice); $this->assertEquals(Office::fromCode("11024"), $invoice->getOffice()); - $this->assertSame('FACTUUR', $invoice->getInvoiceTypeToCode()); + $this->assertSame('FACTUUR', $invoice->getInvoiceTypeToString()); $this->assertSame(5, $invoice->getInvoiceNumber()); $this->assertSame('20120831', $invoice->getInvoiceDateToString()); - $this->assertSame('BNK', $invoice->getBankToCode()); + $this->assertSame('BNK', $invoice->getBankToString()); $this->assertSame(1, $invoice->getInvoiceAddressNumber()); $this->assertSame(1, $invoice->getDeliverAddressNumber()); - $this->assertSame('1000', $invoice->getCustomerToCode()); + $this->assertSame('1000', $invoice->getCustomerToString()); $this->assertSame('2012/08', $invoice->getPeriod()); - $this->assertSame('EUR', $invoice->getCurrencyToCode()); + $this->assertSame('EUR', $invoice->getCurrencyToString()); $ReflectObject = new \ReflectionClass('\PhpTwinfield\Enums\InvoiceStatus'); $this->assertSame($ReflectObject->getConstant('FINAL'), (string)$invoice->getStatus()); $ReflectObject = new \ReflectionClass('\PhpTwinfield\Enums\PaymentMethod'); @@ -157,8 +157,8 @@ public function testGetFinalInvoiceWorks() $invoiceLine = $invoiceLines['1']; $this->assertSame(1, $invoiceLine->getID()); - $this->assertSame('0', $invoiceLine->getArticleToCode()); - $this->assertSame('118', $invoiceLine->getSubArticleToSubCode()); + $this->assertSame('0', $invoiceLine->getArticleToString()); + $this->assertSame('118', $invoiceLine->getSubArticleToString()); $this->assertSame(1, $invoiceLine->getQuantity()); $this->assertSame(1, $invoiceLine->getUnits()); $this->assertSame(true, $invoiceLine->getAllowDiscountOrPremium()); @@ -167,7 +167,7 @@ public function testGetFinalInvoiceWorks() $this->assertSame(0.00, $invoiceLine->getVatValueToFloat()); $this->assertSame(15.00, $invoiceLine->getValueIncToFloat()); $this->assertSame(15.00, $invoiceLine->getUnitsPriceExclToFloat()); - $this->assertSame('8020', $invoiceLine->getDim1ToCode()); + $this->assertSame('8020', $invoiceLine->getDim1ToString()); $invoiceVatLines = $invoice->getVatLines(); $this->assertCount(1, $invoiceVatLines); @@ -175,7 +175,7 @@ public function testGetFinalInvoiceWorks() /** @var InvoiceVatLine $invoiceVatLine */ $invoiceVatLine = current($invoiceVatLines); - $this->assertSame('VN', $invoiceLine->getVatCodeToCode()); + $this->assertSame('VN', $invoiceLine->getVatCodeToString()); $this->assertSame(0.00, $invoiceLine->getVatValueToFloat()); $this->assertNull($invoiceLine->getPerformanceType()); $this->assertNull($invoiceLine->getPerformanceDateToString()); @@ -194,15 +194,15 @@ public function testSendInvoiceWorks() $invoice = new Invoice(); $invoice->setOffice(Office::fromCode('11024')); - $invoice->setInvoiceTypeFromCode('FACTUUR'); + $invoice->setInvoiceTypeFromString('FACTUUR'); $invoice->setInvoiceNumber(5); $invoice->setInvoiceDateFromString('20120831'); - $invoice->setBankFromCode('BNK'); + $invoice->setBankFromString('BNK'); $invoice->setInvoiceAddressNumber(1); $invoice->setDeliverAddressNumber(1); $invoice->setCustomer($customer); $invoice->setPeriod('2012/08'); - $invoice->setCurrencyFromCode('EUR'); + $invoice->setCurrencyFromString('EUR'); $invoice->setStatusFromString('concept'); $invoice->setPaymentMethodFromString('cash'); $invoice->setHeaderText('HEADER'); @@ -210,8 +210,8 @@ public function testSendInvoiceWorks() $invoiceLine = new InvoiceLine(); $invoiceLine->setID(1); - $invoiceLine->setArticleFromCode('4'); - $invoiceLine->setSubArticleFromSubCode('118'); + $invoiceLine->setArticleFromString('4'); + $invoiceLine->setSubArticleFromString('118'); $invoiceLine->setQuantity(1); $invoiceLine->setUnits(1); $invoiceLine->setAllowDiscountOrPremiumFromString('true'); @@ -220,8 +220,8 @@ public function testSendInvoiceWorks() $invoiceLine->setVatValueFromFloat(0.00); $invoiceLine->setValueIncFromFloat(15.00); $invoiceLine->setUnitsPriceExclFromFloat(15.00); - $invoiceLine->setDim1FromCode('8020'); - $invoiceLine->setVatCodeFromCode('VN'); + $invoiceLine->setDim1FromString('8020'); + $invoiceLine->setVatCodeFromString('VN'); $invoice->addLine($invoiceLine); $this->processXmlService diff --git a/tests/UnitTests/DomDocuments/CustomersDocumentUnitTest.php b/tests/UnitTests/DomDocuments/CustomersDocumentUnitTest.php index 2d41031d..d5923a2a 100644 --- a/tests/UnitTests/DomDocuments/CustomersDocumentUnitTest.php +++ b/tests/UnitTests/DomDocuments/CustomersDocumentUnitTest.php @@ -37,15 +37,15 @@ public function testXmlIsCreatedPerSpec() $financials = new CustomerFinancials(); $financials->setDueDays(1); $financials->setPayAvailable(true); - $financials->setPayCodeFromCode('pay-code'); - $financials->setVatCodeFromCode('vat-code'); + $financials->setPayCodeFromString('pay-code'); + $financials->setVatCodeFromString('vat-code'); $financials->setEBilling(true); $financials->setEBillMail('ebillingmail@mail.com'); $customer->setFinancials($financials); $customer->setCreditManagement( (new CustomerCreditManagement()) - ->setResponsibleUserFromCode('responsible-user') + ->setResponsibleUserFromString('responsible-user') ->setBaseCreditLimitFromFloat(50) ->setSendReminderFromString('true') ->setReminderEmail('reminderemail@mail.com') @@ -59,7 +59,7 @@ public function testXmlIsCreatedPerSpec() ->setDefault(true) ->setTypeFromString('invoice') ->setName('My Address') - ->setCountryFromCode('nl') + ->setCountryFromString('nl') ->setCity('city') ->setPostcode('postal code') ->setTelephone('phone number') @@ -75,18 +75,18 @@ public function testXmlIsCreatedPerSpec() $customer->addBank( (new CustomerBank()) ->setDefault(true) + ->setAddressField2('address 2') + ->setAddressField3('address 3') ->setAscription('ascriptor') ->setAccountNumber('account number') ->setBankName('bank name') ->setBicCode('bic code') ->setCity('city') - ->setCountryFromCode('nl') + ->setCountryFromString('nl') ->setIban('iban') ->setNatBicCode('nat-bic') ->setPostcode('postcode') ->setState('state') - ->setField2('address 2') - ->setField3('address 3') ); $this->document->addCustomer($customer);