From 87b9c4a887565fca1dcf17bb7aeebf8ae08ae06f Mon Sep 17 00:00:00 2001 From: HorstOeko Date: Thu, 5 Oct 2023 06:07:04 +0200 Subject: [PATCH] Added getCurrencyCodeType to ObjectHelper, Use in Builder --- src/OrderDocumentBuilder.php | 2 +- src/OrderObjectHelper.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/OrderDocumentBuilder.php b/src/OrderDocumentBuilder.php index 09ee609..71c5fee 100644 --- a/src/OrderDocumentBuilder.php +++ b/src/OrderDocumentBuilder.php @@ -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; } diff --git a/src/OrderObjectHelper.php b/src/OrderObjectHelper.php index 16a9140..8af3750 100644 --- a/src/OrderObjectHelper.php +++ b/src/OrderObjectHelper.php @@ -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 *