Skip to content

Commit

Permalink
feat: small package belgium (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardPerdaan authored Jul 31, 2024
1 parent 38dd95a commit 84aaae1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
3 changes: 1 addition & 2 deletions Model/Sales/Repository/PackageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,7 @@ public function setPackageSmallSettings(string $carrierPath = self::XML_PATH_POS
*/
private function fitInPackageSmall(): bool
{
return AbstractConsignment::CC_BE !== $this->getCurrentCountry()
&& $this->isPackageSmallActive()
return $this->isPackageSmallActive()
&& $this->getWeight() <= $this->getMaxPackageSmallWeight();
}

Expand Down
26 changes: 19 additions & 7 deletions Ui/Component/Listing/Column/TrackActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function prepareDataSource(array $dataSource)
'hidden' => ! $orderManagementActivated,
];
} else {
$item[$this->getData('name')]['action-download_package_label'] = [
$item[$this->getData('name')]['action-download_package_label'] = [
'href' => $this->urlBuilder->getUrl(
'myparcel/order/CreateAndPrintMyParcelTrack',
[
Expand All @@ -101,6 +101,18 @@ public function prepareDataSource(array $dataSource)
'label' => __('Download package label'),
'hidden' => $orderManagementActivated,
];
$item[$this->getData('name')]['action-download_small_package_label'] = [
'href' => $this->urlBuilder->getUrl(
'myparcel/order/CreateAndPrintMyParcelTrack',
[
'selected_ids' => $item['entity_id'],
'mypa_package_type' => 6,
'mypa_request_type' => 'download',
]
),
'label' => __('Download small package label'),
'hidden' => $orderManagementActivated,
];
$item[$this->getData('name')]['action-download_digital_stamp_label'] = [
'href' => $this->urlBuilder->getUrl(
'myparcel/order/CreateAndPrintMyParcelTrack',
Expand All @@ -113,7 +125,7 @@ public function prepareDataSource(array $dataSource)
'label' => __('Download digital stamp label'),
'hidden' => $orderManagementActivated,
];
$item[$this->getData('name')]['action-download_mailbox_label'] = [
$item[$this->getData('name')]['action-download_mailbox_label'] = [
'href' => $this->urlBuilder->getUrl(
'myparcel/order/CreateAndPrintMyParcelTrack',
[
Expand All @@ -125,7 +137,7 @@ public function prepareDataSource(array $dataSource)
'label' => __('Download mailbox label'),
'hidden' => $orderManagementActivated,
];
$item[$this->getData('name')]['action-download_letter_label'] = [
$item[$this->getData('name')]['action-download_letter_label'] = [
'href' => $this->urlBuilder->getUrl(
'myparcel/order/CreateAndPrintMyParcelTrack',
[
Expand All @@ -137,7 +149,7 @@ public function prepareDataSource(array $dataSource)
'label' => __('Download letter label'),
'hidden' => $orderManagementActivated,
];
$item[$this->getData('name')]['action-create_concept'] = [
$item[$this->getData('name')]['action-create_concept'] = [
'href' => $this->urlBuilder->getUrl(
'myparcel/order/CreateAndPrintMyParcelTrack',
[
Expand All @@ -148,7 +160,7 @@ public function prepareDataSource(array $dataSource)
'label' => __('Create new concept'),
'hidden' => $orderManagementActivated,
];
$item[$this->getData('name')]['action-ship_direct'] = [
$item[$this->getData('name')]['action-ship_direct'] = [
'href' => $this->urlBuilder->getUrl(
'adminhtml/order_shipment/start',
[
Expand All @@ -162,7 +174,7 @@ public function prepareDataSource(array $dataSource)
}

if (isset($item[ShippingStatus::NAME])) {
$item[$this->getData('name')]['action-create_concept'] = [
$item[$this->getData('name')]['action-create_concept'] = [
'href' => $this->urlBuilder->getUrl(
'myparcel/order/CreateAndPrintMyParcelTrack',
[
Expand All @@ -173,7 +185,7 @@ public function prepareDataSource(array $dataSource)
'label' => __('Already exported'),
'hidden' => ! $orderManagementActivated,
];
$item[$this->getData('name')]['action-download_package_label'] = [
$item[$this->getData('name')]['action-download_package_label'] = [
'href' => $this->urlBuilder->getUrl(
'myparcel/order/CreateAndPrintMyParcelTrack',
[
Expand Down
1 change: 1 addition & 0 deletions i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Home address only,Livraison à domicile uniquement
Hide sender title,Titre de masquer l'expéditeur
Insured up to:,Assuré jusqu'à :
Download package label,Télécharger l'étiquette du colis
Download small package label,Télécharger l'étiquette du petit colis
Create new concept,Créer une nouveau concept
Create shipment,Créer un envoi
Please select an item from the list,Sélectionnez une commande dans la liste
Expand Down
1 change: 1 addition & 0 deletions i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ MyParcel options,MyParcel opties
Package,Pakket
Insured up to:,Verzekeren tot:
Download package label,Download pakket label
Download small package label,Download klein pakket label
Download digital stamp label,Download digitalepostzegel label
Download mailbox label,Download brievenbuspakje label
Download letter label,Download ongefrankeerd label
Expand Down

0 comments on commit 84aaae1

Please sign in to comment.