Skip to content

Commit

Permalink
LIMS-1331: Send all dispatch requests to Goods Handling unless intern…
Browse files Browse the repository at this point in the history
…ational via DHL for BI/MX
  • Loading branch information
JPHall-DLS authored May 29, 2024
1 parent 040db3b commit ccbf068
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions api/src/Page/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ function _dispatch_dewar()
}

$dew = $this->db->pq(
"SELECT d.dewarid, d.barcode, d.storagelocation, d.dewarstatus, s.shippingid, CONCAT(p.proposalcode, p.proposalnumber) as proposal
"SELECT d.dewarid, d.barcode, d.storagelocation, d.dewarstatus, s.shippingid, p.proposalcode, CONCAT(p.proposalcode, p.proposalnumber) as proposal
FROM dewar d
INNER JOIN shipping s ON s.shippingid = d.shippingid
INNER JOIN proposal p ON p.proposalid = s.proposalid
Expand Down Expand Up @@ -1122,7 +1122,14 @@ function _dispatch_dewar()
$data['LCEMAIL'] = '';
$email->data = $data;

if ($country != $facility_country && !is_null($dispatch_email_intl)) {
if (
$country != $facility_country &&
array_key_exists('DELIVERYAGENT_AGENTNAME', $data) &&
$data['DELIVERYAGENT_AGENTNAME'] === 'DHL' &&
array_key_exists('PROPOSALCODE', $dew) &&
in_array($dew['PROPOSALCODE'], array('bi','cm','mx')) &&
!is_null($dispatch_email_intl)
) {
$recpts = $dispatch_email_intl;
} else {
$recpts = $dispatch_email;
Expand Down

0 comments on commit ccbf068

Please sign in to comment.