Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Changelog.md
  • Loading branch information
mbe1987 committed Oct 6, 2021
2 parents ca3d2b7 + e1e8581 commit 6a35db4
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog
## 1.5.2
* set note1 for cash on delivery
* bugfix: add country selection to standortsuche in wave theme
* add bank data for cash on delivery
* adjusted valid preferred day check to handle test errorrs

## 1.5.1
* same weight calculation for local and international delivery
Expand Down
5 changes: 4 additions & 1 deletion src/modules/mo/mo_dhl/Adapter/GKVShipmentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ protected function buildShipmentDetails(Order $order): ShipmentDetailsType
}
$customerReference = Registry::getLang()->translateString('GENERAL_ORDERNUM') . ' ' . $order->getFieldData('oxordernr');
if ($order->moDHLUsesService(MoDHLService::MO_DHL__CASH_ON_DELIVERY) && $this->getProcess($order)->supportsCashOnDelivery()) {
$details->setBankData((new BankType(null, null, null))->setNote1($customerReference));
$accountOwner = Registry::getConfig()->getShopConfVar('mo_dhl__cod_accountOwner') ?: null;
$bankName = Registry::getConfig()->getShopConfVar('mo_dhl__cod_bankName') ?: null;
$iban = Registry::getConfig()->getShopConfVar('mo_dhl__cod_iban') ?: null;
$details->setBankData((new BankType($accountOwner, $bankName, $iban))->setNote1($customerReference));
}
$details->setCustomerReference($customerReference);
$details->setService($this->buildService($order));
Expand Down
18 changes: 16 additions & 2 deletions src/modules/mo/mo_dhl/Api/Wunschpaket.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,24 @@ public function isValidPreferredDay($zip, \DateTime $date)
{
$plausibleTransferDay = clone $date;
$plausibleTransferDay->modify('-5 days');
foreach ($this->getPreferredDays($zip, $plausibleTransferDay, false) as $preferredDay) {
$alternativePlausibleTransferDay = clone $plausibleTransferDay;
$alternativePlausibleTransferDay->modify('-2 days');
return $this->isValidPreferredDayForGivenSendDate($zip, $plausibleTransferDay, $date)
|| $this->isValidPreferredDayForGivenSendDate($zip, $alternativePlausibleTransferDay, $date);
}

/**
* @param $zip
* @param \DateTime $sendDate
* @param \DateTime $deliveryDate in case of a string: d.m.Y
* @return bool
*/
protected function isValidPreferredDayForGivenSendDate($zip, $sendDate, $deliveryDate)
{
foreach ($this->getPreferredDays($zip, $sendDate, false) as $preferredDay) {
/** @var \DateTime $preferredDayDateTime */
$preferredDayDateTime = $preferredDay['datetime'];
if ($preferredDayDateTime->format('d.m.Y') === $date->format('d.m.Y')) {
if ($preferredDayDateTime->format('d.m.Y') === $deliveryDate->format('d.m.Y')) {
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
'SHOP_MODULE_mo_dhl__notification_mode_NEVER' => 'Niemals',
'SHOP_MODULE_mo_dhl__notification_mode_ALWAYS' => 'Immer',
'SHOP_MODULE_mo_dhl__notification_mode_ASK' => 'Auf Kundenwunsch übermitteln',

'SHOP_MODULE_GROUP_mo_dhl__cod' => 'Nachnahme - Kontodaten',
'SHOP_MODULE_mo_dhl__cod_accountOwner' => 'Kontoinhaber',
'SHOP_MODULE_mo_dhl__cod_bankName' => 'Name der Bank',
'SHOP_MODULE_mo_dhl__cod_iban' => 'IBAN',

'SHOP_MODULE_mo_dhl__ident_check_min_age' => 'Mindestalter für den IdentCheck',
'SHOP_MODULE_mo_dhl__ident_check_min_age_0' => 'kein Mindestalter',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@
'SHOP_MODULE_mo_dhl__notification_mode_ALWAYS' => 'Always',
'SHOP_MODULE_mo_dhl__notification_mode_ASK' => 'Ask the customer',

'SHOP_MODULE_GROUP_mo_dhl__cod' => 'Cash on Delivery - Bank account',
'SHOP_MODULE_mo_dhl__cod_accountOwner' => 'Name of bank account owner',
'SHOP_MODULE_mo_dhl__cod_bankName' => 'Name of bank',
'SHOP_MODULE_mo_dhl__cod_iban' => 'IBAN',

'SHOP_MODULE_mo_dhl__ident_check_min_age' => 'Minimal age for Ident-Check',
'SHOP_MODULE_mo_dhl__ident_check_min_age_0' => 'no minimal age',
'SHOP_MODULE_mo_dhl__ident_check_min_age_16' => '16 years',
Expand Down
18 changes: 18 additions & 0 deletions src/modules/mo/mo_dhl/metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,24 @@
'value' => '0',
'constraints' => '0|16|18',
],
[
'group' => 'mo_dhl__cod',
'name' => 'mo_dhl__cod_accountOwner',
'type' => 'str',
'value' => '',
],
[
'group' => 'mo_dhl__cod',
'name' => 'mo_dhl__cod_bankName',
'type' => 'str',
'value' => '',
],
[
'group' => 'mo_dhl__cod',
'name' => 'mo_dhl__cod_iban',
'type' => 'str',
'value' => '',
],
[
'group' => 'mo_dhl__retoure',
'name' => 'mo_dhl__retoure_reference_prefix',
Expand Down
11 changes: 11 additions & 0 deletions src/modules/mo/mo_dhl/views/tpl/wave/finder.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@
id="moDHLStreet" name="street"/>
<input type="text" placeholder="[{oxmultilang ident="MO_DHL__POSTCODE"}]"
id="moDHLLocality" name="locality"/>
[{assign var="countries_list" value=$oViewConf->moGetDHLCountriesList()}]
<select id="moDHLCountry" name="country"
[{if count($countries_list) === 1}]style="display: none;" [{/if}]
>
<option value="">-</option>
[{foreach from=$countries_list item=country key=country_id}]
<option value="[{$country_id}]" isoalpha2="[{$country.isoalpha2}]">
[{$country.title}]
</option>
[{/foreach}]
</select>
</div>
<div id="moDHLProviders">
[{if $oViewConf->moCanPackstationBeSelected()}]
Expand Down

0 comments on commit 6a35db4

Please sign in to comment.