Skip to content

Commit 3544179

Browse files
committed
Merge remote-tracking branch 'gl_magento2ce/AC-3145' into DHL-AC-3145-JUNE-3-2022
2 parents a945273 + aff8002 commit 3544179

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,8 +1580,13 @@ protected function _doRequest()
15801580
* Shipment bill to account – required if Shipping PaymentType is other than 'S'
15811581
*/
15821582
$nodeBilling->addChild('BillingAccountNumber', (string)$this->getConfigData('account'));
1583-
$nodeBilling->addChild('DutyPaymentType', 'S');
1584-
$nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account'));
1583+
if ($this->isDutiable(
1584+
$rawRequest->getShipperAddressCountryCode(),
1585+
$rawRequest->getRecipientAddressCountryCode()
1586+
)) {
1587+
$nodeBilling->addChild('DutyPaymentType', 'S');
1588+
$nodeBilling->addChild('DutyAccountNumber', (string)$this->getConfigData('account'));
1589+
}
15851590

15861591
/** Receiver */
15871592
$nodeConsignee = $xml->addChild('Consignee', '', '');
@@ -1789,7 +1794,10 @@ protected function _shipmentDetails($xml, $rawRequest, $originRegion = '')
17891794
$contentType = isset($package['params']['container']) ? $package['params']['container'] : '';
17901795
$packageType = $contentType === self::DHL_CONTENT_TYPE_NON_DOC ? 'CP' : 'EE';
17911796
$nodeShipmentDetails->addChild('PackageType', $packageType);
1792-
if ($this->isDutiable($rawRequest->getOrigCountryId(), $rawRequest->getDestCountryId())) {
1797+
if ($this->isDutiable(
1798+
$rawRequest->getShipperAddressCountryCode(),
1799+
$rawRequest->getRecipientAddressCountryCode()
1800+
)) {
17931801
$nodeShipmentDetails->addChild('IsDutiable', 'Y');
17941802
}
17951803
$nodeShipmentDetails->addChild(
@@ -2044,9 +2052,8 @@ protected function _checkDomesticStatus($origCountryCode, $destCountryCode)
20442052

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

2049-
if (($origCountry == $destCountry && $isDomestic)
2056+
if (($origCountry == $destCountry)
20502057
|| (
20512058
$this->_carrierHelper->isCountryInEU($origCountryCode)
20522059
&& $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)