diff --git a/Changelog.md b/Changelog.md index 50c728ca..003b86e9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ # Changelog +## 1.6.9 +* removed unused DHL products +* bugfix for Ident in GKV API +* split name of sender and return receiver in name1, name2 and name3 for custom labels + ## 1.6.8 * bugfix: improved PHP 8.1 compatibility * fixed country value not being sent in form diff --git a/project.json b/project.json index af9e134b..c25fe29f 100644 --- a/project.json +++ b/project.json @@ -4,7 +4,7 @@ "pathToModule": "copy_this/modules/mo/mo_dhl", "prefix": "mo_", "suffix": "", - "version": "1.6.8", + "version": "1.6.9", "compatibility": { "minimumVersion": "6.0", "maximumVersion": null, diff --git a/src/modules/mo/mo_dhl/Adapter/GKVCustomShipmentBuilder.php b/src/modules/mo/mo_dhl/Adapter/GKVCustomShipmentBuilder.php index 6a319acc..38144799 100644 --- a/src/modules/mo/mo_dhl/Adapter/GKVCustomShipmentBuilder.php +++ b/src/modules/mo/mo_dhl/Adapter/GKVCustomShipmentBuilder.php @@ -47,7 +47,7 @@ public function toCustomizableParametersArray(ShipmentOrderType $shipmentOrder): 'total' => ['weight' => $shipmentOrder->getShipment()->getShipmentDetails()->getShipmentItem()->getWeightInKG(), 'title' => Registry::getLang()->translateString('GENERAL_ATALL')], ], $this->getExportDocPositionWeights($shipmentOrder)), 'shipper' => [ - 'name' => $shipper->getName()->getName1() . $shipper->getName()->getName2() . $shipper->getName()->getName3(), + 'name' => $shipper->getName(), 'address' => $shipper->getAddress(), ], 'receiver' => [ @@ -57,7 +57,7 @@ public function toCustomizableParametersArray(ShipmentOrderType $shipmentOrder): 'communication' => $receiver->getCommunication(), ], 'returnReceiver' => [ - 'name' => $returnReceiver->getName()->getName1() . $returnReceiver->getName()->getName2() . $returnReceiver->getName()->getName3(), + 'name' => $returnReceiver->getName(), 'address' => $returnReceiver->getAddress(), ], 'services' => [ @@ -118,7 +118,7 @@ protected function useCustomWeightData(ShipmentOrderType $shipmentOrder, $weight protected function useCustomShipper(ShipmentOrderType $shipmentOrder, $shipperData) { $shipper = $shipmentOrder->getShipment()->getShipper(); - $shipper->getName()->setName1($shipperData['name']); + $shipper->getName()->setName1($shipperData['name1'])->setName2($shipperData['name2'])->setName3($shipperData['name3']); $shipperData['Origin'] = new CountryType($shipperData['country']); $shipper->getAddress()->assign($shipperData); } @@ -130,7 +130,7 @@ protected function useCustomShipper(ShipmentOrderType $shipmentOrder, $shipperDa protected function useCustomReturnReceiver(ShipmentOrderType $shipmentOrder, $returnReceiverData) { $returnReceiver = $shipmentOrder->getShipment()->getReturnReceiver(); - $returnReceiver->getName()->setName1($returnReceiverData['name']); + $returnReceiver->getName()->setName1($returnReceiverData['name1'])->setName2($returnReceiverData['name2'])->setName3($returnReceiverData['name3']); $returnReceiverData['Origin'] = new CountryType($returnReceiverData['country']); $returnReceiver->getAddress()->assign($returnReceiverData); } diff --git a/src/modules/mo/mo_dhl/Api/GKV.php b/src/modules/mo/mo_dhl/Api/GKV.php index a2fd2add..a8a8a866 100644 --- a/src/modules/mo/mo_dhl/Api/GKV.php +++ b/src/modules/mo/mo_dhl/Api/GKV.php @@ -84,7 +84,6 @@ class GKV extends \SoapClient 'ShipperType' => 'Mediaopt\\DHL\\Api\\GKV\\ShipperType', 'ReceiverTypeType' => 'Mediaopt\\DHL\\Api\\GKV\\ReceiverTypeType', 'ReceiverType' => 'Mediaopt\\DHL\\Api\\GKV\\ReceiverType', - 'Ident' => 'Mediaopt\\DHL\\Api\\GKV\\Ident', 'ShipmentDetailsType' => 'Mediaopt\\DHL\\Api\\GKV\\ShipmentDetailsType', 'ShipmentDetailsTypeType' => 'Mediaopt\\DHL\\Api\\GKV\\ShipmentDetailsTypeType', 'ShipmentItemType' => 'Mediaopt\\DHL\\Api\\GKV\\ShipmentItemType', diff --git a/src/modules/mo/mo_dhl/Shipment/Process.php b/src/modules/mo/mo_dhl/Shipment/Process.php index f97ab52b..4521635b 100644 --- a/src/modules/mo/mo_dhl/Shipment/Process.php +++ b/src/modules/mo/mo_dhl/Shipment/Process.php @@ -13,33 +13,11 @@ class Process */ const PAKET = 'PAKET'; - /** - * @var string DHL Paket PRIO - */ - const PAKET_PRIO = 'PAKET_PRIO'; - - /** - * @var string DHL Paket Taggleich - */ - const PAKET_TAGGLEICH = 'PAKET_TAGGLEICH'; - /** * @var string DHL Retoure für DHL Paket */ const RETOURE_FUER_PAKET = 'RETOURE_FUER_PAKET'; - /** - * @var string DHL Retoure für DHL Paket Taggleich - */ - const RETOURE_FUER_PAKET_TAGGLEICH = 'RETOURE_FUER_PAKET_TAGGLEICH'; - /** - * @var string DHL Retoure für DHL Paket Austria - */ - const RETOURE_FUER_PAKET_AT = 'RETOURE_FUER_PAKET_AT'; - /** - * @var string DHL Retoure für DHL Paket Connect - */ - const RETOURE_FUER_PAKET_CONNECT = 'RETOURE_FUER_PAKET_CONNECT'; /** * @var string DHL Paket International */ @@ -50,26 +28,6 @@ class Process */ const EUROPAKET = 'EUROPAKET'; - /** - * @var string DHL Paket Connect - */ - const PAKET_CONNECT = 'PAKET_CONNECT'; - - /** - * @var string DHL Paket Austria - */ - const PAKET_AT = 'PAKET_AT'; - - /** - * @var string DHL Paket Connect (Austria) - */ - const PAKET_CONNECT_AT = 'PAKET_CONNECT_AT'; - - /** - * @var string DHL Paket International (Austria) - */ - const PAKET_INTERNATIONAL_AT = 'PAKET_INTERNATIONAL_AT'; - /** * @var string Warenpost national */ @@ -188,19 +146,6 @@ class Process self::SERVICE_BULKY_GOOD, self::SERVICE_CASH_ON_DELIVERY, ], - self::PAKET_PRIO => [ - self::SERVICE_PREFERRED_NEIGHBOUR, - self::SERVICE_PREFERRED_LOCATION, - self::SERVICE_NOTIFICATION, - self::SERVICE_PREFERRED_DAY, - self::SERVICE_GO_GREEN, - self::SERVICE_PARCEL_OUTLET_ROUTING, - self::SERVICE_DHL_RETOURE, - self::SERVICE_VISUAL_AGE_CHECK, - self::SERVICE_IDENT_CHECK, - self::SERVICE_ADDITIONAL_INSURANCE, - self::SERVICE_CASH_ON_DELIVERY, - ], self::PAKET_INTERNATIONAL => [ self::SERVICE_NOTIFICATION, self::SERVICE_GO_GREEN, @@ -217,13 +162,6 @@ class Process self::SERVICE_GO_GREEN, self::SERVICE_ADDITIONAL_INSURANCE, ], - self::PAKET_CONNECT => [ - self::SERVICE_NOTIFICATION, - self::SERVICE_GO_GREEN, - self::SERVICE_DHL_RETOURE, - self::SERVICE_ADDITIONAL_INSURANCE, - self::SERVICE_BULKY_GOOD, - ], self::WARENPOST => [ self::SERVICE_PREFERRED_NEIGHBOUR, self::SERVICE_PREFERRED_LOCATION, @@ -300,20 +238,11 @@ public function __toString() /** @var string[] $identifierToNumber */ $identifierToNumber = [ self::PAKET => '01', - self::PAKET_PRIO => '01', - self::PAKET_TAGGLEICH => '06', self::PAKET_INTERNATIONAL => '53', self::EUROPAKET => '54', - self::PAKET_CONNECT => '55', self::WARENPOST => '62', self::WARENPOST_INTERNATIONAL => '66', - self::PAKET_AT => '86', - self::PAKET_CONNECT_AT => '87', - self::PAKET_INTERNATIONAL_AT => '82', self::RETOURE_FUER_PAKET => '07', - self::RETOURE_FUER_PAKET_TAGGLEICH => '07', - self::RETOURE_FUER_PAKET_CONNECT => '85', - self::RETOURE_FUER_PAKET_AT => '85', ]; return $identifierToNumber[$this->identifier]; @@ -455,20 +384,11 @@ public function getServiceIdentifier() { $identifierToService = [ self::PAKET => 'V01PAK', - self::PAKET_PRIO => 'V01PRIO', - self::PAKET_TAGGLEICH => 'V06PAK', self::PAKET_INTERNATIONAL => 'V53WPAK', self::EUROPAKET => 'V54EPAK', - self::PAKET_CONNECT => 'V55PAK', self::WARENPOST => 'V62WP', self::WARENPOST_INTERNATIONAL => 'V66WPI', - self::PAKET_AT => 'V86PARCEL', - self::PAKET_CONNECT_AT => 'V87PARCEL', - self::PAKET_INTERNATIONAL_AT => 'V82PARCEL', self::RETOURE_FUER_PAKET => 'V01PAK', - self::RETOURE_FUER_PAKET_TAGGLEICH => 'V06PAK', - self::RETOURE_FUER_PAKET_CONNECT => 'V87PARCEL', - self::RETOURE_FUER_PAKET_AT => 'V86PARCEL', ]; return $identifierToService[$this->identifier]; @@ -497,7 +417,6 @@ public function isInternational() { return in_array($this->identifier, [ self::PAKET_INTERNATIONAL, - self::PAKET_INTERNATIONAL_AT, self::WARENPOST_INTERNATIONAL, ]); } @@ -517,14 +436,8 @@ public static function getAvailableProcesses() { return [ 'PAKET' => 'DHL Paket', - 'PAKET_PRIO' => 'DHL Paket PRIO', - 'PAKET_TAGGLEICH' => 'DHL Paket Taggleich', 'PAKET_INTERNATIONAL' => 'DHL Paket International', 'EUROPAKET' => 'DHL Europaket (B2B)', - 'PAKET_CONNECT' => 'DHL Paket Connect', - 'PAKET_AT' => 'DHL Paket Austria', - 'PAKET_CONNECT_AT' => 'DHL Paket Connect (Austria)', - 'PAKET_INTERNATIONAL_AT' => 'DHL Paket International (Austria)', 'WARENPOST' => 'Warenpost national', 'INTERNETMARKE' => 'Internetmarke', 'WARENPOST_INTERNATIONAL'=> 'Warenpost International', diff --git a/src/modules/mo/mo_dhl/metadata.php b/src/modules/mo/mo_dhl/metadata.php index fd1b9546..b4206c4d 100644 --- a/src/modules/mo/mo_dhl/metadata.php +++ b/src/modules/mo/mo_dhl/metadata.php @@ -17,7 +17,7 @@ 'en' => '

