Skip to content

Commit

Permalink
ENGCOM-3602: [Backport] Fix DHL Quotes for Domestic Shipments when Co…
Browse files Browse the repository at this point in the history
…ntent Type is set to Non-Document #19488
  • Loading branch information
sivaschenko authored Apr 4, 2019
2 parents 4e33ae9 + 0993f6e commit 5742285
Show file tree
Hide file tree
Showing 10 changed files with 1,124 additions and 222 deletions.
4 changes: 1 addition & 3 deletions app/code/Magento/Dhl/Model/Carrier.php
Original file line number Diff line number Diff line change
Expand Up @@ -1968,8 +1968,6 @@ protected function isDutiable($origCountryId, $destCountryId)
{
$this->_checkDomesticStatus($origCountryId, $destCountryId);

return
self::DHL_CONTENT_TYPE_NON_DOC == $this->getConfigData('content_type')
|| !$this->_isDomestic;
return !$this->_isDomestic;
}
}
403 changes: 222 additions & 181 deletions app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<req:ShipmentValidateRequestAP xmlns:req="http://www.dhl.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com ship-val-req_AP.xsd">
<Request xmlns="">
<ServiceHeader>
<SiteID>some ID</SiteID>
<Password>some password</Password>
</ServiceHeader>
</Request>
<LanguageCode xmlns="">EN</LanguageCode>
<PiecesEnabled xmlns="">Y</PiecesEnabled>
<Billing xmlns="">
<ShipperAccountNumber>1234567890</ShipperAccountNumber>
<ShippingPaymentType>S</ShippingPaymentType>
<BillingAccountNumber>1234567890</BillingAccountNumber>
<DutyPaymentType>S</DutyPaymentType>
<DutyAccountNumber>1234567890</DutyAccountNumber>
</Billing>
<Consignee xmlns="">
<CompanyName/>
<AddressLine/>
<City/>
<PostalCode/>
<CountryCode/>
<CountryName/>
<Contact>
<PersonName/>
<PhoneNumber/>
</Contact>
</Consignee>
<Commodity xmlns="">
<CommodityCode>1</CommodityCode>
</Commodity>
<Dutiable xmlns="">
<DeclaredValue>10.00</DeclaredValue>
<DeclaredCurrency>USD</DeclaredCurrency>
</Dutiable>
<Reference xmlns="">
<ReferenceID>shipment reference</ReferenceID>
<ReferenceType>St</ReferenceType>
</Reference>
<ShipmentDetails xmlns="">
<NumberOfPieces>1</NumberOfPieces>
<CurrencyCode>USD</CurrencyCode>
<Pieces xmlns="">
<Piece xmlns="">
<PieceID>1</PieceID>
<PackageType>CP</PackageType>
<Weight>0.5</Weight>
<Depth>3</Depth>
<Width>3</Width>
<Height>3</Height>
<PieceContents>item_name</PieceContents>
</Piece>
</Pieces>
<PackageType>CP</PackageType>
<Weight>0.454</Weight>
<DimensionUnit>C</DimensionUnit>
<WeightUnit>K</WeightUnit>
<GlobalProductCode/>
<LocalProductCode/>
<DoorTo>DD</DoorTo>
<Date/>
<Contents>DHL Parcel TEST</Contents>
</ShipmentDetails>
<Shipper xmlns="">
<ShipperID>1234567890</ShipperID>
<CompanyName/>
<AddressLine/>
<City/>
<PostalCode/>
<CountryCode/>
<CountryName/>
<Contact xmlns="">
<PersonName/>
<PhoneNumber/>
</Contact>
</Shipper>
<LabelImageFormat xmlns="">PDF</LabelImageFormat>
</req:ShipmentValidateRequestAP>
58 changes: 29 additions & 29 deletions app/code/Magento/Dhl/Test/Unit/Model/_files/countries.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
Expand Down Expand Up @@ -83,7 +83,7 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Austria</name>
<domestic>1</domestic>
</AT>
Expand Down Expand Up @@ -132,7 +132,7 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Belgium</name>
<domestic>1</domestic>
</BE>
Expand All @@ -146,7 +146,7 @@
<currency>BGN</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Bulgaria</name>
<domestic>1</domestic>
</BG>
Expand Down Expand Up @@ -257,7 +257,7 @@
<currency>CHF</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Switzerland</name>
</CH>
<CI>
Expand Down Expand Up @@ -331,15 +331,15 @@
<currency>CZK</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Czech Republic, The</name>
<domestic>1</domestic>
</CZ>
<DE>
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Germany</name>
<domestic>1</domestic>
</DE>
Expand All @@ -353,7 +353,7 @@
<currency>DKK</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Denmark</name>
<domestic>1</domestic>
</DK>
Expand Down Expand Up @@ -389,7 +389,7 @@
<currency>EEK</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Estonia</name>
<domestic>1</domestic>
</EE>
Expand All @@ -410,7 +410,7 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Spain</name>
<domestic>1</domestic>
</ES>
Expand All @@ -424,7 +424,7 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Finland</name>
<domestic>1</domestic>
</FI>
Expand Down Expand Up @@ -457,7 +457,7 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>France</name>
<domestic>1</domestic>
</FR>
Expand All @@ -471,7 +471,7 @@
<currency>GBP</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>United Kingdom</name>
<domestic>1</domestic>
</GB>
Expand Down Expand Up @@ -549,7 +549,7 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Greece</name>
<domestic>1</domestic>
</GR>
Expand Down Expand Up @@ -612,7 +612,7 @@
<currency>HUF</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Hungary</name>
<domestic>1</domestic>
</HU>
Expand All @@ -633,7 +633,7 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Ireland, Republic Of</name>
<domestic>1</domestic>
</IE>
Expand Down Expand Up @@ -668,14 +668,14 @@
<currency>ISK</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Iceland</name>
</IS>
<IT>
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Italy</name>
<domestic>1</domestic>
</IT>
Expand Down Expand Up @@ -834,23 +834,23 @@
<currency>LTL</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Lithuania</name>
<domestic>1</domestic>
</LT>
<LU>
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Luxembourg</name>
<domestic>1</domestic>
</LU>
<LV>
<currency>LVL</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Latvia</name>
<domestic>1</domestic>
</LV>
Expand Down Expand Up @@ -1039,15 +1039,15 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Netherlands, The</name>
<domestic>1</domestic>
</NL>
<NO>
<currency>NOK</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Norway</name>
</NO>
<NP>
Expand Down Expand Up @@ -1127,7 +1127,7 @@
<currency>PLN</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Poland</name>
<domestic>1</domestic>
</PL>
Expand All @@ -1142,7 +1142,7 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Portugal</name>
<domestic>1</domestic>
</PT>
Expand Down Expand Up @@ -1177,7 +1177,7 @@
<currency>RON</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Romania</name>
<domestic>1</domestic>
</RO>
Expand Down Expand Up @@ -1231,7 +1231,7 @@
<currency>SEK</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Sweden</name>
<domestic>1</domestic>
</SE>
Expand All @@ -1246,15 +1246,15 @@
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Slovenia</name>
<domestic>1</domestic>
</SI>
<SK>
<currency>EUR</currency>
<weight_unit>KG</weight_unit>
<measure_unit>CM</measure_unit>
<region>EA</region>
<region>EU</region>
<name>Slovakia</name>
<domestic>1</domestic>
</SK>
Expand Down
Loading

0 comments on commit 5742285

Please sign in to comment.