From 39fa9ba0047d246d71c55b6675e2ca1f39a97726 Mon Sep 17 00:00:00 2001 From: Mark Williams Date: Wed, 28 Jan 2026 11:21:39 +0000 Subject: [PATCH 1/2] LIMS-2068: Dont allow duplicate requests to shipping service --- api/src/Page/Shipment.php | 4 ++++ client/src/js/modules/shipment/views/createawb.js | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/api/src/Page/Shipment.php b/api/src/Page/Shipment.php index 0019c1e77..e1021ac38 100644 --- a/api/src/Page/Shipment.php +++ b/api/src/Page/Shipment.php @@ -3451,6 +3451,10 @@ function _create_awb() && in_array($this->arg('COUNTRY'), $facility_courier_countries) && Utils::getValueOrDefault($use_shipping_service_redirect_incoming_shipments) ) { + if ($ship['EXTERNALSHIPPINGIDTOSYNCHROTRON']) { + $this->_error("Shipping service error: Booking already exists"); + return; + } try { $this->_create_shipment_shipment_request($ship, $dewars); $this->_output(array('EXTERNAL' => "1")); diff --git a/client/src/js/modules/shipment/views/createawb.js b/client/src/js/modules/shipment/views/createawb.js index 62b3e43b0..857e91a2c 100644 --- a/client/src/js/modules/shipment/views/createawb.js +++ b/client/src/js/modules/shipment/views/createawb.js @@ -468,6 +468,14 @@ define(['backbone', return } + const ss_url = app.options.get("shipping_service_app_url_incoming") + const externalid = this.shipment.get('EXTERNALSHIPPINGIDTOSYNCHROTRON') + if (externalid && ss_url) { + const link = ss_url+'/shipment-requests/'+externalid+'/incoming' + window.location.href = link + return + } + var prod = null if ( ( From 52104a956c420fa40a6056e1aa09ec920cad52f2 Mon Sep 17 00:00:00 2001 From: Mark Williams Date: Wed, 28 Jan 2026 11:36:02 +0000 Subject: [PATCH 2/2] LIMS-2068: Reuse ss_url variable --- client/src/js/modules/shipment/views/createawb.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/src/js/modules/shipment/views/createawb.js b/client/src/js/modules/shipment/views/createawb.js index 857e91a2c..9d5373bb9 100644 --- a/client/src/js/modules/shipment/views/createawb.js +++ b/client/src/js/modules/shipment/views/createawb.js @@ -472,7 +472,7 @@ define(['backbone', const externalid = this.shipment.get('EXTERNALSHIPPINGIDTOSYNCHROTRON') if (externalid && ss_url) { const link = ss_url+'/shipment-requests/'+externalid+'/incoming' - window.location.href = link + window.location.assign(link) return } @@ -518,7 +518,7 @@ define(['backbone', }, success: function(resp) { if ( - app.options.get("shipping_service_app_url_incoming") + ss_url && (Number(self.terms.get('ACCEPTED')) === 1) // terms.ACCEPTED could be undefined, 1, or "1" && app.options.get("facility_courier_countries").includes(country) ) { @@ -529,9 +529,7 @@ define(['backbone', app.alert({message: "Error performing redirect: external shipping id is null"}) return; } - window.location.assign( - `${app.options.get("shipping_service_app_url")}/shipment-requests/${external_id}/incoming` - ) + window.location.assign(`${ss_url}/shipment-requests/${external_id}/incoming`) }) } else { app.message({ message: 'Air Waybill Successfully Created'})