Skip to content

Commit bd97c6f

Browse files
Merge pull request #7763 from magento-gl/DHL_AC-3145_JULY_12_2022
2 parents 61834aa + a67e92f commit bd97c6f

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

app/code/Magento/Dhl/Model/Carrier.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,7 @@ protected function _doShipmentRequest(\Magento\Framework\DataObject $request)
14041404
* @param \Magento\Framework\DataObject $request
14051405
* @return $this|\Magento\Framework\DataObject|boolean
14061406
* @deprecated 100.2.3
1407+
* @see use processAdditionalValidation method instead
14071408
*/
14081409
public function proccessAdditionalValidation(\Magento\Framework\DataObject $request)
14091410
{
@@ -1580,8 +1581,13 @@ protected function _doRequest()
15801581
* Shipment bill to account – required if Shipping PaymentType is other than 'S'
15811582
*/
15821583
$nodeBilling->addChild('BillingAccountNumber', (string)$this->getConfigData('account'));
1583-
$nodeBilling->addChild('DutyPaymentType', 'S');
1584-
$nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account'));
1584+
if ($this->isDutiable(
1585+
$rawRequest->getShipperAddressCountryCode(),
1586+
$rawRequest->getRecipientAddressCountryCode()
1587+
)) {
1588+
$nodeBilling->addChild('DutyPaymentType', 'S');
1589+
$nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account'));
1590+
}
15851591

15861592
/** Receiver */
15871593
$nodeConsignee = $xml->addChild('Consignee', '', '');
@@ -1789,7 +1795,10 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '')
17891795
$contentType = isset($package['params']['container']) ? $package['params']['container'] : '';
17901796
$packageType = $contentType === self::DHL_CONTENT_TYPE_NON_DOC ? 'CP' : 'EE';
17911797
$nodeShipmentDetails->addChild('PackageType', $packageType);
1792-
if ($this->isDutiable($rawRequest->getOrigCountryId(), $rawRequest->getDestCountryId())) {
1798+
if ($this->isDutiable(
1799+
$rawRequest->getShipperAddressCountryCode(),
1800+
$rawRequest->getRecipientAddressCountryCode()
1801+
)) {
17931802
$nodeShipmentDetails->addChild('IsDutiable', 'Y');
17941803
}
17951804
$nodeShipmentDetails->addChild(
@@ -2044,9 +2053,8 @@ protected function _checkDomesticStatus($origCountryCode, $destCountryCode)
20442053

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

2049-
if (($origCountry == $destCountry && $isDomestic)
2057+
if (($origCountry == $destCountry)
20502058
|| (
20512059
$this->_carrierHelper->isCountryInEU($origCountryCode)
20522060
&& $this->_carrierHelper->isCountryInEU($destCountryCode)

dev/tests/integration/testsuite/Magento/Dhl/_files/domestic_shipment_request.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
<ShipperAccountNumber>1234567890</ShipperAccountNumber>
2929
<ShippingPaymentType>S</ShippingPaymentType>
3030
<BillingAccountNumber>1234567890</BillingAccountNumber>
31-
<DutyPaymentType>S</DutyPaymentType>
32-
<DutyAccountNumber>1234567890</DutyAccountNumber>
3331
</Billing>
3432
<Consignee xmlns="">
3533
<CompanyName/>

0 commit comments

Comments
 (0)