@@ -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 )
0 commit comments