diff --git a/CHANGELOG-PUBLIC.md b/CHANGELOG-PUBLIC.md
index d9cb98f..8832f65 100644
--- a/CHANGELOG-PUBLIC.md
+++ b/CHANGELOG-PUBLIC.md
@@ -592,3 +592,7 @@ MNB-1471 Add cache timeout. MNB-1465 Ensure order comment containing packing inf
MNB-1493 Move UK out of list of countries where postcode is optional
+## 20.45.2 (2021-08-13)
+MNB-1340 Fix for incorrect dispatch date showing in admin
+
+
diff --git a/CHANGELOG.MD b/CHANGELOG.MD
index d9cb98f..8832f65 100755
--- a/CHANGELOG.MD
+++ b/CHANGELOG.MD
@@ -592,3 +592,7 @@ MNB-1471 Add cache timeout. MNB-1465 Ensure order comment containing packing inf
MNB-1493 Move UK out of list of countries where postcode is optional
+## 20.45.2 (2021-08-13)
+MNB-1340 Fix for incorrect dispatch date showing in admin
+
+
diff --git a/composer.json b/composer.json
index e8fd8d2..2574f9e 100755
--- a/composer.json
+++ b/composer.json
@@ -2,7 +2,7 @@
"name": "shipperhq/module-shipper",
"description": "Magento Shipping integration with ShipperHQ",
"type": "magento2-module",
- "version": "20.45.1",
+ "version": "20.45.2",
"license": [
"OSL-3.0",
"AFL-3.0"
diff --git a/src/Helper/CarrierGroup.php b/src/Helper/CarrierGroup.php
index 1f7ba5c..6eff745 100644
--- a/src/Helper/CarrierGroup.php
+++ b/src/Helper/CarrierGroup.php
@@ -139,9 +139,15 @@ public function __construct(
*/
public function saveCarrierGroupInformation($shippingAddress, $shippingMethod, array $additionalDetail = [])
{
- //admin and front end orders use method
- //MNB-1114 undo a change made for SHQ18-1391; no longer compare method price
- $foundRate = $shippingAddress->getShippingRateByCode($shippingMethod);
+ // admin and front end orders use method
+ // MNB-1114 undo a change made for SHQ18-1391; no longer compare method price
+ // MNB-1340 Changed to call getAllShippingRates() instead of getShippingRateByCode as the latter can get an out of date rate
+ $foundRate = false;
+ foreach ($shippingAddress->getAllShippingRates() as $rate) {
+ if ($rate->getCode() == $shippingMethod) {
+ $foundRate = $rate;
+ }
+ }
if ($foundRate && $foundRate->getCarriergroupShippingDetails() != '') {
$shipDetails = $this->shipperDataHelper->decodeShippingDetails(
diff --git a/src/composer.json b/src/composer.json
index 3510d1c..26e15bb 100644
--- a/src/composer.json
+++ b/src/composer.json
@@ -2,7 +2,7 @@
"name": "shipperhq/module-shipper",
"description": "Magento Shipping integration with ShipperHQ",
"type": "magento2-module",
- "version": "20.45.1",
+ "version": "20.45.2",
"license": [
"OSL-3.0",
"AFL-3.0"
diff --git a/src/etc/config.xml b/src/etc/config.xml
index fe753f4..bc67c6e 100755
--- a/src/etc/config.xml
+++ b/src/etc/config.xml
@@ -67,7 +67,7 @@
30
0
1
- 20.45.1
+ 20.45.2
300