M3 Security Fixes for Pass 41

This commit is contained in:
Mark Gregory
2026-09-17 13:37:19 +01:00
parent a9b63e43b3
commit 15773b0bce
56 changed files with 169 additions and 216 deletions
@@ -134,7 +134,7 @@ class CloseShipment extends Controller
// Check Date & Time Before Updating ICM699M
if ($sHDT != '' && $sHTIME != '' && $sHTYPE != '' && $nODEBUG) {
$iCM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
->where('SHMACPKR', $mANIFEST)
->where('SHDT', $sHDT)
->where('SHTIME', $sHTIME)
@@ -156,7 +156,7 @@ class CloseShipment extends Controller
->where('SHERROR', 'Z')
->where('SHTYPE', 'M3-QtyChg')
->get();
foreach ($iCM699MQtyChg as $key => $ICM699MQtyChgR) {
foreach ($iCM699MQtyChg as $ICM699MQtyChgR) {
$string = $ICM699MQtyChgR->SHDATA;
$start = 'PickerLine:';
$end = ' -';
@@ -308,7 +308,6 @@ class CloseShipment extends Controller
$a4ONO = trim($ICM695M1JOINR->A4ONO);
$aYMACPKR = trim($ICM695M1JOINR->AYMACPKR);
$aYINTBOX = trim($ICM695M1JOINR->AYINTBOX);
$a4CLOSEM3 = trim($ICM695M1JOINR->A4CLOSEM3);
$tRACKING = trim($ICM695M1JOINR->TRACKING);
$sCAC = trim($ICM695M1JOINR->SCAC);
$cARRIER = '';
@@ -379,7 +378,7 @@ class CloseShipment extends Controller
// Get Commodities
$commoditiesTmp = isset($responseData->commodities) ? $responseData->commodities : '';
if ($commoditiesTmp != '') {
$commodities = $commoditiesTmp; // json_encode($commoditiesTmp);
$commodities = $commoditiesTmp;
} else {
$commodities = '';
$errorMsgs = $errorMsgs . ' Could not find Commodities; ';
@@ -639,7 +638,6 @@ class CloseShipment extends Controller
if ($responseContents != null && $responseStatusCode == '200') {
$responseMsg = $responseContents->result->CloseShipment;
$m3APIRESULT = $responseMsg->PickingListClose->Result;
$m3APIRESULTMsg = isset($responseMsg->PickingListClose->ErrorMessage) ? $responseMsg->PickingListClose->ErrorMessage : '';
// Check M3 Response for Errors
$responseResult = $responseContents->result;
@@ -664,7 +662,6 @@ class CloseShipment extends Controller
} else {
$m3APIRESULT = 'Error';
$responseMsg = self::NULL_M3_RESPONSE;
$m3APIRESULTMsg = self::NULL_M3_RESPONSE;
$responseResult = '';
$m3Errors = $responseStatusCode;
}
@@ -745,7 +742,7 @@ class CloseShipment extends Controller
// Update ICM699M : Look for CommTCP_read and set SHERROR to Z Case # 580
$sHACKNOTE = 'Sentinel automatically closed the error (false positive CommTCP_read)';
$iCM699MUZ = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
->where('SHMACPKR', $aYMACPKR)
->where('SHCO', $cOMPANY)
->where('SHWHS', $wHS)
@@ -757,7 +754,7 @@ class CloseShipment extends Controller
// Update ICM705M1 to say that we have processed this manifest (set APSPARE2='X' )
if ($tRANSTYPE == 'M') {
$iCM705M1U = DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
->where('APMANIFEST', $mANIFEST)
->where('APCO', $cOMPANY)
->where('APWHS', $wHS)
@@ -794,7 +791,6 @@ class CloseShipment extends Controller
$a4REFORD = trim($ICM695M1JOINR->A4REFORD);
$a4ONO = trim($ICM695M1JOINR->A4ONO);
$aYMACPKR = trim($ICM695M1JOINR->A4MACPKR);
$a4CLOSEM3 = trim($ICM695M1JOINR->A4CLOSEM3);
$aYWHS = trim($ICM695M1JOINR->A4WHS);
$aYCO = trim($ICM695M1JOINR->A4CO);
@@ -843,7 +839,6 @@ class CloseShipment extends Controller
if ($responseContents != null) {
$responseMsg = $responseContents->result->CloseShipment;
$m3APIRESULT = $responseMsg->PickingListClose->Result;
$m3APIRESULTMsg = isset($responseMsg->PickingListClose->ErrorMessage) ? $responseMsg->PickingListClose->ErrorMessage : '';
// Check M3 Response for Errors
$responseResult = $responseContents->result;
@@ -863,7 +858,6 @@ class CloseShipment extends Controller
} else {
$m3APIRESULT = 'Error';
$responseMsg = self::NULL_M3_RESPONSE;
$m3APIRESULTMsg = self::NULL_M3_RESPONSE;
}
// If you get a successful response
@@ -917,7 +911,7 @@ class CloseShipment extends Controller
// Update ICM699M : Look for CommTCP_read and set SHERROR to Z Case # 580
$sHACKNOTE = 'Sentinel automatically closed the error (false positive CommTCP_read)';
$iCM699MUZ = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
->where('SHMACPKR', $aYMACPKR)
->where('SHCO', $cOMPANY)
->where('SHWHS', $wHS)
@@ -141,7 +141,7 @@ class TransferAPI extends Controller
}
// Set SHERROR to Z in ICM699M
$iCM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
->where('SHMACPKR', $dELIVERYNO)
->where('SHDT', $sHDT)
->where('SHTIME', $sHTIME)
@@ -266,7 +266,7 @@ class TransferAPI extends Controller
$responseStatusCode = $response->getStatusCode();
$m3SessionId = $response->hasHeader('x-transaction-id') ? '-sessionID:' . $response->header('x-transaction-id') : '-sessionID';
$m3ResponseTimeTmp = $response->hasHeader('x-response-time') ? ltrim($response->header('x-response-time'), '-') : '0';
$m3ResponseTimeTmp2 = floatval($m3ResponseTimeTmp) / 1000; // $m3ResponseTimeTmp / 1000;
$m3ResponseTimeTmp2 = floatval($m3ResponseTimeTmp) / 1000;
$dateTime = new DateTime;
$dateTime->setTimestamp($m3ResponseTimeTmp2);
$m3ResponseTime = $m3ResponseTimeTmp != '' ? '-M3ResponseTime:' . $dateTime->format('d/m/Y H:i:s.v') : '-M3ResponseTime';
@@ -301,7 +301,7 @@ class TransferAPI extends Controller
Helper::logToICM699M($data);
// Log to ICM799M
$iCM799MINS = DB::connection(config('m3.connection', 'pgsql'))->table('icm799m')
DB::connection(config('m3.connection', 'pgsql'))->table('icm799m')
->insert(['IMDIV' => $dIVI,
'IMPLANT' => $a5PLANT,
'IMWHS' => $wHS,
@@ -548,7 +548,7 @@ class TransferAPI extends Controller
$responseStatusCode = $response->getStatusCode();
$m3SessionId = $response->hasHeader('x-transaction-id') ? '-sessionID:' . $response->header('x-transaction-id') : '-sessionID';
$m3ResponseTimeTmp = $response->hasHeader('x-response-time') ? ltrim($response->header('x-response-time'), '-') : '0';
$m3ResponseTimeTmp2 = floatval($m3ResponseTimeTmp) / 1000; // $m3ResponseTimeTmp / 1000;
$m3ResponseTimeTmp2 = floatval($m3ResponseTimeTmp) / 1000;
$dateTime = new DateTime;
$dateTime->setTimestamp($m3ResponseTimeTmp2);
$m3ResponseTime = $m3ResponseTimeTmp != '' ? '-M3ResponseTime:' . $dateTime->format('d/m/Y H:i:s.v') : '-M3ResponseTime';