Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions api/src/Page/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
14 changes: 10 additions & 4 deletions client/src/js/modules/shipment/views/createawb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.assign(link)
return
}

var prod = null
if (
(
Expand Down Expand Up @@ -510,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)
) {
Expand All @@ -521,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'})
Expand Down
Loading