Skip to content

Commit

Permalink
Added getAccountingAccountTypeCodeType to ObjectHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Oct 5, 2023
1 parent 50e058e commit bfa9ffe
Showing 1 changed file with 50 additions and 5 deletions.
55 changes: 50 additions & 5 deletions src/OrderObjectHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,21 @@ public function getCodeType(?string $value = null): ?object
return $this->createClassInstance('udt\CodeType', $value);
}

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

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

/**
* Creates an instance of CodeType with extended list
* information
Expand Down Expand Up @@ -292,7 +307,7 @@ public function getAmountType(?float $value, ?string $currencyCode = null): ?obj
$amount = $this->createClassInstance('udt\AmountType');

$this->tryCall($amount, "value", $value);
$this->tryCall($amount, "setCurrencyID", $currencyCode);
$this->tryCall($amount, "setCurrencyID", $this->getCurrencyCodeType($currencyCode));

return $amount;
}
Expand Down Expand Up @@ -662,7 +677,7 @@ public function getTradeAddress(?string $lineone = null, ?string $linetwo = null
$this->tryCall($address, "setLineThree", $this->getTextType($linethree));
$this->tryCall($address, "setPostcodeCode", $this->getCodeType($postcode));
$this->tryCall($address, "setCityName", $this->getTextType($city));
$this->tryCall($address, "setCountryID", $this->getCodeType($country));
$this->tryCall($address, "setCountryID", $this->getCountryIDType($country));
$this->tryCallAll($address, ["addToCountrySubDivisionName", "setCountrySubDivisionName"], $this->getTextType($subdivision));

return $address;
Expand Down Expand Up @@ -717,7 +732,7 @@ public function getTradeContact(?string $contactpersonname = null, ?string $cont
$this->tryCall($contact, "setTelephoneUniversalCommunication", $contactphone);
$this->tryCall($contact, "setFaxUniversalCommunication", $contactfax);
$this->tryCall($contact, "setEmailURIUniversalCommunication", $contactemail);
$this->tryCall($contact, "setTypeCode", $contactTypeCode);
$this->tryCall($contact, "setTypeCode", $this->getContactTypeCodeType($contactTypeCode));

return $contact;
}
Expand Down Expand Up @@ -970,7 +985,7 @@ public function getTradeAllowanceChargeType(?float $actualAmount = null, ?bool $
$this->tryCall($allowanceCharge, "setBasisAmount", $this->getAmountType($basisAmount));
$this->tryCall($allowanceCharge, "setBasisQuantity", $this->getQuantityType($basisQuantity, $basisQuantityUnitCode));
$this->tryCall($allowanceCharge, "setActualAmount", $this->getAmountType($actualAmount));
$this->tryCall($allowanceCharge, "setReasonCode", $this->getCodeType($reasonCode));
$this->tryCall($allowanceCharge, "setReasonCode", $this->getAllowanceChargeReasonCodeType($reasonCode));
$this->tryCall($allowanceCharge, "setReason", $this->getTextType($reason));

if (!is_null($taxCategoryCode) && !is_null($taxTypeCode) && !is_null($rateApplicablePercent)) {
Expand Down Expand Up @@ -1056,7 +1071,7 @@ public function getTradeAccountingAccountType(?string $id = null, ?string $typeC
$account = $this->createClassInstance('ram\TradeAccountingAccountType');

$this->tryCall($account, "setID", $this->getIdType($id));
$this->tryCall($account, "setTypeCode", $this->getCodeType($typeCode));
$this->tryCall($account, "setTypeCode", $this->getAccountingAccountTypeCodeType($typeCode));

return $account;
}
Expand Down Expand Up @@ -1381,6 +1396,36 @@ public function getRateType(?float $rateValue = null): ?object
return $rate;
}

/**
* Get Allowance Charge ReasonCode type instance
*
* @param string|null $reason
* @return object|null
*/
public function getAllowanceChargeReasonCodeType(?string $reason): ?object
{
if (self::isAllNullOrEmpty(func_get_args())) {
return null;
}

return $this->createClassInstance('qdt\AllowanceChargeReasonCodeType', $reason);
}

/**
* Get contact type code type instance
*
* @param string|null $reason
* @return object|null
*/
public function getContactTypeCodeType(?string $value): ?object
{
if (self::isAllNullOrEmpty(func_get_args())) {
return null;
}

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

/**
* Creates an instance of a class needed by $orderobject
*
Expand Down

0 comments on commit bfa9ffe

Please sign in to comment.