Skip to content

Commit

Permalink
Added getCurrencyCodeType to ObjectHelper, Use in Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Oct 5, 2023
1 parent a2f9283 commit 87b9c4a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/OrderDocumentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function setDocumentDate(DateTime $documentDate): OrderDocumentBuilder
*/
public function setDocumentCurrency(string $documentCurrency): OrderDocumentBuilder
{
$this->objectHelper->tryCall($this->headerTradeSettlement, "setOrderCurrencyCode", $this->objectHelper->getIdType($documentCurrency));
$this->objectHelper->tryCall($this->headerTradeSettlement, "setOrderCurrencyCode", $this->objectHelper->getCurrencyCodeType($documentCurrency));
return $this;
}

Expand Down
15 changes: 15 additions & 0 deletions src/OrderObjectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,21 @@ public function getDocumentCodeType(?string $value = null): ?object
return $this->createClassInstance('qdt\DocumentCodeType', $value);
}

/**
* Creates an instance of CurrencyCodeType
*
* @param string|null $value
* @return object|null
*/
public function getCurrencyCodeType(?string $value = null): ?object
{
if (self::isAllNullOrEmpty(func_get_args())) {
return null;
}

return $this->createClassInstance('qdt\CurrencyCodeType', $value);
}

/**
* Creates an instance of IDType
*
Expand Down

0 comments on commit 87b9c4a

Please sign in to comment.