diff --git a/classes/Carrier/Dhl/Data/Bank.php b/classes/Carrier/Dhl/Data/Bank.php
new file mode 100644
index 00000000..01a0cf76
--- /dev/null
+++ b/classes/Carrier/Dhl/Data/Bank.php
@@ -0,0 +1,20 @@
+countryISOCode = $isoCode;
+ $obj->state = $state;
+ return $obj;
+ }
+
+}
\ No newline at end of file
diff --git a/classes/Carrier/Dhl/Data/CreateShipmentOrderRequest.php b/classes/Carrier/Dhl/Data/CreateShipmentOrderRequest.php
new file mode 100644
index 00000000..4ff30525
--- /dev/null
+++ b/classes/Carrier/Dhl/Data/CreateShipmentOrderRequest.php
@@ -0,0 +1,20 @@
+ShipmentDetails = new ShipmentDetails();
+ $this->Shipper = new Shipper();
+ $this->ShipperReference = '';
+ $this->Receiver = new Receiver();
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/Dhl/Data/ShipmentDetails.php b/classes/Carrier/Dhl/Data/ShipmentDetails.php
new file mode 100644
index 00000000..a7a155c6
--- /dev/null
+++ b/classes/Carrier/Dhl/Data/ShipmentDetails.php
@@ -0,0 +1,34 @@
+shipmentDate = $date->format('Y-m-d');
+ }
+
+ public function GetShipmentDate(): DateTimeImmutable {
+ return DateTimeImmutable::createFromFormat('Y-m-d', $this->shipmentDate);
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/Dhl/Data/ShipmentItem.php b/classes/Carrier/Dhl/Data/ShipmentItem.php
new file mode 100644
index 00000000..3ebdd53b
--- /dev/null
+++ b/classes/Carrier/Dhl/Data/ShipmentItem.php
@@ -0,0 +1,17 @@
+Name = new Name();
+ $this->Address = new NativeAddressNew();
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/Dhl/Data/Status.php b/classes/Carrier/Dhl/Data/Status.php
new file mode 100644
index 00000000..91b1a213
--- /dev/null
+++ b/classes/Carrier/Dhl/Data/Status.php
@@ -0,0 +1,15 @@
+soapClient = new SoapClient(__DIR__ . '/Wsdl/geschaeftskundenversand-api-3.4.0.wsdl', [
+ 'login' => 'OpenXE_1',
+ 'password' => 'cjzNEpGXxbbnRwcYLISX3ZTTcQrQrz',
+ 'location' => self::PRODUCTION_URL,
+ 'trace' => 1,
+ 'connection_timeout' => 30,
+ 'classmap' => [
+ 'CreateShipmentOrderResponse' => CreateShipmentOrderResponse::class,
+ 'CreationState' => CreationState::class,
+ 'LabelData' => LabelData::class,
+ 'Statusinformation' => Statusinformation::class,
+ 'Version' => Version::class,
+ ]
+ ]);
+
+ $authHeader = new SoapHeader(self::NAMESPACE_CIS, 'Authentification', [
+ 'user' => $user,
+ 'signature' => $signature
+ ]);
+ $this->soapClient->__setSoapHeaders($authHeader);
+ }
+
+ public function CreateShipment(Shipment $shipment): CreateShipmentOrderResponse|string
+ {
+ $request = new CreateShipmentOrderRequest();
+ $request->Version = $this->getVersion();
+ $request->ShipmentOrder = new ShipmentOrder();
+ $request->ShipmentOrder->Shipment = $shipment;
+ $request->ShipmentOrder->sequenceNumber = '1';
+ $request->labelResponseType = "B64";
+ try {
+ $response = $this->soapClient->createShipmentOrder($request);
+ return $response;
+ } catch (\SoapFault $e) {
+ return $e->getMessage();
+ }
+ }
+
+ private function getVersion() {
+ $version = new Version();
+ $version->majorRelease = '3';
+ $version->minorRelease = '4';
+ return $version;
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/Dhl/Wsdl/geschaeftskundenversand-api-3.4.0-schema-bcs_base.xsd b/classes/Carrier/Dhl/Wsdl/geschaeftskundenversand-api-3.4.0-schema-bcs_base.xsd
new file mode 100644
index 00000000..042e3cfb
--- /dev/null
+++ b/classes/Carrier/Dhl/Wsdl/geschaeftskundenversand-api-3.4.0-schema-bcs_base.xsd
@@ -0,0 +1,3760 @@
+
+
+
+
+
+ A sequence number defined by the (soap-) client. The
+ sequenceNumber is
+ returned by the webservice within the result of the
+ createShipment operation, so
+ that the client is able to assign the
+ shipment information of the response to the
+ shipment data of the
+ request.
+
+
+
+
+
+
+
+
+
+ The version of the webservice and the version of the
+ software
+ build.
+
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+
+
+
+ The shipmentdata for creating a shipment.
+
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+ ShipmentOrder is the highest parent element that
+ contains all
+ data with respect to one shipment order.
+
+
+
+
+
+ Dial to determine label ouput format. Must be
+ either 'URL' or
+ 'B64' = Base64encoded: it is possible to request
+ an URL for receiving
+ the label as PDF stream, or to request the
+ label as base64encoded binary
+ data directly. If not defined by
+ client, web service defaults to
+ 'URL'.
+
+
+
+
+
+
+
+
+
+
+
+
+ The group profile you select defines the billing
+ numbers you can use for creating shipments. To define group
+ profiles please visit our business costumer portal.
+
+
+
+
+
+
+
+
+
+
+ In this optional section you can define the following label formats:
+ A4:common label laser printing A4 plain paper;
+ 910-300-700: common label laser printing 105 x 205 mm (A5 plain paper, 910-300-700);
+ 910-300-700-oz: common label laser printing 105 x 205 mm without additional barcode labels (A5 plain paper, 910-300-700);
+ 910-300-300: common label laser printing 105 x 148 mm (A5 plain paper, 910-300-700);
+ 910-300-300-oz: common label laser printing 105 x 148 mm without additional barcode labels (A5 plain paper, 910-300-300);
+ 910-300-710: common label laser printing 105 x 208 mm (910-300-710);
+ 910-300-600: common label thermal printing 103 x 199 mm (910-300-600, 910-300-610);
+ 910-300-400: common label thermal printing 103 x 150 mm (910-300-400, 910-300-410);
+ 100x70mm: 100 x 70 mm label (only for Warenpost and Warenpost International);
+
+
+
+
+
+
+
+
+
+
+ In this optional section you can define the following label formats:
+ A4:common label laser printing A4 plain paper;
+ 910-300-700: common label laser printing 105 x 205 mm (a5 plain paper, 910-300-700);
+ 910-300-700-oz: common label laser printing 105 x 205 mm without additional barcode labels (A5 plain paper, 910-300-700);
+ 910-300-300: common label laser printing 105 x 148 mm (A5 plain paper, 910-300-300);
+ 910-300-300-oz: common label laser printing 105 x 148 mm without additional barcode labels (A5 plain paper, 910-300-300);
+ 910-300-710: common label laser printing 105 x 208 mm (910-300-710);
+ 910-300-600: common label thermal printing 103 x 199 mm (910-300-600, 910-300-610);
+ 910-300-400: common label thermal printing 103 x 150 mm (910-300-400, 910-300-410);
+ 100x70mm: 100 x 70 mm label (only for Warenpost and Warenpost International);
+
+
+
+
+
+
+
+
+
+ To get a single PDF for shipping and return label
+ select this option.
+
+
+
+
+
+
+
+
+
+
+
+
+ The shipmentdata for validating a shipment.
+
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+ ShipmentOrder is the highest parent element that
+ contains all
+ data with respect to one shipment order.
+
+
+
+
+
+
+
+
+
+ The status of the operation and the shipment
+ identifier (if
+ available).
+
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Success status after processing the overall
+ request.
+
+
+
+
+
+ The operation's success status for every single
+ ShipmentOrder
+ will be returned by one CreationState element. It is
+ identifiable via
+ SequenceNumber.
+
+
+
+
+
+
+
+
+ The status of the operation and the shipment
+ identifier (if
+ available).
+
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Success status after processing the overall
+ request.
+
+
+
+
+
+ The operation's success status for every single
+ ShipmentOrder
+ will be returned by one CreationState element. It is
+ identifiable via
+ SequenceNumber.
+
+
+
+
+
+
+
+
+ The identifier for the shipment for which the label
+ url is
+ requested.
+
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+
+ Dial to determine label ouput format. Must be
+ either 'URL' or
+ 'B64' = Base64encoded: it is possible to request
+ an URL for receiving
+ the label as PDF stream, or to request the
+ label as base64encoded binary
+ data directly. If not defined by
+ client, web service defaults to
+ 'URL'.
+
+
+
+
+
+
+
+
+
+
+
+
+ The group profile you select defines the billing
+ numbers you can use for creating shipments. To define group
+ profiles please visit our business costumer portal.
+ The group
+ profile defines the shipments you can get documents for.
+ The
+ shipment needs to have an account/billing number allocated to
+ the
+ group profile. To define group profiles please visit our
+ business
+ costumer portal.
+
+
+
+
+
+
+
+
+
+
+ In this optional section you can define the following label formats:
+ A4:common label laser printing A4 plain paper;
+ 910-300-700: common label laser printing 105 x 205 mm (910-300-700);
+ 910-300-700-oz: common label laser printing 105 x 205 mm without additional barcode labels (910-300-700);
+ 910-300-300: common label laser printing 105 x 148 mm (910-300-700);
+ 910-300-300-oz: common label laser printing 105 x 148 mm without additional barcode labels (910-300-300);
+ 910-300-710: common label laser printing 105 x 208 mm (910-300-710);
+ 910-300-600: common label thermal printing 103 x 199 mm (910-300-600, 910-300-610);
+ 910-300-400: common label thermal printing 103 x 150 mm (910-300-400, 910-300-410);
+ 100x70mm: 100 x 70 mm label (only for Warenpost and Warenpost International);
+
+
+
+
+
+
+
+
+
+
+ In this optional section you can define the following label formats:
+ A4:common label laser printing A4 plain paper;
+ 910-300-700: common label laser printing 105 x 205 mm (910-300-700);
+ 910-300-700-oz: common label laser printing 105 x 205 mm without additional barcode labels (910-300-700);
+ 910-300-300: common label laser printing 105 x 148 mm (910-300-700);
+ 910-300-300-oz: common label laser printing 105 x 148 mm without additional barcode labels (910-300-300);
+ 910-300-710: common label laser printing 105 x 208 mm (910-300-710);
+ 910-300-600: common label thermal printing 103 x 199 mm (910-300-600, 910-300-610);
+ 910-300-400: common label thermal printing 103 x 150 mm (910-300-400, 910-300-410);
+ 100x70mm: 100 x 70 mm label (only for Warenpost and Warenpost International);
+
+
+
+
+
+
+
+
+
+ To get a single PDF for shipping and return label
+ select this option.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The status of the operation and requested urls for
+ getting the
+ label.
+
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Success status after processing the overall
+ request.
+
+
+
+
+
+ For every ShipmentNumber requested, one LabelData
+ node is
+ returned that contains the status of the label retrieval
+ operation and
+ the URL for the label (if available).
+
+
+
+
+
+
+
+
+ Manifests one ore more shipments.
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+
+
+ Contains a shipment number. Any number of a printed shipment not already manifested can be used.
+ A Request can contain the element up to 50 times.
+ Requests need to either contain at least one times shipmentNumber or allshipments.
+ Requests cannot contain shipmentNumber and allShipments at the same time.
+
+
+
+
+
+
+ Manifests all shipments. Can be used instead the element “shipmentNumber”. The element is used without a value, e.g.
+
+
+
+
+
+
+
+
+
+ The status of the operation
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Status of the request (value of zero means, the
+ request was
+ processed without error; value greater than zero
+ indicates that an error
+ occurred).
+
+
+
+
+
+ The status of the operation for the corresponding
+ shipment.
+
+
+
+
+
+
+
+
+ The identifier for the shipment which should be
+ deleted.
+
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+ In order to delete previously created DD shipment
+ orders,
+ ShipmentNumber. ShipmentNumber is required. This parent
+ element inherits
+ from ShipmentNumberType, therefore all following
+ subelements are valid
+ according to schema, however the web service
+ accepts shipmentNumber
+ only. Note: you can delete more than one
+ shipment by passing multiple
+ ShipmentNumber containers.
+
+
+
+
+
+
+
+
+ The status of the operation.
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Success status after processing the overall
+ request.
+
+
+
+
+
+ For every ShipmentNumber requested, one
+ DeletionState node
+ is returned that contains the status of the
+ respective deletion
+ operation.
+
+
+
+
+
+
+
+
+ The identifier for the shipment for which the export
+ document url is
+ requested.
+
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+ To request export documents, ShipmentNumber.
+ ShipmentNumber
+ is required. This parent element inherits from
+ ShipmentNumberType,
+ therefore all following subelements are valid
+ according to schema,
+ however the web service accepts
+ shipmentNumber only.
+
+
+
+
+
+ Dial to determine label ouput format. Must be
+ either 'URL' or
+ 'B64' = Base64encoded: it is possible to request
+ an URL for receiving
+ the label as PDF stream, or to request the
+ label as base64encoded binary
+ data directly. If not defined by
+ client, web service defaults to
+ 'URL'.
+
+
+
+
+
+
+
+
+
+
+
+
+ The group profile you select defines the billing
+ numbers you can use for creating shipments. To define group
+ profiles please visit our business costumer portal.
+ The group
+ profile defines the shipments you can get documents for.
+ The
+ shipment needs to have an account/billing number allocated to
+ the
+ group profile. To define group profiles please visit our
+ business
+ costumer portal.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The status of the operation and requested export
+ document.
+
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Status of the request (value of zero means, the
+ request was
+ processed without error; value greater than zero
+ indicates that an error
+ occurred).
+
+
+
+
+
+ Contains the result of the document processing: in
+ case of no
+ errors, a base64 encoded PDF is contained; also, the
+ status of this
+ particular document generation and the passed
+ shipment number are
+ returned.
+
+
+
+
+
+
+
+
+ The request data for the manifest document
+
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+ Date in format yyyy-mm-dd
+
+
+
+
+
+
+
+
+ The status of the operation and requested export
+ document.
+
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Status of the request (value of zero means, the
+ request was
+ processed without error; value greater than zero
+ indicates that an error
+ occurred).
+
+
+
+
+
+ The Base64 encoded pdf data for receiving the
+ manifest.
+
+
+
+
+
+
+
+
+ The shipmentdata for creating a shipment.
+
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+ The ShipmentNumber of the shipment, which sould be
+ updated.
+ ShipmentNumber is required. This parent element inherits
+ from
+ ShipmentNumberType, therefore all following subelements are
+ valid
+ according to schema, however the web service accepts
+ shipmentNumber
+ only.
+
+
+
+
+
+ ShipmentOrder contains an update of all data of the
+ selected
+ shipment order.
+
+
+
+
+
+ Dial to determine label ouput format. Must be
+ either 'URL' or
+ 'B64' = Base64encoded: it is possible to request
+ an URL for receiving
+ the label as PDF stream, or to request the
+ label as base64encoded binary
+ data directly. If not defined by
+ client, web service defaults to
+ 'URL'.
+
+
+
+
+
+
+
+
+
+
+
+
+ The group profile you select defines the billing
+ numbers you can use for creating shipments. To define group
+ profiles please visit our business costumer portal.
+
+
+
+
+
+
+
+
+
+
+ In this optional section you can define the following label formats:
+ A4:common label laser printing A4 plain paper;
+ 910-300-700: common label laser printing 105 x 205 mm (910-300-700);
+ 910-300-700-oz: common label laser printing 105 x 205 mm without additional barcode labels (910-300-700);
+ 910-300-300: common label laser printing 105 x 148 mm (910-300-700);
+ 910-300-300-oz: common label laser printing 105 x 148 mm without additional barcode labels (910-300-300);
+ 910-300-710: common label laser printing 105 x 208 mm (910-300-710);
+ 910-300-600: common label thermal printing 103 x 199 mm (910-300-600, 910-300-610);
+ 910-300-400: common label thermal printing 103 x 150 mm (910-300-400, 910-300-410);
+ 100x70mm: 100 x 70 mm label (only for Warenpost and Warenpost International);
+
+
+
+
+
+
+
+
+
+
+ In this optional section you can define the following label formats:
+ A4:common label laser printing A4 plain paper;
+ 910-300-700: common label laser printing 105 x 205 mm (910-300-700);
+ 910-300-700-oz: common label laser printing 105 x 205 mm without additional barcode labels (910-300-700);
+ 910-300-300: common label laser printing 105 x 148 mm (910-300-700);
+ 910-300-300-oz: common label laser printing 105 x 148 mm without additional barcode labels (910-300-300);
+ 910-300-710: common label laser printing 105 x 208 mm (910-300-710);
+ 910-300-600: common label thermal printing 103 x 199 mm (910-300-600, 910-300-610);
+ 910-300-400: common label thermal printing 103 x 150 mm (910-300-400, 910-300-410);
+ 100x70mm: 100 x 70 mm label (only for Warenpost and Warenpost International);
+
+
+
+
+
+
+
+
+
+ To get a single PDF for shipping and return label
+ select this option.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The status of the operation and the shipment
+ identifier (if
+ available).
+
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Success status after processing the overall
+ request.
+
+
+
+
+
+ Can contain any DHL shipmentnumber. For successful
+ and unsuccessful operations, the requested
+ ShipmentNumber to be
+ deleted is returned. This is no matter if the operation
+ could be
+ performed or not.
+
+
+
+
+
+
+
+
+
+
+ Can contain any DHL shipmentnumber. For successful
+ and unsuccessful operations, the requested
+ ShipmentNumber to be
+ deleted is returned. This is no matter if the operation
+ could be
+ performed or not.
+
+
+
+
+
+
+
+
+
+
+ The operation's success status for every single
+ ShipmentOrder
+ will be returned by one UpdateState element. It is
+ identifiable via
+ ShipmentNumber.
+
+
+
+
+
+
+
+
+ The operation's success status for every single
+ ShipmentOrder will be
+ returned by one CreationState element. It is
+ identifiable via SequenceNumber.
+
+
+
+
+
+ Identifier for ShipmentOrder set by client
+ application in
+ CreateShipment request. The defined value is looped
+ through and returned
+ unchanged by the web service within the
+ response of createShipment. The
+ client can therefore assign the
+ status information of the response to the
+ correct ShipmentOrder of
+ the request.
+
+
+
+
+
+ Can contain any DHL shipmentnumber. For successful
+ and unsuccessful operations, the requested
+ ShipmentNumber to be
+ deleted is returned. This is no matter if the operation
+ could be
+ performed or not.
+
+
+
+
+
+
+
+
+
+
+ Can contain any DHL shipmentnumber. For successful
+ and unsuccessful operations, the requested
+ ShipmentNumber to be
+ deleted is returned. This is no matter if the operation
+ could be
+ performed or not.
+
+
+
+
+
+
+
+
+
+
+ For successful operations, a shipment number is
+ created and
+ returned. Depending on the invoked product.
+
+
+
+
+
+
+
+ The operation's success status for every single
+ ShipmentOrder will be
+ returned by one CreationState element. It is
+ identifiable via SequenceNumber.
+
+
+
+
+
+ Identifier for ShipmentOrder set by client
+ application in
+ CreateShipment request. The defined value is looped
+ through and returned
+ unchanged by the web service within the
+ response of createShipment. The
+ client can therefore assign the
+ status information of the response to the
+ correct ShipmentOrder of
+ the request.
+
+
+
+
+
+ Success status of processing a particular shipment.
+
+
+
+
+
+
+
+ The status information used in different situations.
+
+
+
+
+
+ Overall status of the entire request: A value of
+ zero means, the
+ request was processed without error. A value
+ greater than zero indicates
+ that an error occurred. The detailed
+ mapping and explanation of returned
+ status codes is contained in
+ the list.
+
+
+
+
+
+ Explanation of the statuscode. Explains what types of errors occurred.
+
+
+
+
+
+ Detailed explanation of errors or warnings, p.e. “Invalid postal code”.
+ This element is kept for compatibility reasons only. Please use “statusType” und “errorMassage” with their subelements instead.
+
+
+
+
+
+ Explains if an error or warning occurred
+
+
+
+
+
+ Explains details of the error and where it occurred
+
+
+
+
+
+ Explains if an error or warning occurred
+
+
+
+
+
+ Explains details of the error and where it occurred
+
+
+
+
+
+
+
+
+
+ Explanation of the statusElement and potential errors.
+
+
+
+
+
+ Explanation of the statusMessage and potential errors.
+
+
+
+
+
+
+
+
+ Information about each piece (e.g. the generated
+ licence plate). For
+ every piece, a PieceInformation container holds
+ the license plate
+ number.
+
+
+
+
+
+ For every piece a piece number is created that is of
+ one of the
+ following types (mostly licensePlate).
+
+
+
+
+
+
+
+ Data for the creation of a shipment.
+
+
+
+
+ Free field to to tag multiple shipment orders
+ individually by
+ client. Essential for later mapping of response
+ data returned by webservice
+ upon createShipment operation. Allows
+ client to assign the shipment
+ information of the response to the
+ correct shipment order of the
+ request.
+
+
+
+
+
+ Is the core element of a ShipmentOrder. It contains
+ all relevant
+ information of the shipment.
+
+
+
+
+
+
+ Contains the information of the shipment product
+ code, weight and size characteristics and services to be used.
+
+
+
+
+
+
+ Contains relevant information about the
+ Shipper.
+
+
+
+
+
+ Contains a reference to the Shipper data
+ configured in GKP.
+
+
+
+
+
+
+ Contains relevant information about
+ Receiver.
+
+
+
+
+
+ To be used if a return label address shall be
+ generated.
+
+
+
+
+
+ For international shipments. This section
+ contains information about the exported goods relevant for
+ customs. For international shipments: commercial invoice and
+ customs declaration (CN23) have to be attached to the shipment.
+ Data relevant for customs also has to be transferred as
+ electronically.
+
+
+
+
+
+ Is only to be indicated by DHL partners
+
+
+
+
+
+
+
+
+
+
+
+
+ If set to true (=1), the label will be only be
+ printable, if the
+ receiver address is valid.
+
+
+
+
+
+
+
+ Data for the creation of a shipment.
+
+
+
+
+ Free field to to tag multiple shipment orders
+ individually by
+ client. Essential for later mapping of response
+ data returned by webservice
+ upon createShipment operation. Allows
+ client to assign the shipment
+ information of the response to the
+ correct shipment order of the
+ request.
+
+
+
+
+
+ Is the core element of a ShipmentOrder. It contains
+ all relevant
+ information of the shipment.
+
+
+
+
+
+
+ Contains the information of the shipment product
+ code, weight and size characteristics and services to be used.
+
+
+
+
+
+ Contains relevant information about the
+ Shipper.
+
+
+
+
+
+ Contains relevant information about
+ Receiver.
+
+
+
+
+
+ To be used if a return label address shall be
+ generated.
+
+
+
+
+
+ For international shipments. This section
+ contains information about the exported goods relevant for
+ customs. For international shipments: commercial invoice and
+ customs declaration (CN23) have to be attached to the shipment.
+ Data relevant for customs also has to be transferred as
+ electronically.
+
+
+
+
+
+ Is only to be indicated by DHL partners
+
+
+
+
+
+
+
+
+
+
+
+
+ If set to true (=1), the label will be only be
+ printable, if the
+ receiver address is valid.
+
+
+
+
+
+
+
+ The data of the shipper or return receiver.
+
+
+
+
+
+ Name of the Return Receiver
+
+
+
+
+ Contains address data.
+
+
+
+
+ Information about communication.
+
+
+
+
+
+
+ The data of the shipper of a shipment.
+
+
+
+
+
+
+
+
+ Key of reference.
+
+
+
+
+
+
+
+ The receiver data.
+
+
+
+
+
+
+ The address data of the receiver.
+
+
+
+
+ The address of the receiver is a german
+ Packstation.
+
+
+
+
+
+ The address of the receiver is a german
+ Postfiliale.
+
+
+
+
+
+
+ Information about communication.
+
+
+
+
+
+
+ The receiver data of a shipment.
+
+
+
+
+
+
+
+
+ Identity data (used for ident services).
+
+
+
+
+
+ First name of the person to be verified. Field
+ length must be
+ less than or equal to 30.
+
+
+
+
+
+ Last name of the person to be verified. Field length
+ must be less
+ than or equal to 30.
+
+
+
+
+
+ Name of the street of registered address. Field
+ length must be
+ less than or equal to 30.
+
+
+
+
+
+ House number of registered address. Field length
+ must be less
+ than or equal to 10.
+
+
+
+
+
+ Postcode of registered address. Field length must be
+ less than or
+ equal to 15.
+
+
+
+
+
+ City of registered address. Field length must be
+ less than or
+ equal to 30.
+
+
+
+
+
+ Person's date of birth. Format must be yyyy-mm-dd.
+
+
+
+
+
+ Person's nationality. Field length must be less than
+ or equal to
+ 30.
+
+
+
+
+
+
+
+ Details of a shipment.
+
+
+
+
+
+ Determines the DHL Paket product to be ordered.
+ V01PAK: DHL PAKET;
+ V53WPAK: DHL PAKET International;
+ V54EPAK: DHL Europaket;
+ V62WP: Warenpost;
+ V66WPI: Warenpost International
+
+
+
+
+
+
+ A reference number that the client can assign for
+ better association purposes. Appears on shipment label. To use the
+ reference number for tracking purposes, it should be at least 8
+ characters long and unique
+
+
+
+
+
+
+
+
+
+
+ Date of shipment should be close to current date and
+ must not be
+ in the past. Iso format required: yyyy-mm-dd.
+
+
+
+
+
+
+
+
+
+
+
+ Name of a cost center. Appears on shipment label.
+
+
+
+
+
+
+
+
+
+
+ DHL account number (14 digits).
+
+
+
+
+
+
+
+
+
+
+
+ A reference number that the client can assign for
+ better
+ association purposes. Appears on return shipment label. To
+ use the reference number for tracking purposes, it should be at
+ least 8 characters long and unique.
+
+
+
+
+
+
+
+
+
+
+
+
+ Details of a shipment.
+
+
+
+
+
+ extends the ShipmentDetailsType
+
+
+
+ For every parcel specified, contains weight in kg,
+ length
+ in cm, width in cm and height in cm.
+
+
+
+
+
+ Use one dedicated Service node for each service to
+ be
+ booked with the shipment product. Add another Service node for
+ booking a further service and so on. Successful booking of a
+ particular service depends on account permissions and product's
+ service combinatorics. I.e. not every service is allowed for
+ every
+ product, or can be combined with all other allowed
+ services. The
+ service bundles that contain all services are the
+ following.
+
+
+
+
+
+ Mechanism to send notifications by email after
+ successful
+ manifesting of shipment.
+
+
+
+
+
+ Bank data can be provided here for different
+ purposes.
+ E.g. if COD is booked as service, bank data must be
+ provided by DHL
+ customer (mandatory server logic). The collected
+ money will be
+ transferred to specified bank account.
+
+
+
+
+
+
+
+
+
+ Item/Piece data.
+
+
+
+
+ The weight of the piece in kg
+
+
+
+
+
+
+
+
+
+
+
+ The length of the piece in cm.
+
+
+
+
+
+
+
+
+
+
+ The width of the piece in cm.
+
+
+
+
+
+
+
+
+
+
+ The height of the piece in cm.
+
+
+
+
+
+
+
+
+
+
+
+
+ Item/Piece data of a shipment.
+
+
+
+
+
+
+
+
+ GKV shipment services.
+
+
+
+ can be
+
+
+
+
+ This service is used exclusively for shipments with
+ special delivery requirements. It is not available for our regular
+ business customers.
+
+
+
+
+
+ Service for package return. For packagingReturn you
+ also have to book a return label.
+
+
+
+
+
+ Service "Endorsement". Mandatory for shipments with
+ product DHL Paket International: V53WPAK
+
+
+
+
+
+ Service visual age check
+
+
+
+
+ Service preferred location
+
+
+
+
+ Service preferred neighbour
+ The details field should be set to the preferred
+ neighbours
+ name.
+
+
+
+
+
+ Service preferred day
+
+
+
+
+ Invoke service No Neighbour Delivery.
+
+
+
+
+
+ Invoke service Named Person Only.
+
+
+
+
+ Invoke service return receipt.
+
+
+
+
+ Premium for fast and safe delivery of international
+ shipments.
+
+
+
+
+
+ Service Cash on delivery.
+
+
+
+
+ Postal Delivery Duty Paid
+ Deutsche Post and sender handle import duties instead of consignee
+
+
+
+
+ Closest Droppoint
+
+ Delivery to the droppoint closest to the address of the recipient of the shipment. For this kind of delivery either the phone number and/or the e-mail address of the receiver is mandatory.
+
+ For shipments using DHL Paket International it is recommended that you choose one of the three delivery types:
+ Economy
+ Premium
+ CDP
+
+ Otherwise, the current default for the receiver country will be picked.
+
+
+
+
+ Standard delivery of international shipments
+
+ For shipments using DHL Paket International it is recommended that you choose one of the three delivery types:
+
+ Economy
+ Premium
+ CDP
+
+ Otherwise, the current default for the receiver country will be picked.
+
+
+
+
+ Insure shipment with higher than standard amount.
+
+
+
+
+
+ Service to ship bulky goods.
+
+
+
+
+ Service configuration for IdentCheck.
+
+
+
+
+
+ Service configuration for ParcelOutletRouting.
+ Details can be an
+ email-address, if not set receiver email will be
+ used
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+ e-mail address for notification in case of
+ non-deliverability
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+ Delivery Day:
+ Please enter the day (yyyy-mm-ddd) on which you would like the shipment to be delivered.
+ The requested day must be at least 2 and at most 6 working days after the shipment date.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+ e.g. garage, terrace
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+ name, streetname streetnumber
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+ E-mail address for notification in case of
+ non-deliverability.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Details of the Service (freetext)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+ Type of the Service (List of Types)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+ This service defines the handling of parcels that
+ cannot be delivered. There are two options: IMMEDIATE (Sending back
+ to sender), ABANDONMENT (Abandonment of parcel at the hands of
+ sender (free of charge). The definition of undeliverability is
+ country-specific and depends on the regulations of the postal
+ company of the receiving country. Usually, if parcels cannot be
+ delivered at first try, recipients receive a notification card and
+ can pick up their shipment at a local postal office. After the
+ storage period has expired, the shipment will be handled according
+ to your choosen endorsement option. Shipments that cannot be
+ delivered due to address problems or active refusal will be either
+ returned immediately or treated as abandoned.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+ Individual details for handling (freetext)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+ Number of Days to hold shipment before shipment
+ will be returend
+ to sender
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+ Service VisualCheckOfAge is used to specify the
+ minimum age of the recipient.
+ The following types are allowed: "A16"
+ or "A18"
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+ Timeframe of delivery, if the option is used:
+ ValidValues are
+ 10001200: 10:00 until 12:00;
+ 12001400: 12:00 until
+ 14:00
+ 14001600: 14:00 until 16:00;
+ 16001800: 16:00 until 18:00
+ 18002000: 18:00 until 20:00;
+ 19002100: 19:00 until 21:00
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+ Day of Delivery, if the option is used: Date in
+ format
+ yyyy-mm-dd
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+ Please enter the Amount that should be insured
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+ Money amount to be collected. Mandatory if COD is
+ chosen.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+ Mandatory if unfree is chosen. 0= cash / 1= invoice.
+
+
+
+
+
+
+
+
+
+
+
+ Paid by third party, e.g. Receiver. DHL account
+ number mandatory if
+ PaymentType 1 = invoice is selected. Field
+ length must be less than or equal to
+ 10.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Surname (family name) of the person for ident
+ check.
+
+
+
+
+
+
+
+
+
+
+
+ Given name (first name) of the person for
+ ident
+ check.
+
+
+
+
+
+
+
+
+
+
+
+ date of birth (DOB) of the person for ident
+ check,
+ if the option is used: Date in format
+ yyyy-mm-dd
+ This attribute is only optional, if you set a minimum age
+
+
+
+
+
+
+
+
+
+
+
+ minimum age of the person for ident check
+ ("A16" or "A18")
+ This attribute is only optional, if you specify the date of birth
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Indicates, if the option is on/off
+
+
+
+
+
+
+
+
+
+
+
+
+ Notification type
+
+
+
+
+ Email address of the recipient. Mandatory if
+ Notification is
+ set.
+
+
+
+
+
+
+
+
+
+
+
+ You
+ may choose between a standard DHL e-mail text (no ID needed) or configure
+ an individual text within the section "Administration".
+
+
+
+
+
+
+
+
+
+
+
+ The data of the export document for a shipment.
+
+
+
+
+
+ Invoice number if applicable
+
+
+
+
+
+
+
+
+
+ Export type
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Description mandatory if ExportType is OTHER.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Element provides terms of trades, incoterms codes:
+
+
DDP (Delivery Duty Paid)
+
DXV (Delivery Duty Paid (excl. VAT))
+
DAP (formerly DDU, Delivery At Place)
+
DDX (Delivery Duty Paid (excl. Duties, taxes and VAT)
+
CPT (Carriage Paid To (within EU only))
+
+ are vaild values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PlaceOfCommital is a Locaton the shipment is handed
+ over to DHL
+
+
+
+
+
+
+
+
+
+
+ Postage costs billed in the invoice
+
+
+
+
+
+
+
+
+
+
+
+
+ CustomsCurrency refers to all stated goods / customs
+ values as well as postage costs. The information has to match
+ the currency of the commercial invoice or the invoice for customs
+ purposes. ISO 4217 alpha, p.E.:
+ EUR for Euro
+ USD for US Dollar
+ GBP for British Pound
+
+
+
+
+
+
+
+
+
+
+ The permit number.
+
+
+
+
+
+
+
+
+
+ The attestation number.
+
+
+
+
+
+
+
+
+
+ The customs reference is used by customs authorities
+ to identify
+ economics operators an/or other persons involved. With
+ the given reference,
+ granted authorizations and/or relevant
+ processes in customs
+ clearance an/or
+ taxation can be taken into
+ account.
+
+
+
+
+
+
+
+
+
+
+ The customs reference is used by customs authorities
+ to identify
+ economics operators an/or other persons involved. With
+ the given reference,
+ granted authorizations and/or relevant
+ processes in customs
+ clearance an/or
+ taxation can be taken into
+ account.
+
+
+
+
+
+
+
+
+
+
+ Sets an electronic export notification.
+
+
+
+
+
+ One or more child elements for every position to be
+ defined within the Export Document. Each one contains description,
+ country code of origin, amount, net weight, customs value.
+ Multiple positions only possible for shipments using DHL Paket
+ International (V53WPAK).
+ Shipments using DHL Europaket (V54EPAK)
+ can only contain one
+ ExportDocPosition.
+
+
+
+
+
+
+ Description of the goods
+
+
+
+
+
+
+
+
+
+ ISO-Code (ISO 3166-2) of country the goods were
+ manufactured
+
+
+
+
+
+
+
+
+
+
+
+ Customs tariff number of the unit / position.
+ If the service PDDP is used, customsTariffNumber is required.
+
+
+
+
+
+
+
+
+
+
+ Quantity of the unit / position. Only positive
+ values (> 0) are allowed.
+
+
+
+
+
+
+
+
+
+
+
+ Net weight of the unit / position. Only positive
+ values (> 0) are allowed.The total net weight must not exceed
+ the shipment weight
+
+
+
+
+
+
+
+
+
+
+
+
+ Customs value amount of the unit /position. Only
+ positive values (> 0) are allowed.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Further address information
+The following data fields from the cis_base-types are processed/mandatory/optional:
+-------------------------------------------------------------------------------------------------------
+Salutation (optional) : cis:NameType->Person->salutation
+Company Name 1 (mandatory): cis:NameType->Company->name1
+Company Name 2 (optional) : cis:NameType->Company->name2
+Contact Name (mandatory): cis:CommunicationType->contactPerson
+Street Name (mandatory): cis:NativeAddressType->streetName
+Street Number (mandatory): cis:NativeAddressType->streetNumber
+Add. Address (optional) : cis:NativeAddressType->careOfName
+Postcode (mandatory): cis:NativeAddressType->zip
+City Name (mandatory): cis:NativeAddressType->city
+ISO Country Code (mandatory): cis:NativeAddressType->Origin->CountryType->countryISOType
+Phone Number (mandatory): cis:CommunicationType->phone
+Email Address (mandatory): cis:CommunicationType->email
+
+
+
+
+
+ Mandatory if further address is to be specified.
+
+
+
+
+
+
+ Determines whether further address is one of the
+ following types.
+
+
+
+
+
+ Extra data for name extension.
+
+
+
+
+ Contains address data.
+
+
+
+
+ Info about communication.
+
+
+
+
+
+
+
+
+
+ The status of the getLabel operation and the url for
+ requesting the label
+ (if available).
+
+
+
+
+
+ Success status of processing retrieval of particular
+ shipment
+ label.
+
+
+
+
+
+ For successful and unsuccessful operations, the
+ requested
+ ShipmentNumber of the label to be retrieved is returned.
+ This is no matter
+ if it the operation could be performed or not.
+
+
+
+
+
+
+ If label output format was requested as 'URL' via
+ LabelResponseType, this element will be returned. It contains the
+ URL to
+ access the PDF label. This is default output format if not
+ specified
+ other by client in labelResponseType. Depending on
+ setting in customer
+ profile all labels or just the shipmentlabel.
+
+
+
+
+
+ Label as base64 encoded pdf data, depending on
+ setting in
+ customer profile all labels or just the shipmentlabel.
+
+
+
+
+
+
+
+ If label output format was requested as 'URL' via
+ LabelResponseType, this element will be returned. It contains the
+ URL to
+ access the PDF label. This is default output format if not
+ specified
+ other by client in labelResponseType. Depending on
+ setting in customer
+ profile all labels or just the
+ returnshipmentlabel.
+
+
+
+
+
+ Label as base64 encoded pdf data, depending on
+ setting in
+ customer profile all labels or just the
+ returnshipmentlabel.
+
+
+
+
+
+
+
+ If label output format was requested as 'URL' via
+ LabelResponseType, this element will be returned. It contains the
+ URL to
+ access the PDF label. This is default output format if not
+ specified
+ other by client in labelResponseType. Depending on
+ setting in customer
+ profile all labels or just the export
+ documents.
+
+
+
+
+
+ Label as base64 encoded pdf data, depending on
+ setting in
+ customer profile all labels or just the export
+ documents.
+
+
+
+
+
+
+
+ If label output format was requested as 'URL' via
+ LabelResponseType, this element will be returned. It contains the
+ URL to
+ access the PDF label. This is default output format if not
+ specified
+ other by client in labelResponseType. Depending on
+ setting in customer
+ profile all labels or just the cod related
+ documents.
+
+
+
+
+
+ Label as base64 encoded pdf data, depending on
+ setting in
+ customer profile all labels or just the cod related
+ documents.
+
+
+
+
+
+
+
+
+ The status of the getLabel operation and the url for
+ requesting the label
+ (if available)
+
+
+
+
+
+ ShipmentNumber
+
+
+
+
+ Status of the request (value of zero means, the
+ request was
+ processed without error; value greater than zero
+ indicates that an error
+ occurred).
+
+
+
+
+
+
+ Export doc as base64 encoded pdf data
+
+
+
+
+
+ URL for downloading the Export doc as pdf
+
+
+
+
+
+
+
+
+ The status of a doManifest operation.
+
+
+
+
+ ShipmentNumber
+
+
+
+
+ Status of the request (value of zero means, the
+ request was
+ processed without error; value greater than zero
+ indicates that an error
+ occurred).
+
+
+
+
+
+
+
+ The status of a deleteShipment operation.
+
+
+
+
+
+ For successful and unsuccessful operations, the
+ requested
+ ShipmentNumber to be deleted is returned. This is no
+ matter if the operation
+ could be performed or not.
+
+
+
+
+
+ Success status of processing the deletion of
+ particular
+ shipment.
+
+
+
+
+
+
+
+ The data for a pickup order.
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+ Contains information in further leaf elements about
+ product,
+ DHL account, pickup date and time, pickup location,
+ amount of pieces,
+ pallets, and shipments, moreover weight and
+ volume weight, size.
+
+
+
+
+
+ The pickup address.
+
+
+
+
+ The address and contact information of the
+ orderer.
+
+
+
+
+
+
+
+
+ The data for a pickup order.
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Success status after processing the request.
+
+
+
+
+
+ The confirmation number of the successfully created
+ pickup
+ order. It can later be used for cancelling a pickup order.
+ Confirmation
+ number is not available for each pickup type.
+
+
+
+
+
+ If available, a shipment number is returned.
+
+
+
+
+
+
+
+
+ The details of a pickup order.
+
+
+
+
+ Pickup date in format yyyy-mm-dd. Mandatory if
+ pickup is booked
+ along with shipment order.
+
+
+
+
+
+
+
+
+
+
+
+ Earliest time for pickup. Format is hh:mm.
+
+
+
+
+
+
+
+
+
+
+
+ Lates time for pickup. Format is hh:mm.
+
+
+
+
+
+
+
+
+
+
+
+ Remarks to be considered when pickup is done.
+
+
+
+
+
+ Area to further detail pickup location beyond
+ address.
+
+
+
+
+
+
+
+
+The pickup address. In the PickupType the following data fields are processed/mandatory/optional:
+----------------------------------------------------------------------------------------------
+Company Name 1 (mandatory): cis:NameType->Company->name1
+Contact Name (mandatory): cis:CommunicationType->contactPerson
+Street Name (mandatory): cis:NativeAddressType->streetName
+Street Number (mandatory): cis:NativeAddressType->streetNumber
+Add. Address (optional) : cis:NativeAddressType->careOfName
+Postcode (mandatory): cis:NativeAddressType->zip
+City Name (mandatory): cis:NativeAddressType->city
+ISO Country Code (mandatory): cis:NativeAddressType->Origin->CountryType->countryISOType
+Phone Number (mandatory): cis:CommunicationType->phone
+Email Address (mandatory): cis:CommunicationType->email
+
+
+
+
+
+ Determines whether pickup address is one of the
+ following
+ types.
+
+
+
+
+
+ Data fields for pickup address.
+
+
+
+
+ Info about communication.
+
+
+
+
+
+
+
+Information about the pickup orderer. In the PickupOrdererType the following data fields are processed/mandatory/optional:
+----------------------------------------------------------------------------------------------
+Salutation (optional) : cis:NameType->Person->salutation
+Company Name 1 (mandatory): cis:NameType->Company->name1
+Company Name 2 (optional) : cis:NameType->Company->name2
+Contact Name (mandatory): cis:CommunicationType->contactPerson
+Street Name (mandatory): cis:NativeAddressType->streetName
+Street Number (mandatory): cis:NativeAddressType->streetNumber
+Add. Address (optional) : cis:NativeAddressType->careOfName
+Postcode (mandatory): cis:NativeAddressType->zip
+City Name (mandatory): cis:NativeAddressType->city
+ISO Country Code (mandatory): cis:NativeAddressType->Origin->CountryType->countryISOType
+Phone Number (mandatory): cis:CommunicationType->phone
+Email Address (mandatory): cis:CommunicationType->email
+
+
+
+
+
+ Determines whether orderer contact address is of the
+ following
+ type.
+
+
+
+
+
+ Optional name appendix.
+
+
+
+
+ Data fields for orderer's address.
+
+
+
+
+ Info about communication.
+
+
+
+
+
+
+ The data of the pickup order.
+
+
+
+
+ Depending on whether a DD pickup or TD pickup is
+ invoked, this
+ field contains either the 10-digit EKP number (DD
+ pickups) or the 9-digit
+ accountNumberExpress (TD pickups).
+
+
+
+
+
+
+
+
+
+
+ Pickup date in format yyyy-mm-dd.
+
+
+
+
+
+
+
+
+
+
+ Earliest time for pickup. Format is hh:mm.
+
+
+
+
+
+
+
+
+
+
+
+ Lates time for pickup. Format is hh:mm.
+
+
+
+
+
+
+
+
+
+
+
+ Remarks to be considered when pickup is done.
+ Mandatory if 'TDI'
+ is selected.
+
+
+
+
+
+ Area to further detail pickup location beyond
+ address. Mandatory
+ for TDN and TDI, optional for DDN and DDI.
+
+
+
+
+
+ Number of pieces to be picked up.
+
+
+
+
+
+
+
+
+
+ Number of pallets to be picked up.
+
+
+
+
+
+
+
+
+
+ The weight of all shipment's pieces in kg. Field
+ length must be
+ less than or equal to 22.
+
+
+
+
+
+
+
+
+
+
+
+
+ Number of shipments to be picked up.
+
+
+
+
+
+
+
+
+
+ The total volumetric weight of all pieces in kg.
+ Calculated by
+ piece = length x width x height in centimetres /
+ 5000. Field length must be
+ less than or equal to 22.
+
+
+
+
+
+
+
+
+
+
+
+
+ The maximum length in cm.
+
+
+
+
+
+
+
+
+
+
+
+ The maximum width in cm.
+
+
+
+
+
+
+
+
+
+
+
+ The maximum height in cm.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The data for cancelling a pickup order.
+
+
+
+
+
+
+ The version of the webservice implementation for
+ which the
+ requesting client is developed.
+
+
+
+
+
+ The confirmation number of the pickup order which
+ should be
+ cancelled. Use value from pickup response attribute
+ 'ConfirmationNumber'
+ to cancel respective pickup order. Note: only
+ one pickup can be deleted
+ at a time.
+
+
+
+
+
+
+
+
+ The status of the cancel pickup operation.
+
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Success status after processing the request.
+
+
+
+
+
+
+
+
+ Identity data (used e.g. for ident services)
+
+
+
+
+
+
+ If driving license shall be used for verifying
+ identity.
+
+
+
+
+
+
+ ID number of the driving license. Mandatory if
+ DrivingLicense is chosen as identity
+ instrument.
+
+
+
+
+
+ Name of certifying authority of the driving
+ license. Mandatory if DrivingLicense is chosen as identity
+ instrument.
+
+
+
+
+
+
+
+
+ If identity card shall be used for verifying
+ identity.
+
+
+
+
+
+
+ Number of the identity card. Mandatory if
+ IdentityCard is chosen as identity instrument. Field length
+ must be less than or equal to 20.
+
+
+
+
+
+ Name of certifying card authority. Mandatory if
+ IdentityCard is chosen as identity instrument. Field length
+ must be less than or equal to 30.
+
+
+
+
+
+
+
+
+ If a bank card shall be used for verifying
+ identity.
+
+
+
+
+
+
+ Type of bank card. Mandatory if BankCard is
+ chosen as identity instrument.
+
+
+
+
+
+ Number of bank card. Mandatory if BankCard is
+ chosen as identity instrument.
+
+
+
+
+
+ Name of bank. Mandatory if BankCard is chosen as
+ identity instrument.
+
+
+
+
+
+ Bank code. Mandatory if BankCard is chosen as
+ identity instrument.
+
+
+
+
+
+
+
+
+
+
+
+ Type of Packstation (Receiver is in Germany)
+
+
+
+
+ includes
+
+
+
+ Number of the packstation
+
+
+
+
+ Post Nummer of the receiver
+
+
+
+
+ Postcode
+
+
+
+
+
+
+
+
+
+
+
+ City name.
+
+
+
+
+
+
+
+
+
+
+
+ Type of Postfiliale (Receiver is in Germany)
+
+
+
+
+ includes
+
+
+
+ Number of the postfiliale
+
+
+
+
+ Post Nummer of the receiver
+
+
+
+
+ Postcode
+
+
+
+
+
+
+
+
+
+
+
+ City name.
+
+
+
+
+
+
+
+
+
+
+
+ Type of ParcelShop (Receiver is in Europe)
+
+
+
+
+ includes
+
+
+
+ Number of the ParcelShop
+
+
+
+
+ Name of street of the ParcelShop
+
+
+
+
+
+
+
+
+
+
+ House number of the ParcelShop
+
+
+
+
+
+
+
+
+
+ Postcode
+
+
+
+
+
+
+
+
+
+
+
+ City name.
+
+
+
+
+
+
+
+
+
+
+
+ The status of the operation and the shipment
+ identifier (if
+ available).
+
+
+
+
+
+
+ The version of the webservice implementation.
+
+
+
+
+
+ Success status after processing the overall
+ request.
+
+
+
+
+
+ The operation's success status for every single
+ ShipmentOrder
+ will be returned by one CreationState element. It is
+ identifiable via
+ SequenceNumber.
+
+
+
+
+
+
+
+
+ The version of the webservice implementation for
+ which the requesting
+ client is developed.
+
+
+
+
+
+ includes
+
+
+
+ The number of the major release. E.g. the '3' in
+ version
+ "3.2.".
+
+
+
+
+
+
+
+
+
+
+ The number of the minor release. E.g. the '2' in version "3.2.". Please note, that if you wish to use the old error handling, you need use Version 3.2 or below
+
+
+
+
+
+
+
+
+
+
+ Optional build id to be addressed.
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/classes/Carrier/Dhl/Wsdl/geschaeftskundenversand-api-3.4.0-schema-cis_base.xsd b/classes/Carrier/Dhl/Wsdl/geschaeftskundenversand-api-3.4.0-schema-cis_base.xsd
new file mode 100644
index 00000000..60d8e041
--- /dev/null
+++ b/classes/Carrier/Dhl/Wsdl/geschaeftskundenversand-api-3.4.0-schema-cis_base.xsd
@@ -0,0 +1,1126 @@
+
+
+
+
+
+
+
+ Country specific ISO code.
+
+
+
+
+
+
+
+
+ First 10 digit number extract from the 14 digit DHL Account Number. E.g. if DHL Account Number is "5000000008 72 01" then EKP is equal to 5000000008.
+
+
+
+
+
+
+
+
+
+
+ Field has the partner id. I.e. the last 2 digit number extract from the 14 digit DHL Account Number. E.g. if DHL Account Number is "5000000008 72 01" then Attendance is 01.
+
+
+
+
+
+
+
+
+
+
+ Procedure ID (part of account number).
+
+
+
+
+
+
+
+
+
+
+ DHL account number (14 digits).
+
+
+
+
+
+
+
+
+
+
+ Express AccountNumber (9 digits).
+
+
+
+
+
+
+
+
+
+
+ Ident code number.
+
+
+
+
+
+
+
+
+
+
+
+ License plate number.
+
+
+
+
+
+
+
+
+
+ Airway bill number.
+
+
+
+
+
+
+
+
+
+
+ route code (default).
+
+
+
+
+
+
+
+
+
+
+
+
+ The following barcode types are:
+ 1. GS1 Barcode
+ 2. ASC MH10 Barcode
+ 3. 2/5 Interleaved
+ 4. Code 128 ( UPU )
+
+
+
+
+
+
+
+
+
+
+
+ City name.
+
+
+
+
+
+
+
+
+
+ Province name.
+
+
+
+
+
+
+
+
+
+ Code for street name (part of routecode).
+
+
+
+
+
+
+
+
+
+
+ Code for street number (part of routecode).
+
+
+
+
+
+
+
+
+
+
+ Country.
+
+
+
+
+ Authentification.
+
+
+
+
+ The version of the webservice implementation for which the
+requesting client is developed.
+
+
+
+
+ includes
+
+
+
+ The number of the major release. E.g. the '3' in version "3.2.".
+
+
+
+
+
+
+
+
+
+ The number of the minor release. E.g. the '3' in version "3.2.".
+
+
+
+
+
+
+
+
+
+ Optional build id to be addressed.
+
+
+
+
+
+
+
+
+
+
+
+
+ Type of authentification
+
+
+
+ includes
+
+
+
+ username for the business customer portal (only lower case)
+
+
+
+
+
+
+
+ password for the business customer portal
+
+
+
+
+
+
+
+
+
+
+
+ Type of native address
+
+
+
+ includes
+
+
+
+ The name of the street. Optionally the house number can be passed in this field too.
+ In this case the field "streetNumber" must not be present.
+
+
+
+
+
+
+
+
+
+ The house number. This field is only optional when the house number is passed with
+ the field streetName.
+
+
+
+
+
+
+
+
+
+ Address addon, is only printed in the international area (V53WPAK)
+
+
+
+
+
+
+
+
+
+ DispatchingInformation, is only printed in the international area (V53WPAK)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Type of native address
+
+
+
+ includes
+
+
+
+ The name of the street. Optionally the house number can be passed in this field too.
+ In this case the field "streetNumber" must not be present.
+
+
+
+
+
+
+
+
+
+ The house number. This field is only optional when the house number is passed with
+ the field streetName.
+
+
+
+
+
+
+
+
+
+
+
+ Country.
+
+
+
+
+
+
+
+
+
+
+ The name of the street. Optionally the house number can be passed in this field too.
+ In this case the field "streetNumber" must not be present.
+
+
+
+
+
+
+
+
+
+ The house number. This field is only optional when the house number is passed with
+ the field streetName.
+
+
+
+
+
+
+
+
+
+ Address addon, is only printed in the international area (V53WPAK)
+
+
+
+
+
+
+
+
+
+ DispatchingInformation, is only printed in the international area (V53WPAK)
+
+
+
+
+
+
+
+
+
+
+
+
+ Country.
+
+
+
+
+
+
+ Type of pickup address
+
+
+
+ includes
+
+
+
+ can be
+
+
+
+ Default address
+
+
+
+
+ Packstation address
+
+
+
+
+
+
+
+
+
+ Type of delivery address
+
+
+
+ includes
+
+
+
+ can be
+
+
+
+ Default address
+
+
+
+
+ Postoffice address
+
+
+
+
+ Packstation address
+
+
+
+
+
+
+
+
+
+ Type of bank information
+
+
+
+ includes
+
+
+
+ Name of bank account owner.
+
+
+
+
+
+
+
+
+
+ Name of bank.
+
+
+
+
+
+
+
+
+
+ IBAN code of bank account.
+
+
+
+
+
+
+
+
+
+ Purpose of bank information.
+
+
+
+
+
+
+
+
+
+ Purpose of bank information.
+
+
+
+
+
+
+
+
+
+ Bank-Information-Code (BankCCL) of bank account.
+
+
+
+
+
+
+
+
+
+ Accountreferece to customer profile
+
+
+
+
+
+
+
+
+
+
+
+ Type of name
+
+
+
+ includes
+
+
+
+
+
+
+
+
+ Type of name
+
+
+
+ includes
+
+
+
+ Name of receiver (first part)
+
+
+
+
+
+
+
+
+
+
+
+ Name of receiver (first part)
+
+
+
+
+
+
+
+
+
+ Name of company (second part).
+
+
+
+
+
+
+
+
+
+ Name of company (third part).
+
+
+
+
+
+
+
+
+
+ Type of communication.
+
+
+
+ includes
+
+
+
+ Phone number.
+
+ If you are using delivery type CDP, the phone number and/or e-mail address are mandatory
+
+
+
+
+
+
+
+
+
+ Emailaddress.
+
+ If you are using delivery type CDP, the phone number and/or e-mail address are mandatory
+
+
+
+
+
+
+
+
+
+ First name and last name of contact person.
+
+
+
+
+
+
+
+
+
+
+
+ Type of contact.
+
+
+
+ includes
+
+
+
+ Contact communication information.
+
+
+
+
+ Contact address.
+
+
+
+
+ Contact name.
+
+
+
+
+
+
+ Type of packstation.
+
+
+
+ includes
+
+
+
+ Post Nummer of the receiver, if not set receiver e-mail and/or mobilephone number needs to be set. When sending to a packstation with "DHL Paket" (V01PAK), the postnumber must always be entered.
+
+
+
+
+
+
+
+
+
+
+ Number of the Packstation.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Type of Postfiliale
+
+
+
+ includes
+
+
+
+ Number of the postfiliale
+
+
+
+
+
+
+
+
+
+
+ Post Nummer of the receiver
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Type of Postfiliale
+
+
+
+ includes
+
+
+
+ Number of the postfiliale
+
+
+
+
+
+
+
+
+
+
+ Post Nummer of the receiver or receiver e-mail-adress.
+
+
+
+
+
+
+
+
+
+
+
+
+ Country.
+
+
+
+
+
+
+ Type of ParcelShop (Receiver is in Europe)
+
+
+
+ includes
+
+
+
+ Number of the ParcelShop
+
+
+
+
+
+
+
+
+
+
+ Name of street of the ParcelShop
+
+
+
+
+
+
+
+
+
+ House number of the ParcelShop
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Type of customer
+
+
+
+ includes
+
+
+
+ Name of customer.
+
+
+
+
+ VAT id.
+
+
+
+
+
+ Address of customer
+
+
+
+
+ Contact information
+
+
+
+
+ Bank information
+
+
+
+
+ Additional notes
+
+
+
+
+
+
+ Type of error
+
+
+
+ includes
+
+
+
+ Priority (e.g. error, warnung, .....)
+
+
+
+
+ Code
+
+
+
+
+ Occurence
+
+
+
+
+ Short description
+
+
+
+
+ Detailed description
+
+
+
+
+ Suggested solution
+
+
+
+
+ Name of application
+
+
+
+
+ Module name
+
+
+
+
+
+
+ Type of zip code
+
+
+
+
+
+
+
+ Type of country
+
+
+
+ includes
+
+
+
+ Name of country.
+
+
+
+
+
+
+
+
+
+ Country's ISO-Code (ISO-2-Alpha).
+
+
+
+
+ Name of state.
+
+
+
+
+
+
+
+
+
+
+
+ Type of shipment number
+
+
+
+ can be
+
+
+
+
+
+
+ part of webservice response
+
+
+
+
+ includes
+
+
+
+ statuscode value.
+
+
+
+
+
+
+
+
+
+ description corresponding to the statuscode
+
+
+
+
+
+
+
+
+
+
+
+
+ DHL product Key.
+
+
+
+
+
+
+
+
+
+
+ Package dimensions (length, width, height)
+
+
+
+
+ includes
+
+
+
+ length of package
+
+
+
+
+ width of package
+
+
+
+
+ height of package
+
+
+
+
+ unit for all measures
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Time Frame in which actions should affect
+
+
+
+
+ includes
+
+
+
+ begin of timeframe
+
+
+
+
+ end of timeframe
+
+
+
+
+
+
+
+ Can contain any DHL shipmentnumber.
+
+
+
+
+
+
+
+
diff --git a/classes/Carrier/Dhl/Wsdl/geschaeftskundenversand-api-3.4.0.wsdl b/classes/Carrier/Dhl/Wsdl/geschaeftskundenversand-api-3.4.0.wsdl
new file mode 100644
index 00000000..9a0fc217
--- /dev/null
+++ b/classes/Carrier/Dhl/Wsdl/geschaeftskundenversand-api-3.4.0.wsdl
@@ -0,0 +1,340 @@
+
+
+
+
+
+
+
+
+
+ The authentication data.
+
+
+
+ The shipmentdata for creating a shipment.
+
+
+
+ The status of the createShipment operation and the identifier for the
+ shipment.
+
+
+
+ The shipmentdata for validating a shipment.
+
+
+
+ The status of the validateShipment operation and the identifier for the
+ shipment.
+
+
+
+ The identifier for the shipment which should be
+ deleted.
+
+
+
+ The status of the deletion operation.
+
+
+
+ The identifier for the shipment which should be
+ manifested.
+
+
+
+ The status of the manifest operation.
+
+
+
+ The identifier for the DD shipment for which the label url is
+ requested.
+
+
+
+ The status of the operation and the label url (if
+ available).
+
+
+
+ The version of webservice implementation.
+
+
+
+ The version of webservice implementation.
+
+
+
+ The identifier for the DD shipment for which the label url is
+ requested.
+
+
+
+ The status of the operation and the label url (if
+ available).
+
+
+
+ Request a manifest of the given date / date range.
+
+
+
+ The status of the operation and the manifest url (if
+ available).
+
+
+
+ Request a manifest of the given date / date range.
+
+
+
+ The status of the operation and the manifest url (if
+ available).
+
+
+
+ The status of the operation and the manifest url (if
+ available).
+
+
+
+
+ Creates shipments.
+
+ The shipment data.
+
+
+ The status of the createShipment operation and the identifier for the
+ shipment.
+
+
+
+ Creates shipments.
+
+ The shipment data.
+
+
+ The status of the validateShipment operation and the identifier for the
+ shipment.
+
+
+
+ Deletes the requested shipments.
+
+ The identifier for the shipment which should be
+ deleted.
+
+
+ The status of the deletion operation.
+
+
+
+ Manifest the requested DD shipments.
+
+ The identifier for the shipment which should be
+ manifested.
+
+
+ The status of the manifest operation.
+
+
+
+ Returns the request-url for getting a label.
+
+ The identifier for the shipment for which the label url is
+ requested.
+
+
+ The status of the operation and the label url (if
+ available).
+
+
+
+ Returns the actual version of the implementation of the whole ISService
+ webservice.
+
+
+ The version of webservice implementation.
+
+
+
+ Returns the request-url for getting a export
+ document.
+
+ The identifier for the shipment for which the export document url is
+ requested.
+
+
+ The status of the operation and the export document url (if
+ available).
+
+
+
+ Request the manifest.
+
+ The request data.
+
+
+ The status of the getManifest operation and the manifest
+ url.
+
+
+
+ Updates a shipment order.
+
+ The shipment data.
+
+
+ The status of the updateShipment operation and the identifier for the
+ shipment.
+
+
+
+
+
+
+ Creates shipments.
+
+
+ The authentication data and the shipment data.
+
+
+
+
+ The status of the operation and the shipment
+ identifier.
+
+
+
+
+ Validates shipments.
+
+
+ The authentication data and the shipment data.
+
+
+
+
+ The status of the operation and the shipment
+ identifier.
+
+
+
+
+ Deletes the requested shipments.
+
+
+ The authentication data and the shipment
+ identifier.
+
+
+
+
+ The status of the operation.
+
+
+
+
+ Manifest the requested shipments.
+
+
+ The authentication data and the shipment
+ identifier.
+
+
+
+
+ The status of the operation.
+
+
+
+
+ Returns the request-url for getting a label.
+
+
+ The authentication data and the shipment
+ identifier.
+
+
+
+
+ The status of the operation and the url for requesting the
+ label.
+
+
+
+
+ Returns the actual version of the implementation of the whole ISService
+ webservice.
+
+
+
+
+
+ The version of the implementation.
+
+
+
+
+ Returns the request-url for getting a export
+ document.
+
+
+ The authentication data and the shipment
+ identifier.
+
+
+
+
+ The status of the operation and the url for requesting the export
+ document.
+
+
+
+
+ Requests the manifest.
+
+
+ The authentication data and the shipment data.
+
+
+
+
+ The status of the operation and the manifest url.
+
+
+
+
+ Updates a shipment order.
+
+
+ The authentication data and the shipment data.
+
+
+
+
+ The status of the operation
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/classes/Carrier/SendCloud/Data/Document.php b/classes/Carrier/SendCloud/Data/Document.php
new file mode 100644
index 00000000..023b6176
--- /dev/null
+++ b/classes/Carrier/SendCloud/Data/Document.php
@@ -0,0 +1,31 @@
+Type = $data->type;
+ $obj->Size = $data->size;
+ $obj->Link = $data->link;
+ return $obj;
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/SendCloud/Data/ParcelBase.php b/classes/Carrier/SendCloud/Data/ParcelBase.php
new file mode 100644
index 00000000..e3c16de7
--- /dev/null
+++ b/classes/Carrier/SendCloud/Data/ParcelBase.php
@@ -0,0 +1,42 @@
+ $this->Name,
+ 'company_name' => $this->CompanyName,
+ 'address' => $this->Address,
+ 'address_2' => $this->Address2,
+ 'house_number' => $this->HouseNumber,
+ 'city' => $this->City,
+ 'postal_code' => $this->PostalCode,
+ 'telephone' => $this->Telephone,
+ 'request_label' => $this->RequestLabel,
+ 'email' => $this->EMail,
+ 'country' => $this->Country,
+ 'shipment' => ['id' => $this->ShippingMethodId],
+ 'weight' => number_format($this->Weight / 1000, 3, '.', null),
+ 'order_number' => $this->OrderNumber,
+ 'total_order_value_currency' => $this->TotalOrderValueCurrency,
+ 'total_order_value' => number_format($this->TotalOrderValue, 2, '.', null),
+ 'country_state' => $this->CountryState,
+ 'sender_address' => $this->SenderAddressId,
+ 'customs_invoice_nr' => $this->CustomsInvoiceNr,
+ 'customs_shipment_type' => $this->CustomsShipmentType,
+ 'external_reference' => $this->ExternalReference,
+ 'total_insured_value' => $this->TotalInsuredValue ?? 0,
+ 'parcel_items' => array_map(fn(ParcelItem $item)=>$item->toApiRequest(), $this->ParcelItems),
+ 'is_return' => $this->IsReturn,
+ 'length' => $this->Length,
+ 'width' => $this->Width,
+ 'height' => $this->Height,
+ ];
+ }
+
+}
\ No newline at end of file
diff --git a/classes/Carrier/SendCloud/Data/ParcelCreationError.php b/classes/Carrier/SendCloud/Data/ParcelCreationError.php
new file mode 100644
index 00000000..0d202b6d
--- /dev/null
+++ b/classes/Carrier/SendCloud/Data/ParcelCreationError.php
@@ -0,0 +1,16 @@
+ $this->HsCode,
+ 'weight' => number_format($this->Weight / 1000, 3, '.', null),
+ 'quantity' => $this->Quantity,
+ 'description' => $this->Description,
+ 'value' => $this->Price,
+ 'origin_country' => $this->OriginCountry,
+ 'sku' => $this->Sku ?? '',
+ 'product_id' => $this->ProductId ?? '',
+ ];
+ }
+
+ public static function fromApiResponse(object $data): ParcelItem
+ {
+ $obj = new ParcelItem();
+ $obj->HsCode = $data->hs_code;
+ $obj->Weight = intval(floatval($data->weight)*1000);
+ $obj->Quantity = $data->quantity;
+ $obj->Description = $data->description;
+ $obj->Price = $data->value;
+ $obj->OriginCountry = $data->origin_country;
+ $obj->Sku = $data->sku;
+ $obj->ProductId = $data->product_id;
+ return $obj;
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/SendCloud/Data/ParcelResponse.php b/classes/Carrier/SendCloud/Data/ParcelResponse.php
new file mode 100644
index 00000000..9fbec442
--- /dev/null
+++ b/classes/Carrier/SendCloud/Data/ParcelResponse.php
@@ -0,0 +1,82 @@
+Documents as $item)
+ if ($item->Type == $type)
+ return $item;
+ return null;
+ }
+
+ /**
+ * @throws Exception
+ */
+ public static function fromApiResponse(object $data): ParcelResponse
+ {
+ $obj = new ParcelResponse();
+ $obj->Address = $data->address_divided->street;
+ $obj->Address2 = $data->address_2;
+ $obj->HouseNumber = $data->address_divided->house_number;
+ $obj->CarrierCode = $data->carrier->code;
+ $obj->City = $data->city;
+ $obj->CompanyName = $data->company_name;
+ $obj->Country = $data->country->iso_2;
+ $obj->CustomsInvoiceNr = $data->customs_invoice_nr;
+ $obj->CustomsShipmentType = $data->customs_shipment_type;
+ $obj->DateCreated = new DateTimeImmutable($data->date_created);
+ $obj->DateUpdated = new DateTimeImmutable($data->date_updated);
+ $obj->DateAnnounced = new DateTimeImmutable($data->date_announced);
+ $obj->EMail = $data->email;
+ $obj->Id = $data->id;
+ $obj->Name = $data->name;
+ $obj->OrderNumber = $data->order_number;
+ $obj->ParcelItems = array_map(fn($item)=>ParcelItem::fromApiResponse($item), $data->parcel_items);
+ $obj->PostalCode = $data->postal_code;
+ $obj->ExternalReference = $data->external_reference;
+ $obj->ShippingMethodId = $data->shipment->id;
+ $obj->ShipmentMethodName = $data->shipment->name;
+ $obj->StatusId = $data->status->id;
+ $obj->StatusMessage = $data->status->message;
+ $obj->Documents = array_map(fn($item)=>Document::fromApiResponse($item), $data->documents);
+ $obj->Telephone = $data->telephone;
+ $obj->TotalInsuredValue = $data->total_insured_value;
+ $obj->TotalOrderValue = $data->total_order_value;
+ $obj->TotalOrderValueCurrency = $data->total_order_value_currency;
+ $obj->TrackingNumber = $data->tracking_number;
+ $obj->TrackingUrl = $data->tracking_url;
+ $obj->Weight = $data->weight;
+ $obj->Length = $data->length;
+ $obj->Height = $data->height;
+ $obj->Width = $data->width;
+ $obj->IsReturn = $data->is_return;
+ $obj->Errors = $data->errors->non_field_errors;
+ return $obj;
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/SendCloud/Data/SenderAddress.php b/classes/Carrier/SendCloud/Data/SenderAddress.php
new file mode 100644
index 00000000..6e249d64
--- /dev/null
+++ b/classes/Carrier/SendCloud/Data/SenderAddress.php
@@ -0,0 +1,59 @@
+CompanyName; $this->ContactName; $this->Street $this->HouseNumber; $this->PostalCode; $this->City";
+ }
+
+
+ public static function fromApiResponse(object $data): SenderAddress {
+ $obj = new SenderAddress();
+ $obj->City = $data->city;
+ $obj->CompanyName = $data->company_name;
+ $obj->ContactName = $data->contact_name;
+ $obj->Country = $data->country;
+ $obj->CountryState = $data->country_state;
+ $obj->Email = $data->email;
+ $obj->HouseNumber = $data->house_number;
+ $obj->Id = $data->id;
+ $obj->PostalBox = $data->postal_box;
+ $obj->PostalCode = $data->postal_code;
+ $obj->Street = $data->street;
+ $obj->Telephone = $data->telephone;
+ $obj->VatNumber = $data->vat_number;
+ $obj->EoriNumber = $data->eori_number;
+ $obj->BrandId = $data->brand_id;
+ $obj->Label = $data->label;
+ $obj->SignatureFullName = $data->signature_full_name;
+ $obj->SignatureInitials = $data->signature_initials;
+ return $obj;
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/SendCloud/Data/ShippingMethod.php b/classes/Carrier/SendCloud/Data/ShippingMethod.php
new file mode 100644
index 00000000..53b3bfd4
--- /dev/null
+++ b/classes/Carrier/SendCloud/Data/ShippingMethod.php
@@ -0,0 +1,35 @@
+Id = $data->id;
+ $obj->Name = $data->name;
+ $obj->Carrier = $data->carrier ?? null;
+ $obj->MinWeight = $data->properties->min_weight;
+ $obj->MaxWeight = $data->properties->max_weight;
+ $obj->MaxLength = $data->properties->max_dimensions->length;
+ $obj->MaxWidth = $data->properties->max_dimensions->width;
+ $obj->MaxHeight = $data->properties->max_dimensions->height;
+ $obj->Unit = $data->properties->max_dimensions->unit;
+ return $obj;
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/SendCloud/Data/ShippingProduct.php b/classes/Carrier/SendCloud/Data/ShippingProduct.php
new file mode 100644
index 00000000..77d5fa98
--- /dev/null
+++ b/classes/Carrier/SendCloud/Data/ShippingProduct.php
@@ -0,0 +1,35 @@
+Name = $data->name;
+ $obj->Carrier = $data->carrier;
+ $obj->ServicePointsCarrier = $data->service_points_carrier;
+ $obj->Code = $data->code;
+ $obj->MinWeight = $data->weight_range->min_weight;
+ $obj->MaxWeight = $data->weight_range->max_weight;
+ foreach ($data->methods as $method) {
+ $child = ShippingMethod::fromApiResponse($method);
+ $child->Carrier = $obj->Carrier;
+ $obj->ShippingMethods[] = $child;
+ }
+ return $obj;
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/SendCloud/SendCloudApi.php b/classes/Carrier/SendCloud/SendCloudApi.php
new file mode 100644
index 00000000..dc05a05a
--- /dev/null
+++ b/classes/Carrier/SendCloud/SendCloudApi.php
@@ -0,0 +1,163 @@
+public_key = $public_key;
+ $this->private_key = $private_key;
+ }
+
+ /**
+ * @throws SendcloudApiException
+ */
+ public function GetSenderAddresses(): array
+ {
+ $uri = self::PROD_BASE_URI . '/user/addresses/sender';
+ $response = $this->sendRequest($uri);
+ foreach ($response['body']->sender_addresses as $item)
+ $res[] = SenderAddress::fromApiResponse($item);
+ return $res ?? [];
+ }
+
+ /**
+ * @throws SendcloudApiException
+ */
+ public function GetShippingProducts(string $sourceCountry, ?string $targetCountry = null, ?int $weight = null,
+ ?int $height = null, ?int $length = null, ?int $width = null): array
+ {
+ $uri = self::PROD_BASE_URI . '/shipping-products';
+ $params = ['from_country' => $sourceCountry];
+ if ($targetCountry !== null)
+ $params['to_country'] = $targetCountry;
+ if ($weight !== null && $weight > 0)
+ $params['weight'] = $weight;
+ if ($height !== null && $height > 0) {
+ $params['height'] = $height;
+ $params['height_unit'] = 'centimeter';
+ }
+ if ($length !== null && $length > 0) {
+ $params['length'] = $length;
+ $params['length_unit'] = 'centimeter';
+ }
+ if ($width !== null && $width > 0) {
+ $params['width'] = $width;
+ $params['width_unit'] = 'centimeter';
+ }
+ $response = $this->sendRequest($uri, $params);
+ return array_map(fn($x) => ShippingProduct::fromApiResponse($x), $response['body'] ?? []);
+ }
+
+ /**
+ * @throws SendcloudApiException
+ */
+ public function CreateParcel(ParcelCreation $parcel): ParcelResponse|string|null
+ {
+ $uri = self::PROD_BASE_URI . '/parcels';
+ $response = $this->sendRequest($uri, null, true, ['parcel' => $parcel->toApiRequest()], [200,400]);
+ switch ($response['code']) {
+ case 200:
+ if (isset($response['body']->parcel))
+ try {
+ return ParcelResponse::fromApiResponse($response['body']->parcel);
+ } catch (Exception $e) {
+ throw new SendcloudApiException(previous: $e);
+ }
+ break;
+ case 400:
+ if (isset($response->error))
+ return $response->error->message;
+ break;
+ }
+ throw SendcloudApiException::fromResponse($response);
+ }
+
+ /**
+ * @throws SendcloudApiException
+ */
+ public function DownloadDocument(Document $document): string
+ {
+ $curl = curl_init();
+ curl_setopt_array($curl, [
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_URL => $document->Link,
+ CURLOPT_HTTPHEADER => [
+ "Authorization: Basic " . base64_encode($this->public_key . ':' . $this->private_key)
+ ],
+ ]);
+ $output = curl_exec($curl);
+ $code = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
+ if ($code != 200)
+ throw SendcloudApiException::fromResponse(['code' => $code, 'body' => $output]);
+ return $output;
+ }
+
+ /**
+ * @throws SendcloudApiException
+ */
+ function sendRequest(string $uri, array $query_params = null, bool $post = false, array $postFields = null,
+ array $allowedResponseCodes = [200]): ?array
+ {
+ if (empty($this->public_key) || empty($this->private_key))
+ return null;
+
+ $curl = curl_init();
+ if (is_array($query_params)) {
+ $uri .= '?' . http_build_query($query_params);
+ }
+ curl_setopt_array($curl, [
+ CURLOPT_RETURNTRANSFER => 1,
+ CURLOPT_URL => $uri,
+ CURLOPT_HTTPHEADER => [
+ "Authorization: Basic " . base64_encode($this->public_key . ':' . $this->private_key),
+ 'Content-Type: application/json'
+ ],
+ ]);
+ if ($post === true) {
+ curl_setopt_array($curl, [
+ CURLOPT_POST => true,
+ CURLOPT_POSTFIELDS => json_encode($postFields)
+ ]);
+ }
+
+ $output = json_decode(curl_exec($curl));
+ $code = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
+ curl_close($curl);
+
+ $ret = [
+ 'code' => $code,
+ 'body' => $output,
+ ];
+
+ if (!in_array($code, $allowedResponseCodes))
+ throw SendcloudApiException::fromResponse($ret);
+
+ return $ret;
+ }
+}
\ No newline at end of file
diff --git a/classes/Carrier/SendCloud/SendcloudApiException.php b/classes/Carrier/SendCloud/SendcloudApiException.php
new file mode 100644
index 00000000..effcc1a1
--- /dev/null
+++ b/classes/Carrier/SendCloud/SendcloudApiException.php
@@ -0,0 +1,24 @@
+Id = $id;
+ $obj->Name = $name;
+ return $obj;
+ }
+
+ public function WithLength(float $min, float $max): Product {
+ $this->LengthMin = $min;
+ $this->LengthMax = $max;
+ return $this;
+ }
+
+ public function WithWidth(float $min, float $max): Product {
+ $this->WidthMin = $min;
+ $this->WidthMax = $max;
+ return $this;
+ }
+
+ public function WithHeight(float $min, float $max): Product {
+ $this->HeightMin = $min;
+ $this->HeightMax = $max;
+ return $this;
+ }
+
+ public function WithWeight(float $min, float $max): Product {
+ $this->WeightMin = $min;
+ $this->WeightMax = $max;
+ return $this;
+ }
+
+ public function WithServices(array $services): Product {
+ $this->AvailableServices = $services;
+ return $this;
+ }
+}
\ No newline at end of file
diff --git a/classes/Modules/ShippingMethod/www/js/shipping_method_create.js b/classes/Modules/ShippingMethod/www/js/shipping_method_create.js
index a7b6a50e..7654263a 100644
--- a/classes/Modules/ShippingMethod/www/js/shipping_method_create.js
+++ b/classes/Modules/ShippingMethod/www/js/shipping_method_create.js
@@ -1,3 +1,10 @@
+/*
+ * SPDX-FileCopyrightText: 2022 Andreas Palm
+ * SPDX-FileCopyrightText: 2019 Xentral (c) Xentral ERP Software GmbH, Fuggerstrasse 11, D-86150 Augsburg, Germany
+ *
+ * SPDX-License-Identifier: LicenseRef-EGPL-3.1
+ */
+
var ShippingMethodCreate = function ($) {
'use strict';
@@ -11,35 +18,14 @@ var ShippingMethodCreate = function ($) {
vueElementId: '#shipment-create',
},
search: function (el) {
- $.ajax({
- url: 'index.php?module=versandarten&action=create&cmd=suche',
- type: 'POST',
- dataType: 'json',
- data: {
- val: $(el).val()
- }
+ let val = $(el).val().toLowerCase();
+ $('.createbutton').each(function() {
+ let desc = $(this).find('.tilegrid-tile-title').text();
+ if (desc.toLowerCase().indexOf(val)>=0)
+ $(this).show();
+ else
+ $(this).hide();
})
- .done(function (data) {
- if (typeof data != 'undefined' && data != null) {
- if (typeof data.ausblenden != 'undefined' && data.ausblenden != null) {
- me.storage.hideElements = data.ausblenden.split(';');
- $.each(me.storage.hideElements, function (k, v) {
- if (v != '') {
- $('#' + v).hide();
- }
- });
-
- }
- if (typeof data.anzeigen != 'undefined' && data.anzeigen != null) {
- me.storage.showElements = data.anzeigen.split(';');
- $.each(me.storage.showElements, function (k, v) {
- if (v != '') {
- $('#' + v).show();
- }
- });
- }
- }
- });
},
init: function () {
if ($(me.selector.vueElementId).length === 0) {
diff --git a/phpwf/plugins/class.templateparser.php b/phpwf/plugins/class.templateparser.php
index 0c626424..09854989 100644
--- a/phpwf/plugins/class.templateparser.php
+++ b/phpwf/plugins/class.templateparser.php
@@ -1,4 +1,11 @@
-
+*/
+?>
htmlspecialchars($text);
}
- $ret .= '
'.$text.'
';
+ $ret = sprintf('
%s
', $class, $text);
if($_var === 'return')
- {
return $ret;
- }
- return $this->app->Tpl->Add($_var, $ret);
+
+ $this->app->Tpl->Add($_var, $ret);
}
public function addSelect($_var, $id, $name, $options, $selected = '', $class = '')
diff --git a/www/lib/class.erpapi.php b/www/lib/class.erpapi.php
index 5eff2662..4131d029 100644
--- a/www/lib/class.erpapi.php
+++ b/www/lib/class.erpapi.php
@@ -1,4 +1,11 @@
0)
}
//@refactor ApplicationCore
-function LoadVersandModul($modul, $id)
+function LoadVersandModul(string $modul, int $id): Versanddienstleister
{
- if(empty($modul) ||
- strpos($modul,'..') !== false ||
- !@is_file(__DIR__.'/versandarten/'.$modul.'.php')
- )
- {
- return;
- }
- $class_name = 'Versandart_'.$modul;
- $class_name_custom = 'Versandart_'.$modul.'Custom';
- if(!class_exists($class_name))
- {
- if(@is_file(__DIR__.'/versandarten/'.$modul.'_custom.php'))
- {
- include_once(__DIR__.'/versandarten/'.$modul.'_custom.php');
- }else{
- include_once(__DIR__.'/versandarten/'.$modul.'.php');
- }
- }
- if(class_exists($class_name_custom))
- {
- return new $class_name_custom($this->app, $id);
- }elseif(class_exists($class_name))
- {
- return new $class_name($this->app, $id);
- }
+ /** @var Versandarten $versandarten */
+ $versandarten = $this->app->loadModule('versandarten');
+ return $versandarten->loadModule($modul, $id);
}
//@refactor versanddiestleister Modul
@@ -15304,131 +15289,131 @@ function Paketmarke($parsetarget,$sid="",$zusatz="",$typ="DHL")
}
}
- if($sid=="versand")
- {
- // falche tracingnummer bei DHL da wir in der Funktion PaketmarkeDHLEmbedded sind
- if((strlen($tracking) < 12 || strlen($tracking) > 21) && $trackingsubmitcancel=="" && ($typ=="DHL" || $typ=="Intraship"))
+ if($sid=="versand")
{
- header("Location: index.php?module=versanderzeugen&action=frankieren&id=$id&land=$land&tracking_again=1");
- exit;
- }
- else
- {
-/* $versandartenmodul = $this->app->DB->SelectArr("SELECT id, modul,bezeichnung FROM versandarten WHERE aktiv = 1 AND ausprojekt = 0 AND type = '".$this->app->DB->real_escape_string($typ)."' AND modul != '' AND (projekt = 0 OR projekt = '$projekt') ORDER BY projekt DESC LIMIT 1");
- if($versandartenmodul && @is_file(dirname(__FILE__).'/versandarten/'.$versandartenmodul[0]['modul'].'.php'))
+ // falche tracingnummer bei DHL da wir in der Funktion PaketmarkeDHLEmbedded sind
+ if((strlen($tracking) < 12 || strlen($tracking) > 21) && $trackingsubmitcancel=="" && ($typ=="DHL" || $typ=="Intraship"))
{
- $obj = $this->LoadVersandModul($versandartenmodul[0]['modul'], $versandartenmodul[0]['id']);
- if(!empty($obj) && method_exists($obj, 'TrackingReplace'))
- {
- $tracking = $obj->TrackingReplace($tracking);
- }
+ header("Location: index.php?module=versanderzeugen&action=frankieren&id=$id&land=$land&tracking_again=1");
+ exit;
}
+ else
+ {
+ /* $versandartenmodul = $this->app->DB->SelectArr("SELECT id, modul,bezeichnung FROM versandarten WHERE aktiv = 1 AND ausprojekt = 0 AND type = '".$this->app->DB->real_escape_string($typ)."' AND modul != '' AND (projekt = 0 OR projekt = '$projekt') ORDER BY projekt DESC LIMIT 1");
+ if($versandartenmodul && @is_file(dirname(__FILE__).'/versandarten/'.$versandartenmodul[0]['modul'].'.php'))
+ {
+ $obj = $this->LoadVersandModul($versandartenmodul[0]['modul'], $versandartenmodul[0]['id']);
+ if(!empty($obj) && method_exists($obj, 'TrackingReplace'))
+ {
+ $tracking = $obj->TrackingReplace($tracking);
+ }
+ }
*/
- $trackingUser = !empty($this->app->User) && method_exists($this->app->User,'GetParameter')?
- $this->app->User->GetParameter('versand_lasttracking'):'';
+ $trackingUser = !empty($this->app->User) && method_exists($this->app->User,'GetParameter')?
+ $this->app->User->GetParameter('versand_lasttracking'):'';
- if(!empty($trackingUser) && in_array($trackingUser,[$trackingBefore,$tracking])) {
- $this->app->User->SetParameter('versand_lasttracking','');
- $this->app->User->SetParameter('versand_lasttracking_link','');
- $this->app->User->SetParameter('versand_lasttracking_versand', '');
- $this->app->User->SetParameter('versand_lasttracking_lieferschein', '');
- }
+ if(!empty($trackingUser) && in_array($trackingUser,[$trackingBefore,$tracking])) {
+ $this->app->User->SetParameter('versand_lasttracking','');
+ $this->app->User->SetParameter('versand_lasttracking_link','');
+ $this->app->User->SetParameter('versand_lasttracking_versand', '');
+ $this->app->User->SetParameter('versand_lasttracking_lieferschein', '');
+ }
- $this->app->DB->Update("UPDATE versand SET versandunternehmen='$versand', tracking='$tracking',
- versendet_am=NOW(),versendet_am_zeitstempel=NOW(), abgeschlossen='1',logdatei=NOW() WHERE id='$id' LIMIT 1");
- if($lieferschein = $this->app->DB->Select("SELECT lieferschein FROM versand WHERE id = '$id' LIMIT 1")) {
- $this->app->erp->LieferscheinProtokoll($lieferschein,'Verarbeitung im Versandzentrum');
- }
- $rechnung = $this->app->DB->Select("SELECT rechnung FROM versand WHERE id = '$id' LIMIT 1");
- if($lieferschein && ($auftrag = $this->app->DB->Select("SELECT auftragid FROM lieferschein WHERE id = '$lieferschein'"))) {
- $this->app->erp->AuftragProtokoll($auftrag,'Verarbeitung im Versandzentrum');
+ $this->app->DB->Update("UPDATE versand SET versandunternehmen='$versand', tracking='$tracking',
+ versendet_am=NOW(),versendet_am_zeitstempel=NOW(), abgeschlossen='1',logdatei=NOW() WHERE id='$id' LIMIT 1");
+ if($lieferschein = $this->app->DB->Select("SELECT lieferschein FROM versand WHERE id = '$id' LIMIT 1")) {
+ $this->app->erp->LieferscheinProtokoll($lieferschein,'Verarbeitung im Versandzentrum');
+ }
+ $rechnung = $this->app->DB->Select("SELECT rechnung FROM versand WHERE id = '$id' LIMIT 1");
+ if($lieferschein && ($auftrag = $this->app->DB->Select("SELECT auftragid FROM lieferschein WHERE id = '$lieferschein'"))) {
+ $this->app->erp->AuftragProtokoll($auftrag,'Verarbeitung im Versandzentrum');
- if(empty($rechnung)) {
- $rechnung = $this->app->DB->Select(
- sprintf(
- "SELECT id FROM rechnung WHERE auftragid = %d AND status <> 'storniert' AND belegnr <> '' LIMIT 1",
- $auftrag
- )
- );
- if($rechnung) {
- $this->app->DB->Update(
+ if(empty($rechnung)) {
+ $rechnung = $this->app->DB->Select(
sprintf(
- 'UPDATE versand SET rechnung = %d WHERE id = %d AND rechnung = 0',
- $rechnung, $id
+ "SELECT id FROM rechnung WHERE auftragid = %d AND status <> 'storniert' AND belegnr <> '' LIMIT 1",
+ $auftrag
)
);
+ if($rechnung) {
+ $this->app->DB->Update(
+ sprintf(
+ 'UPDATE versand SET rechnung = %d WHERE id = %d AND rechnung = 0',
+ $rechnung, $id
+ )
+ );
+ }
}
}
- }
- $projekt = $this->app->DB->Select("SELECT projekt FROM lieferschein WHERE id = '$lieferschein' LIMIT 1");
- if($lieferschein) {
+ $projekt = $this->app->DB->Select("SELECT projekt FROM lieferschein WHERE id = '$lieferschein' LIMIT 1");
+ if($lieferschein) {
- $this->PDFArchivieren('lieferschein', $lieferschein, true);
- }
- $proformaPrinted = false;
- $druckennachtracking = $this->app->erp->Projektdaten($projekt,'druckennachtracking');
- if($druckennachtracking
- && !($proformarechnung = $this->app->DB->Select(
- sprintf(
- 'SELECT id FROM proformarechnung WHERE lieferschein = %d LIMIT 1',
- $lieferschein
+ $this->PDFArchivieren('lieferschein', $lieferschein, true);
+ }
+ $proformaPrinted = false;
+ $druckennachtracking = $this->app->erp->Projektdaten($projekt,'druckennachtracking');
+ if($druckennachtracking
+ && !($proformarechnung = $this->app->DB->Select(
+ sprintf(
+ 'SELECT id FROM proformarechnung WHERE lieferschein = %d LIMIT 1',
+ $lieferschein
+ )
)
- )
- )
- ) {
- /** @var Versanderzeugen $versandObj */
- $versandObj = $this->LoadModul('versanderzeugen');
- if($versandObj !== null && method_exists($versandObj, 'checkPrintCreateProformaInvoice')) {
- $druckercode = $this->app->DB->Select("SELECT druckerlogistikstufe2 FROM projekt WHERE id='$projekt' LIMIT 1");
+ )
+ ) {
+ /** @var Versanderzeugen $versandObj */
+ $versandObj = $this->LoadModul('versanderzeugen');
+ if($versandObj !== null && method_exists($versandObj, 'checkPrintCreateProformaInvoice')) {
+ $druckercode = $this->app->DB->Select("SELECT druckerlogistikstufe2 FROM projekt WHERE id='$projekt' LIMIT 1");
- if($druckercode <=0) {
- $druckercode = $this->app->erp->Firmendaten('standardversanddrucker'); // standard = 3 // 2 buchhaltung // 1 empfang
+ if($druckercode <=0) {
+ $druckercode = $this->app->erp->Firmendaten('standardversanddrucker'); // standard = 3 // 2 buchhaltung // 1 empfang
+ }
+ $userversanddrucker = $this->app->DB->Select("SELECT standardversanddrucker FROM user WHERE id='".$this->app->User->GetID()."'");
+ if($userversanddrucker>0) {
+ $druckercode = $userversanddrucker;
+ }
+ $deliveryArr = $this->app->DB->SelectRow(
+ sprintf('SELECT land FROM lieferschein WHERE id = %d', $lieferschein)
+ );
+ $country = $deliveryArr['land'];
+ $versandObj->checkPrintCreateProformaInvoice($lieferschein,$country,$projekt,$druckercode,true);
+ $proformaPrinted = $druckercode > 0;
}
- $userversanddrucker = $this->app->DB->Select("SELECT standardversanddrucker FROM user WHERE id='".$this->app->User->GetID()."'");
- if($userversanddrucker>0) {
- $druckercode = $userversanddrucker;
- }
- $deliveryArr = $this->app->DB->SelectRow(
- sprintf('SELECT land FROM lieferschein WHERE id = %d', $lieferschein)
+ }
+ if($rechnung) {
+ $this->PDFArchivieren('rechnung', $rechnung, true);
+ }
+ elseif($auftrag && $druckennachtracking
+ && $this->app->DB->Select(
+ sprintf(
+ "SELECT id FROM auftrag WHERE id = %d AND art <> 'lieferung'",
+ $auftrag
+ )
+ )
+ ) {
+ $rechnung = $this->WeiterfuehrenAuftragZuRechnung($auftrag);
+ $this->BelegFreigabe('rechnung', $rechnung);
+ $this->app->DB->Update(
+ sprintf(
+ 'UPDATE versand SET rechnung = %d WHERE id = %d LIMIT 1',
+ $rechnung, $id
+ )
);
- $country = $deliveryArr['land'];
- $versandObj->checkPrintCreateProformaInvoice($lieferschein,$country,$projekt,$druckercode,true);
- $proformaPrinted = $druckercode > 0;
+ $this->app->DB->Update(
+ sprintf(
+ "UPDATE rechnung SET schreibschutz = 1, status = 'versendet' WHERE id = %d",
+ $rechnung
+ )
+ );
+ $this->PDFArchivieren('rechnung', $rechnung, true);
}
- }
- if($rechnung) {
- $this->PDFArchivieren('rechnung', $rechnung, true);
- }
- elseif($auftrag && $druckennachtracking
- && $this->app->DB->Select(
- sprintf(
- "SELECT id FROM auftrag WHERE id = %d AND art <> 'lieferung'",
- $auftrag
- )
- )
- ) {
- $rechnung = $this->WeiterfuehrenAuftragZuRechnung($auftrag);
- $this->BelegFreigabe('rechnung', $rechnung);
- $this->app->DB->Update(
- sprintf(
- 'UPDATE versand SET rechnung = %d WHERE id = %d LIMIT 1',
- $rechnung, $id
- )
- );
- $this->app->DB->Update(
- sprintf(
- "UPDATE rechnung SET schreibschutz = 1, status = 'versendet' WHERE id = %d",
- $rechnung
- )
- );
- $this->PDFArchivieren('rechnung', $rechnung, true);
- }
- if($rechnung > 0 && $druckennachtracking
- && $this->app->DB->Select("SELECT count(id) FROM versand WHERE lieferschein = '$lieferschein'") <= 1) {
- $druckercode = $this->app->DB->Select("SELECT druckerlogistikstufe2 FROM projekt WHERE id='$projekt' LIMIT 1");
+ if($rechnung > 0 && $druckennachtracking
+ && $this->app->DB->Select("SELECT count(id) FROM versand WHERE lieferschein = '$lieferschein'") <= 1) {
+ $druckercode = $this->app->DB->Select("SELECT druckerlogistikstufe2 FROM projekt WHERE id='$projekt' LIMIT 1");
if($druckercode <=0)
$druckercode = $this->app->erp->Firmendaten("standardversanddrucker"); // standard = 3 // 2 buchhaltung // 1 empfang
@@ -15437,32 +15422,12 @@ function Paketmarke($parsetarget,$sid="",$zusatz="",$typ="DHL")
if($userversanddrucker>0)
$druckercode = $userversanddrucker;
- $this->app->erp->BriefpapierHintergrundDisable($druckercode);
+ $this->app->erp->BriefpapierHintergrundDisable($druckercode);
- $addressId = $this->app->DB->Select("SELECT `adresse` FROM `rechnung` WHERE `id` = '{$rechnung}' LIMIT 1");
- $printInvoice = $this->app->DB->Select("SELECT `rechnung_papier` FROM `adresse` WHERE `id` = '{$addressId}' LIMIT 1");
- $amountPrintedInvoices = $this->app->DB->Select("SELECT `rechnung_anzahlpapier` FROM `adresse` WHERE `id` = '{$addressId}' LIMIT 1");
- if($printInvoice === '1' && $amountPrintedInvoices > 0){
- if(class_exists('RechnungPDFCustom'))
- {
- $Brief = new RechnungPDFCustom($this->app,$projekt);
- }else{
- $Brief = new RechnungPDF($this->app,$projekt);
- }
- $Brief->GetRechnung($rechnung);
- $tmpfile = $Brief->displayTMP();
-
- for($i = 1; $i <= $amountPrintedInvoices; $i++) {
- $this->app->printer->Drucken($druckercode,$tmpfile);
- }
- } else {
- $autodruckrechnungmenge = $this->app->erp->Projektdaten($projekt,"autodruckrechnungmenge");
- $autodruckrechnung= $this->app->erp->Projektdaten($projekt,"autodruckrechnung");
-
- if($autodruckrechnungmenge < 0)$autodruckrechnungmenge = 1;
-
- if($autodruckrechnung > 0)
- {
+ $addressId = $this->app->DB->Select("SELECT `adresse` FROM `rechnung` WHERE `id` = '{$rechnung}' LIMIT 1");
+ $printInvoice = $this->app->DB->Select("SELECT `rechnung_papier` FROM `adresse` WHERE `id` = '{$addressId}' LIMIT 1");
+ $amountPrintedInvoices = $this->app->DB->Select("SELECT `rechnung_anzahlpapier` FROM `adresse` WHERE `id` = '{$addressId}' LIMIT 1");
+ if($printInvoice === '1' && $amountPrintedInvoices > 0){
if(class_exists('RechnungPDFCustom'))
{
$Brief = new RechnungPDFCustom($this->app,$projekt);
@@ -15472,88 +15437,108 @@ function Paketmarke($parsetarget,$sid="",$zusatz="",$typ="DHL")
$Brief->GetRechnung($rechnung);
$tmpfile = $Brief->displayTMP();
- for($i = 1; $i <= $autodruckrechnungmenge; $i++) {
+ for($i = 1; $i <= $amountPrintedInvoices; $i++) {
$this->app->printer->Drucken($druckercode,$tmpfile);
}
+ } else {
+ $autodruckrechnungmenge = $this->app->erp->Projektdaten($projekt,"autodruckrechnungmenge");
+ $autodruckrechnung= $this->app->erp->Projektdaten($projekt,"autodruckrechnung");
+
+ if($autodruckrechnungmenge < 0)$autodruckrechnungmenge = 1;
+
+ if($autodruckrechnung > 0)
+ {
+ if(class_exists('RechnungPDFCustom'))
+ {
+ $Brief = new RechnungPDFCustom($this->app,$projekt);
+ }else{
+ $Brief = new RechnungPDF($this->app,$projekt);
+ }
+ $Brief->GetRechnung($rechnung);
+ $tmpfile = $Brief->displayTMP();
+
+ for($i = 1; $i <= $autodruckrechnungmenge; $i++) {
+ $this->app->printer->Drucken($druckercode,$tmpfile);
+ }
+ }
}
- }
- // Print additional invoices for export
- $exportdruckrechnung = $this->app->erp->Projektdaten($projekt,"exportdruckrechnung");
- if($exportdruckrechnung)
- {
- $exportland = $this->app->DB->Select("SELECT land FROM rechnung WHERE id = '$rechnung' LIMIT 1");
- $exportdruckrechnung = $this->app->erp->Export($exportland);
+ // Print additional invoices for export
+ $exportdruckrechnung = $this->app->erp->Projektdaten($projekt,"exportdruckrechnung");
if($exportdruckrechnung)
{
- $mengedruck = $this->app->erp->Projektdaten($projekt,"exportdruckrechnungmenge");
- for($mengedruck;$mengedruck > 0;$mengedruck--)
+ $exportland = $this->app->DB->Select("SELECT land FROM rechnung WHERE id = '$rechnung' LIMIT 1");
+ $exportdruckrechnung = $this->app->erp->Export($exportland);
+ if($exportdruckrechnung)
{
- $this->app->printer->Drucken($druckercode,$tmpfile);
+ $mengedruck = $this->app->erp->Projektdaten($projekt,"exportdruckrechnungmenge");
+ for($mengedruck;$mengedruck > 0;$mengedruck--)
+ {
+ $this->app->printer->Drucken($druckercode,$tmpfile);
+ }
}
}
- }
- unlink($tmpfile);
- if($this->app->erp->Projektdaten($projekt,"automailrechnung")=="1")
- {
- // aber nur das erste mal also wenn es einen eintrag in der versand tabelle gibt
- $rechnungbereitsversendet = $this->app->DB->Select("SELECT versendet FROM rechnung WHERE id = '$rechnung' LIMIT 1");
- if($rechnungbereitsversendet!="1")
+ unlink($tmpfile);
+ if($this->app->erp->Projektdaten($projekt,"automailrechnung")=="1")
{
- $this->app->erp->Rechnungsmail($rechnung);
- }
- }
- $this->BriefpapierHintergrundEnable();
- }
-
- if($druckennachtracking && $lieferschein && $this->Export($land)
- && $this->Projektdaten($projekt, 'proformainvoice_amount') && $proformaRechnungId = $this->app->DB->Select(
- sprintf(
- "SELECT id FROM proformarechnung WHERE lieferschein = %d AND status <> 'storniert' LIMIT 1",
- $lieferschein
- ))
- ) {
- /** @var Versanderzeugen $objProforma */
- $objVersand = $this->LoadModul('versanderzeugen');
- if($objVersand && method_exists($objVersand,'checkPrintCreateProformaInvoice')){
- if(empty($druckercode)) {
- $druckercode = $this->app->DB->Select("SELECT druckerlogistikstufe2 FROM projekt WHERE id='$projekt' LIMIT 1");
-
- if($druckercode <= 0) {
- $druckercode = $this->app->erp->Firmendaten('standardversanddrucker'); // standard = 3 // 2 buchhaltung // 1 empfang
- }
- $userversanddrucker = $this->app->DB->Select("SELECT standardversanddrucker FROM user WHERE id='" . $this->app->User->GetID() . "'");
- if($userversanddrucker > 0) {
- $druckercode = $userversanddrucker;
+ // aber nur das erste mal also wenn es einen eintrag in der versand tabelle gibt
+ $rechnungbereitsversendet = $this->app->DB->Select("SELECT versendet FROM rechnung WHERE id = '$rechnung' LIMIT 1");
+ if($rechnungbereitsversendet!="1")
+ {
+ $this->app->erp->Rechnungsmail($rechnung);
}
}
- $objVersand->checkPrintCreateProformaInvoice($lieferschein, $land, $projekt, $druckercode, empty($proformaPrinted));
+ $this->BriefpapierHintergrundEnable();
}
- }
- if(!$this->app->erp->Firmendaten('versandmail_zwischenspeichern') || !$this->app->DB->Select("SELECT id FROM prozessstarter WHERE parameter = 'versandmailsundrueckmeldung' AND aktiv = 1"))
- {
- $this->VersandAbschluss($id);
- $this->RunHook('versanderzeugen_frankieren_hook1', 1, $id);
- //versand mail an kunden
- $this->Versandmail($id);
- }else{
- $this->app->DB->Update("UPDATE versand SET cronjob = 1 WHERE id = '$id' LIMIT 1");
- }
- $weiterespaket=$this->app->Secure->GetPOST("weiterespaket");
- $lieferscheinkopie=$this->app->Secure->GetPOST("lieferscheinkopie");
- if($weiterespaket=="1")
- {
- if($lieferscheinkopie=="1") $lieferscheinkopie=0; else $lieferscheinkopie=1;
- //$this->app->erp->LogFile("Lieferscheinkopie $lieferscheinkopie");
- $all = $this->app->DB->SelectArr("SELECT * FROM versand WHERE id='$id' LIMIT 1");
- $this->app->DB->Insert("INSERT INTO versand (id,adresse,rechnung,lieferschein,versandart,projekt,bearbeiter,versender,versandunternehmen,firma,
- keinetrackingmail,gelesen,paketmarkegedruckt,papieregedruckt,weitererlieferschein)
- VALUES ('','{$all[0]['adresse']}','{$all[0]['rechnung']}','{$all[0]['lieferschein']}','{$all[0]['versandart']}','{$all[0]['projekt']}',
- '{$all[0]['bearbeiter']}','{$all[0]['versender']}','{$all[0]['versandunternehmen']}',
- '{$all[0]['firma']}','{$all[0]['keinetrackingmail']}','{$all[0]['gelesen']}',0,$lieferscheinkopie,1)");
+ if($druckennachtracking && $lieferschein && $this->Export($land)
+ && $this->Projektdaten($projekt, 'proformainvoice_amount') && $proformaRechnungId = $this->app->DB->Select(
+ sprintf(
+ "SELECT id FROM proformarechnung WHERE lieferschein = %d AND status <> 'storniert' LIMIT 1",
+ $lieferschein
+ ))
+ ) {
+ /** @var Versanderzeugen $objProforma */
+ $objVersand = $this->LoadModul('versanderzeugen');
+ if($objVersand && method_exists($objVersand,'checkPrintCreateProformaInvoice')){
+ if(empty($druckercode)) {
+ $druckercode = $this->app->DB->Select("SELECT druckerlogistikstufe2 FROM projekt WHERE id='$projekt' LIMIT 1");
+
+ if($druckercode <= 0) {
+ $druckercode = $this->app->erp->Firmendaten('standardversanddrucker'); // standard = 3 // 2 buchhaltung // 1 empfang
+ }
+ $userversanddrucker = $this->app->DB->Select("SELECT standardversanddrucker FROM user WHERE id='" . $this->app->User->GetID() . "'");
+ if($userversanddrucker > 0) {
+ $druckercode = $userversanddrucker;
+ }
+ }
+ $objVersand->checkPrintCreateProformaInvoice($lieferschein, $land, $projekt, $druckercode, empty($proformaPrinted));
+ }
+ }
+
+ if(!$this->app->erp->Firmendaten('versandmail_zwischenspeichern') || !$this->app->DB->Select("SELECT id FROM prozessstarter WHERE parameter = 'versandmailsundrueckmeldung' AND aktiv = 1"))
+ {
+ $this->VersandAbschluss($id);
+ $this->RunHook('versanderzeugen_frankieren_hook1', 1, $id);
+ //versand mail an kunden
+ $this->Versandmail($id);
+ }else{
+ $this->app->DB->Update("UPDATE versand SET cronjob = 1 WHERE id = '$id' LIMIT 1");
+ }
+ $weiterespaket=$this->app->Secure->GetPOST("weiterespaket");
+ $lieferscheinkopie=$this->app->Secure->GetPOST("lieferscheinkopie");
+ if($weiterespaket=="1")
+ {
+ if($lieferscheinkopie=="1") $lieferscheinkopie=0; else $lieferscheinkopie=1;
+ //$this->app->erp->LogFile("Lieferscheinkopie $lieferscheinkopie");
+ $all = $this->app->DB->SelectArr("SELECT * FROM versand WHERE id='$id' LIMIT 1");
+ $this->app->DB->Insert("INSERT INTO versand (id,adresse,rechnung,lieferschein,versandart,projekt,bearbeiter,versender,versandunternehmen,firma,
+ keinetrackingmail,gelesen,paketmarkegedruckt,papieregedruckt,weitererlieferschein)
+ VALUES ('','{$all[0]['adresse']}','{$all[0]['rechnung']}','{$all[0]['lieferschein']}','{$all[0]['versandart']}','{$all[0]['projekt']}',
+ '{$all[0]['bearbeiter']}','{$all[0]['versender']}','{$all[0]['versandunternehmen']}',
+ '{$all[0]['firma']}','{$all[0]['keinetrackingmail']}','{$all[0]['gelesen']}',0,$lieferscheinkopie,1)");
$newid = $this->app->DB->GetInsertID();
@@ -15591,7 +15576,7 @@ function Paketmarke($parsetarget,$sid="",$zusatz="",$typ="DHL")
$this->app->DB->Insert("INSERT INTO versand (id,versandunternehmen, tracking,
versendet_am,abgeschlossen,retoure,
freigegeben,firma,adresse,projekt,gewicht,paketmarkegedruckt,anzahlpakete)
- VALUES ('','$versand','$tracking',NOW(),1,'$id',1,'".$this->app->User->GetFirma()."','$adresse','$projekt','$kg','1','1') ");
+ VALUES ('','$versand','$tracking',NOW(),1,'$id',1,'".$this->app->User->GetFirma()."','$adresse','$projekt','$kg','1','1') ");
$versandid = $this->app->DB->GetInsertID();
if($this->app->DB->Select("SELECT automailversandbestaetigung FROM projekt WHERE id = '$projekt' LIMIT 1"))$this->Versandmail($versandid);
@@ -15620,23 +15605,6 @@ function Paketmarke($parsetarget,$sid="",$zusatz="",$typ="DHL")
if($kg=="") {
$kg = $this->VersandartMindestgewicht($id);
}
-/*
- //Brauchen wir nicht
- $versandartenmodul = $this->app->DB->SelectArr("SELECT id, modul,bezeichnung FROM versandarten WHERE aktiv = 1 AND ausprojekt = 0 AND type = '".$this->app->DB->real_escape_string($versand)."' AND modul != '' AND (projekt = 0 OR projekt = '$projekt') ORDER BY projekt DESC LIMIT 1");
- if($versandartenmodul && @is_file(dirname(__FILE__).'/versandarten/'.$versandartenmodul[0]['modul'].'.php'))
- {
- $class_name = 'Versandart_'.$versandartenmodul[0]['modul'];
- if(!class_exists($class_name))include_once(dirname(__FILE__).'/versandarten/'.$versandartenmodul[0]['modul'].'.php');
- if(class_exists($class_name))
- {
- $obj = new $class_name($this->app, $versandartenmodul[0]['id']);
- if(method_exists($obj, 'TrackingReplace')){
- $tracking = $obj->TrackingReplace($tracking);
- }
- }
- }
-*/
-
$trackingUser = !empty($this->app->User) && method_exists($this->app->User,'GetParameter')?
$this->app->User->GetParameter('versand_lasttracking'):'';
@@ -15647,9 +15615,9 @@ function Paketmarke($parsetarget,$sid="",$zusatz="",$typ="DHL")
$this->app->User->SetParameter('versand_lasttracking_lieferschein', '');
}
- $this->app->DB->Insert("INSERT INTO versand (id,versandunternehmen, tracking, tracking_link,
- versendet_am,abgeschlossen,lieferschein,
- freigegeben,firma,adresse,projekt,gewicht,paketmarkegedruckt,anzahlpakete)
+ $this->app->DB->Insert("INSERT INTO versand (id,versandunternehmen, tracking, tracking_link,
+ versendet_am,abgeschlossen,lieferschein,
+ freigegeben,firma,adresse,projekt,gewicht,paketmarkegedruckt,anzahlpakete)
VALUES ('','$versand','$tracking', '{$trackingLink}',NOW(),1,'$id',1,'".$this->app->User->GetFirma()."','$adresse','$projekt','$kg','1','1') ");
$versandid = $this->app->DB->GetInsertID();
@@ -15670,8 +15638,7 @@ function Paketmarke($parsetarget,$sid="",$zusatz="",$typ="DHL")
'SELECT zahlweise FROM rechnung WHERE id = %d', $rechnung
)
);
- }
- else{
+ } else {
$rechnung_projekt = $this->app->DB->Select(
sprintf(
'SELECT projekt FROM auftrag WHERE id = %d', $auftrag
@@ -15806,176 +15773,17 @@ function Paketmarke($parsetarget,$sid="",$zusatz="",$typ="DHL")
if($kg=="") $kg=$this->VersandartMindestgewicht($lieferschein);
- //$versandartenmodul = $this->app->DB->SelectArr("SELECT id, modul FROM versanddienstleister WHERE aktiv = 1 AND modul = '".$this->app->DB->real_escape_string($typ)."' AND (projekt = 0 OR projekt = '$projekt') ORDER BY projekt DESC LIMIT 1");
- $versandartenmodul = $this->app->DB->SelectArr("SELECT id, modul,bezeichnung, einstellungen_json FROM versandarten WHERE aktiv = 1 AND ausprojekt = 0 AND type = '".$this->app->DB->real_escape_string($typ)."' AND modul != '' AND (projekt = 0 OR projekt = '$projekt') ORDER BY projekt DESC LIMIT 1");
- if($versandartenmodul && @is_file(dirname(__FILE__).'/versandarten/'.$versandartenmodul[0]['modul'].'.php'))
- {
- $obj = $this->LoadVersandModul($versandartenmodul[0]['modul'], $versandartenmodul[0]['id']);
- $this->app->Tpl->Set("ZUSATZ",$versandartenmodul[0]['bezeichnung']);
-
- if(!empty($obj) && method_exists($obj, 'Paketmarke'))
+ $versandartenmodul = $this->app->DB->SelectArr("SELECT id, modul,bezeichnung, einstellungen_json FROM versandarten WHERE aktiv = 1 AND ausprojekt = 0 AND type = '".$this->app->DB->real_escape_string($typ)."' AND modul != '' AND (projekt = 0 OR projekt = '$projekt') ORDER BY projekt DESC LIMIT 1");
+ if($versandartenmodul && @is_file(dirname(__FILE__).'/versandarten/'.$versandartenmodul[0]['modul'].'.php'))
{
- $error = $obj->Paketmarke($sid!=''?$sid:'lieferschein',$id);
- }else $error[] = 'Versandmodul '.$typ.' fehlerhaft!';
- }else{
- switch($typ)
- {
- case "DHL":
- if($nachnahme=="" && $versichert=="" && $extraversichert=="")
- {
- $this->EasylogPaketmarkeStandard($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg);
- } else if ($nachnahme=="1" && $versichert=="" && $extraversichert=="")
- {
- $this->EasylogPaketmarkeNachnahme($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg,$betrag,$rechnungsnummer);
- } else if ($versichert=="1" && $extraversichert=="" && $nachnahme=="")
- {
- $this->EasylogPaketmarke2500($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg);
- } else if ($versichert=="1" && $extraversichert=="" && $nachnahme=="1")
- {
- $this->EasylogPaketmarkeNachnahme2500($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg,$betrag,$rechnungsnummer);
- } else if ($versichert=="" && $extraversichert=="1" && $nachnahme=="1")
- {
- $this->EasylogPaketmarkeNachnahme25000($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg,$betrag,$rechnungsnummer);
- } else if ($extraversichert=="1" && $versichert=="" && $nachnahme=="")
- {
- $this->EasylogPaketmarke25000($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg);
- }
- break;
- case "Intraship":
- $kg = (float)str_replace(',','.',$kg);
+ $obj = $this->LoadVersandModul($versandartenmodul[0]['modul'], $versandartenmodul[0]['id']);
+ $this->app->Tpl->Set("ZUSATZ",$versandartenmodul[0]['bezeichnung']);
- $abholdatum = $this->app->Secure->GetPOST("abholdatum");
- $retourenlabel= $this->app->Secure->GetPOST("retourenlabel");
- if($retourenlabel)
- {
- $this->app->Tpl->Set('RETOURENLABEL', ' checked="checked" ');
- $zusaetzlich['retourenlabel'] = 1;
- }
- if($abholdatum){
- $this->app->Tpl->Set('ABHOLDATUM',$abholdatum);
- $zusaetzlich['abholdatum'] = date('Y-m-d', strtotime($abholdatum));
- $this->app->User->SetParameter("paketmarke_abholdatum",$zusaetzlich['abholdatum']);
- }
- if($altersfreigabe)$zusaetzlich['altersfreigabe'] = 1;
- if($nachnahme=="1")
- $error = $this->IntrashipPaketmarkeNachnahme($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg,$betrag,$rechnungsnummer,$zusaetzlich);
- else
- $error = $this->IntrashipPaketmarkeStandard($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg,"",$rechnungsnummer,$zusaetzlich);
- break;
- case "UPS":
- $error = $this->UPSPaketmarke($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg,$betrag,$rechnungsnummer);
- break;
- case "FEDEX":
- $error = $this->FEDEXPaketmarke($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg,$betrag,$rechnungsnummer);
- break;
- case 'Go':
- if($name && $strasse && $plz && $ort && (($hausnummer && (!$land || $land == 'DE') || ($land && $land != 'DE'))))
- {
- $kg = $this->app->Secure->GetPOST("kg");
- if($kg=="") $kg=$this->VersandartMindestgewicht($lieferschein);
- $kg = str_replace(',','.',$kg);
- $frei = $this->app->Secure->GetPOST("frei")==1?1:0;
- $auftragid = $this->app->DB->Select("SELECT auftragid FROM lieferschein where id = ".(int)$lieferschein." limit 1");
-
- if($frei){
- $this->app->Tpl->Set('FREI',' checked="checked" ');
- $zusaetzlich['frei'] = 1;
- }
- $selbstabholung = $this->app->Secure->GetPOST("selbstabholung");
- if($selbstabholung){
- $this->app->Tpl->Set('SELBSTABHOLUNG',' checked="checked" ');
- $zusaetzlich['selbstabholung'] = 1;
- }
- $landesvorwahl = $this->app->Secure->GetPOST("landesvorwahl");
- if($landesvorwahl){
- $this->app->Tpl->Set('LANDESVORWAHL',$landesvorwahl);
- $zusaetzlich['landesvorwahl'] = $landesvorwahl;
- }
- $ortsvorwahl = $this->app->Secure->GetPOST("ortsvorwahl");
- if($ortsvorwahl){
- $this->app->Tpl->Set('ORTSVORWAHL',$ortsvorwahl);
- $zusaetzlich['ortsvorwahl'] = $ortsvorwahl;
- }
- if($telefon)
- {
- $this->app->Tpl->Set('TELEFON',$telefon);
- $zusaetzlich['telefon'] = $telefon;
- }
- if($email)
- {
- $this->app->Tpl->Set('EMAIL',trim($email));
- $zusaetzlich['email'] = trim($email);
- }
-
-
- $selbstanlieferung = $this->app->Secure->GetPOST("selbstanlieferung");
- if($selbstanlieferung){
- $this->app->Tpl->Set('SELBSTANLIEFERUNG',' checked="checked" ');
- $zusaetzlich['selbstanlieferung'] = 1;
- }
- $abholdatum = $this->app->Secure->GetPOST("abholdatum");
- if($abholdatum){
- $this->app->Tpl->Set('ABHOLDATUM',$abholdatum);
- $zusaetzlich['abholdatum'] = $abholdatum;
- $this->app->User->SetParameter("paketmarke_abholdatum",$zusaetzlich['abholdatum']);
- }
- $zustelldatum = $this->app->Secure->GetPOST("zustelldatum");
- if(!$zustelldatum)
- {
- //$zustelldatum = $this->app->DB->Select("SELECT lieferdatum FROM rechnung where id = ".(int)$rechnungid." and lieferdatum > now() limit 1");
- $zustelldatum = $this->app->DB->Select("SELECT lieferdatum FROM auftrag where id = ".(int)$auftragid." limit 1");
- }
- if($zustelldatum){
- $this->app->Tpl->Set('ZUSTELLDATUM',$zustelldatum);
- $zusaetzlich['zustelldatum'] = $zustelldatum;
- }
-
- if(!$abholdatum)
- {
- //$abholdatum = $this->app->DB->Select("SELECT tatsaechlicheslieferdatum FROM rechnung where id = ".(int)$rechnungid." and tatsaechlicheslieferdatum > now() limit 1");
- $abholdatum = $this->app->DB->Select("SELECT date_format(now(),'%d.%m.%Y')");
- /*if(!$abholdatum)
- {
- $projekt = $this->app->DB->Select("SELECT projekt FROM auftrag WHERE id='$auftragid' LIMIT 1");
- $differenztage = $this->Projektdaten($projekt,"differenz_auslieferung_tage");
- if($differenztage<0) $differenztage=2;
- $abholdatum = $this->app->DB->Select("SELECT DATE_SUB(lieferdatum, INTERVAL $differenztage DAY) from auftrag WHERE id='$auftragid' and DATE_SUB(lieferdatum, INTERVAL $differenztage DAY) > now() LIMIT 1");
- }*/
- if($abholdatum)
- {
- $this->app->Tpl->Set('ABHOLDATUM',$abholdatum);
- $zusaetzlich['abholdatum'] = $abholdatum;
- $this->app->User->SetParameter("paketmarke_abholdatum",$zusaetzlich['abholdatum']);
- }
- }
-
-
- $Zustellhinweise = $this->app->Secure->GetPOST("Zustellhinweise");
- if($Zustellhinweise){
- $this->app->Tpl->Set('ZUSTELLHINWEISE',$Zustellhinweise);
- $zusaetzlich['Zustellhinweise'] = $Zustellhinweise;
- }
- $Abholhinweise = $this->app->Secure->GetPOST("Abholhinweise");
- if($Abholhinweise){
- $this->app->Tpl->Set('ABHOLHINWEISE',$Abholhinweise);
- $zusaetzlich['Abholhinweise'] = $Abholhinweise;
- }
-
-
- if($anzahl)$zusaetzlich['menge'] = $anzahl;
- $inhalt = $this->app->Secure->GetPOST("inhalt");
- if($inhalt){
- $this->app->Tpl->Set('INHALT',$inhalt);
- $zusaetzlich['inhalt'] = $inhalt;
- }
- if(isset($nachnahme))$zusaetzlich['nachnahme'] = $nachnahme;
- $this->GoPaketmarke($id,$name,$name2,$name3,$strasse,$hausnummer,$plz,$ort,$land,$kg,$betrag,$rechnungsnummer, $zusaetzlich);
- } else header("Location: index.php?module=lieferschein&action=paketmarke&id=$id");
- break;
-
- }
+ if(!empty($obj) && method_exists($obj, 'Paketmarke'))
+ {
+ $error = $obj->Paketmarke($sid!=''?$sid:'lieferschein',$id);
+ }else $error[] = 'Versandmodul '.$typ.' fehlerhaft!';
}
-
if(!isset($error) || !$error)$this->app->DB->Update("UPDATE versand SET gewicht='$kg',paketmarkegedruckt=1,anzahlpakete='$anzahl' WHERE id='$id' LIMIT 1");
}
if(!$error)
@@ -16008,8 +15816,7 @@ function Paketmarke($parsetarget,$sid="",$zusatz="",$typ="DHL")
break;
}
- $this->app->DB->Insert("INSERT INTO versandpakete (id,versand,gewicht,nr,versender) VALUES ('','$id','$kg','$anzahli','".$this->app->User->GetName()."')");
- }
+ $this->app->DB->Insert("INSERT INTO versandpakete (id,versand,gewicht,nr,versender) VALUES ('','$id','$kg','$anzahli','".$this->app->User->GetName()."')"); }
}
diff --git a/www/lib/class.versanddienstleister.php b/www/lib/class.versanddienstleister.php
index 9ebae57e..e2e5afcd 100644
--- a/www/lib/class.versanddienstleister.php
+++ b/www/lib/class.versanddienstleister.php
@@ -1,371 +1,324 @@
-app = $app;
+ if ($id === null || $id === 0)
+ return;
+ $this->id = $id;
+ $row = $this->app->DB->SelectRow("SELECT * FROM versandarten WHERE id=$this->id");
+ $this->type = $row['type'];
+ $this->projectId = $row['projekt'];
+ $this->labelPrinterId = $row['paketmarke_drucker'];
+ $this->documentPrinterId = $row['export_drucker'];
+ $this->shippingMail = $row['versandmail'];
+ $this->businessLetterTemplateId = $row['geschaeftsbrief_vorlage'];
+ $this->settings = json_decode($row['einstellungen_json']);
+ }
- if($sid==='versand')
- {
- $tid = $this->app->DB->Select("SELECT lieferschein FROM versand WHERE id='$id' LIMIT 1");
- $rechnung = $this->app->DB->Select("SELECT rechnung FROM versand WHERE id='$id' LIMIT 1");
+ public function isEtikettenDrucker(): bool
+ {
+ return false;
+ }
+
+ public abstract function GetName(): string;
+
+ public function GetAdressdaten($id, $sid): array
+ {
+ $auftragId = $lieferscheinId = $rechnungId = $versandId = 0;
+ if ($sid === 'rechnung')
+ $rechnungId = $id;
+ if ($sid === 'lieferschein') {
+ $lieferscheinId = $id;
+ $auftragId = $this->app->DB->Select("SELECT auftragid FROM lieferschein WHERE id=$lieferscheinId LIMIT 1");
+ $rechnungId = $this->app->DB->Select("SELECT id FROM rechnung WHERE lieferschein = '$lieferscheinId' LIMIT 1");
+ if ($rechnungId <= 0)
+ $rechnungId = $this->app->DB->Select("SELECT rechnungid FROM lieferschein WHERE id='$lieferscheinId' LIMIT 1");
+ }
+ if ($sid === 'versand') {
+ $versandId = $id;
+ $lieferscheinId = $this->app->DB->Select("SELECT lieferschein FROM versand WHERE id='$versandId' LIMIT 1");
+ $rechnungId = $this->app->DB->Select("SELECT rechnung FROM versand WHERE id='$versandId' LIMIT 1");
$sid = 'lieferschein';
- } else {
- $tid = $id;
- if($sid === 'lieferschein'){
- $rechnung = $this->app->DB->Select("SELECT id FROM rechnung WHERE lieferschein = '$tid' LIMIT 1");
- }
- if($rechnung<=0) {
- $rechnung = $this->app->DB->Select("SELECT rechnungid FROM lieferschein WHERE id='$tid' LIMIT 1");
- }
- }
- $ret['tid'] = $tid;
- $ret['rechnung'] = $rechnung;
-
- if($rechnung){
- $artikel_positionen = $this->app->DB->SelectArr("SELECT * FROM rechnung_position WHERE rechnung='$rechnung'");
- } else {
- $artikel_positionen = $this->app->DB->SelectArr(sprintf('SELECT * FROM `%s` WHERE `%s` = %d',$sid.'_position',$sid,$tid));
}
- if($sid==='rechnung' || $sid==='lieferschein' || $sid==='adresse')
- {
- $docArr = $this->app->DB->SelectRow(sprintf('SELECT * FROM `%s` WHERE id = %d LIMIT 1',$sid, $tid));
+ if ($auftragId <= 0 && $rechnungId > 0)
+ $auftragId = $this->app->DB->Select("SELECT auftragid FROM rechnung WHERE id=$rechnungId LIMIT 1");
- $name = trim($docArr['name']);//trim($this->app->DB->Select("SELECT name FROM $sid WHERE id='$tid' LIMIT 1"));
- $name2 = trim($docArr['adresszusatz']);//trim($this->app->DB->Select("SELECT adresszusatz FROM $sid WHERE id='$tid' LIMIT 1"));
- $abt = 0;
- if($name2==='')
- {
- $name2 = trim($docArr['abteilung']);//trim($this->app->DB->Select("SELECT abteilung FROM $sid WHERE id='$tid' LIMIT 1"));
- $abt=1;
- }
- $name3 = trim($docArr['ansprechpartner']);//trim($this->app->DB->Select("SELECT ansprechpartner FROM $sid WHERE id='$tid' LIMIT 1"));
- if($name3==='' && $abt!==1){
- $name3 = trim($docArr['abteilung']);//trim($this->app->DB->Select("SELECT abteilung FROM $sid WHERE id='$tid' LIMIT 1"));
- }
+ if ($sid === 'rechnung' || $sid === 'lieferschein' || $sid === 'adresse') {
+ $docArr = $this->app->DB->SelectRow("SELECT * FROM `$sid` WHERE id = $id LIMIT 1");
+ $ret['addressId'] = $docArr['adresse'];
+ $ret['auftragId'] = $auftragId;
+ $ret['rechnungId'] = $rechnungId;
+ $ret['lieferscheinId'] = $lieferscheinId;
- //unterabteilung versuchen einzublenden
- if($name2==='') {
- $name2 = trim($docArr['unterabteilung']);//trim($this->app->DB->Select("SELECT unterabteilung FROM $sid WHERE id='$tid' LIMIT 1"));
- } else if ($name3==='') {
- $name3 = trim($docArr['unterabteilung']);//trim($this->app->DB->Select("SELECT unterabteilung FROM $sid WHERE id='$tid' LIMIT 1"));
- }
+ $addressfields = ['name', 'adresszusatz', 'abteilung', 'ansprechpartner', 'unterabteilung', 'ort', 'plz',
+ 'strasse', 'land'];
+ $ret['original'] = array_filter($docArr, fn($key) => in_array($key, $addressfields), ARRAY_FILTER_USE_KEY);
- if($name3!=='' && $name2==='') {
- $name2=$name3;
- $name3='';
- }
+ $ret['name'] = empty(trim($docArr['ansprechpartner'])) ? trim($docArr['name']) : trim($docArr['ansprechpartner']);
+ $ret['name2'] = !empty(trim($docArr['ansprechpartner'])) ? trim($docArr['name']) : '';
+ $ret['name3'] = join(';', array_filter([
+ $docArr['abteilung'],
+ $docArr['unterabteilung']
+ ], fn(string $item) => !empty(trim($item))));
+ $ret['address2'] = $docArr['adresszusatz'];
- $ort = trim($docArr['ort']);//trim($this->app->DB->Select("SELECT ort FROM $sid WHERE id='$tid' LIMIT 1"));
- $plz = trim($docArr['plz']);//trim($this->app->DB->Select("SELECT plz FROM $sid WHERE id='$tid' LIMIT 1"));
- $land = trim($docArr['land']);//trim($this->app->DB->Select("SELECT land FROM $sid WHERE id='$tid' LIMIT 1"));
- $strasse = trim($docArr['strasse']);//trim($this->app->DB->Select("SELECT strasse FROM $sid WHERE id='$tid' LIMIT 1"));
- $strassekomplett = $strasse;
+ $ret['city'] = $docArr['ort'];
+ $ret['zip'] = $docArr['plz'];
+ $ret['country'] = $docArr['land'];
+ $ret['phone'] = $docArr['telefon'];
+ $ret['email'] = $docArr['email'];
+ $ret['addresstype'] = 0;
+
+ $strasse = trim($docArr['strasse']);
+ $ret['streetwithnumber'] = $strasse;
$hausnummer = trim($this->app->erp->ExtractStreetnumber($strasse));
+ $strasse = trim(str_replace($hausnummer, '', $strasse));
+ $strasse = str_replace('.', '', $strasse);
- $strasse = trim(str_replace($hausnummer,'',$strasse));
- $strasse = str_replace('.','',$strasse);
-
- if($strasse=='')
- {
+ if ($strasse == '') {
$strasse = trim($hausnummer);
$hausnummer = '';
}
- $telefon = trim($docArr['telefon']);//trim($this->app->DB->Select("SELECT telefon FROM $sid WHERE id='$tid' LIMIT 1"));
- $email = trim($docArr['email']);//trim($this->app->DB->Select("SELECT email FROM $sid WHERE id='$tid' LIMIT 1"));
+ $ret['street'] = $strasse;
+ $ret['streetnumber'] = $hausnummer;
+ if (str_contains($docArr['strasse'], 'Packstation')) {
+ $ret['addresstype'] = 1;
+ $ret['parcelstationNumber'] = $hausnummer;
+ } else if (str_contains($docArr['strasse'], 'Postfiliale')) {
+ $ret['addresstype'] = 2;
+ $ret['postofficeNumber'] = $hausnummer;
+ }
+
+ $tmp = join(' ', [$docArr['ansprechpartner'], $docArr['abteilung'], $docArr['unterabteilung']]);
+ if (preg_match("/\d{6,10}/", $tmp, $match)) {
+ $ret['postnumber'] = $match[0];
+ }
+
+ if ($auftragId > 0) {
+ $internet = $this->app->DB->Select("SELECT internet FROM auftrag WHERE id = $auftragId LIMIT 1");
+ if (!empty($internet))
+ $orderNumberParts[] = $internet;
+ }
+ if (!empty($docArr['ihrebestellnummer'])) {
+ $orderNumberParts[] = $docArr['ihrebestellnummer'];
+ }
+ $orderNumberParts[] = $docArr['belegnr'];
+ $ret['order_number'] = implode(' / ', $orderNumberParts);
}
+
// wenn rechnung im spiel entweder durch versand oder direkt rechnung
- if($rechnung >0)
- {
- $zahlungsweise = $this->app->DB->Select("SELECT zahlungsweise FROM rechnung WHERE id='$rechnung' LIMIT 1");
- $soll = $this->app->DB->Select("SELECT soll FROM rechnung WHERE id='$rechnung' LIMIT 1");
+ if ($rechnungId > 0) {
+ $invoice_data = $this->app->DB->SelectRow("SELECT zahlungsweise, soll, belegnr FROM rechnung WHERE id='$rechnungId' LIMIT 1");
+ $ret['zahlungsweise'] = $invoice_data['zahlungsweise'];
+ $ret['betrag'] = $invoice_data['soll'];
+ $ret['invoice_number'] = $invoice_data['belegnr'];
- if($zahlungsweise==='nachnahme'){
- $nachnahme = true;
- }
-
- if($soll >= 500 && $soll <= 2500){
- $versichert = true;
- }
-
- if($soll > 2500) {
- $extraversichert = true;
+ if ($invoice_data['zahlungsweise'] === 'nachnahme') {
+ $ret['nachnahme'] = true;
}
}
- if(isset($frei))$ret['frei'] = $frei;
- if(isset($inhalt))$ret['inhalt'] = $inhalt;
- if(isset($keinealtersabfrage))$ret['keinealtersabfrage'] = $keinealtersabfrage;
- if(isset($altersfreigabe))$ret['altersfreigabe'] = $altersfreigabe;
- if(isset($zahlungsweise))$ret['zahlungsweise'] = $zahlungsweise;
- if(isset($versichert))$ret['versichert'] = $versichert;
- if(isset($soll))$ret['betrag'] = $soll;
- if(isset($extraversichert))$ret['extraversichert'] = $extraversichert;
- if(isset($nachnahme))$ret['nachnahme'] = $nachnahme;
- $ret['name'] = $name;
- $ret['name2'] = $name2;
- $ret['name3'] = $name3;
- $ret['ort'] = $ort;
- $ret['plz'] = $plz;
- $ret['strasse'] = $strasse;
- $ret['strassekomplett'] = $strassekomplett;
- $ret['hausnummer'] = $hausnummer;
- $ret['land'] = $land;
- $ret['telefon'] = $telefon;
- $ret['phone'] = $telefon;
- $ret['email'] = trim($email," \t\n\r\0\x0B\xc2\xa0");
+ $sql = "SELECT
+ lp.bezeichnung,
+ lp.menge,
+ coalesce(nullif(lp.zolltarifnummer, '0'), nullif(rp.zolltarifnummer, '0'), nullif(a.zolltarifnummer, '')) as zolltarifnummer,
+ coalesce(nullif(lp.herkunftsland, '0'), nullif(rp.herkunftsland, '0'), nullif(a.herkunftsland, '')) as herkunftsland,
+ coalesce(nullif(lp.zolleinzelwert, '0'), rp.preis *(1-rp.rabatt/100), 0) as zolleinzelwert,
+ coalesce(nullif(lp.zolleinzelgewicht, 0), a.gewicht) as zolleinzelgewicht,
+ lp.zollwaehrung
+ FROM lieferschein_position lp
+ JOIN artikel a on lp.artikel = a.id
+ LEFT JOIN auftrag_position ap on lp.auftrag_position_id = ap.id
+ LEFT JOIN rechnung_position rp on ap.id = rp.auftrag_position_id
+ LEFT JOIN rechnung r on rp.rechnung = r.id
+ WHERE lp.lieferschein = $lieferscheinId
+ AND a.lagerartikel = 1
+ AND r.status != 'storniert'
+ ORDER BY lp.sort";
+ $ret['positions'] = $this->app->DB->SelectArr($sql);
- $check_date = $this->app->DB->Select("SELECT date_format(now(),'%Y-%m-%d')");
-
- $ret['abholdaumt'] = date('d.m.Y', strtotime($check_date));
-
- $anzahl = $this->app->Secure->GetGET("anzahl");
-
- if($anzahl <= 0)
- {
- $anzahl=1;
- }
-
- if($sid==="lieferschein"){
- $standardkg = $this->app->erp->VersandartMindestgewicht($tid);
- }
- else{
+ if ($sid === "lieferschein") {
+ $standardkg = $this->app->erp->VersandartMindestgewicht($lieferscheinId);
+ } else {
$standardkg = $this->app->erp->VersandartMindestgewicht();
}
- //$this->app->erp->PaketmarkeGewichtForm($anzahl, $standardkg, $this->VersandartMindestgewicht());
- $ret['standardkg'] = $standardkg;
- $ret['anzahl'] = $anzahl;
+ $ret['weight'] = $standardkg;
return $ret;
}
/**
- * @param string $target
+ * Returns an array of additional field definitions to be stored for this module:
+ * [
+ * 'field_name' => [
+ * 'typ' => text(default)|textarea|checkbox|select
+ * 'default' => default value
+ * 'optionen' => just for selects [key=>value]
+ * 'size' => size attribute for text fields
+ * 'placeholder' => placeholder attribute for text fields
+ * ]
+ * ]
*
- * @return string
+ * @return array
*/
- public function Einstellungen($target = 'return')
+ public function AdditionalSettings(): array
{
- if(!$this->id)
- {
- return '';
- }
- //$id = $this->id;
- $struktur = $this->EinstellungenStruktur();
- if($this->app->Secure->GetPOST('speichern'))
- {
- $json = $this->app->DB->Select("SELECT einstellungen_json FROM versandarten WHERE id = '".$this->id."' LIMIT 1");
- $modul = $this->app->DB->Select("SELECT modul FROM versandarten WHERE id = '".$this->id."' LIMIT 1");
- if(!empty($json))
- {
+ return [];
+ }
+
+ /**
+ * Renders all additional settings as fields into $target
+ * @param string $target template placeholder for rendered output
+ * @param array $form data for form values (from database or form submit)
+ * @return void
+ */
+ public function RenderAdditionalSettings(string $target, array $form): void
+ {
+ $fields = $this->AdditionalSettings();
+ if ($this->app->Secure->GetPOST('speichern')) {
+ $json = $this->app->DB->Select("SELECT einstellungen_json FROM versandarten WHERE id = '" . $this->id . "' LIMIT 1");
+ $modul = $this->app->DB->Select("SELECT modul FROM versandarten WHERE id = '" . $this->id . "' LIMIT 1");
+ if (!empty($json)) {
$json = @json_decode($json, true);
- }else{
+ } else {
$json = array();
- foreach($struktur as $name => $val)
- {
- if(isset($val['default']))
- {
+ foreach ($fields as $name => $val) {
+ if (isset($val['default'])) {
$json[$name] = $val['default'];
}
}
}
- if(empty($json))
- {
+ if (empty($json)) {
$json = null;
}
- foreach($struktur as $name => $val)
- {
+ foreach ($fields as $name => $val) {
- if($modul === $this->app->Secure->GetPOST('modul_name'))
- {
- $json[$name] = $this->app->Secure->GetPOST($name, '','', 1);
+ if ($modul === $this->app->Secure->GetPOST('modul_name')) {
+ $json[$name] = $this->app->Secure->GetPOST($name, '', '', 1);
}
-
- if(isset($val['replace']))
- {
- switch($val['replace'])
- {
+
+ if (isset($val['replace'])) {
+ switch ($val['replace']) {
case 'lieferantennummer':
- $json[$name] = $this->app->erp->ReplaceLieferantennummer(1,$json[$name],1);
- break;
+ $json[$name] = $this->app->erp->ReplaceLieferantennummer(1, $json[$name], 1);
+ break;
}
}
}
$json_str = $this->app->DB->real_escape_string(json_encode($json));
- $this->app->DB->Update("UPDATE versandarten SET einstellungen_json = '$json_str' WHERE id = '".$this->id."' LIMIT 1");
+ $this->app->DB->Update("UPDATE versandarten SET einstellungen_json = '$json_str' WHERE id = '" . $this->id . "' LIMIT 1");
}
- $id = $this->id;
$html = '';
-
- $json = $this->app->DB->Select("SELECT einstellungen_json FROM versandarten WHERE id = '$id' LIMIT 1");
- if($json)
- {
- $json = json_decode($json, true);
- }else{
- $json = null;
- }
- $changed = false;
- foreach($struktur as $name => $val)
+ foreach ($fields as $name => $val) // set missing default values
{
- if(isset($val['default']) && !isset($json[$name]))
- {
- $changed = true;
- $json[$name] = $val['default'];
+ if (isset($val['default']) && !isset($form[$name])) {
+ $form[$name] = $val['default'];
}
}
- if($changed)
- {
- $json_str = $this->app->DB->real_escape_string(json_encode($json));
- $this->app->DB->Update("UPDATE versandarten SET einstellungen_json = '$json_str' WHERE id = '".$this->id."' LIMIT 1");
- }
- $first = true;
- foreach($struktur as $name => $val)
- {
- if(isset($val['heading']))
- {
- $html .= '