m3 Security Fixes
This commit is contained in:
@@ -50,11 +50,11 @@ class CloseShipment extends Controller
|
||||
# PDF File PATH
|
||||
$pdfFilePath = Config::get('arrays.PdfPath');
|
||||
$DELIVERYNO = $MANIFEST != '' ? $MANIFEST : '000000';
|
||||
|
||||
|
||||
// Log::channel('dailyCron')->info("Close Manifest:".$MANIFEST.'-WHS: '.$WHS."-CO:".$COMPANY);
|
||||
|
||||
if ($urlParams != '') {
|
||||
# Write to Logs : JSON
|
||||
# Write to Logs : JSON
|
||||
$JSONIN = json_encode([
|
||||
"WHS" => $WHS,
|
||||
"COMPANY" => $COMPANY,
|
||||
@@ -87,7 +87,7 @@ class CloseShipment extends Controller
|
||||
|
||||
if ($tokenData->code == '200') {
|
||||
$IonToken = isset($tokenData->token) ? $tokenData->token : '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$SHDATA = isset($tokenData->message) ? $tokenData->message : '';
|
||||
$DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : '000000';
|
||||
@@ -107,7 +107,7 @@ class CloseShipment extends Controller
|
||||
'SHWHS' => $WHS
|
||||
];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
return $tokenResponse;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ class CloseShipment extends Controller
|
||||
->where('AYMACPKR',$MANIFEST)
|
||||
->where('AYWHS',$WHS)
|
||||
->orderBy('AYMACPKR');
|
||||
|
||||
|
||||
# Check Date & Time Before Updating ICM699M
|
||||
if ($SHDT!='' && $SHTIME!='' && $SHTYPE!='' && $NODEBUG) {
|
||||
$ICM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
@@ -141,7 +141,7 @@ class CloseShipment extends Controller
|
||||
->where('SHDT',$SHDT)
|
||||
->where('SHTIME',$SHTIME)
|
||||
->where('SHCO',$COMPANY)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHSOURCE',$SHSOURCE)
|
||||
->where('SHERROR','X')
|
||||
->where('SHTYPE',$SHTYPE)
|
||||
@@ -153,7 +153,7 @@ class CloseShipment extends Controller
|
||||
->select()
|
||||
->where('SHMACPKR',$MANIFEST)
|
||||
->where('SHCO',$COMPANY)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHSOURCE','PackSyst4tray')
|
||||
->where('SHERROR','Z')
|
||||
->where('SHTYPE','M3-QtyChg')
|
||||
@@ -176,7 +176,7 @@ class CloseShipment extends Controller
|
||||
->where('A4MACPKR',$MANIFEST)
|
||||
->orderBy('A4MACPKR');
|
||||
}
|
||||
|
||||
|
||||
$ICM695M1TMP = $ICM695M1PREP->get();
|
||||
// dump($ICM695M1TMP);
|
||||
// Log::channel('dailyCron')->info($ICM695M1TMP);
|
||||
@@ -194,7 +194,7 @@ class CloseShipment extends Controller
|
||||
});
|
||||
}
|
||||
// dump($ICM695M1TMPCOLF);
|
||||
|
||||
|
||||
$ICM695M1TMPCOLFA = $ICM695M1TMPCOLF->toArray();
|
||||
// dump($ICM695M1TMPCOLFA);
|
||||
|
||||
@@ -239,7 +239,7 @@ class CloseShipment extends Controller
|
||||
|
||||
# Close Shipment for Manifest or Single MacPKR
|
||||
if (count($ICM695M1TMP)>0 && ($TRANSTYPE=='M' || $TRANSTYPE=='P')) {
|
||||
# Loop the Results from $ICM595M1TMP
|
||||
# Loop the Results from $ICM595M1TMP
|
||||
foreach ($ICM695M1TMP as $key => $ICM695M1R) {
|
||||
$PACKAGES = [];
|
||||
$AYWHS = trim($ICM695M1R->AYWHS);
|
||||
@@ -272,7 +272,7 @@ class CloseShipment extends Controller
|
||||
// ->where('IMWHS',$AYWHS)
|
||||
// ->where('IMDELNO',$AYMACPKR)
|
||||
// ->where('IMLINE',$AYRLNO)
|
||||
// ->whereIn('IMTOLOC',['DOCK','PACK'])
|
||||
// ->whereIn('IMTOLOC',['DOCK','PACK'])
|
||||
// ->get();
|
||||
|
||||
# PFC : Check that Picked / Packed are all Equal
|
||||
@@ -283,13 +283,13 @@ class CloseShipment extends Controller
|
||||
$A5RSVQTY = isset($ICM688M2SLR->A5RSVQTY) ? $ICM688M2SLR->A5RSVQTY : 0;
|
||||
$A5ShortShipQty = (int) $A5RSVQTY - (int) $A5PICKED;
|
||||
|
||||
# Set EndFLag=1 for short picks
|
||||
# Set EndFLag=1 for short picks
|
||||
if ($A5ShortShipQty > 0) {
|
||||
$EndFlag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# Get TRAILERNUMBER SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
|
||||
# Get TRAILERNUMBER SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
|
||||
$TRAILERNUMBERS = DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
|
||||
->select('APTRUCKID','APTRACKNO','APMANIFEST')
|
||||
->where('APCO',$COMPANY)
|
||||
@@ -313,7 +313,7 @@ class CloseShipment extends Controller
|
||||
->orderBy('AYINTBOX')
|
||||
->get();
|
||||
// dd($ICM695M1JOINTMP);
|
||||
|
||||
|
||||
foreach ($ICM695M1JOINTMP as $key => $ICM695M1JOINR) {
|
||||
$A4SHIPVIA = isset($ICM695M1JOINR->A4SHIPVIA) ? trim(str_replace("&", "_",$ICM695M1JOINR->A4SHIPVIA)) : '';
|
||||
|
||||
@@ -375,18 +375,18 @@ class CloseShipment extends Controller
|
||||
->where('A1DELNO',$AYMACPKR)
|
||||
->first();
|
||||
$GS1LabelExist = isset($ICM666MSQLSel->A1SPR1A01) ? trim($ICM666MSQLSel->A1SPR1A01) : 0;
|
||||
|
||||
|
||||
# Case #566: BOL = PRONUMBER For SCAC=='RETR'
|
||||
if ($SCAC=='RETR') {
|
||||
$BILLOFLADING = $PRONUMBER;
|
||||
}
|
||||
|
||||
# Get Commodities
|
||||
# Get Commodities
|
||||
$myRequest = new Request();
|
||||
$myRequest->setMethod('POST');
|
||||
|
||||
|
||||
$myRequest->request->add([
|
||||
'MACPKR' => $AYMACPKR
|
||||
'MACPKR' => $AYMACPKR
|
||||
]);
|
||||
# Call processShipment
|
||||
$controller = new GetContentsController();
|
||||
@@ -411,7 +411,7 @@ class CloseShipment extends Controller
|
||||
$commodities = '';
|
||||
$ErrorMsgs = $ErrorMsgs ." Could not find Commodities; ";
|
||||
}
|
||||
# End Commodities
|
||||
# End Commodities
|
||||
|
||||
# Check ICM699M for SHERROR=X
|
||||
$ICM699MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
@@ -433,7 +433,7 @@ class CloseShipment extends Controller
|
||||
}
|
||||
|
||||
if($AYTYPE==""){
|
||||
# Get AETYPE SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
|
||||
# Get AETYPE SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
|
||||
$ICM693MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm693m')
|
||||
->select('AEID')
|
||||
->where('AESPR1A01','D')
|
||||
@@ -448,11 +448,11 @@ class CloseShipment extends Controller
|
||||
# If billable=Y and a4ratetcp(FREIGHT)>0 and a4ratem3=blank, then call the freight API CoCharge
|
||||
if ($BILLABLE=='Y' && $FREIGHT>0 && $A4RATEM3=='') {
|
||||
$DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : '000000';
|
||||
|
||||
|
||||
if($SHIPTYPE=='LTL') {
|
||||
$shippingToBill = $FREIGHT*(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceLTL'))/100;
|
||||
$shippingToBill = $FREIGHT*(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceLTL'))/100;
|
||||
} else {
|
||||
$shippingToBill = $FREIGHT*(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel') )/100;
|
||||
$shippingToBill = $FREIGHT*(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel') )/100;
|
||||
}
|
||||
# Construct Json for COCharge
|
||||
$JSONCoCharge = [
|
||||
@@ -478,7 +478,7 @@ class CloseShipment extends Controller
|
||||
# Set PDF URLs for Labels
|
||||
$CarrierLabel = '';
|
||||
$ContentLabel = '';
|
||||
|
||||
|
||||
$docTypes = ['ContentLabel','CarrierLabel'];
|
||||
foreach ($docTypes as $key => $value) {
|
||||
switch ($value) {
|
||||
@@ -489,7 +489,7 @@ class CloseShipment extends Controller
|
||||
$pdfFileName = $pdfFilePath.$PDFKey.'.pdf';
|
||||
// dd($pdfFileName);
|
||||
|
||||
if(File::exists($pdfFileName)){
|
||||
if(File::exists($pdfFileName)){
|
||||
$CarrierLabel = route('m3.M3GetPDFFromCache.index',['MACPKR'=>$AYMACPKR, 'DOCTYPE'=>$DOCTYPE ]);
|
||||
}
|
||||
break;
|
||||
@@ -524,7 +524,7 @@ class CloseShipment extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
# Get Packages Array
|
||||
# Get Packages Array
|
||||
$PACKAGES[]=[
|
||||
"TRACKINGID" => $TRACKING,
|
||||
"BUNDLES" => $AYTYPE,
|
||||
@@ -617,7 +617,7 @@ class CloseShipment extends Controller
|
||||
# MAK : Log JSON Manifest # and MACKPKR #
|
||||
// Log::channel('dailyCron')->info('1 >>> JSON Sent for Manifest: '.$MANIFEST.' ,Macpicker: '.$AYMACPKR);
|
||||
Log::channel('dailyCron')->info('1 >>> JSON Sent for Manifest: '.(string)(int)$MANIFEST.' ,Macpicker: '.$AYMACPKR);
|
||||
|
||||
|
||||
$data = [
|
||||
'SHMACPKR' => $DELIVERYNO,
|
||||
'SHDT' => date('Y-m-d'),
|
||||
@@ -670,13 +670,13 @@ class CloseShipment extends Controller
|
||||
$responseMsg = $responseContents->result->CloseShipment;
|
||||
$M3APIRESULT = $responseMsg->PickingListClose->Result;
|
||||
$M3APIRESULTMsg = isset($responseMsg->PickingListClose->ErrorMessage) ? $responseMsg->PickingListClose->ErrorMessage: '';
|
||||
|
||||
|
||||
# Check M3 Response for Errors
|
||||
$responseResult = $responseContents->result;
|
||||
$M3Errors = Helper::checkM3Errors($responseResult);
|
||||
// dd($M3Errors);
|
||||
|
||||
# If you get a successful response, update database file ICM688M1/A4RATEm3=X
|
||||
# If you get a successful response, update database file ICM688M1/A4RATEm3=X
|
||||
# Update ICM688M1 : Change A4RATEM3
|
||||
if (count($JSONCoCharge)>0 && $M3APIRESULT != 'Error') {
|
||||
DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
|
||||
@@ -781,7 +781,7 @@ class CloseShipment extends Controller
|
||||
$ICM699MUZ = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
->where('SHMACPKR',$AYMACPKR)
|
||||
->where('SHCO',$COMPANY)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHSOURCE',$SHSOURCE)
|
||||
->where('SHERROR','X')
|
||||
->where('SHTYPE','M3-General')
|
||||
@@ -793,17 +793,17 @@ class CloseShipment extends Controller
|
||||
$ICM705M1U = DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
|
||||
->where('APMANIFEST',$MANIFEST)
|
||||
->where('APCO',$COMPANY)
|
||||
->where('APWHS',$WHS)
|
||||
->where('APWHS',$WHS)
|
||||
->update(["APSPARE2"=>"X"]);
|
||||
}
|
||||
|
||||
# Send Response
|
||||
|
||||
# Send Response
|
||||
if ($allErrMsgs=='') {
|
||||
return response()->json([
|
||||
'code' => '200',
|
||||
'status' => 'Success',
|
||||
'message'=> 'All Operations Successful'
|
||||
]);
|
||||
]);
|
||||
}
|
||||
else{
|
||||
$allErrMsgsC = Helper::removeDuplicateSubstrings($allErrMsgs);
|
||||
@@ -812,9 +812,9 @@ class CloseShipment extends Controller
|
||||
'code' => '206',
|
||||
'status' => 'Success With Warnings',
|
||||
'message'=> $allErrMsgsC ."; Check Transaction Logs for Errors or Warnings."
|
||||
]);
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
# Close Shipment for Zero Picks
|
||||
else if (count($ICM695M1TMP)>0 && $TRANSTYPE=='Z') {
|
||||
@@ -876,12 +876,12 @@ class CloseShipment extends Controller
|
||||
$responseContents = json_decode($response->getBody()->getContents());
|
||||
$M3SessionId = $response->hasHeader('x-transaction-id') ? "-sessionID:". $response->header('x-transaction-id') : '-sessionID';
|
||||
$M3Errors = '';
|
||||
|
||||
|
||||
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;
|
||||
$M3Errors = Helper::checkM3Errors($responseResult);
|
||||
@@ -959,21 +959,21 @@ class CloseShipment extends Controller
|
||||
$ICM699MUZ = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
->where('SHMACPKR',$AYMACPKR)
|
||||
->where('SHCO',$COMPANY)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHSOURCE',$SHSOURCE)
|
||||
->where('SHERROR','X')
|
||||
->where('SHTYPE','M3-General')
|
||||
->where('SHDATA','like','%CommTCP_read%')
|
||||
->update(["SHERROR"=>"Z","SHACKUSER"=>$SHUSER,"SHACKDATE"=>date('Y-m-d'),"SHACKTIME"=>date('H:i:s'),"SHACKNOTE"=> $SHACKNOTE]);
|
||||
}
|
||||
|
||||
# Send Response
|
||||
|
||||
# Send Response
|
||||
if ($ErrorMsgs=='') {
|
||||
return response()->json([
|
||||
'code' => '200',
|
||||
'status' => 'Success',
|
||||
'message'=> 'All Operations Successful'
|
||||
]);
|
||||
]);
|
||||
}
|
||||
else{
|
||||
return response()->json([
|
||||
@@ -988,9 +988,9 @@ class CloseShipment extends Controller
|
||||
$DELIVERYNO = isset($MANIFEST) ? $MANIFEST : '000000';
|
||||
// # Set SHDATA Message
|
||||
$SHDATAMSG = 'No records found in ICM695M1,or URL parameters incomplete';
|
||||
# count($ICM695M1TMP)==0 ? 'MacPkr already closed' :
|
||||
# count($ICM695M1TMP)==0 ? 'MacPkr already closed' :
|
||||
$SHERROR = 'X';
|
||||
# count($ICM695M1TMP)==0 ? 'Z' :
|
||||
# count($ICM695M1TMP)==0 ? 'Z' :
|
||||
|
||||
# Write to Logs Out : Error
|
||||
$data = [
|
||||
|
||||
Reference in New Issue
Block a user