Enable features providing Post & Paket Delivery to your OXID shop.

' . '

Handbook

', ], 'thumbnail' => 'logo.png', - 'version' => '1.6.8', + 'version' => '1.6.9', 'author' => 'mediaopt.', 'url' => 'http://www.mediaopt.de', 'email' => 'shopsoftware@deutschepost.de', diff --git a/src/modules/mo/mo_dhl/views/admin/tpl/order_dhl_custom_label.tpl b/src/modules/mo/mo_dhl/views/admin/tpl/order_dhl_custom_label.tpl index 3c18e611..2f43f7db 100644 --- a/src/modules/mo/mo_dhl/views/admin/tpl/order_dhl_custom_label.tpl +++ b/src/modules/mo/mo_dhl/views/admin/tpl/order_dhl_custom_label.tpl @@ -198,13 +198,32 @@ [{oxmultilang ident='MO_DHL__CUSTOM_LABEL_SHIPPER'}] + [{assign var="name" value=$shipmentOrder.shipper.name}] - [{oxmultilang ident='MO_DHL__CUSTOM_LABEL_NAME'}] + [{oxmultilang ident='SHOP_MODULE_mo_dhl__sender_line1'}] + + + + + + + + [{oxmultilang ident='SHOP_MODULE_mo_dhl__sender_line2'}] + + + + + + + + [{oxmultilang ident='SHOP_MODULE_mo_dhl__sender_line3'}] - + [{assign var="address" value=$shipmentOrder.shipper.address}] @@ -264,13 +283,32 @@ [{oxmultilang ident='MO_DHL__CUSTOM_LABEL_RETURN_RECEIVER'}] + [{assign var="name" value=$shipmentOrder.returnReceiver.name}] - [{oxmultilang ident='MO_DHL__CUSTOM_LABEL_NAME'}] + [{oxmultilang ident='SHOP_MODULE_mo_dhl__retoure_receiver_line1'}] + + + + + + + + [{oxmultilang ident='SHOP_MODULE_mo_dhl__retoure_receiver_line2'}] + + + + + + + + [{oxmultilang ident='SHOP_MODULE_mo_dhl__retoure_receiver_line3'}] - + [{assign var="address" value=$shipmentOrder.returnReceiver.address}] @@ -432,7 +470,7 @@ + value="[{if $identDetails}][{$identDetails->getSurname()}][{/if}]"> @@ -441,7 +479,7 @@ + value="[{if $identDetails}][{$identDetails->getGivenName()}][{/if}]"> @@ -450,7 +488,7 @@ + value="[{if $identDetails}][{$identDetails->getDateOfBirth()}][{/if}]"> @@ -460,8 +498,8 @@ diff --git a/tests/Export/CsvExporterTest.php b/tests/Export/CsvExporterTest.php index 16138ca6..111e754e 100644 --- a/tests/Export/CsvExporterTest.php +++ b/tests/Export/CsvExporterTest.php @@ -21,14 +21,8 @@ class CsvExporterTest extends PHPUnit_Framework_TestCase { const PROCESS_IDENTIFIERS = [ Process::PAKET, - Process::PAKET_PRIO, - Process::PAKET_TAGGLEICH, Process::PAKET_INTERNATIONAL, Process::EUROPAKET, - Process::PAKET_CONNECT, - Process::PAKET_INTERNATIONAL_AT, - Process::PAKET_AT, - Process::PAKET_CONNECT_AT, ]; const EXPECTED_ROW = [ diff --git a/tests/Shipment/ProcessTest.php b/tests/Shipment/ProcessTest.php index a4409e6b..a54e1cf2 100644 --- a/tests/Shipment/ProcessTest.php +++ b/tests/Shipment/ProcessTest.php @@ -22,14 +22,8 @@ class ProcessTest extends PHPUnit_Framework_TestCase const PROCESS_IDENTIFIERS = [ Process::PAKET, - Process::PAKET_PRIO, - Process::PAKET_TAGGLEICH, Process::PAKET_INTERNATIONAL, Process::EUROPAKET, - Process::PAKET_CONNECT, - Process::PAKET_INTERNATIONAL_AT, - Process::PAKET_AT, - Process::PAKET_CONNECT_AT, Process::WARENPOST, ];