Skip to content

Commit

Permalink
Merge pull request #7700 from magento-gl/DHL-AC-3145-JUNE-3-2022
Browse files Browse the repository at this point in the history
  • Loading branch information
sidolov authored Jun 9, 2022
2 parents 74ff88e + bcaea60 commit 3f9f487
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 13 additions & 5 deletions app/code/Magento/Dhl/Model/Carrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ protected function _doShipmentRequest(\Magento\Framework\DataObject $request)
* @param \Magento\Framework\DataObject $request
* @return $this|\Magento\Framework\DataObject|boolean
* @deprecated 100.2.3
* @see use processAdditionalValidation method instead
*/
public function proccessAdditionalValidation(\Magento\Framework\DataObject $request)
{
Expand Down Expand Up @@ -1580,8 +1581,13 @@ protected function _doRequest()
* Shipment bill to account – required if Shipping PaymentType is other than 'S'
*/
$nodeBilling->addChild('BillingAccountNumber', (string)$this->getConfigData('account'));
$nodeBilling->addChild('DutyPaymentType', 'S');
$nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account'));
if ($this->isDutiable(
$rawRequest->getShipperAddressCountryCode(),
$rawRequest->getRecipientAddressCountryCode()
)) {
$nodeBilling->addChild('DutyPaymentType', 'S');
$nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account'));
}

/** Receiver */
$nodeConsignee = $xml->addChild('Consignee', '', '');
Expand Down Expand Up @@ -1789,7 +1795,10 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '')
$contentType = isset($package['params']['container']) ? $package['params']['container'] : '';
$packageType = $contentType === self::DHL_CONTENT_TYPE_NON_DOC ? 'CP' : 'EE';
$nodeShipmentDetails->addChild('PackageType', $packageType);
if ($this->isDutiable($rawRequest->getOrigCountryId(), $rawRequest->getDestCountryId())) {
if ($this->isDutiable(
$rawRequest->getShipperAddressCountryCode(),
$rawRequest->getRecipientAddressCountryCode()
)) {
$nodeShipmentDetails->addChild('IsDutiable', 'Y');
}
$nodeShipmentDetails->addChild(
Expand Down Expand Up @@ -2044,9 +2053,8 @@ protected function _checkDomesticStatus($origCountryCode, $destCountryCode)

$origCountry = (string)$this->getCountryParams($origCountryCode)->getData('name');
$destCountry = (string)$this->getCountryParams($destCountryCode)->getData('name');
$isDomestic = (string)$this->getCountryParams($destCountryCode)->getData('domestic');

if (($origCountry == $destCountry && $isDomestic)
if (($origCountry == $destCountry)
|| (
$this->_carrierHelper->isCountryInEU($origCountryCode)
&& $this->_carrierHelper->isCountryInEU($destCountryCode)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
<ShipperAccountNumber>1234567890</ShipperAccountNumber>
<ShippingPaymentType>S</ShippingPaymentType>
<BillingAccountNumber>1234567890</BillingAccountNumber>
<DutyPaymentType>S</DutyPaymentType>
<DutyAccountNumber>1234567890</DutyAccountNumber>
</Billing>
<Consignee xmlns="">
<CompanyName/>
Expand Down

0 comments on commit 3f9f487

Please sign in to comment.