Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Auto assign EKP-Ending depending on need #28

Open
Petschko opened this issue Aug 9, 2017 · 6 comments
Open

Auto assign EKP-Ending depending on need #28

Petschko opened this issue Aug 9, 2017 · 6 comments

Comments

@Petschko
Copy link
Owner

Petschko commented Aug 9, 2017

I've think about assigning the last 4 digits of the EKP automaticly depending on which Product is used (and if a Return-Lebel is needed)...

But I'm a bit unsure if this is a good idea, feel free to tell me what you think about it!

@leolems
Copy link

leolems commented Nov 21, 2017

Adding a fixed "0101" to the EPK is not going to work for international shipments, so a more flexible solution would be appreciated. Thanks for the awesome LIB by the way... :)

@Petschko
Copy link
Owner Author

You're welcome! I wish I could improve it, but I don't have a head at the moment to code after work...

Anyway I will try to implement it then, thanks for the Answer^^

@Morgy93
Copy link

Morgy93 commented Jul 10, 2018

It would be awesome to predefine different EKP and then let it automatically choose the right one.
Something like

$credentials->setNationalShipmentEkp('EKP account number for national shipment');
$credentials->setInternationalShipmentEkp('EKP account number for international shipment');
$credentials->setReturnShipmentEkp('EKP account number for return shipment');

and the service chooses the EKP to use depending on which product is used.

By the way .. it's EKP and not EPK =)

@Petschko
Copy link
Owner Author

It would be super helpful if I know, in which case which Number should be set. I don't want to create a bad automatic-function

It's a good idea to create these functions like you mentioned @Morgy93

@Petschko Petschko changed the title Auto assign EPK-Ending depending on need Auto assign EKP-Ending depending on need Jul 14, 2018
@Petschko Petschko self-assigned this Jul 17, 2018
@Petschko Petschko added this to the 1.0 milestone Jul 17, 2018
@Petschko Petschko moved this from To do to In progress in Multiple Labels +backward compatibility Sep 5, 2018
@Petschko Petschko modified the milestones: 1.0, 1.1 Sep 7, 2018
@mpitz
Copy link

mpitz commented Jun 25, 2020

"on need"

However, it would only be helpful if a corresponding number had not already been given.
Perhaps the application that uses the module already generates the EKP with 14 digits.

But yes, would be nice. It was a stumbling block when I wanted to implement it for the first time.

@Petschko Petschko removed their assignment Jul 9, 2020
@drechsler-development
Copy link

drechsler-development commented Jul 9, 2021

Hi

Isn't the accountNumber in Version 3.0 (and lower versions) just a concatenated string of the EKP + Procedure + Participant?
So the Procedure will be the second and third character in the appropriate DHL product.
Like '01' in 'V01PAK' for a 'DHL PAKET'
So the accountNumber could be something like

//VALIDATION of $product agains possible products is not implemented here. This is just an example!!
function getProcedure(string $product){
  return strlen($product) ? substr($product,1,2) : '';
}

$procedure = $this->getProcedure($this->product);
['accountNumber'] = $this->ekp.$procedure.$this->participant;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants