diff --git a/Modules/M3/Console/CallCloseAPI.php b/Modules/M3/Console/CallCloseAPI.php
index fa59acd4..f0e4e2a8 100644
--- a/Modules/M3/Console/CallCloseAPI.php
+++ b/Modules/M3/Console/CallCloseAPI.php
@@ -8,11 +8,11 @@ use Illuminate\Console\Command;
use Illuminate\Http\Request;
use Log;
use Modules\M3\Http\Controllers\API\CloseShipment;
-use Str;
class CallCloseAPI extends Command
{
protected $signature = 'command:CallCloseAPI {user?} {manifest?} {co?} {whs?} ';
+
protected $description = 'Call Close API';
public function handle()
@@ -24,9 +24,11 @@ class CallCloseAPI extends Command
return $this->closeSpecificManifest($manifest, (string) ($this->argument('co') ?? ''), (string) ($this->argument('whs') ?? ''));
}
$this->closePendingManifests();
+
return self::SUCCESS;
} catch (\Throwable $th) {
Log::channel('dailyCron')->error($th);
+
return self::FAILURE;
}
}
@@ -55,9 +57,11 @@ class CallCloseAPI extends Command
->where('APSPARE2', '')->where('APCO', $co)->where('APWHS', $whs)->where('APMANIFEST', $manifest)->exists();
if (! $exists) {
Log::channel('dailyCron')->warning('Manifest not available for close', compact('manifest', 'co', 'whs'));
+
return self::FAILURE;
}
$this->closeManifest($manifest, $co, $whs);
+
return self::SUCCESS;
}
diff --git a/Modules/M3/Console/ClosedOrderSaveXls.php b/Modules/M3/Console/ClosedOrderSaveXls.php
index 945a4a66..49a29758 100644
--- a/Modules/M3/Console/ClosedOrderSaveXls.php
+++ b/Modules/M3/Console/ClosedOrderSaveXls.php
@@ -100,7 +100,7 @@ class ClosedOrderSaveXls extends Command
str_replace('-', '', $to),
$file,
! Storage::disk('publicCL')->exists($file),
- 'Last Month'
+ 'Last Month',
);
}
@@ -122,7 +122,7 @@ class ClosedOrderSaveXls extends Command
str_replace('-', '', $to),
$file,
true,
- 'Current Month'
+ 'Current Month',
);
}
@@ -134,7 +134,7 @@ class ClosedOrderSaveXls extends Command
string $to,
string $file,
bool $shouldGenerate,
- string $label
+ string $label,
): void {
$this->info('From Date: ' . $from);
$this->info('To Date: ' . $to);
@@ -222,8 +222,7 @@ SQL;
Log::channel('dailyCron')->info(
'Maximum allowed records for Excel export is: ' . number_format($maxRecords)
- . ' current records: ' . number_format($count)
+ . ' current records: ' . number_format($count),
);
}
-
-}
\ No newline at end of file
+}
diff --git a/Modules/M3/Console/GenerateGS1Cmd.php b/Modules/M3/Console/GenerateGS1Cmd.php
index c52d7c81..7552b0ef 100644
--- a/Modules/M3/Console/GenerateGS1Cmd.php
+++ b/Modules/M3/Console/GenerateGS1Cmd.php
@@ -59,15 +59,15 @@ class GenerateGS1Cmd extends Command
// Get the Calling User
$userId = $this->argument('user');
- $SHUSER = isset($userId) ? $userId : (m3_user() !== '' ? Str::upper(trim(m3_user())) : 'TWOSHIP');
- $this->info('User: ' . $SHUSER);
+ $sHUSER = isset($userId) ? $userId : (m3_user() !== '' ? Str::upper(trim(m3_user())) : 'TWOSHIP');
+ $this->info('User: ' . $sHUSER);
// Get Manifest Array
- $GSArray1 = $this->option('gsarray');
- $GSArray = json_decode($GSArray1, true);
+ $gSArray1 = $this->option('gsarray');
+ $gSArray = json_decode($gSArray1, true);
// MAK : Used for debug only
- $GSArray = ['Macpkr' => '55555', 'Recipient_Address1' => '9571 Pan American DR', 'Recipient_Address2' => 'C/O AEE Solar', 'Recipient_City' => 'El Paso',
+ $gSArray = ['Macpkr' => '55555', 'Recipient_Address1' => '9571 Pan American DR', 'Recipient_Address2' => 'C/O AEE Solar', 'Recipient_City' => 'El Paso',
'Recipient_CompanyName' => 'SNAPRACK EL PASO PRODUCTION', 'Recipient_CountryCode' => 'US', 'Recipient_PostalCode' => '79927', 'Recipient_State' => 'TX',
'Sender_Address1' => '6800 Arnold Miller Pkwy', 'Sender_Address2' => '', 'Sender_City' => 'Solon',
'Sender_CompanyName' => 'Erico International', 'Sender_Country' => 'US', 'Sender_PostalCode' => '44139', 'Sender_State' => 'OH',
@@ -75,19 +75,19 @@ class GenerateGS1Cmd extends Command
'PackagesArray' => ['package 1', 'package 2'],
];
- if ($SHUSER != '') {
+ if ($sHUSER != '') {
// Get User CO & WH from Table ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
- ->where('R428US', '=', $SHUSER)
+ ->where('R428US', '=', $sHUSER)
->first();
- $R428US = isset($ICM428M->R428US) ? $ICM428M->R428US : ''; // User
- $COMPANY = isset($ICM428M->R428CO) ? $ICM428M->R428CO : ''; // Company
- $PLANT = isset($ICM428M->R428PL) ? $ICM428M->R428PL : ''; // Plant
- $WHS = isset($ICM428M->R428WH) ? $ICM428M->R428WH : ''; // WareHouse
+ $r428US = isset($iCM428M->R428US) ? $iCM428M->R428US : ''; // User
+ $cOMPANY = isset($iCM428M->R428CO) ? $iCM428M->R428CO : ''; // Company
+ $pLANT = isset($iCM428M->R428PL) ? $iCM428M->R428PL : ''; // Plant
+ $wHS = isset($iCM428M->R428WH) ? $iCM428M->R428WH : ''; // WareHouse
- $Macpkr = $GSArray['Macpkr'];
+ $macpkr = $gSArray['Macpkr'];
$packageType = '0';
$manufactID = '0826528'; // MAK : get ID from Nvent and save to Config File
$total_length = 9;
@@ -121,25 +121,25 @@ class GenerateGS1Cmd extends Command
';
// Get number of Pallets
- $packageCount = count($GSArray['PackagesArray']);
+ $packageCount = count($gSArray['PackagesArray']);
$packageNum = 1;
- foreach ($GSArray['PackagesArray'] as $key => $value) {
+ foreach ($gSArray['PackagesArray'] as $key => $value) {
$table_style = $packageNum < $packageCount ? ' style="page-break-after: always;" ' : '';
if (Cache::has('GS1SEQUENCE')) {
- $GS1SEQUENCE = Cache::get('GS1SEQUENCE');
- $GS1SEQUENCE++;
- $GS1SEQUENCEID = str_pad($GS1SEQUENCE, $total_length, '0', STR_PAD_LEFT);
+ $gS1SEQUENCE = Cache::get('GS1SEQUENCE');
+ $gS1SEQUENCE++;
+ $gS1SEQUENCEID = str_pad($gS1SEQUENCE, $total_length, '0', STR_PAD_LEFT);
}
// Box Number Not Found Get it from DB
else {
- $GS1SEQUENCE = 1;
- $GS1SEQUENCEID = str_pad($GS1SEQUENCE, $total_length, '0', STR_PAD_LEFT);
+ $gS1SEQUENCE = 1;
+ $gS1SEQUENCEID = str_pad($gS1SEQUENCE, $total_length, '0', STR_PAD_LEFT);
}
- Cache::forever('GS1SEQUENCE', $GS1SEQUENCEID);
- $this->info('>>> GS1 sequence Id: ' . $GS1SEQUENCEID);
+ Cache::forever('GS1SEQUENCE', $gS1SEQUENCEID);
+ $this->info('>>> GS1 sequence Id: ' . $gS1SEQUENCEID);
- $gs1_128_bc_1 = '00' . $packageType . $manufactID . $GS1SEQUENCEID;
+ $gs1_128_bc_1 = '00' . $packageType . $manufactID . $gS1SEQUENCEID;
// Calculate Check Digit
$digits = str_split($gs1_128_bc_1);
@@ -160,17 +160,17 @@ class GenerateGS1Cmd extends Command
$checkDigit = ($remainder == 0) ? 0 : 10 - $remainder;
$gs1_128_bc = $gs1_128_bc_1 . $checkDigit;
- $gs1_128_bc_desc = '(00)' . $packageType . $manufactID . $GS1SEQUENCEID . $checkDigit;
+ $gs1_128_bc_desc = '(00)' . $packageType . $manufactID . $gS1SEQUENCEID . $checkDigit;
$data = [
- 'ship_to' => $GSArray['Recipient_CompanyName'] . '
- PURCHASE ORDER: ' . $GSArray['Macpkr'] . '
+ PURCHASE ORDER: ' . $gSArray['Macpkr'] . '
Vendor: ' . $manufactID . '
|
@@ -246,9 +246,9 @@ class GenerateGS1Cmd extends Command
$labelsPath = Config::get('arrays.PdfPath');
// Put the PDF in labels/CarrierLabel
- $GSFolder = 'GSLabel';
- $carrierFileName = $GSFolder . '_' . $Macpkr . '_' . $COMPANY . '_' . $WHS;
- file_put_contents($labelsPath . $GSFolder . '/' . $carrierFileName . '.pdf', $pdfContent);
+ $gSFolder = 'GSLabel';
+ $carrierFileName = $gSFolder . '_' . $macpkr . '_' . $cOMPANY . '_' . $wHS;
+ file_put_contents($labelsPath . $gSFolder . '/' . $carrierFileName . '.pdf', $pdfContent);
// Check if the PDF was generated correctly
// if (!file_exists($tempPdfPath) || filesize($tempPdfPath) === 0) {
diff --git a/Modules/M3/Helpers/Helper.php b/Modules/M3/Helpers/Helper.php
index 84b4f36d..199a4266 100644
--- a/Modules/M3/Helpers/Helper.php
+++ b/Modules/M3/Helpers/Helper.php
@@ -21,7 +21,7 @@ class Helper
$token = Cache::get('token');
if (isset($token)) {
- $IonToken = $token;
+ $ionToken = $token;
} else {
// ## CURL
// ## Generate Token
@@ -55,9 +55,9 @@ class Helper
'message' => 'Token Verification Error...' . curl_error($curl),
]);
} elseif (isset($responseJ->access_token)) {
- $IonToken = $responseJ->access_token;
+ $ionToken = $responseJ->access_token;
- Cache::put('token', $IonToken, now()->addMinutes(59));
+ Cache::put('token', $ionToken, now()->addMinutes(59));
} else {
return response()->json([
'code' => '400',
@@ -69,9 +69,9 @@ class Helper
curl_close($curl);
}
- return $IonToken;
+ return $ionToken;
// 'code' => '200',
- // 'token' => $IonToken
+ // 'token' => $ionToken
// ]);
}
@@ -88,7 +88,7 @@ class Helper
$token = Cache::get('token');
if (isset($token)) {
- $IonToken = $token;
+ $ionToken = $token;
} else {
// ## CURL
// ## Generate Token
@@ -127,8 +127,8 @@ class Helper
'message' => 'Token Verification Error...' . curl_error($curl),
]);
} elseif (isset($responseJ->access_token)) {
- $IonToken = $responseJ->access_token;
- Cache::put('token', $IonToken, now()->addMinutes(59));
+ $ionToken = $responseJ->access_token;
+ Cache::put('token', $ionToken, now()->addMinutes(59));
} else {
// Clear Cache
Cache::forget('token');
@@ -143,7 +143,7 @@ class Helper
return response()->json([
'code' => '200',
- 'token' => $IonToken,
+ 'token' => $ionToken,
]);
}
@@ -254,34 +254,34 @@ class Helper
public static function checkLength($JSONL, $DBL, $TYPE)
{
// Check type
- $JSONType = gettype($JSONL);
+ $jSONType = gettype($JSONL);
- switch ($JSONType) {
+ switch ($jSONType) {
case 'string':
- $JSONTypeConv = 'string';
+ $jSONTypeConv = 'string';
break;
case 'double':
- $JSONTypeConv = 'number';
+ $jSONTypeConv = 'number';
break;
case 'integer':
- $JSONTypeConv = 'number';
+ $jSONTypeConv = 'number';
break;
default:
- $JSONTypeConv = 'null';
+ $jSONTypeConv = 'null';
break;
}
$TYPE = $TYPE == 'integer' || $TYPE == 'DEC' ? 'number' : $TYPE;
// Check Json Field should be < DB Field
- $LengthOK[413] = (strlen($JSONL) <= $DBL) ? true : false;
+ $lengthOK[413] = (strlen($JSONL) <= $DBL) ? true : false;
// Empty Fields
- $LengthOK[411] = true; // !empty($JSONL) ? true : false ;
+ $lengthOK[411] = true; // !empty($JSONL) ? true : false ;
// Wrong Types
- $LengthOK[417] = true; // $JSONTypeConv == $TYPE ? true : false ;
- // Log::info($LengthOK);
+ $lengthOK[417] = true; // $jSONTypeConv == $TYPE ? true : false ;
+ // Log::info($lengthOK);
- return $LengthOK;
+ return $lengthOK;
}
public static function sanityzeString($StrTosanityze)
diff --git a/Modules/M3/Http/Controllers/API/CloseShipment.php b/Modules/M3/Http/Controllers/API/CloseShipment.php
index 06b09ca6..a015dec9 100644
--- a/Modules/M3/Http/Controllers/API/CloseShipment.php
+++ b/Modules/M3/Http/Controllers/API/CloseShipment.php
@@ -17,7 +17,9 @@ use Str;
class CloseShipment extends Controller
{
private const ZERO_PAD = '000000';
+
private const JSON_CONTENT_TYPE = 'application/json';
+
private const NULL_M3_RESPONSE = 'M3 API responded with null value';
// CloseShipmentCoChargeAPI : with URL PARAMS COCharge
@@ -28,54 +30,53 @@ class CloseShipment extends Controller
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
// dump($request->all());
- $NODEBUG = true; // ALWAYS set TRUE in Production
- $PACKAGES = [];
- $JSONCoCharge = [];
- $JSONCS = [];
+ $nODEBUG = true; // ALWAYS set TRUE in Production
+ $pACKAGES = [];
+ $jSONCoCharge = [];
+ $jSONCS = [];
// Get the Calling User
- $SHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
- $SHSOURCE = 'CloseShipmentCoChargeAPI';
+ $sHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
+ $sHSOURCE = 'CloseShipmentCoChargeAPI';
try {
// Get URL PARAMS
$urlParams = count($request->all()) > 0 ? $request->all() : '';
- $WHS = isset($urlParams['WHS']) ? $urlParams['WHS'] : '';
- $COMPANY = isset($urlParams['COMPANY']) ? $urlParams['COMPANY'] : '';
- $MANIFEST = isset($urlParams['MANIFEST']) ? $urlParams['MANIFEST'] : '';
- $TRANSTYPE = isset($urlParams['TRANSTYPE']) ? $urlParams['TRANSTYPE'] : 'M'; // M , P , Z
- $TRANSTYPE = $TRANSTYPE != '' ? $TRANSTYPE : 'M'; // M , P , Z
- $SHDT = isset($urlParams['SHDT']) ? $urlParams['SHDT'] : '';
- $SHTIME = isset($urlParams['SHTIME']) ? $urlParams['SHTIME'] : '';
- $SHTYPE = isset($urlParams['SHTYPE']) ? $urlParams['SHTYPE'] : '';
+ $wHS = isset($urlParams['WHS']) ? $urlParams['WHS'] : '';
+ $cOMPANY = isset($urlParams['COMPANY']) ? $urlParams['COMPANY'] : '';
+ $mANIFEST = isset($urlParams['MANIFEST']) ? $urlParams['MANIFEST'] : '';
+ $tRANSTYPE = isset($urlParams['TRANSTYPE']) ? $urlParams['TRANSTYPE'] : 'M'; // M , P , Z
+ $tRANSTYPE = $tRANSTYPE != '' ? $tRANSTYPE : 'M'; // M , P , Z
+ $sHDT = isset($urlParams['SHDT']) ? $urlParams['SHDT'] : '';
+ $sHTIME = isset($urlParams['SHTIME']) ? $urlParams['SHTIME'] : '';
+ $sHTYPE = isset($urlParams['SHTYPE']) ? $urlParams['SHTYPE'] : '';
$allErrMsgs = '';
- $LineAck = [];
+ $lineAck = [];
// PDF File PATH
$pdfFilePath = Config::get('arrays.PdfPath');
- $DELIVERYNO = $MANIFEST != '' ? $MANIFEST : self::ZERO_PAD;
-
+ $dELIVERYNO = $mANIFEST != '' ? $mANIFEST : self::ZERO_PAD;
if ($urlParams != '') {
// Write to Logs : JSON
- $JSONIN = json_encode([
- 'WHS' => $WHS,
- 'COMPANY' => $COMPANY,
- 'MANIFEST-MACPKR' => $MANIFEST,
- 'TRANSTYPE' => $TRANSTYPE,
+ $jSONIN = json_encode([
+ 'WHS' => $wHS,
+ 'COMPANY' => $cOMPANY,
+ 'MANIFEST-MACPKR' => $mANIFEST,
+ 'TRANSTYPE' => $tRANSTYPE,
]);
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Req-out',
- 'SHDATA' => $JSONIN,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $jSONIN,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -85,24 +86,24 @@ class CloseShipment extends Controller
$tokenData = $tokenResponse->getData();
if ($tokenData->code == '200') {
- $IonToken = isset($tokenData->token) ? $tokenData->token : '';
+ $ionToken = isset($tokenData->token) ? $tokenData->token : '';
} else {
- $SHDATA = isset($tokenData->message) ? $tokenData->message : '';
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
+ $sHDATA = isset($tokenData->message) ? $tokenData->message : '';
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
// Write to Logs : Error
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $SHDATA,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $sHDATA,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -111,257 +112,256 @@ class CloseShipment extends Controller
// Set Endpoint URL
$endPointURL = env('ENDPOINTURL') . 'APIFLOWS/Sentinel/TransferAPI?ionapiRespStyle=sync';
- $token = $IonToken;
+ $token = $ionToken;
// Read from ICM695M1
- if ($TRANSTYPE == 'M') {
- $ICM695M1PREP = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
+ if ($tRANSTYPE == 'M') {
+ $iCM695M1PREP = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
->select('AYCO', 'AYWHS', 'AYMACPKR', 'AYRLNO', 'AYAPRF1551')
->distinct()
- ->where('AYCO', $COMPANY)
- ->where('AYAPRF1551', $MANIFEST)
- ->where('AYWHS', $WHS)
+ ->where('AYCO', $cOMPANY)
+ ->where('AYAPRF1551', $mANIFEST)
+ ->where('AYWHS', $wHS)
->orderBy('AYMACPKR');
- } elseif ($TRANSTYPE == 'P') {
- $ICM695M1PREP = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
+ } elseif ($tRANSTYPE == 'P') {
+ $iCM695M1PREP = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
->select('AYCO', 'AYWHS', 'AYMACPKR', 'AYRLNO', 'AYAPRF1551')
->distinct()
- ->where('AYCO', $COMPANY)
- ->where('AYMACPKR', $MANIFEST)
- ->where('AYWHS', $WHS)
+ ->where('AYCO', $cOMPANY)
+ ->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')
- ->where('SHMACPKR', $MANIFEST)
- ->where('SHDT', $SHDT)
- ->where('SHTIME', $SHTIME)
- ->where('SHCO', $COMPANY)
- ->where('SHWHS', $WHS)
- ->where('SHSOURCE', $SHSOURCE)
+ if ($sHDT != '' && $sHTIME != '' && $sHTYPE != '' && $nODEBUG) {
+ $iCM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ ->where('SHMACPKR', $mANIFEST)
+ ->where('SHDT', $sHDT)
+ ->where('SHTIME', $sHTIME)
+ ->where('SHCO', $cOMPANY)
+ ->where('SHWHS', $wHS)
+ ->where('SHSOURCE', $sHSOURCE)
->where('SHERROR', 'X')
- ->where('SHTYPE', $SHTYPE)
- ->update(['SHERROR' => 'Z', 'SHACKUSER' => $SHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s')]);
+ ->where('SHTYPE', $sHTYPE)
+ ->update(['SHERROR' => 'Z', 'SHACKUSER' => $sHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s')]);
}
// Get Acknowledged Record for M3-QtyChg PackSyst4tray
- $ICM699MQtyChg = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ $iCM699MQtyChg = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
->select()
- ->where('SHMACPKR', $MANIFEST)
- ->where('SHCO', $COMPANY)
- ->where('SHWHS', $WHS)
+ ->where('SHMACPKR', $mANIFEST)
+ ->where('SHCO', $cOMPANY)
+ ->where('SHWHS', $wHS)
->where('SHSOURCE', 'PackSyst4tray')
->where('SHERROR', 'Z')
->where('SHTYPE', 'M3-QtyChg')
->get();
- foreach ($ICM699MQtyChg as $key => $ICM699MQtyChgR) {
+ foreach ($iCM699MQtyChg as $key => $ICM699MQtyChgR) {
$string = $ICM699MQtyChgR->SHDATA;
$start = 'PickerLine:';
$end = ' -';
- $LineAck[] = Helper::getSubstringBetween($string, $start, $end);
+ $lineAck[] = Helper::getSubstringBetween($string, $start, $end);
}
- } elseif ($TRANSTYPE == 'Z') {
- $ICM695M1PREP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
+ } elseif ($tRANSTYPE == 'Z') {
+ $iCM695M1PREP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
->select()
->distinct()
- ->where('A4CO', $COMPANY)
- ->where('A4WHS', $WHS)
- ->where('A4MACPKR', $MANIFEST)
+ ->where('A4CO', $cOMPANY)
+ ->where('A4WHS', $wHS)
+ ->where('A4MACPKR', $mANIFEST)
->orderBy('A4MACPKR');
}
- $ICM695M1TMP = $ICM695M1PREP->get();
- // Log::channel('dailyCron')->info($ICM695M1TMP);
+ $iCM695M1TMP = $iCM695M1PREP->get();
+ // Log::channel('dailyCron')->info($iCM695M1TMP);
// PFC if MACKPKR already Closed : Case 671
- $ICM695M1TMPCOL = collect($ICM695M1TMP);
- if ($TRANSTYPE == 'Z') {
- $ICM695M1TMPCOLF = $ICM695M1TMPCOL->map(function ($post) {
+ $iCM695M1TMPCOL = collect($iCM695M1TMP);
+ if ($tRANSTYPE == 'Z') {
+ $iCM695M1TMPCOLF = $iCM695M1TMPCOL->map(function ($post) {
return trim($post->A4MACPKR);
});
} else {
- $ICM695M1TMPCOLF = $ICM695M1TMPCOL->map(function ($post) {
+ $iCM695M1TMPCOLF = $iCM695M1TMPCOL->map(function ($post) {
return trim($post->AYMACPKR);
});
}
- $ICM695M1TMPCOLFA = $ICM695M1TMPCOLF->toArray();
+ $iCM695M1TMPCOLFA = $iCM695M1TMPCOLF->toArray();
- $ICM699MSuccess = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ $iCM699MSuccess = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
->select('SHMACPKR')
- ->whereIn('SHMACPKR', $ICM695M1TMPCOLFA)
- ->where('SHCO', $COMPANY)
- ->where('SHWHS', $WHS)
+ ->whereIn('SHMACPKR', $iCM695M1TMPCOLFA)
+ ->where('SHCO', $cOMPANY)
+ ->where('SHWHS', $wHS)
->where('SHSOURCE', 'CloseShipmentCoChargeAPI')
->where('SHERROR', '')
->where('SHTYPE', 'M3-Res-out')
->where('SHDATA', 'like', '%Success%')
->get();
- $ICM699MSuccessCol = collect($ICM699MSuccess);
- $ICM699MSuccessColF = $ICM699MSuccessCol->map(function ($post) {
+ $iCM699MSuccessCol = collect($iCM699MSuccess);
+ $iCM699MSuccessColF = $iCM699MSuccessCol->map(function ($post) {
return $post->SHMACPKR;
});
- $ICM699MSuccessColFAr = $ICM699MSuccessColF->toArray();
+ $iCM699MSuccessColFAr = $iCM699MSuccessColF->toArray();
- if ($TRANSTYPE == 'Z') {
+ if ($tRANSTYPE == 'Z') {
// Use the reject method to remove items based on the condition
- $ICM695M1TMPF = $ICM695M1TMP->reject(function ($post) use ($ICM699MSuccessColFAr) {
- return in_array($post->A4MACPKR, $ICM699MSuccessColFAr);
+ $iCM695M1TMPF = $iCM695M1TMP->reject(function ($post) use ($iCM699MSuccessColFAr) {
+ return in_array($post->A4MACPKR, $iCM699MSuccessColFAr);
});
} else {
// Use the reject method to remove items based on the condition
- $ICM695M1TMPF = $ICM695M1TMP->reject(function ($post) use ($ICM699MSuccessColFAr) {
- return in_array($post->AYMACPKR, $ICM699MSuccessColFAr);
+ $iCM695M1TMPF = $iCM695M1TMP->reject(function ($post) use ($iCM699MSuccessColFAr) {
+ return in_array($post->AYMACPKR, $iCM699MSuccessColFAr);
});
}
- $ICM695M1TMP = $ICM695M1TMPF;
+ $iCM695M1TMP = $iCM695M1TMPF;
-
- $FreightTermsTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm321m')
+ $freightTermsTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm321m')
->selectRaw('TRIM(ARCODE) as FREIGHTTERMS,ARCHARGE as BILLABLE')
->get();
// Close Shipment for Manifest or Single MacPKR
- if (count($ICM695M1TMP) > 0 && ($TRANSTYPE == 'M' || $TRANSTYPE == 'P')) {
+ if (count($iCM695M1TMP) > 0 && ($tRANSTYPE == 'M' || $tRANSTYPE == 'P')) {
// Loop the Results from $ICM595M1TMP
- foreach ($ICM695M1TMP as $key => $ICM695M1R) {
- $PACKAGES = [];
- $AYWHS = trim($ICM695M1R->AYWHS);
- $AYCO = trim($ICM695M1R->AYCO);
- $AYMACPKR = trim($ICM695M1R->AYMACPKR);
- $AYRLNO = trim($ICM695M1R->AYRLNO);
- $MANIFEST = trim($ICM695M1R->AYAPRF1551);
+ foreach ($iCM695M1TMP as $key => $ICM695M1R) {
+ $pACKAGES = [];
+ $aYWHS = trim($ICM695M1R->AYWHS);
+ $aYCO = trim($ICM695M1R->AYCO);
+ $aYMACPKR = trim($ICM695M1R->AYMACPKR);
+ $aYRLNO = trim($ICM695M1R->AYRLNO);
+ $mANIFEST = trim($ICM695M1R->AYAPRF1551);
// Reset Errors after each Loop
- $ErrorMsgs = '';
+ $errorMsgs = '';
// Set Endflag for Short pick after each Loop
- $EndFlag = 0;
+ $endFlag = 0;
// Precheck All Qty are Equal before Proceeding to Close
// Get Parts And Lots from ICM688M2
- $ICM688M2SL = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m2')
+ $iCM688M2SL = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m2')
->select('A5PART', 'A5PACKED', 'A5PICKED', 'A5PKLN', 'A5RSVQTY')
->distinct()
- ->where('A5CO', $AYCO)
- ->where('A5WHS', $AYWHS)
- ->where('A5MACPKR', $AYMACPKR)
- ->where('A5RLNO', $AYRLNO)
+ ->where('A5CO', $aYCO)
+ ->where('A5WHS', $aYWHS)
+ ->where('A5MACPKR', $aYMACPKR)
+ ->where('A5RLNO', $aYRLNO)
->orderBy('A5PART')
->get();
- // dump($ICM688M2SL);
+ // dump($iCM688M2SL);
// Get PACK/Dock from ICM799M
// $ICM799MSEL = DB::connection(config('m3.connection', 'pgsql'))->table('icm799m')
// ->groupBy('IMTOLOC')
// ->select('IMTOLOC',DB::raw('SUM(IMQTY) as IMQTYTOT') )
- // ->where('IMDIV',$AYCO)
- // ->where('IMWHS',$AYWHS)
- // ->where('IMDELNO',$AYMACPKR)
- // ->where('IMLINE',$AYRLNO)
+ // ->where('IMDIV',$aYCO)
+ // ->where('IMWHS',$aYWHS)
+ // ->where('IMDELNO',$aYMACPKR)
+ // ->where('IMLINE',$aYRLNO)
// ->whereIn('IMTOLOC',['DOCK','PACK'])
// ->get();
// PFC : Check that Picked / Packed are all Equal
- foreach ($ICM688M2SL as $key => $ICM688M2SLR) {
- $A5PACKED = isset($ICM688M2SLR->A5PACKED) ? $ICM688M2SLR->A5PACKED : 0;
- $A5PICKED = isset($ICM688M2SLR->A5PICKED) ? $ICM688M2SLR->A5PICKED : 0;
- $A5PKLN = isset($ICM688M2SLR->A5PKLN) ? $ICM688M2SLR->A5PKLN : 0;
- $A5RSVQTY = isset($ICM688M2SLR->A5RSVQTY) ? $ICM688M2SLR->A5RSVQTY : 0;
- $A5ShortShipQty = (int) $A5RSVQTY - (int) $A5PICKED;
+ foreach ($iCM688M2SL as $key => $ICM688M2SLR) {
+ $a5PACKED = isset($ICM688M2SLR->A5PACKED) ? $ICM688M2SLR->A5PACKED : 0;
+ $a5PICKED = isset($ICM688M2SLR->A5PICKED) ? $ICM688M2SLR->A5PICKED : 0;
+ $a5PKLN = isset($ICM688M2SLR->A5PKLN) ? $ICM688M2SLR->A5PKLN : 0;
+ $a5RSVQTY = isset($ICM688M2SLR->A5RSVQTY) ? $ICM688M2SLR->A5RSVQTY : 0;
+ $a5ShortShipQty = (int) $a5RSVQTY - (int) $a5PICKED;
// Set EndFLag=1 for short picks
- if ($A5ShortShipQty > 0) {
- $EndFlag = 1;
+ if ($a5ShortShipQty > 0) {
+ $endFlag = 1;
}
}
// Get TRAILERNUMBER SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
- $TRAILERNUMBERS = DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
+ $tRAILERNUMBERS = DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
->select('APTRUCKID', 'APTRACKNO', 'APMANIFEST')
- ->where('APCO', $COMPANY)
- ->where('APMANIFEST', $MANIFEST)
- ->where('APWHS', $WHS)
+ ->where('APCO', $cOMPANY)
+ ->where('APMANIFEST', $mANIFEST)
+ ->where('APWHS', $wHS)
->first();
- $TRAILERNUMBER = isset($TRAILERNUMBERS->APTRUCKID) ? trim($TRAILERNUMBERS->APTRUCKID) : '';
- $PRONUMBER = isset($TRAILERNUMBERS->APTRACKNO) ? trim($TRAILERNUMBERS->APTRACKNO) : '';
+ $tRAILERNUMBER = isset($tRAILERNUMBERS->APTRUCKID) ? trim($tRAILERNUMBERS->APTRUCKID) : '';
+ $pRONUMBER = isset($tRAILERNUMBERS->APTRACKNO) ? trim($tRAILERNUMBERS->APTRACKNO) : '';
- $ICM695M1JOINTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
+ $iCM695M1JOINTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
->selectRAW('AYMACPKR,AYINTBOX,AYHEIGHT,AYWIDTH,AYDEPTH,AYTYPE,AYLNWGHT,AYID,AYSPR1A01,TRIM(AYSPR15A01) AS SCAC , TRIM(AYSPR30A01) AS TRACKING,AYTRUCK AS AGGREGATION,A4RATETCP AS FREIGHT, A4OFSTRM AS FREIGHTTERMS,A4RATEM3,A4CLOSEM3, A4SHIPTYPE, A4REFORD,A4ONO,A4SHIPVIA,A42SSVCNAM,A4SHIPVIA1')
->leftJoin('ICM688M1', function ($join) {
$join->on('AYCO', '=', 'A4CO');
$join->on('AYWHS', '=', 'A4WHS');
$join->on('AYMACPKR', '=', 'A4MACPKR');
})
- ->where('AYMACPKR', $AYMACPKR)
- ->where('AYCO', $AYCO)
- ->where('AYWHS', $AYWHS)
+ ->where('AYMACPKR', $aYMACPKR)
+ ->where('AYCO', $aYCO)
+ ->where('AYWHS', $aYWHS)
->orderBy('AYINTBOX')
->get();
- foreach ($ICM695M1JOINTMP as $key => $ICM695M1JOINR) {
- $A4SHIPVIA = isset($ICM695M1JOINR->A4SHIPVIA) ? trim(str_replace('&', '_', $ICM695M1JOINR->A4SHIPVIA)) : '';
+ foreach ($iCM695M1JOINTMP as $key => $ICM695M1JOINR) {
+ $a4SHIPVIA = isset($ICM695M1JOINR->A4SHIPVIA) ? trim(str_replace('&', '_', $ICM695M1JOINR->A4SHIPVIA)) : '';
- $SHIPTYPE = trim($ICM695M1JOINR->A4SHIPTYPE);
- $A42SSVCNAM = trim($ICM695M1JOINR->A42SSVCNAM);
- $A4SHIPVIA1 = trim($ICM695M1JOINR->A4SHIPVIA1);
- $FREIGHTTERMS = trim($ICM695M1JOINR->FREIGHTTERMS);
- $A4RATEM3 = trim($ICM695M1JOINR->A4RATEM3);
- $FREIGHT = trim($ICM695M1JOINR->FREIGHT);
- $A4REFORD = trim($ICM695M1JOINR->A4REFORD);
- $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 = '';
- $AYTYPE = trim($ICM695M1JOINR->AYID) != '' ? trim($ICM695M1JOINR->AYID) : '';
- $AYLNWGHT = trim($ICM695M1JOINR->AYLNWGHT);
- $AYHEIGHT = trim($ICM695M1JOINR->AYHEIGHT);
- $AYWIDTH = trim($ICM695M1JOINR->AYWIDTH);
- $AYDEPTH = trim($ICM695M1JOINR->AYDEPTH);
- $BILLOFLADING = isset($ICM695M1JOINR->AYSPR1A01) ? trim($ICM695M1JOINR->AYSPR1A01) : '';
- $TRANSPORTMODE = $A4SHIPVIA;
- $SERVICETYPE = $A4SHIPVIA;
+ $sHIPTYPE = trim($ICM695M1JOINR->A4SHIPTYPE);
+ $a42SSVCNAM = trim($ICM695M1JOINR->A42SSVCNAM);
+ $a4SHIPVIA1 = trim($ICM695M1JOINR->A4SHIPVIA1);
+ $fREIGHTTERMS = trim($ICM695M1JOINR->FREIGHTTERMS);
+ $a4RATEM3 = trim($ICM695M1JOINR->A4RATEM3);
+ $fREIGHT = trim($ICM695M1JOINR->FREIGHT);
+ $a4REFORD = trim($ICM695M1JOINR->A4REFORD);
+ $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 = '';
+ $aYTYPE = trim($ICM695M1JOINR->AYID) != '' ? trim($ICM695M1JOINR->AYID) : '';
+ $aYLNWGHT = trim($ICM695M1JOINR->AYLNWGHT);
+ $aYHEIGHT = trim($ICM695M1JOINR->AYHEIGHT);
+ $aYWIDTH = trim($ICM695M1JOINR->AYWIDTH);
+ $aYDEPTH = trim($ICM695M1JOINR->AYDEPTH);
+ $bILLOFLADING = isset($ICM695M1JOINR->AYSPR1A01) ? trim($ICM695M1JOINR->AYSPR1A01) : '';
+ $tRANSPORTMODE = $a4SHIPVIA;
+ $sERVICETYPE = $a4SHIPVIA;
// Get Carrier Name from ICM160M
- if ($SCAC != '') {
- $SCACSub = substr($SCAC, 0, 4);
- $ICM160M = DB::connection(config('m3.connection', 'pgsql'))->table('icm160m')
+ if ($sCAC != '') {
+ $sCACSub = substr($sCAC, 0, 4);
+ $iCM160M = DB::connection(config('m3.connection', 'pgsql'))->table('icm160m')
->select('CANAM')
- ->where('CANUM', $SCACSub)
- ->where('CACO', $COMPANY)
+ ->where('CANUM', $sCACSub)
+ ->where('CACO', $cOMPANY)
->first();
- $CARRIER = isset($ICM160M->CANAM) ? trim(str_replace('&', '_', $ICM160M->CANAM)) : '';
+ $cARRIER = isset($iCM160M->CANAM) ? trim(str_replace('&', '_', $iCM160M->CANAM)) : '';
}
// PFC Check BOL for LTL
- if ($SHIPTYPE == 'LTL') {
- $ErrorMsgs = $BILLOFLADING == '' || $SCAC == '' || $TRACKING == '' ?
- $ErrorMsgs . " Missing one or more of tracking number, BOL, or carrier. Please enter this data manually in 'invoicing' screen and retry this API call;" : $ErrorMsgs . '';
+ if ($sHIPTYPE == 'LTL') {
+ $errorMsgs = $bILLOFLADING == '' || $sCAC == '' || $tRACKING == '' ?
+ $errorMsgs . " Missing one or more of tracking number, BOL, or carrier. Please enter this data manually in 'invoicing' screen and retry this API call;" : $errorMsgs . '';
} else {
- $ErrorMsgs = $SCAC == '' || $TRACKING == '' ?
- $ErrorMsgs . " Missing one or more of tracking number, BOL, or carrier. Please enter this data manually in 'invoicing' screen and retry this API call; " : $ErrorMsgs . '';
+ $errorMsgs = $sCAC == '' || $tRACKING == '' ?
+ $errorMsgs . " Missing one or more of tracking number, BOL, or carrier. Please enter this data manually in 'invoicing' screen and retry this API call; " : $errorMsgs . '';
}
- if ($PRONUMBER == '' && $SCAC == 'RETR') {
- $ErrorMsgs = $ErrorMsgs . ' Missing PARS info for this RETRans order. Please contact MPBA to ask them to enter the value for you, and then you can retry; ';
+ if ($pRONUMBER == '' && $sCAC == 'RETR') {
+ $errorMsgs = $errorMsgs . ' Missing PARS info for this RETRans order. Please contact MPBA to ask them to enter the value for you, and then you can retry; ';
}
// MAK : PFC Check for GS1-Label A1SPR1A01 in ICM666M and ICM695M3
- $GS1Label = '';
+ $gS1Label = '';
// First Check if GS1 Label is required in ICM666M
- $ICM666MSQLSel = DB::connection(config('m3.connection', 'pgsql'))->table('icm666m')
+ $iCM666MSQLSel = DB::connection(config('m3.connection', 'pgsql'))->table('icm666m')
->select('A1SPR1A01')
- ->where('A1CO', $AYCO)
- ->where('A1WHS', $AYWHS)
- ->where('A1DELNO', $AYMACPKR)
+ ->where('A1CO', $aYCO)
+ ->where('A1WHS', $aYWHS)
+ ->where('A1DELNO', $aYMACPKR)
->first();
- $GS1LabelExist = isset($ICM666MSQLSel->A1SPR1A01) ? trim($ICM666MSQLSel->A1SPR1A01) : 0;
+ $gS1LabelExist = isset($iCM666MSQLSel->A1SPR1A01) ? trim($iCM666MSQLSel->A1SPR1A01) : 0;
// Case #566: BOL = PRONUMBER For SCAC=='RETR'
- if ($SCAC == 'RETR') {
- $BILLOFLADING = $PRONUMBER;
+ if ($sCAC == 'RETR') {
+ $bILLOFLADING = $pRONUMBER;
}
// Get Commodities
@@ -369,7 +369,7 @@ class CloseShipment extends Controller
$myRequest->setMethod('POST');
$myRequest->request->add([
- 'MACPKR' => $AYMACPKR,
+ 'MACPKR' => $aYMACPKR,
]);
// Call processShipment
$controller = new GetContentsController;
@@ -386,100 +386,100 @@ class CloseShipment extends Controller
// dump( $commodities);
} else {
$commodities = '';
- $ErrorMsgs = $ErrorMsgs . ' Could not find Commodities; ';
+ $errorMsgs = $errorMsgs . ' Could not find Commodities; ';
}
} else {
$commodities = '';
- $ErrorMsgs = $ErrorMsgs . ' Could not find Commodities; ';
+ $errorMsgs = $errorMsgs . ' Could not find Commodities; ';
}
// End Commodities
// Check ICM699M for SHERROR=X
- $ICM699MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ $iCM699MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
->select('SHMACPKR')
- ->where('SHMACPKR', $AYMACPKR)
- ->where('SHCO', $AYCO)
- ->where('SHWHS', $AYWHS)
+ ->where('SHMACPKR', $aYMACPKR)
+ ->where('SHCO', $aYCO)
+ ->where('SHWHS', $aYWHS)
->whereIn('SHSOURCE', ['TransferAPIURL', 'CloseShipmentCoChargeAPI', 'PackSyst4tray'])
->where('SHERROR', 'X')
->whereIn('SHTYPE', ['M3-Res-out', 'M3-QtyChg'])
->first();
- $AlreadySentToM3 = isset($ICM699MS->SHMACPKR) ? trim($ICM699MS->SHMACPKR) : '';
+ $alreadySentToM3 = isset($iCM699MS->SHMACPKR) ? trim($iCM699MS->SHMACPKR) : '';
- if ($AlreadySentToM3 != '') {
+ if ($alreadySentToM3 != '') {
// Add Message
- $ErrorMsgs = $ErrorMsgs . ' There are previous M3 transmissions in error for this delivery note that have not been addressed; ';
+ $errorMsgs = $errorMsgs . ' There are previous M3 transmissions in error for this delivery note that have not been addressed; ';
}
- if ($AYTYPE == '') {
+ if ($aYTYPE == '') {
// Get AETYPE SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
- $ICM693MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm693m')
+ $iCM693MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm693m')
->select('AEID')
->where('AESPR1A01', 'D')
->where('AETYPE', trim($ICM695M1JOINR->AYTYPE))
->first();
- $AYTYPE = isset($ICM693MS->AEID) ? trim($ICM693MS->AEID) : '';
+ $aYTYPE = isset($iCM693MS->AEID) ? trim($iCM693MS->AEID) : '';
}
- $CurrentFreightTerms = $FreightTermsTMP->where('FREIGHTTERMS', $FREIGHTTERMS)->first();
- $BILLABLE = isset($CurrentFreightTerms->BILLABLE) ? trim($CurrentFreightTerms->BILLABLE) : 'N';
+ $currentFreightTerms = $freightTermsTMP->where('FREIGHTTERMS', $fREIGHTTERMS)->first();
+ $bILLABLE = isset($currentFreightTerms->BILLABLE) ? trim($currentFreightTerms->BILLABLE) : 'N';
// 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 : self::ZERO_PAD;
+ if ($bILLABLE == 'Y' && $fREIGHT > 0 && $a4RATEM3 == '') {
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
- if ($SHIPTYPE == 'LTL') {
- $shippingToBill = $FREIGHT * (100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceLTL')) / 100;
+ if ($sHIPTYPE == 'LTL') {
+ $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 = [
- 'QUANTITY' => round($shippingToBill, 2), // $FREIGHT with modified Params
- 'ORDERCATEGORY' => $A4REFORD,
- 'CONUMBER' => $A4ONO,
+ $jSONCoCharge = [
+ 'QUANTITY' => round($shippingToBill, 2), // $fREIGHT with modified Params
+ 'ORDERCATEGORY' => $a4REFORD,
+ 'CONUMBER' => $a4ONO,
];
} else {
- $JSONCoCharge = [];
+ $jSONCoCharge = [];
}
// If billable=Y and a4ratetcp(FREIGHT)=0 and a4ratem3=blank, then we need to:
// Write a record to ICM699M to indicate that we are not calling the rate API because the $ are 0
- if ($BILLABLE == 'Y' && $FREIGHT == 0 && $A4RATEM3 == '') {
+ if ($bILLABLE == 'Y' && $fREIGHT == 0 && $a4RATEM3 == '') {
// Add Message
- $ErrorMsgs = $ErrorMsgs . ' Please manually add a freight charge for this Prepaid and Add order; ';
+ $errorMsgs = $errorMsgs . ' Please manually add a freight charge for this Prepaid and Add order; ';
}
// Close Shipment
// If ( (billable=Y and a4RATEM3 (from array in memory)="X") OR (billable=N) ) and a4closeM3="" then call the close API
// Set PDF URLs for Labels
- $CarrierLabel = '';
- $ContentLabel = '';
+ $carrierLabel = '';
+ $contentLabel = '';
$docTypes = ['ContentLabel', 'CarrierLabel'];
foreach ($docTypes as $key => $value) {
switch ($value) {
case 'CarrierLabel':
- $DOCTYPE = 'CarrierLabel';
- $DOCNUMT = $AYINTBOX;
- $PDFKey = $value . '/' . $value . '_' . $AYMACPKR . '_' . $DOCNUMT . '_' . $COMPANY . '_' . $WHS;
- $pdfFileName = $pdfFilePath . $PDFKey . '.pdf';
+ $dOCTYPE = 'CarrierLabel';
+ $dOCNUMT = $aYINTBOX;
+ $pDFKey = $value . '/' . $value . '_' . $aYMACPKR . '_' . $dOCNUMT . '_' . $cOMPANY . '_' . $wHS;
+ $pdfFileName = $pdfFilePath . $pDFKey . '.pdf';
if (File::exists($pdfFileName)) {
- $CarrierLabel = route('m3.M3GetPDFFromCache.index', ['MACPKR' => $AYMACPKR, 'DOCTYPE' => $DOCTYPE]);
+ $carrierLabel = route('m3.M3GetPDFFromCache.index', ['MACPKR' => $aYMACPKR, 'DOCTYPE' => $dOCTYPE]);
}
break;
case 'ContentLabel':
- $DOCTYPE = 'ContentLabel';
- $DOCNUMT = $AYINTBOX;
- $PDFKey = $value . '/' . $value . '_' . $AYMACPKR . '_' . $DOCNUMT . '_' . $COMPANY . '_' . $WHS;
- $pdfFileName = $pdfFilePath . $PDFKey . '.pdf';
+ $dOCTYPE = 'ContentLabel';
+ $dOCNUMT = $aYINTBOX;
+ $pDFKey = $value . '/' . $value . '_' . $aYMACPKR . '_' . $dOCNUMT . '_' . $cOMPANY . '_' . $wHS;
+ $pdfFileName = $pdfFilePath . $pDFKey . '.pdf';
if (File::exists($pdfFileName)) {
- $ContentLabel = route('m3.M3GetPDFFromCache.index', ['MACPKR' => $AYMACPKR, 'DOCTYPE' => $DOCTYPE]);
+ $contentLabel = route('m3.M3GetPDFFromCache.index', ['MACPKR' => $aYMACPKR, 'DOCTYPE' => $dOCTYPE]);
}
break;
@@ -489,141 +489,141 @@ class CloseShipment extends Controller
}
// Second Check GS1 Label existence in ICM695M3
- if ($GS1LabelExist == 1) {
- $ICM695M3SQLSel = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m3')
+ if ($gS1LabelExist == 1) {
+ $iCM695M3SQLSel = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m3')
->select('A2GS1LABEL')
- ->where('A2CO', $AYCO)
- ->where('A2WHS', $AYWHS)
- // ->where('A2MACPKR',$AYMACPKR)
- ->where('A2INTBOX', $AYINTBOX)
+ ->where('A2CO', $aYCO)
+ ->where('A2WHS', $aYWHS)
+ // ->where('A2MACPKR',$aYMACPKR)
+ ->where('A2INTBOX', $aYINTBOX)
->first();
- $GS1Label = isset($ICM695M3SQLSel->A2GS1LABEL) ? trim($ICM695M3SQLSel->A2GS1LABEL) : '';
+ $gS1Label = isset($iCM695M3SQLSel->A2GS1LABEL) ? trim($iCM695M3SQLSel->A2GS1LABEL) : '';
- if ($GS1Label == '') {
- $ErrorMsgs = $ErrorMsgs . ' Missing G1-128 Label. Please contact MPBA to ask them to enter the value for you, and then you can retry; ';
+ if ($gS1Label == '') {
+ $errorMsgs = $errorMsgs . ' Missing G1-128 Label. Please contact MPBA to ask them to enter the value for you, and then you can retry; ';
}
}
// Get Packages Array
- $PACKAGES[] = [
- 'TRACKINGID' => $TRACKING,
- 'BUNDLES' => $AYTYPE,
- 'WEIGHT' => $AYLNWGHT,
- 'HEIGHT' => $AYHEIGHT,
- 'WIDTH' => $AYWIDTH,
- 'LENGTH' => $AYDEPTH,
- 'SSCC' => $GS1Label,
- 'SHIPLABELDOC' => $CarrierLabel,
- 'CONTENTLABELDOC' => $ContentLabel,
+ $pACKAGES[] = [
+ 'TRACKINGID' => $tRACKING,
+ 'BUNDLES' => $aYTYPE,
+ 'WEIGHT' => $aYLNWGHT,
+ 'HEIGHT' => $aYHEIGHT,
+ 'WIDTH' => $aYWIDTH,
+ 'LENGTH' => $aYDEPTH,
+ 'SSCC' => $gS1Label,
+ 'SHIPLABELDOC' => $carrierLabel,
+ 'CONTENTLABELDOC' => $contentLabel,
];
}
// Check Packages array before proceeding with CloseShipment
- if (count($PACKAGES) > 0) {
+ if (count($pACKAGES) > 0) {
// Get Packlist
- $PackingList = '';
- $DOCTYPE = 'PackingList';
- $DOCNUMT = $AYMACPKR;
- $PDFKey = $DOCTYPE . '/' . $DOCTYPE . '_' . $AYMACPKR . '_' . $DOCNUMT . '_' . $COMPANY . '_' . $WHS;
- $pdfFileName = $pdfFilePath . $PDFKey . '.pdf';
+ $packingList = '';
+ $dOCTYPE = 'PackingList';
+ $dOCNUMT = $aYMACPKR;
+ $pDFKey = $dOCTYPE . '/' . $dOCTYPE . '_' . $aYMACPKR . '_' . $dOCNUMT . '_' . $cOMPANY . '_' . $wHS;
+ $pdfFileName = $pdfFilePath . $pDFKey . '.pdf';
if (File::exists($pdfFileName)) {
- $PackingList = route('m3.M3GetPDFFromCache.index', ['MACPKR' => $AYMACPKR, 'DOCTYPE' => $DOCTYPE]);
+ $packingList = route('m3.M3GetPDFFromCache.index', ['MACPKR' => $aYMACPKR, 'DOCTYPE' => $dOCTYPE]);
}
// Add Cocharge
- if (count($JSONCoCharge) > 0) {
+ if (count($jSONCoCharge) > 0) {
// Construct Json for CloseShipment With PDF Files
$tempClose = [
- 'DIVI' => $AYCO,
- 'WHS' => $AYWHS,
- 'DELIVERYNO' => $AYMACPKR,
- 'PICKLISTSUFFIX' => $AYRLNO,
+ 'DIVI' => $aYCO,
+ 'WHS' => $aYWHS,
+ 'DELIVERYNO' => $aYMACPKR,
+ 'PICKLISTSUFFIX' => $aYRLNO,
'TYPE' => 'CloseShipment',
- 'SCAC' => $SCAC,
- 'CARRIER' => $CARRIER,
- 'TRANSPORTMODE' => $TRANSPORTMODE,
- 'SERVICETYPE' => $SERVICETYPE,
- 'TRACKINGNUMBER' => $TRACKING,
- 'PRONUMBER' => $PRONUMBER,
- 'BILLOFLADING' => $BILLOFLADING,
- 'TRAILERNUMBER' => $TRAILERNUMBER,
- 'PACKAGES' => $PACKAGES,
- 'DELIVERYNOTEDOC' => $PackingList,
- 'shipType' => $SHIPTYPE,
- 'carrierServiceDescription' => $A42SSVCNAM,
- 'modeOfTransport' => $A4SHIPVIA1,
+ 'SCAC' => $sCAC,
+ 'CARRIER' => $cARRIER,
+ 'TRANSPORTMODE' => $tRANSPORTMODE,
+ 'SERVICETYPE' => $sERVICETYPE,
+ 'TRACKINGNUMBER' => $tRACKING,
+ 'PRONUMBER' => $pRONUMBER,
+ 'BILLOFLADING' => $bILLOFLADING,
+ 'TRAILERNUMBER' => $tRAILERNUMBER,
+ 'PACKAGES' => $pACKAGES,
+ 'DELIVERYNOTEDOC' => $packingList,
+ 'shipType' => $sHIPTYPE,
+ 'carrierServiceDescription' => $a42SSVCNAM,
+ 'modeOfTransport' => $a4SHIPVIA1,
'COMMODITIES' => $commodities,
- 'ENDFLAG' => $EndFlag,
+ 'ENDFLAG' => $endFlag,
];
- $JSONCoChargeCS = array_merge($JSONCoCharge, $tempClose);
- $JSONCS = json_encode($JSONCoChargeCS);
+ $jSONCoChargeCS = array_merge($jSONCoCharge, $tempClose);
+ $jSONCS = json_encode($jSONCoChargeCS);
} else {
// Construct Json for CloseShipment With PDF Files
- $JSONCS = json_encode([
- 'DIVI' => $AYCO,
- 'WHS' => $AYWHS,
- 'DELIVERYNO' => $AYMACPKR,
- 'PICKLISTSUFFIX' => $AYRLNO,
+ $jSONCS = json_encode([
+ 'DIVI' => $aYCO,
+ 'WHS' => $aYWHS,
+ 'DELIVERYNO' => $aYMACPKR,
+ 'PICKLISTSUFFIX' => $aYRLNO,
'TYPE' => 'CloseShipment',
- 'SCAC' => $SCAC,
- 'CARRIER' => $CARRIER,
- 'TRANSPORTMODE' => $TRANSPORTMODE,
- 'SERVICETYPE' => $SERVICETYPE,
- 'TRACKINGNUMBER' => $TRACKING,
- 'PRONUMBER' => $PRONUMBER,
- 'BILLOFLADING' => $BILLOFLADING,
- 'TRAILERNUMBER' => $TRAILERNUMBER,
- 'PACKAGES' => $PACKAGES,
- 'DELIVERYNOTEDOC' => $PackingList,
- 'ServiceType' => $SHIPTYPE,
- 'ServiceLevelCode' => $A42SSVCNAM,
- 'TransportationMode' => $A4SHIPVIA1,
+ 'SCAC' => $sCAC,
+ 'CARRIER' => $cARRIER,
+ 'TRANSPORTMODE' => $tRANSPORTMODE,
+ 'SERVICETYPE' => $sERVICETYPE,
+ 'TRACKINGNUMBER' => $tRACKING,
+ 'PRONUMBER' => $pRONUMBER,
+ 'BILLOFLADING' => $bILLOFLADING,
+ 'TRAILERNUMBER' => $tRAILERNUMBER,
+ 'PACKAGES' => $pACKAGES,
+ 'DELIVERYNOTEDOC' => $packingList,
+ 'ServiceType' => $sHIPTYPE,
+ 'ServiceLevelCode' => $a42SSVCNAM,
+ 'TransportationMode' => $a4SHIPVIA1,
'COMMODITIES' => $commodities,
- 'ENDFLAG' => $EndFlag,
+ 'ENDFLAG' => $endFlag,
]);
}
// No Errors Proceed in Calling M3 CLose API
- if ($ErrorMsgs == '') {
+ if ($errorMsgs == '') {
// Write to Logs Out : Send JSON Request To M3
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
- // dump($DELIVERYNO);
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
+ // dump($dELIVERYNO);
// 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);
+ // 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,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-JSN-out',
- 'SHDATA' => $JSONCS,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $jSONCS,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
$response = Http::withHeaders([
- 'accept' => self::JSON_CONTENT_TYPE,
- 'Content-Type' => self::JSON_CONTENT_TYPE,
- 'Connection' => 'close',
- ])
+ 'accept' => self::JSON_CONTENT_TYPE,
+ 'Content-Type' => self::JSON_CONTENT_TYPE,
+ 'Connection' => 'close',
+ ])
->withToken($token)
- ->withBody($JSONCS, self::JSON_CONTENT_TYPE)
+ ->withBody($jSONCS, self::JSON_CONTENT_TYPE)
->timeout(Config::get('arrays.curlTimeOut'))
->retry(3, 100)
->post($endPointURL);
$responseStatusCode = $response->getStatusCode();
- $M3SessionId = $response->hasHeader('x-transaction-id') ? '-sessionID:' . $response->header('x-transaction-id') : '-sessionID';
+ $m3SessionId = $response->hasHeader('x-transaction-id') ? '-sessionID:' . $response->header('x-transaction-id') : '-sessionID';
$responseJSON = $response->getBody()->getContents();
- $JsonSanytized = Helper::sanityzeString($responseJSON);
- $responseContents = json_decode($JsonSanytized);
+ $jsonSanytized = Helper::sanityzeString($responseJSON);
+ $responseContents = json_decode($jsonSanytized);
// MAK : Add response Time
// $M3ResponseTimeTmp = $response->hasHeader('x-response-time') ? ltrim($response->header('x-response-time'),"-") : '';
@@ -642,53 +642,53 @@ 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 : '';
+ $m3APIRESULT = $responseMsg->PickingListClose->Result;
+ $m3APIRESULTMsg = isset($responseMsg->PickingListClose->ErrorMessage) ? $responseMsg->PickingListClose->ErrorMessage : '';
// Check M3 Response for Errors
$responseResult = $responseContents->result;
- $M3Errors = Helper::checkM3Errors($responseResult);
+ $m3Errors = Helper::checkM3Errors($responseResult);
// If you get a successful response, update database file ICM688M1/A4RATEm3=X
// Update ICM688M1 : Change A4RATEM3
- if (count($JSONCoCharge) > 0 && $M3APIRESULT != 'Error') {
+ if (count($jSONCoCharge) > 0 && $m3APIRESULT != 'Error') {
DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
- ->where('A4MACPKR', $AYMACPKR)
- ->where('A4CO', $AYCO)
- ->where('A4WHS', $AYWHS)
+ ->where('A4MACPKR', $aYMACPKR)
+ ->where('A4CO', $aYCO)
+ ->where('A4WHS', $aYWHS)
->update(['A4RATEM3' => 'X', 'A4PICKSTS' => 'A']);
- } elseif (count($JSONCoCharge) == 0 && $M3APIRESULT != 'Error') {
+ } elseif (count($jSONCoCharge) == 0 && $m3APIRESULT != 'Error') {
// Update ICM688M1 : Change A4RATEM3
DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
- ->where('A4MACPKR', $AYMACPKR)
- ->where('A4CO', $AYCO)
- ->where('A4WHS', $AYWHS)
+ ->where('A4MACPKR', $aYMACPKR)
+ ->where('A4CO', $aYCO)
+ ->where('A4WHS', $aYWHS)
->update(['A4PICKSTS' => 'A']);
}
} else {
- $M3APIRESULT = 'Error';
+ $m3APIRESULT = 'Error';
$responseMsg = self::NULL_M3_RESPONSE;
- $M3APIRESULTMsg = self::NULL_M3_RESPONSE;
+ $m3APIRESULTMsg = self::NULL_M3_RESPONSE;
$responseResult = '';
- $M3Errors = $responseStatusCode;
+ $m3Errors = $responseStatusCode;
}
// If you get a successful response
- if ($M3APIRESULT != 'Error') {
+ if ($m3APIRESULT != 'Error') {
// Write to Logs Out : Success
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'Success...' . json_encode($responseResult) . $M3SessionId,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => 'Success...' . json_encode($responseResult) . $m3SessionId,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
}
@@ -696,75 +696,75 @@ class CloseShipment extends Controller
else {
// Update ICM688M1 : Change A4PICKSTS
DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
- ->where('A4MACPKR', $AYMACPKR)
- ->where('A4CO', $AYCO)
- ->where('A4WHS', $AYWHS)
+ ->where('A4MACPKR', $aYMACPKR)
+ ->where('A4CO', $aYCO)
+ ->where('A4WHS', $aYWHS)
->update(['A4PICKSTS' => 'a']);
// Write to Logs Out : Error
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'Important-Error: ' . $M3Errors . json_encode($responseMsg) . $M3SessionId,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => 'Important-Error: ' . $m3Errors . json_encode($responseMsg) . $m3SessionId,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
// Add Message
- $ErrorMsgs = $ErrorMsgs . $M3Errors . ' ';
+ $errorMsgs = $errorMsgs . $m3Errors . ' ';
}
}
// Errors found Log to ICM699M and update A4PICKSTS
else {
// Write to Logs : Error
// Clear Duplicate messages
- $ErrorMsgsC = Helper::removeDuplicateSubstrings($ErrorMsgs);
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
+ $errorMsgsC = Helper::removeDuplicateSubstrings($errorMsgs);
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $ErrorMsgsC,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $errorMsgsC,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
}
}
- $allErrMsgs = $allErrMsgs . $ErrorMsgs;
+ $allErrMsgs = $allErrMsgs . $errorMsgs;
}
// 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')
- ->where('SHMACPKR', $AYMACPKR)
- ->where('SHCO', $COMPANY)
- ->where('SHWHS', $WHS)
- ->where('SHSOURCE', $SHSOURCE)
+ $sHACKNOTE = 'Sentinel automatically closed the error (false positive CommTCP_read)';
+ $iCM699MUZ = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ ->where('SHMACPKR', $aYMACPKR)
+ ->where('SHCO', $cOMPANY)
+ ->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]);
+ ->update(['SHERROR' => 'Z', 'SHACKUSER' => $sHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s'), 'SHACKNOTE' => $sHACKNOTE]);
// 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')
- ->where('APMANIFEST', $MANIFEST)
- ->where('APCO', $COMPANY)
- ->where('APWHS', $WHS)
+ if ($tRANSTYPE == 'M') {
+ $iCM705M1U = DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
+ ->where('APMANIFEST', $mANIFEST)
+ ->where('APCO', $cOMPANY)
+ ->where('APWHS', $wHS)
->update(['APSPARE2' => 'X']);
}
@@ -787,105 +787,105 @@ class CloseShipment extends Controller
}
// Close Shipment for Zero Picks
- elseif (count($ICM695M1TMP) > 0 && $TRANSTYPE == 'Z') {
- $ErrorMsgs = '';
+ elseif (count($iCM695M1TMP) > 0 && $tRANSTYPE == 'Z') {
+ $errorMsgs = '';
- foreach ($ICM695M1TMP as $key => $ICM695M1JOINR) {
- $SHIPTYPE = trim($ICM695M1JOINR->A4SHIPTYPE);
- $FREIGHTTERMS = trim($ICM695M1JOINR->A4OFSTRM);
- $A4RATEM3 = trim($ICM695M1JOINR->A4RATEM3);
- $FREIGHT = trim($ICM695M1JOINR->A4RATETCP);
- $A4REFORD = trim($ICM695M1JOINR->A4REFORD);
- $A4ONO = trim($ICM695M1JOINR->A4ONO);
- $AYMACPKR = trim($ICM695M1JOINR->A4MACPKR);
- $A4CLOSEM3 = trim($ICM695M1JOINR->A4CLOSEM3);
- $AYWHS = trim($ICM695M1JOINR->A4WHS);
- $AYCO = trim($ICM695M1JOINR->A4CO);
+ foreach ($iCM695M1TMP as $key => $ICM695M1JOINR) {
+ $sHIPTYPE = trim($ICM695M1JOINR->A4SHIPTYPE);
+ $fREIGHTTERMS = trim($ICM695M1JOINR->A4OFSTRM);
+ $a4RATEM3 = trim($ICM695M1JOINR->A4RATEM3);
+ $fREIGHT = trim($ICM695M1JOINR->A4RATETCP);
+ $a4REFORD = trim($ICM695M1JOINR->A4REFORD);
+ $a4ONO = trim($ICM695M1JOINR->A4ONO);
+ $aYMACPKR = trim($ICM695M1JOINR->A4MACPKR);
+ $a4CLOSEM3 = trim($ICM695M1JOINR->A4CLOSEM3);
+ $aYWHS = trim($ICM695M1JOINR->A4WHS);
+ $aYCO = trim($ICM695M1JOINR->A4CO);
// Construct Json for CloseShipment Without PDF Files
- $JSONCS = json_encode([
- 'DIVI' => $AYCO,
- 'WHS' => $AYWHS,
- 'DELIVERYNO' => $AYMACPKR,
+ $jSONCS = json_encode([
+ 'DIVI' => $aYCO,
+ 'WHS' => $aYWHS,
+ 'DELIVERYNO' => $aYMACPKR,
'TYPE' => 'CloseShipment',
'PICKLISTSUFFIX' => '1',
'ENDFLAG' => '1',
]);
// Write to Logs Out : JSON Request To M3
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-JSN-out',
- 'SHDATA' => $JSONCS,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $jSONCS,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
$response = Http::withHeaders([
- 'accept' => self::JSON_CONTENT_TYPE,
- 'Content-Type' => self::JSON_CONTENT_TYPE,
- 'Connection' => 'close',
- ])
+ 'accept' => self::JSON_CONTENT_TYPE,
+ 'Content-Type' => self::JSON_CONTENT_TYPE,
+ 'Connection' => 'close',
+ ])
->withToken($token)
- ->withBody($JSONCS, self::JSON_CONTENT_TYPE)
+ ->withBody($jSONCS, self::JSON_CONTENT_TYPE)
->timeout(Config::get('arrays.curlTimeOut'))
->retry(2, 100)
->post($endPointURL);
$responseContents = json_decode($response->getBody()->getContents());
- $M3SessionId = $response->hasHeader('x-transaction-id') ? '-sessionID:' . $response->header('x-transaction-id') : '-sessionID';
- $M3Errors = '';
+ $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 : '';
+ $m3APIRESULT = $responseMsg->PickingListClose->Result;
+ $m3APIRESULTMsg = isset($responseMsg->PickingListClose->ErrorMessage) ? $responseMsg->PickingListClose->ErrorMessage : '';
// Check M3 Response for Errors
$responseResult = $responseContents->result;
- $M3Errors = Helper::checkM3Errors($responseResult);
+ $m3Errors = Helper::checkM3Errors($responseResult);
// If you get a successful response, update database file ICM688M1/A4PICKSTS=A
- if ($M3APIRESULT != 'Error') {
+ if ($m3APIRESULT != 'Error') {
// Update ICM688M1 : Change A4RATEM3
DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
- ->where('A4MACPKR', $AYMACPKR)
- ->where('A4CO', $AYCO)
- ->where('A4WHS', $AYWHS)
+ ->where('A4MACPKR', $aYMACPKR)
+ ->where('A4CO', $aYCO)
+ ->where('A4WHS', $aYWHS)
->where('A4PICKSTS', '!=', 'X')
->update(['A4PICKSTS' => 'A']);
}
} else {
- $M3APIRESULT = 'Error';
+ $m3APIRESULT = 'Error';
$responseMsg = self::NULL_M3_RESPONSE;
- $M3APIRESULTMsg = self::NULL_M3_RESPONSE;
+ $m3APIRESULTMsg = self::NULL_M3_RESPONSE;
}
// If you get a successful response
- if ($M3APIRESULT != 'Error') {
+ if ($m3APIRESULT != 'Error') {
// Write to Logs Out : Success
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'Success' . $M3SessionId,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => 'Success' . $m3SessionId,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
}
@@ -893,47 +893,47 @@ class CloseShipment extends Controller
else {
// Update ICM688M1 : Change A4PICKSTS
DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
- ->where('A4MACPKR', $AYMACPKR)
- ->where('A4CO', $AYCO)
- ->where('A4WHS', $AYWHS)
+ ->where('A4MACPKR', $aYMACPKR)
+ ->where('A4CO', $aYCO)
+ ->where('A4WHS', $aYWHS)
->where('A4PICKSTS', '!=', 'X')
->update(['A4PICKSTS' => 'a']);
// Write to Logs Out : Error
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'Important-Error: ' . $M3Errors . json_encode($responseMsg) . $M3SessionId,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => 'Important-Error: ' . $m3Errors . json_encode($responseMsg) . $m3SessionId,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
// Add Message
- $ErrorMsgs = $ErrorMsgs . $M3Errors . '-';
+ $errorMsgs = $errorMsgs . $m3Errors . '-';
}
// 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')
- ->where('SHMACPKR', $AYMACPKR)
- ->where('SHCO', $COMPANY)
- ->where('SHWHS', $WHS)
- ->where('SHSOURCE', $SHSOURCE)
+ $sHACKNOTE = 'Sentinel automatically closed the error (false positive CommTCP_read)';
+ $iCM699MUZ = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ ->where('SHMACPKR', $aYMACPKR)
+ ->where('SHCO', $cOMPANY)
+ ->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]);
+ ->update(['SHERROR' => 'Z', 'SHACKUSER' => $sHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s'), 'SHACKNOTE' => $sHACKNOTE]);
}
// Send Response
- if ($ErrorMsgs == '') {
+ if ($errorMsgs == '') {
return response()->json([
'code' => '200',
'status' => 'Success',
@@ -943,32 +943,32 @@ class CloseShipment extends Controller
return response()->json([
'code' => '206',
'status' => 'Success With Warnings',
- 'message' => $ErrorMsgs . '; Check The Logs for Errors or Warnings.',
+ 'message' => $errorMsgs . '; Check The Logs for Errors or Warnings.',
]);
}
}
// ## End Zero Pick
else {
- $DELIVERYNO = isset($MANIFEST) ? $MANIFEST : self::ZERO_PAD;
+ $dELIVERYNO = isset($mANIFEST) ? $mANIFEST : self::ZERO_PAD;
// # Set SHDATA Message
- $SHDATAMSG = 'No records found in ICM695M1,or URL parameters incomplete';
- // count($ICM695M1TMP)==0 ? 'MacPkr already closed' :
- $SHERROR = 'X';
- // count($ICM695M1TMP)==0 ? 'Z' :
+ $sHDATAMSG = 'No records found in ICM695M1,or URL parameters incomplete';
+ // count($iCM695M1TMP)==0 ? 'MacPkr already closed' :
+ $sHERROR = 'X';
+ // count($iCM695M1TMP)==0 ? 'Z' :
// Write to Logs Out : Error
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
- 'SHERROR' => $SHERROR,
+ 'SHERROR' => $sHERROR,
'SHINTBOX' => '',
'SHTYPE' => 'M3-Req-out',
- 'SHDATA' => $SHDATAMSG,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $sHDATAMSG,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -976,24 +976,24 @@ class CloseShipment extends Controller
return response()->json([
'code' => '405',
'status' => 'Error',
- 'message' => 'No records found in ICM695M1,or URL parameters incomplete For MacPkr/Manifest:' . $DELIVERYNO,
+ 'message' => 'No records found in ICM695M1,or URL parameters incomplete For MacPkr/Manifest:' . $dELIVERYNO,
]);
}
} else {
// Write to Logs Out : Error
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
'SHDATA' => 'No URL Parameters Sent',
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -1010,17 +1010,17 @@ class CloseShipment extends Controller
// dd($getCurlErrors);
// Write to Logs Out : Failed
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'Curl Error: Communication with M3 Timed Out' . ' M3-JSN-out' . $JSONIN,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHDATA' => 'Curl Error: Communication with M3 Timed Out' . ' M3-JSN-out' . $jSONIN,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -1031,19 +1031,19 @@ class CloseShipment extends Controller
]);
} else {
// Write to Logs Out : Error
- $DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : self::ZERO_PAD;
+ $dELIVERYNO = isset($aYMACPKR) ? $aYMACPKR : self::ZERO_PAD;
$data = [
- 'SHMACPKR' => $DELIVERYNO,
+ 'SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
'SHDATA' => 'An Error Occured - ' . substr($th, 0, 300),
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $COMPANY,
- 'SHWHS' => $WHS,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $cOMPANY,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
Log::error($th);
diff --git a/Modules/M3/Http/Controllers/API/M3Controller.php b/Modules/M3/Http/Controllers/API/M3Controller.php
index 13ea9a17..eb44daa7 100644
--- a/Modules/M3/Http/Controllers/API/M3Controller.php
+++ b/Modules/M3/Http/Controllers/API/M3Controller.php
@@ -5,7 +5,6 @@ namespace Modules\M3\Http\Controllers\API;
use Config;
use DB;
use Illuminate\Http\Request;
-use Log;
use Modules\M3\Helpers\Helper;
use Modules\M3\Http\Controllers\Controller;
use Modules\M3\Services\PostgresProgramBridge;
@@ -14,6 +13,7 @@ use Str;
class M3Controller extends Controller
{
private const FIELD_PREFIX = 'Field: ';
+
private const M3_LIST_SUFFIX = ' M3-Lis-JSN';
// Split Data and Write to ICM666M2
@@ -22,15 +22,15 @@ class M3Controller extends Controller
// dump($dataSplit);
$commentDataSS = explode("\n", $dataSplit);
- $AXLINENO = 1;
+ $aXLINENO = 1;
foreach ($commentDataSS as $substring) {
// Process each substring
$fullData = $commentData;
$fullData['AXCOMMENT'] = $substring;
- $fullData['AXLINENO'] = $AXLINENO;
+ $fullData['AXLINENO'] = $aXLINENO;
$insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm666m2')->insert($fullData);
- $AXLINENO++;
+ $aXLINENO++;
// AXCO ICM666M2 CHARACTER 3
// AXWHS ICM666M2 CHARACTER 3
@@ -57,10 +57,10 @@ class M3Controller extends Controller
ini_set('max_input_time', Config::get('arrays.PHPTimeOut'));
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
- $REQKPKUS = m3_user() !== '' ? Str::upper(m3_user()) : 'WEBUSER';
- $SHSOURCE = 'M3ReceiverAPI';
+ $rEQKPKUS = m3_user() !== '' ? Str::upper(m3_user()) : 'WEBUSER';
+ $sHSOURCE = 'M3ReceiverAPI';
- $ICM666MFields = [
+ $iCM666MFields = [
'Company' => ['A1CO', 3, 'string'],
'Warehouse' => ['A1WHS', 3, 'string'],
'Plant' => ['A1PLANT', 3, 'string'],
@@ -137,30 +137,30 @@ class M3Controller extends Controller
$jsonFile = count($request->json()->all()) > 0 ? $request->json()->all() : '';
// Root
- $Company = isset($jsonFile['Company']) ? $jsonFile['Company'] : '';
- $Plant = isset($jsonFile['Plant']) ? $jsonFile['Plant'] : '';
- $Warehouse = isset($jsonFile['Warehouse']) ? $jsonFile['Warehouse'] : '';
- $OrderNumber = isset($jsonFile['OrderNumber']) ? $jsonFile['OrderNumber'] : '';
- $PickerNumber = isset($jsonFile['PickerNumber']) ? $jsonFile['PickerNumber'] : '';
- $PromDate = isset($jsonFile['PromDate']) ? $jsonFile['PromDate'] : '';
- $RouteCode = isset($jsonFile['RouteCode']) ? $jsonFile['RouteCode'] : '';
- $OrderCategory = isset($jsonFile['OrderCategory']) ? $jsonFile['OrderCategory'] : '';
- $ReleaseNumber = isset($jsonFile['ReleaseNumber']) ? $jsonFile['ReleaseNumber'] : '';
- $ShipmentNumber = isset($jsonFile['ShipmentNumber']) ? $jsonFile['ShipmentNumber'] : '';
- $Currency = isset($jsonFile['Currency']) ? $jsonFile['Currency'] : '';
- $CarrierCode = isset($jsonFile['CarrierCode']) ? $jsonFile['CarrierCode'] : '';
- $ShipmentPONumber = isset($jsonFile['ShipmentPONumber']) ? $jsonFile['ShipmentPONumber'] : ''; // CustPo
- $ShipTerms = isset($jsonFile['ShipTerms']) ? $jsonFile['ShipTerms'] : '';
- $OrderClass = isset($jsonFile['OrderClass']) ? $jsonFile['OrderClass'] : '';
- $GS1Label = isset($jsonFile['GS1-128Label']) ? $jsonFile['GS1-128Label'] : '0';
- $CurrencyExchangeRate = isset($jsonFile['CurrencyExchangeRate']) ? $jsonFile['CurrencyExchangeRate'] : '';
+ $company = isset($jsonFile['Company']) ? $jsonFile['Company'] : '';
+ $plant = isset($jsonFile['Plant']) ? $jsonFile['Plant'] : '';
+ $warehouse = isset($jsonFile['Warehouse']) ? $jsonFile['Warehouse'] : '';
+ $orderNumber = isset($jsonFile['OrderNumber']) ? $jsonFile['OrderNumber'] : '';
+ $pickerNumber = isset($jsonFile['PickerNumber']) ? $jsonFile['PickerNumber'] : '';
+ $promDate = isset($jsonFile['PromDate']) ? $jsonFile['PromDate'] : '';
+ $routeCode = isset($jsonFile['RouteCode']) ? $jsonFile['RouteCode'] : '';
+ $orderCategory = isset($jsonFile['OrderCategory']) ? $jsonFile['OrderCategory'] : '';
+ $releaseNumber = isset($jsonFile['ReleaseNumber']) ? $jsonFile['ReleaseNumber'] : '';
+ $shipmentNumber = isset($jsonFile['ShipmentNumber']) ? $jsonFile['ShipmentNumber'] : '';
+ $currency = isset($jsonFile['Currency']) ? $jsonFile['Currency'] : '';
+ $carrierCode = isset($jsonFile['CarrierCode']) ? $jsonFile['CarrierCode'] : '';
+ $shipmentPONumber = isset($jsonFile['ShipmentPONumber']) ? $jsonFile['ShipmentPONumber'] : ''; // CustPo
+ $shipTerms = isset($jsonFile['ShipTerms']) ? $jsonFile['ShipTerms'] : '';
+ $orderClass = isset($jsonFile['OrderClass']) ? $jsonFile['OrderClass'] : '';
+ $gS1Label = isset($jsonFile['GS1-128Label']) ? $jsonFile['GS1-128Label'] : '0';
+ $currencyExchangeRate = isset($jsonFile['CurrencyExchangeRate']) ? $jsonFile['CurrencyExchangeRate'] : '';
// Set Carrier BWAY if it's empty for Tilburg only
- if (($CarrierCode == '' || $CarrierCode == null) && $Warehouse == '111' && $Company == '410' && $Plant == '410') {
- $CarrierCode = 'BWAY';
+ if (($carrierCode == '' || $carrierCode == null) && $warehouse == '111' && $company == '410' && $plant == '410') {
+ $carrierCode = 'BWAY';
}
- $SHMACPKR = $PickerNumber != '' ? $PickerNumber : '000000';
+ $sHMACPKR = $pickerNumber != '' ? $pickerNumber : '000000';
if ($jsonFile != '') {
// Order Category
@@ -174,74 +174,74 @@ class M3Controller extends Controller
// Recipient
$recipient = $jsonFile['Recipient'];
- $CompanyName = isset($recipient['CompanyName']) ? $recipient['CompanyName'] : '';
- $Address1 = isset($recipient['Address1']) ? $recipient['Address1'] : '';
- $Address2 = isset($recipient['Address2']) ? $recipient['Address2'] : '';
- $City = isset($recipient['City']) ? $recipient['City'] : '';
- $State = isset($recipient['State']) ? $recipient['State'] : '';
- $PostalCode = isset($recipient['PostalCode']) ? $recipient['PostalCode'] : '';
- $Country = isset($recipient['Country']) ? $recipient['Country'] : '';
- $PostalCode = isset($recipient['PostalCode']) ? $recipient['PostalCode'] : '';
- $BillToId = isset($recipient['BillToId']) ? $recipient['BillToId'] : '';
- $ShipToId = isset($recipient['ShipToId']) ? $recipient['ShipToId'] : '';
- $Address3 = isset($recipient['Address3']) ? $recipient['Address3'] : '';
- $Address4 = isset($recipient['Address4']) ? $recipient['Address4'] : '';
- $CountryName = isset($recipient['CountryName']) ? $recipient['CountryName'] : '';
- $PersonName = isset($recipient['PersonName']) ? $recipient['PersonName'] : '';
- $AccountNo = isset($recipient['AccountNo']) ? $recipient['AccountNo'] : '';
- $Email = isset($recipient['Email']) ? $recipient['Email'] : '';
- $A1DATEADD = date('Ymd');
- $A1TIMEADD = date('His');
+ $companyName = isset($recipient['CompanyName']) ? $recipient['CompanyName'] : '';
+ $address1 = isset($recipient['Address1']) ? $recipient['Address1'] : '';
+ $address2 = isset($recipient['Address2']) ? $recipient['Address2'] : '';
+ $city = isset($recipient['City']) ? $recipient['City'] : '';
+ $state = isset($recipient['State']) ? $recipient['State'] : '';
+ $postalCode = isset($recipient['PostalCode']) ? $recipient['PostalCode'] : '';
+ $country = isset($recipient['Country']) ? $recipient['Country'] : '';
+ $postalCode = isset($recipient['PostalCode']) ? $recipient['PostalCode'] : '';
+ $billToId = isset($recipient['BillToId']) ? $recipient['BillToId'] : '';
+ $shipToId = isset($recipient['ShipToId']) ? $recipient['ShipToId'] : '';
+ $address3 = isset($recipient['Address3']) ? $recipient['Address3'] : '';
+ $address4 = isset($recipient['Address4']) ? $recipient['Address4'] : '';
+ $countryName = isset($recipient['CountryName']) ? $recipient['CountryName'] : '';
+ $personName = isset($recipient['PersonName']) ? $recipient['PersonName'] : '';
+ $accountNo = isset($recipient['AccountNo']) ? $recipient['AccountNo'] : '';
+ $email = isset($recipient['Email']) ? $recipient['Email'] : '';
+ $a1DATEADD = date('Ymd');
+ $a1TIMEADD = date('His');
// MycarrierDetails
- $ShipVia = isset($jsonFile['ShipVia']) ? $jsonFile['ShipVia'] : '';
+ $shipVia = isset($jsonFile['ShipVia']) ? $jsonFile['ShipVia'] : '';
// Comments
- $Picker = $Packer = $Carrier = $Other = '';
- $AXCO = $Company;
- $AXPLANT = $Plant;
- $AXWHS = $Warehouse;
- $AXDELNO = $PickerNumber;
- $AXONO = $OrderNumber;
- $AXRLNO = $ReleaseNumber;
- $AXSHNO = $ShipmentNumber;
+ $picker = $packer = $carrier = $other = '';
+ $aXCO = $company;
+ $aXPLANT = $plant;
+ $aXWHS = $warehouse;
+ $aXDELNO = $pickerNumber;
+ $aXONO = $orderNumber;
+ $aXRLNO = $releaseNumber;
+ $aXSHNO = $shipmentNumber;
$comments = isset($jsonFile['Comments']) ? $jsonFile['Comments'] : '';
if ($comments != '') {
foreach ($comments as $key => $comment) {
$commentData = [];
- $AXDOCUMENT = Helper::sanityzeString($key);
+ $aXDOCUMENT = Helper::sanityzeString($key);
- $commentData = ['AXCO' => $AXCO, 'AXPLANT' => $AXPLANT, 'AXWHS' => $AXWHS, 'AXDELNO' => $AXDELNO, 'AXONO' => $AXONO,
- 'AXRLNO' => $AXRLNO, 'AXSHNO' => $AXSHNO, 'AXDOCUMENT' => $AXDOCUMENT];
+ $commentData = ['AXCO' => $aXCO, 'AXPLANT' => $aXPLANT, 'AXWHS' => $aXWHS, 'AXDELNO' => $aXDELNO, 'AXONO' => $aXONO,
+ 'AXRLNO' => $aXRLNO, 'AXSHNO' => $aXSHNO, 'AXDOCUMENT' => $aXDOCUMENT];
- switch ($AXDOCUMENT) {
+ switch ($aXDOCUMENT) {
case 'Picker':
- $Picker = isset($comment) ? Helper::sanityzeString($comment) : 'null';
- if ($Picker != 'null') {
- $this->insertToICM666M2($Picker, $commentData);
+ $picker = isset($comment) ? Helper::sanityzeString($comment) : 'null';
+ if ($picker != 'null') {
+ $this->insertToICM666M2($picker, $commentData);
}
break;
case 'Packer':
- $Packer = isset($comment) ? Helper::sanityzeString($comment) : 'null';
- if ($Packer != 'null') {
- $this->insertToICM666M2($Packer, $commentData);
+ $packer = isset($comment) ? Helper::sanityzeString($comment) : 'null';
+ if ($packer != 'null') {
+ $this->insertToICM666M2($packer, $commentData);
}
break;
case 'Carrier':
- $Carrier = isset($comment) ? Helper::sanityzeString($comment) : 'null';
- if ($Carrier != 'null') {
- $this->insertToICM666M2($Carrier, $commentData);
+ $carrier = isset($comment) ? Helper::sanityzeString($comment) : 'null';
+ if ($carrier != 'null') {
+ $this->insertToICM666M2($carrier, $commentData);
}
break;
case 'Other':
- $Other = isset($comment) ? Helper::sanityzeString($comment) : 'null';
- if ($Other != 'null') {
- $this->insertToICM666M2($Other, $commentData);
+ $other = isset($comment) ? Helper::sanityzeString($comment) : 'null';
+ if ($other != 'null') {
+ $this->insertToICM666M2($other, $commentData);
}
break;
@@ -255,117 +255,117 @@ class M3Controller extends Controller
$tmpProd = '';
$products = $jsonFile['Contents']['Commodities'];
foreach ($products as $key => $product) {
- $Quantity = isset($product['Quantity']) ? $product['Quantity'] : '';
- $Description = isset($product['Description']) ? Str::limit($product['Description'], 25, '') : '';
- $PartNumber = isset($product['PartNumber']) ? $product['PartNumber'] : '';
- $OrderLine = isset($product['OrderLine']) ? $product['OrderLine'] : '';
- $PartWeight = isset($product['PartWeight']) ? $product['PartWeight'] : '';
- $PickerLine = isset($product['PickerLine']) ? $product['PickerLine'] : '';
- $PrimaryLocation = isset($product['PrimaryLocation']) ? $product['PrimaryLocation'] : '';
- $Allocation = isset($product['Allocation']) ? $product['Allocation'] : '';
- $AllocatedTo = isset($product['AllocatedTo']) ? $product['AllocatedTo'] : '';
- $LocationSeq = isset($product['LocationSeq']) ? $product['LocationSeq'] : '';
- $Zone = isset($product['Zone']) ? $product['Zone'] : '';
- $BaseUnitPrice = isset($product['BaseUnitPrice']) ? $product['BaseUnitPrice'] : '';
- $FrgnUnitPrice = isset($product['FrgnUnitPrice']) ? $product['FrgnUnitPrice'] : '';
- $SellUOM = isset($product['SellUOM']) ? $product['SellUOM'] : '';
- $PartConv = isset($product['PartConv']) ? $product['PartConv'] : '';
- $UOM = isset($product['UOM']) ? $product['UOM'] : '';
- $HazMat = isset($product['HazMat']) ? $product['HazMat'] : '';
- $PartUPC = isset($product['PartUPC']) ? $product['PartUPC'] : '';
- $PartEAN = isset($product['PartEAN']) ? $product['PartEAN'] : '';
- $LotFlag = isset($product['LotFlag']) ? $product['LotFlag'] : '';
- $ManOrd = isset($product['ManOrd']) ? $product['ManOrd'] : '';
- $LotNumber = isset($product['LotNumber']) ? $product['LotNumber'] : '';
- $ProductArea = isset($product['ProductArea']) ? $product['ProductArea'] : '';
- $FreightClass = isset($product['FreightClass']) ? $product['FreightClass'] : '';
- $ShipmentPOLine = isset($product['ShipmentPOLine']) ? $product['ShipmentPOLine'] : '';
- $LocationType = isset($product['LocationType']) ? $product['LocationType'] : '';
- $PallSize = isset($product['PallSize']) ? $product['PallSize'] : '';
- $MasterCarton = isset($product['MasterCarton']) ? $product['MasterCarton'] : '';
- $MasterQty = isset($product['MasterQty']) ? $product['MasterQty'] : '';
- $InnerQty = isset($product['InnerQty']) ? $product['InnerQty'] : '';
- $PalletQty = isset($product['PalletQty']) ? $product['PalletQty'] : '';
- $CartonQty = isset($product['CartonQty']) ? $product['CartonQty'] : '';
- $KitPartNumber = isset($product['KitPartNumber']) ? $product['KitPartNumber'] : '';
- $OrderLineSuffix = isset($product['OrderLineSuffix']) ? $product['OrderLineSuffix'] : '';
- $CustomerPartNumber = isset($product['CustomerPartNumber']) ? substr($product['CustomerPartNumber'], 0, 20) : ''; // Limit to 20 Chars
+ $quantity = isset($product['Quantity']) ? $product['Quantity'] : '';
+ $description = isset($product['Description']) ? Str::limit($product['Description'], 25, '') : '';
+ $partNumber = isset($product['PartNumber']) ? $product['PartNumber'] : '';
+ $orderLine = isset($product['OrderLine']) ? $product['OrderLine'] : '';
+ $partWeight = isset($product['PartWeight']) ? $product['PartWeight'] : '';
+ $pickerLine = isset($product['PickerLine']) ? $product['PickerLine'] : '';
+ $primaryLocation = isset($product['PrimaryLocation']) ? $product['PrimaryLocation'] : '';
+ $allocation = isset($product['Allocation']) ? $product['Allocation'] : '';
+ $allocatedTo = isset($product['AllocatedTo']) ? $product['AllocatedTo'] : '';
+ $locationSeq = isset($product['LocationSeq']) ? $product['LocationSeq'] : '';
+ $zone = isset($product['Zone']) ? $product['Zone'] : '';
+ $baseUnitPrice = isset($product['BaseUnitPrice']) ? $product['BaseUnitPrice'] : '';
+ $frgnUnitPrice = isset($product['FrgnUnitPrice']) ? $product['FrgnUnitPrice'] : '';
+ $sellUOM = isset($product['SellUOM']) ? $product['SellUOM'] : '';
+ $partConv = isset($product['PartConv']) ? $product['PartConv'] : '';
+ $uOM = isset($product['UOM']) ? $product['UOM'] : '';
+ $hazMat = isset($product['HazMat']) ? $product['HazMat'] : '';
+ $partUPC = isset($product['PartUPC']) ? $product['PartUPC'] : '';
+ $partEAN = isset($product['PartEAN']) ? $product['PartEAN'] : '';
+ $lotFlag = isset($product['LotFlag']) ? $product['LotFlag'] : '';
+ $manOrd = isset($product['ManOrd']) ? $product['ManOrd'] : '';
+ $lotNumber = isset($product['LotNumber']) ? $product['LotNumber'] : '';
+ $productArea = isset($product['ProductArea']) ? $product['ProductArea'] : '';
+ $freightClass = isset($product['FreightClass']) ? $product['FreightClass'] : '';
+ $shipmentPOLine = isset($product['ShipmentPOLine']) ? $product['ShipmentPOLine'] : '';
+ $locationType = isset($product['LocationType']) ? $product['LocationType'] : '';
+ $pallSize = isset($product['PallSize']) ? $product['PallSize'] : '';
+ $masterCarton = isset($product['MasterCarton']) ? $product['MasterCarton'] : '';
+ $masterQty = isset($product['MasterQty']) ? $product['MasterQty'] : '';
+ $innerQty = isset($product['InnerQty']) ? $product['InnerQty'] : '';
+ $sonar_pallet_qty = isset($product['PalletQty']) ? $product['PalletQty'] : '';
+ $cartonQty = isset($product['CartonQty']) ? $product['CartonQty'] : '';
+ $kitPartNumber = isset($product['KitPartNumber']) ? $product['KitPartNumber'] : '';
+ $orderLineSuffix = isset($product['OrderLineSuffix']) ? $product['OrderLineSuffix'] : '';
+ $customerPartNumber = isset($product['CustomerPartNumber']) ? substr($product['CustomerPartNumber'], 0, 20) : ''; // Limit to 20 Chars
// Initialise Table Fields to be filled
- $InsertArray = [];
+ $insertArray = [];
$fieldValues = [
- 'Company' => $Company,
- 'Warehouse' => $Warehouse,
- 'Plant' => $Plant,
- 'PickerNumber' => $PickerNumber,
- 'OrderNumber' => $OrderNumber,
- 'ReleaseNumber' => $ReleaseNumber,
- 'ShipmentNumber' => $ShipmentNumber,
- 'OrderLine' => $OrderLine,
- 'PartNumber' => $PartNumber,
- 'Description' => $Description,
- 'Quantity' => $Quantity,
- 'BaseUnitPrice' => $BaseUnitPrice,
- 'Currency' => $Currency,
- 'Zone' => $Zone,
- 'PromDate' => $PromDate,
- 'RouteCode' => $RouteCode,
- 'BillToId' => $BillToId,
- 'ShipToId' => $ShipToId,
- 'CompanyName' => $CompanyName,
- 'Address1' => $Address1,
- 'Address2' => $Address2,
- 'Address3' => $Address3,
- 'Address4' => $Address4,
- 'City' => $City,
- 'State' => $State,
- 'PostalCode' => $PostalCode,
- 'Country' => $Country,
- 'CountryName' => $CountryName,
- 'PartWeight' => $PartWeight,
- 'SellUOM' => $SellUOM,
- 'PartConv' => $PartConv,
- 'CarrierCode' => $CarrierCode,
- 'ShipVia' => $ShipVia,
- 'PrimaryLocation' => $PrimaryLocation,
- 'Allocation' => $Allocation,
- 'AllocatedTo' => $AllocatedTo,
- 'LocationSeq' => $LocationSeq,
- 'UOM' => $UOM,
- 'HazMat' => $HazMat,
- 'PartUPC' => $PartUPC,
- 'PartEAN' => $PartEAN,
- 'LotFlag' => $LotFlag,
- 'ManOrd' => $ManOrd,
- 'LotNumber' => $LotNumber,
- 'ProductArea' => $ProductArea,
- 'FreightClass' => $FreightClass,
- 'ShipmentPONumber' => $ShipmentPONumber,
- 'ShipmentPOLine' => $ShipmentPOLine,
- 'ShipTerms' => $ShipTerms,
- 'OrderClass' => $OrderClass,
- 'LocationType' => $LocationType,
- 'PallSize' => $PallSize,
- 'MasterCarton' => $MasterCarton,
- 'MasterQty' => $MasterQty,
- 'InnerQty' => $InnerQty,
- 'PalletQty' => $PalletQty,
- 'CartonQty' => $CartonQty,
- 'PersonName' => $PersonName,
- 'AccountNo' => $AccountNo,
- 'Email' => $Email,
- 'OrderCategory' => $OrderCategory,
- 'A1DATEADD' => $A1DATEADD,
- 'A1TIMEADD' => $A1TIMEADD,
- 'KitPartNumber' => $KitPartNumber,
- 'OrderLineSuffix' => $OrderLineSuffix,
- 'CustomerPartNumber' => $CustomerPartNumber,
- 'GS1Label' => $GS1Label,
- 'CurrencyExchangeRate' => $CurrencyExchangeRate,
+ 'Company' => $company,
+ 'Warehouse' => $warehouse,
+ 'Plant' => $plant,
+ 'PickerNumber' => $pickerNumber,
+ 'OrderNumber' => $orderNumber,
+ 'ReleaseNumber' => $releaseNumber,
+ 'ShipmentNumber' => $shipmentNumber,
+ 'OrderLine' => $orderLine,
+ 'PartNumber' => $partNumber,
+ 'Description' => $description,
+ 'Quantity' => $quantity,
+ 'BaseUnitPrice' => $baseUnitPrice,
+ 'Currency' => $currency,
+ 'Zone' => $zone,
+ 'PromDate' => $promDate,
+ 'RouteCode' => $routeCode,
+ 'BillToId' => $billToId,
+ 'ShipToId' => $shipToId,
+ 'CompanyName' => $companyName,
+ 'Address1' => $address1,
+ 'Address2' => $address2,
+ 'Address3' => $address3,
+ 'Address4' => $address4,
+ 'City' => $city,
+ 'State' => $state,
+ 'PostalCode' => $postalCode,
+ 'Country' => $country,
+ 'CountryName' => $countryName,
+ 'PartWeight' => $partWeight,
+ 'SellUOM' => $sellUOM,
+ 'PartConv' => $partConv,
+ 'CarrierCode' => $carrierCode,
+ 'ShipVia' => $shipVia,
+ 'PrimaryLocation' => $primaryLocation,
+ 'Allocation' => $allocation,
+ 'AllocatedTo' => $allocatedTo,
+ 'LocationSeq' => $locationSeq,
+ 'UOM' => $uOM,
+ 'HazMat' => $hazMat,
+ 'PartUPC' => $partUPC,
+ 'PartEAN' => $partEAN,
+ 'LotFlag' => $lotFlag,
+ 'ManOrd' => $manOrd,
+ 'LotNumber' => $lotNumber,
+ 'ProductArea' => $productArea,
+ 'FreightClass' => $freightClass,
+ 'ShipmentPONumber' => $shipmentPONumber,
+ 'ShipmentPOLine' => $shipmentPOLine,
+ 'ShipTerms' => $shipTerms,
+ 'OrderClass' => $orderClass,
+ 'LocationType' => $locationType,
+ 'PallSize' => $pallSize,
+ 'MasterCarton' => $masterCarton,
+ 'MasterQty' => $masterQty,
+ 'InnerQty' => $innerQty,
+ 'PalletQty' => $sonar_pallet_qty,
+ 'CartonQty' => $cartonQty,
+ 'PersonName' => $personName,
+ 'AccountNo' => $accountNo,
+ 'Email' => $email,
+ 'OrderCategory' => $orderCategory,
+ 'A1DATEADD' => $a1DATEADD,
+ 'A1TIMEADD' => $a1TIMEADD,
+ 'KitPartNumber' => $kitPartNumber,
+ 'OrderLineSuffix' => $orderLineSuffix,
+ 'CustomerPartNumber' => $customerPartNumber,
+ 'GS1Label' => $gS1Label,
+ 'CurrencyExchangeRate' => $currencyExchangeRate,
];
// Check JSON fields if empty or > DB Fields
- foreach ($ICM666MFields as $key => $value) {
+ foreach ($iCM666MFields as $key => $value) {
// Sanitize String
$fieldValue = Helper::sanityzeString($fieldValues[$key] ?? '');
// Check Var Types & Length
@@ -383,44 +383,44 @@ class M3Controller extends Controller
}
// Write to Logs Out : Error & JSON
- $data = ['SHMACPKR' => $SHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-spl',
- 'SHDATA' => json_encode($message) . self::M3_LIST_SUFFIX . json_encode($jsonFile), 'SHUSER' => $REQKPKUS, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $Company, 'SHWHS' => $Warehouse];
+ $data = ['SHMACPKR' => $sHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-spl',
+ 'SHDATA' => json_encode($message) . self::M3_LIST_SUFFIX . json_encode($jsonFile), 'SHUSER' => $rEQKPKUS, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $company, 'SHWHS' => $warehouse];
Helper::logToICM699M($data);
return response()->json($message);
} elseif ($fieldValue != '') {
- $InsertArray[$value[0]] = $fieldValue;
+ $insertArray[$value[0]] = $fieldValue;
}
}
// Check ICM709M
- $ICM709MSEL = DB::connection(config('m3.connection', 'pgsql'))->table('icm709m')
+ $iCM709MSEL = DB::connection(config('m3.connection', 'pgsql'))->table('icm709m')
->select()
- ->where('AT9CO', $AXCO)
- ->where('AT9PLT', $AXPLANT)
- ->where('AT9WHS', $AXWHS)
- ->where('AT9PART', $PartNumber)
+ ->where('AT9CO', $aXCO)
+ ->where('AT9PLT', $aXPLANT)
+ ->where('AT9WHS', $aXWHS)
+ ->where('AT9PART', $partNumber)
->first();
- $palletQty = isset($ICM709MSEL->AT9QTY) ? $ICM709MSEL->AT9QTY : 0;
+ $palletQty = isset($iCM709MSEL->AT9QTY) ? $iCM709MSEL->AT9QTY : 0;
// dd($palletQty);
// Get Pallet Qty
- $InsertArray['A1USRN01'] = $palletQty;
+ $insertArray['A1USRN01'] = $palletQty;
// Hazard Material
- $HazMat = isset($ICM709MSEL->AT9WRN) ? $ICM709MSEL->AT9WRN : '';
- $InsertArray['A1MATWRN'] = $HazMat;
+ $hazMat = isset($iCM709MSEL->AT9WRN) ? $iCM709MSEL->AT9WRN : '';
+ $insertArray['A1MATWRN'] = $hazMat;
- // $InsertArray['A1USRN01']=$palletQty;
+ // $insertArray['A1USRN01']=$palletQty;
// }
// SQL Insert to ICM666M
- $insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm666m')->insert($InsertArray);
+ $insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm666m')->insert($insertArray);
}
// Call PGM ICM700CSBM
- if ($Warehouse != '' && $PickerNumber != '' && $Company != '') {
- $PGMERRORS = '';
- $AWREQN = '';
+ if ($warehouse != '' && $pickerNumber != '' && $company != '') {
+ $pGMERRORS = '';
+ $aWREQN = '';
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
try {
@@ -435,13 +435,13 @@ class M3Controller extends Controller
case 8001:
// "Authorization failure on distributed database connection attempt"
// Usually means a wrong DB2 user or password
- $PGMERRORS = 'Could not connect due to wrong user or password.';
+ $pGMERRORS = 'Could not connect due to wrong user or password.';
break;
case 42705:
- $PGMERRORS = 'Database not found. Try WRKRDBDIRE to check.';
+ $pGMERRORS = 'Database not found. Try WRKRDBDIRE to check.';
break;
default:
- $PGMERRORS = 'Could not connect. Error: ' . $code . ' ' . $msg;
+ $pGMERRORS = 'Could not connect. Error: ' . $code . ' ' . $msg;
break;
}
}
@@ -455,14 +455,14 @@ class M3Controller extends Controller
// AddParameterChar($io, $size, $comment, $varName, $value, $varying, $dimension)
// Add Warehouse Param
- $params[] = $conn->AddParameterChar('in', 3, 'Company', '', $Company);
+ $params[] = $conn->AddParameterChar('in', 3, 'Company', '', $company);
- $params[] = $conn->AddParameterChar('in', 3, 'Warehouse', '', $Warehouse);
+ $params[] = $conn->AddParameterChar('in', 3, 'Warehouse', '', $warehouse);
// AddParameterPackDec($io, $length, $scale, $comment, $varName, $value,$dimension)
// Add Delivery Note Param
- $PickerNumberNoZero = ltrim(strval($PickerNumber), '0');
- $params[] = $conn->AddParameterChar('in', 11, 'PickerNumber', '', $PickerNumberNoZero);
+ $pickerNumberNoZero = ltrim(strval($pickerNumber), '0');
+ $params[] = $conn->AddParameterChar('in', 11, 'PickerNumber', '', $pickerNumberNoZero);
// Start Time Tracking
$start = microtime(true);
@@ -471,20 +471,20 @@ class M3Controller extends Controller
$result = $conn->PgmCall('ICM700CSBM', env('OBJLIB'), $params, [], []);
if (! $result) {
- $PGMERRORS = 'Error calling program. Code: ' . $conn->getErrorCode() . ' - Msg: ' . $conn->getErrorMsg();
+ $pGMERRORS = 'Error calling program. Code: ' . $conn->getErrorCode() . ' - Msg: ' . $conn->getErrorMsg();
}
- if ($PGMERRORS != '') {
+ if ($pGMERRORS != '') {
// Write to Logs Out : Error & JSON
- $data = ['SHMACPKR' => $SHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-spl',
- 'SHDATA' => $PGMERRORS . self::M3_LIST_SUFFIX . json_encode($jsonFile), 'SHUSER' => $REQKPKUS, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $Company, 'SHWHS' => $Warehouse];
+ $data = ['SHMACPKR' => $sHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-spl',
+ 'SHDATA' => $pGMERRORS . self::M3_LIST_SUFFIX . json_encode($jsonFile), 'SHUSER' => $rEQKPKUS, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $company, 'SHWHS' => $warehouse];
Helper::logToICM699M($data);
}
}
// Write to Logs Out : Success
- $data = ['SHMACPKR' => $SHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => '', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-in',
- 'SHDATA' => json_encode($jsonFile), 'SHUSER' => $REQKPKUS, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $Company, 'SHWHS' => $Warehouse];
+ $data = ['SHMACPKR' => $sHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => '', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-in',
+ 'SHDATA' => json_encode($jsonFile), 'SHUSER' => $rEQKPKUS, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $company, 'SHWHS' => $warehouse];
Helper::logToICM699M($data);
return response()->json([
@@ -494,10 +494,10 @@ class M3Controller extends Controller
]);
} else {
// Write to Logs Out : Error & JSON
- $SHACKNOTE = 'Sentinel automatically closed the error related to this empty data set sent by M3';
+ $sHACKNOTE = 'Sentinel automatically closed the error related to this empty data set sent by M3';
- $data = ['SHMACPKR' => $SHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'Z', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-in',
- 'SHDATA' => 'No Json File Found...', 'SHUSER' => $REQKPKUS, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $Company, 'SHWHS' => $Warehouse, 'SHACKNOTE' => $SHACKNOTE];
+ $data = ['SHMACPKR' => $sHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'Z', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-in',
+ 'SHDATA' => 'No Json File Found...', 'SHUSER' => $rEQKPKUS, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $company, 'SHWHS' => $warehouse, 'SHACKNOTE' => $sHACKNOTE];
Helper::logToICM699M($data);
return response()->json([
@@ -508,8 +508,8 @@ class M3Controller extends Controller
}
} catch (\Throwable $th) {
// Write to Logs Out : Error & JSON
- $data = ['SHMACPKR' => $SHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-in',
- 'SHDATA' => 'General Catchable Error - ' . substr($th, 0, 300) . self::M3_LIST_SUFFIX . json_encode($jsonFile), 'SHUSER' => $REQKPKUS, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $Company, 'SHWHS' => $Warehouse];
+ $data = ['SHMACPKR' => $sHMACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Lis-in',
+ 'SHDATA' => 'General Catchable Error - ' . substr($th, 0, 300) . self::M3_LIST_SUFFIX . json_encode($jsonFile), 'SHUSER' => $rEQKPKUS, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $company, 'SHWHS' => $warehouse];
Helper::logToICM699M($data);
return response()->json([
diff --git a/Modules/M3/Http/Controllers/API/ReplenAPI.php b/Modules/M3/Http/Controllers/API/ReplenAPI.php
index ac797b84..0babee16 100644
--- a/Modules/M3/Http/Controllers/API/ReplenAPI.php
+++ b/Modules/M3/Http/Controllers/API/ReplenAPI.php
@@ -15,6 +15,7 @@ use Str;
class ReplenAPI extends Controller
{
private const ZERO_PAD = '000000';
+
private const JSON_CONTENT_TYPE = 'application/json';
// M3Replenishement with URL Params
@@ -27,53 +28,53 @@ class ReplenAPI extends Controller
// dd($request->all());
// Log::info( $request->all() );
// Get The Calling User
- $SHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
- $MACPKR = isset($MACPKR) ? $MACPKR : self::ZERO_PAD;
- $SHSOURCE = 'M3InventoryReportReplen';
- $M3Errors = '';
+ $sHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
+ $mACPKR = isset($mACPKR) ? $mACPKR : self::ZERO_PAD;
+ $sHSOURCE = 'M3InventoryReportReplen';
+ $m3Errors = '';
try {
// Get Json Contents
$urlParams = count($request->all()) > 0 ? $request->all() : '';
- $CO = isset($urlParams['CO']) ? $urlParams['CO'] : '';
- $WHS = isset($urlParams['WHS']) ? $urlParams['WHS'] : '';
- $PARTNO = isset($urlParams['PARTNO']) ? $urlParams['PARTNO'] : '';
- $PKLN = isset($urlParams['PKLN']) ? $urlParams['PKLN'] : '';
- $REQPKWS = isset($urlParams['REQPKWS']) ? $urlParams['REQPKWS'] : '';
- $REQKPKUS = isset($urlParams['REQKPKUS']) ? $urlParams['REQKPKUS'] : 'WebUser';
+ $cO = isset($urlParams['CO']) ? $urlParams['CO'] : '';
+ $wHS = isset($urlParams['WHS']) ? $urlParams['WHS'] : '';
+ $pARTNO = isset($urlParams['PARTNO']) ? $urlParams['PARTNO'] : '';
+ $pKLN = isset($urlParams['PKLN']) ? $urlParams['PKLN'] : '';
+ $rEQPKWS = isset($urlParams['REQPKWS']) ? $urlParams['REQPKWS'] : '';
+ $rEQKPKUS = isset($urlParams['REQKPKUS']) ? $urlParams['REQKPKUS'] : 'WebUser';
if ($urlParams != '') {
- $IncomingParams = ['CO' => $CO, 'WHS' => $WHS, 'PARTNO' => $PARTNO, 'PKLN' => $PKLN, 'REQPKWS' => $REQPKWS, 'REQKPKUS' => $REQKPKUS];
- $IncomingParams = json_encode($IncomingParams);
+ $incomingParams = ['CO' => $cO, 'WHS' => $wHS, 'PARTNO' => $pARTNO, 'PKLN' => $pKLN, 'REQPKWS' => $rEQPKWS, 'REQKPKUS' => $rEQKPKUS];
+ $incomingParams = json_encode($incomingParams);
// Write to Logs : Params In
- $data = ['SHMACPKR' => $MACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => '', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Req-out',
- 'SHDATA' => $IncomingParams, 'SHUSER' => $SHUSER, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $CO, 'SHWHS' => $WHS];
+ $data = ['SHMACPKR' => $mACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => '', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Req-out',
+ 'SHDATA' => $incomingParams, 'SHUSER' => $sHUSER, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $cO, 'SHWHS' => $wHS];
Helper::logToICM699M($data);
- $PART = explode(',', $PARTNO);
- foreach ($PART as $key => $value) {
- $PARTS[] = ['PART' => $value, 'LOT' => ''];
+ $pART = explode(',', $pARTNO);
+ foreach ($pART as $key => $value) {
+ $pARTS[] = ['PART' => $value, 'LOT' => ''];
}
- $JSON = json_encode(['WHS' => $WHS, 'PARTS' => $PARTS]);
+ $jSON = json_encode(['WHS' => $wHS, 'PARTS' => $pARTS]);
// Write to Logs : Params Sent To M3
- $data = ['SHMACPKR' => $MACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => '', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Req-out',
- 'SHDATA' => 'Sent To M3-' . $JSON, 'SHUSER' => $SHUSER, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $CO, 'SHWHS' => $WHS];
+ $data = ['SHMACPKR' => $mACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => '', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Req-out',
+ 'SHDATA' => 'Sent To M3-' . $jSON, 'SHUSER' => $sHUSER, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $cO, 'SHWHS' => $wHS];
Helper::logToICM699M($data);
// Get Token
$tokenResponse = Helper::checkReceiveTokenV2();
$tokenData = $tokenResponse->getData();
if ($tokenData->code == '200') {
- $IonToken = isset($tokenData->token) ? $tokenData->token : '';
+ $ionToken = isset($tokenData->token) ? $tokenData->token : '';
} else {
- $SHDATA = isset($tokenData->message) ? $tokenData->message : '';
+ $sHDATA = isset($tokenData->message) ? $tokenData->message : '';
// Write to Logs : Error
- $data = ['SHMACPKR' => $MACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $SHDATA, 'SHUSER' => $SHUSER, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $CO, 'SHWHS' => $WHS];
+ $data = ['SHMACPKR' => $mACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
+ 'SHDATA' => $sHDATA, 'SHUSER' => $sHUSER, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $cO, 'SHWHS' => $wHS];
Helper::logToICM699M($data);
return $tokenResponse;
@@ -81,39 +82,39 @@ class ReplenAPI extends Controller
// Call ionapi with Params
$endPointURL = env('ENDPOINTURL') . 'APIFLOWS/Sentinel/M3InventoryReportList?ionapiRespStyle=sync';
- $token = $IonToken;
+ $token = $ionToken;
$response = Http::withHeaders([
- 'accept' => self::JSON_CONTENT_TYPE,
- 'Content-Type' => self::JSON_CONTENT_TYPE,
- ])
+ 'accept' => self::JSON_CONTENT_TYPE,
+ 'Content-Type' => self::JSON_CONTENT_TYPE,
+ ])
->withToken($token)
- ->withBody($JSON, self::JSON_CONTENT_TYPE)
+ ->withBody($jSON, self::JSON_CONTENT_TYPE)
->timeout(Config::get('arrays.curlTimeOut'))
->retry(3, 100)
->post($endPointURL);
$responseStatusCode = $response->getStatusCode();
- $M3SessionId = $response->hasHeader('x-transaction-id') ? '-sessionID:' . $response->header('x-transaction-id') : '-sessionID';
+ $m3SessionId = $response->hasHeader('x-transaction-id') ? '-sessionID:' . $response->header('x-transaction-id') : '-sessionID';
if ($responseStatusCode == '200') {
// Check M3 Response for Errors
- $M3Errors = '';
+ $m3Errors = '';
$responseJSON = $response->getBody()->getContents();
- $JsonSanytized = Helper::sanityzeString($responseJSON);
+ $jsonSanytized = Helper::sanityzeString($responseJSON);
// Array
- $responseArray = json_decode($JsonSanytized, true);
+ $responseArray = json_decode($jsonSanytized, true);
$responseTMP = $responseArray['result'];
} else {
- $M3Errors = 'Error: No Response from M3';
+ $m3Errors = 'Error: No Response from M3';
}
// Validate response From M3
- if ($M3Errors != '') {
+ if ($m3Errors != '') {
// Write to Logs : Error
- $data = ['SHMACPKR' => $MACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $responseStatusCode . '-' . $M3Errors . $M3SessionId, 'SHUSER' => $SHUSER, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $CO, 'SHWHS' => $WHS];
+ $data = ['SHMACPKR' => $mACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
+ 'SHDATA' => $responseStatusCode . '-' . $m3Errors . $m3SessionId, 'SHUSER' => $sHUSER, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $cO, 'SHWHS' => $wHS];
Helper::logToICM699M($data);
// Send Response
@@ -124,8 +125,8 @@ class ReplenAPI extends Controller
]);
} else {
// Write to Logs : JSON
- $data = ['SHMACPKR' => $MACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => '', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $responseStatusCode . '-' . $JsonSanytized . $M3SessionId, 'SHUSER' => $SHUSER, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $CO, 'SHWHS' => $WHS];
+ $data = ['SHMACPKR' => $mACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => '', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
+ 'SHDATA' => $responseStatusCode . '-' . $jsonSanytized . $m3SessionId, 'SHUSER' => $sHUSER, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $cO, 'SHWHS' => $wHS];
Helper::logToICM699M($data);
}
@@ -146,70 +147,70 @@ class ReplenAPI extends Controller
// Delete Old Records from IC630M
foreach ($dataToWrite2 as $key => $value) {
- $ICM630MDeleteSQL = DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')
- ->where('LLCO', $CO)
- ->where('LLWHNO', $WHS)
+ $iCM630MDeleteSQL = DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')
+ ->where('LLCO', $cO)
+ ->where('LLWHNO', $wHS)
->where('LLPPN', trim($value['PartNumber']))
->delete();
}
foreach ($dataToWrite2 as $key => $value) {
// Check if Location exist in DE640M $value['Location']
- $DE640MSQLSEL = DB::connection(config('m3.connection', 'pgsql'))->table('de640m')
- ->where('LVCO', $CO)
+ $dE640MSQLSEL = DB::connection(config('m3.connection', 'pgsql'))->table('de640m')
+ ->where('LVCO', $cO)
->where('WSELOC', $value['Warehouse'])
->where('VLOCID', $value['Location'])
->first();
- $LocationExist = isset($DE640MSQLSEL->VLOCID) ? trim($DE640MSQLSEL->VLOCID) : '';
- $WHExist = isset($DE640MSQLSEL->WSELOC) ? trim($DE640MSQLSEL->WSELOC) : '';
- $COExist = isset($DE640MSQLSEL->LVCO) ? trim($DE640MSQLSEL->LVCO) : '';
+ $locationExist = isset($dE640MSQLSEL->VLOCID) ? trim($dE640MSQLSEL->VLOCID) : '';
+ $wHExist = isset($dE640MSQLSEL->WSELOC) ? trim($dE640MSQLSEL->WSELOC) : '';
+ $cOExist = isset($dE640MSQLSEL->LVCO) ? trim($dE640MSQLSEL->LVCO) : '';
// if No records Founds insert New Record
- if ($LocationExist == '' && $WHExist == '' && $COExist == '') {
- $SQLInsertPrep640M['LVCO'] = $CO; // Company
- $SQLInsertPrep640M['WSELOC'] = $value['Warehouse'];
- // $SQLInsertPrep640M['LVUSD3'] = $value['']; // Pallet Size : Not Found in M3 JSON
- $SQLInsertPrep640M['VLOCID'] = $value['Location']; // Stock location
- $SQLInsertPrep640M['LVSEQN'] = $value['LocationSeq'];
- $SQLInsertPrep640M['LVUSD2'] = $value['LocationType'];
- $SQLInsertPrep640M['LVZONE'] = $value['Zone']; // Warehouse zone
- $SQLInsertPrep640M['LVMAINTTS'] = now(); // Last maintained time stamp
+ if ($locationExist == '' && $wHExist == '' && $cOExist == '') {
+ $sQLInsertPrep640M['LVCO'] = $cO; // Company
+ $sQLInsertPrep640M['WSELOC'] = $value['Warehouse'];
+ // $sQLInsertPrep640M['LVUSD3'] = $value['']; // Pallet Size : Not Found in M3 JSON
+ $sQLInsertPrep640M['VLOCID'] = $value['Location']; // Stock location
+ $sQLInsertPrep640M['LVSEQN'] = $value['LocationSeq'];
+ $sQLInsertPrep640M['LVUSD2'] = $value['LocationType'];
+ $sQLInsertPrep640M['LVZONE'] = $value['Zone']; // Warehouse zone
+ $sQLInsertPrep640M['LVMAINTTS'] = now(); // Last maintained time stamp
- DB::connection(config('m3.connection', 'pgsql'))->table('de640m')->insert($SQLInsertPrep640M);
+ DB::connection(config('m3.connection', 'pgsql'))->table('de640m')->insert($sQLInsertPrep640M);
}
// Update
else {
- $SQLUpdatePrep640M['LVSEQN'] = $value['LocationSeq'];
- $SQLUpdatePrep640M['LVUSD2'] = $value['LocationType'];
- $SQLUpdatePrep640M['LVZONE'] = $value['Zone'];
- $SQLUpdatePrep640M['LVMAINTTS'] = now();
+ $sQLUpdatePrep640M['LVSEQN'] = $value['LocationSeq'];
+ $sQLUpdatePrep640M['LVUSD2'] = $value['LocationType'];
+ $sQLUpdatePrep640M['LVZONE'] = $value['Zone'];
+ $sQLUpdatePrep640M['LVMAINTTS'] = now();
DB::connection(config('m3.connection', 'pgsql'))->table('de640m')
- ->where('LVCO', $CO)
+ ->where('LVCO', $cO)
->where('WSELOC', $value['Warehouse'])
->where('VLOCID', $value['Location'])
- ->update($SQLUpdatePrep640M);
+ ->update($sQLUpdatePrep640M);
}
// Insert New Records to IC630M
- $SQLInsertPrep630M = [];
- $SQLInsertPrep630M['LLCO'] = $CO; // Company
- $SQLInsertPrep630M['LLWHNO'] = $value['Warehouse']; // Warehouse
- $SQLInsertPrep630M['LLPPN'] = $value['PartNumber']; // Part Number
- $SQLInsertPrep630M['LLBALANCE'] = $value['Quantity']; // Quantity
- $SQLInsertPrep630M['LLSTLC'] = $value['Location']; // Stock location
- $SQLInsertPrep630M['LLLTNO'] = $value['LotNumber']; // Lot Number
- $SQLInsertPrep630M['LLMAINTTS'] = now(); // Request time timestamp
- $SQLInsertPrep630M['LLIZLCF'] = trim($value['LotNumber']) != '' ? '1' : ''; // Lot control flag
- $SQLInsertPrep630M['LLSPR10A01'] = $value['Allocation']; // Allocation
- $SQLInsertPrep630M['LLSPR15A01'] = $value['AllocatedTo']; // AllocatedTo
+ $sQLInsertPrep630M = [];
+ $sQLInsertPrep630M['LLCO'] = $cO; // Company
+ $sQLInsertPrep630M['LLWHNO'] = $value['Warehouse']; // Warehouse
+ $sQLInsertPrep630M['LLPPN'] = $value['PartNumber']; // Part Number
+ $sQLInsertPrep630M['LLBALANCE'] = $value['Quantity']; // Quantity
+ $sQLInsertPrep630M['LLSTLC'] = $value['Location']; // Stock location
+ $sQLInsertPrep630M['LLLTNO'] = $value['LotNumber']; // Lot Number
+ $sQLInsertPrep630M['LLMAINTTS'] = now(); // Request time timestamp
+ $sQLInsertPrep630M['LLIZLCF'] = trim($value['LotNumber']) != '' ? '1' : ''; // Lot control flag
+ $sQLInsertPrep630M['LLSPR10A01'] = $value['Allocation']; // Allocation
+ $sQLInsertPrep630M['LLSPR15A01'] = $value['AllocatedTo']; // AllocatedTo
- $DescSanytized = Helper::sanityzeString($value['Description']);
- // $DescSanytized = str_replace(['–','\u20131'], '-',$value['Description']);
- $SQLInsertPrep630M['LLCMDESC'] = $DescSanytized; // Description
+ $descSanytized = Helper::sanityzeString($value['Description']);
+ // $descSanytized = str_replace(['–','\u20131'], '-',$value['Description']);
+ $sQLInsertPrep630M['LLCMDESC'] = $descSanytized; // Description
- DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')->insert($SQLInsertPrep630M);
+ DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')->insert($sQLInsertPrep630M);
}
// Send Response
@@ -219,9 +220,9 @@ class ReplenAPI extends Controller
]);
} else {
// Write to Logs Out : Error
- $MACPKR = isset($MACPKR) ? $MACPKR : self::ZERO_PAD;
- $data = ['SHMACPKR' => $MACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'No URL Parameters Sent', 'SHUSER' => $SHUSER, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $CO, 'SHWHS' => $WHS];
+ $mACPKR = isset($mACPKR) ? $mACPKR : self::ZERO_PAD;
+ $data = ['SHMACPKR' => $mACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
+ 'SHDATA' => 'No URL Parameters Sent', 'SHUSER' => $sHUSER, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $cO, 'SHWHS' => $wHS];
Helper::logToICM699M($data);
// Return Error
@@ -233,14 +234,14 @@ class ReplenAPI extends Controller
}
} catch (\Throwable $th) {
// Write to Logs Out : Error
- $MACPKR = isset($MACPKR) ? $MACPKR : self::ZERO_PAD;
+ $mACPKR = isset($mACPKR) ? $mACPKR : self::ZERO_PAD;
$getCurlErrors = str_contains($th->getMessage(), 'cURL error');
if ($getCurlErrors) {
// dd($getCurlErrors);
// Write to Logs Out : Failed
- $data = ['SHMACPKR' => $MACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'Curl Error: Communication with M3 Timed Out' . ' M3-JSN-out' . $IncomingParams, 'SHUSER' => $SHUSER, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $CO, 'SHWHS' => $WHS];
+ $data = ['SHMACPKR' => $mACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => 'X', 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
+ 'SHDATA' => 'Curl Error: Communication with M3 Timed Out' . ' M3-JSN-out' . $incomingParams, 'SHUSER' => $sHUSER, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $cO, 'SHWHS' => $wHS];
Helper::logToICM699M($data);
return response()->json([
@@ -251,16 +252,16 @@ class ReplenAPI extends Controller
} else {
// Set SHERROR To Z if Duplicate Key Detected $th
// Read The substring from SHDATA after M3-JSN-out
- $SHERROR = 'X';
+ $sHERROR = 'X';
$word = 'Duplicate key value specified';
$position = strpos($th, $word);
if ($position !== false) {
- $SHERROR = 'Z';
+ $sHERROR = 'Z';
}
- $data = ['SHMACPKR' => $MACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => $SHERROR, 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'An Error Occured - ' . substr($th, 0, 300), 'SHUSER' => $SHUSER, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $CO, 'SHWHS' => $WHS];
+ $data = ['SHMACPKR' => $mACPKR, 'SHDT' => date('Y-m-d'), 'SHTIME' => date('H:i:s'), 'SHERROR' => $sHERROR, 'SHINTBOX' => '', 'SHTYPE' => 'M3-Res-out',
+ 'SHDATA' => 'An Error Occured - ' . substr($th, 0, 300), 'SHUSER' => $sHUSER, 'SHSOURCE' => $sHSOURCE, 'SHCO' => $cO, 'SHWHS' => $wHS];
Helper::logToICM699M($data);
return response()->json([
diff --git a/Modules/M3/Http/Controllers/API/TransferAPI.php b/Modules/M3/Http/Controllers/API/TransferAPI.php
index 08ec53df..8a0adb9b 100644
--- a/Modules/M3/Http/Controllers/API/TransferAPI.php
+++ b/Modules/M3/Http/Controllers/API/TransferAPI.php
@@ -16,8 +16,11 @@ use Str;
class TransferAPI extends Controller
{
private const ZERO_PAD = '000000';
+
private const JSON_CONTENT_TYPE = 'application/json';
+
private const ORDER_CATEGORY_LABEL = ' Order Category: ';
+
private const NO_URL_PARAMETERS = 'No URL Parameters Sent';
// TransferAPIURL : with URL PARAMS
@@ -28,31 +31,31 @@ class TransferAPI extends Controller
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
// Get the Calling User
- $SHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
+ $sHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
// Set SHSOURCE
- $SHSOURCE = 'TransferAPIURL';
- $M3Errors = '';
+ $sHSOURCE = 'TransferAPIURL';
+ $m3Errors = '';
// Get URL PARAMS
$urlParams = count($request->all()) > 0 ? $request->all() : '';
- $DIVI = isset($urlParams['COMPANY']) ? $urlParams['COMPANY'] : '';
- $WHS = isset($urlParams['WHS']) ? $urlParams['WHS'] : '';
+ $dIVI = isset($urlParams['COMPANY']) ? $urlParams['COMPANY'] : '';
+ $wHS = isset($urlParams['WHS']) ? $urlParams['WHS'] : '';
try {
if ($urlParams != '') {
- $PART = isset($urlParams['PART']) ? $urlParams['PART'] : '';
- $LOCATIONFROM = isset($urlParams['LOCATIONFROM']) ? $urlParams['LOCATIONFROM'] : '';
- $LOCATIONTO = isset($urlParams['LOCATIONTO']) ? $urlParams['LOCATIONTO'] : '';
- $QUANTITY = isset($urlParams['QUANTITY']) ? $urlParams['QUANTITY'] : '';
- $ORDERCATEGORY = isset($urlParams['ORDERCATEGORY']) ? $urlParams['ORDERCATEGORY'] : '';
- $LOTNUMBER = isset($urlParams['LOTNUMBER']) ? $urlParams['LOTNUMBER'] : '';
- $CONUMBER = isset($urlParams['CONUMBER']) ? $urlParams['CONUMBER'] : '';
- $COLINENO = isset($urlParams['COLINENO']) ? $urlParams['COLINENO'] : '';
- $DELIVERYNO = isset($urlParams['DELIVERYNO']) ? $urlParams['DELIVERYNO'] : self::ZERO_PAD;
- $PICKLISTSUFFIX = isset($urlParams['PICKLISTSUFFIX']) ? $urlParams['PICKLISTSUFFIX'] : '';
- $ENDFLAG = isset($urlParams['ENDFLAG']) ? $urlParams['ENDFLAG'] : '';
- $TYPE = isset($urlParams['TYPE']) ? $urlParams['TYPE'] : '';
- $COLINESUFFIX = isset($urlParams['COLINESUFFIX']) ? $urlParams['COLINESUFFIX'] : '';
+ $pART = isset($urlParams['PART']) ? $urlParams['PART'] : '';
+ $lOCATIONFROM = isset($urlParams['LOCATIONFROM']) ? $urlParams['LOCATIONFROM'] : '';
+ $lOCATIONTO = isset($urlParams['LOCATIONTO']) ? $urlParams['LOCATIONTO'] : '';
+ $qUANTITY = isset($urlParams['QUANTITY']) ? $urlParams['QUANTITY'] : '';
+ $oRDERCATEGORY = isset($urlParams['ORDERCATEGORY']) ? $urlParams['ORDERCATEGORY'] : '';
+ $lOTNUMBER = isset($urlParams['LOTNUMBER']) ? $urlParams['LOTNUMBER'] : '';
+ $cONUMBER = isset($urlParams['CONUMBER']) ? $urlParams['CONUMBER'] : '';
+ $cOLINENO = isset($urlParams['COLINENO']) ? $urlParams['COLINENO'] : '';
+ $dELIVERYNO = isset($urlParams['DELIVERYNO']) ? $urlParams['DELIVERYNO'] : self::ZERO_PAD;
+ $pICKLISTSUFFIX = isset($urlParams['PICKLISTSUFFIX']) ? $urlParams['PICKLISTSUFFIX'] : '';
+ $eNDFLAG = isset($urlParams['ENDFLAG']) ? $urlParams['ENDFLAG'] : '';
+ $tYPE = isset($urlParams['TYPE']) ? $urlParams['TYPE'] : '';
+ $cOLINESUFFIX = isset($urlParams['COLINESUFFIX']) ? $urlParams['COLINESUFFIX'] : '';
// TYPE :
// DeliveryNote
@@ -69,157 +72,157 @@ class TransferAPI extends Controller
// 5 = Distribution Order
// 9 = Move order
- $DELIVERYNO = isset($DELIVERYNO) ? $DELIVERYNO : self::ZERO_PAD;
+ $dELIVERYNO = isset($dELIVERYNO) ? $dELIVERYNO : self::ZERO_PAD;
- $TRANSTYPE = isset($urlParams['TRANSTYPE']) ? $urlParams['TRANSTYPE'] : ''; // R for Retry
- $SHDT = isset($urlParams['SHDT']) ? $urlParams['SHDT'] : '';
- $SHTIME = isset($urlParams['SHTIME']) ? $urlParams['SHTIME'] : '';
- $SHTYPE = isset($urlParams['SHTYPE']) ? $urlParams['SHTYPE'] : '';
+ $tRANSTYPE = isset($urlParams['TRANSTYPE']) ? $urlParams['TRANSTYPE'] : ''; // R for Retry
+ $sHDT = isset($urlParams['SHDT']) ? $urlParams['SHDT'] : '';
+ $sHTIME = isset($urlParams['SHTIME']) ? $urlParams['SHTIME'] : '';
+ $sHTYPE = isset($urlParams['SHTYPE']) ? $urlParams['SHTYPE'] : '';
// Retry Transfer
- if ($TRANSTYPE == 'R') {
- // $t = strtotime($SHTIME);
+ if ($tRANSTYPE == 'R') {
+ // $t = strtotime($sHTIME);
// $SHTIMEHM = date('H:i',$t);
// dd($SHTIMEHM);
// Get the record that contain the payload
- $ICM699MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ $iCM699MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
->select('SHDATA')
- ->where('SHMACPKR', $DELIVERYNO)
- ->where('SHDT', $SHDT)
- ->where('SHTIME', $SHTIME)
+ ->where('SHMACPKR', $dELIVERYNO)
+ ->where('SHDT', $sHDT)
+ ->where('SHTIME', $sHTIME)
// ->whereRaw("VARCHAR_FORMAT (TIMESTAMP (CURRENT DATE) + MIDNIGHT_SECONDS (SHTIME) SECONDS, 'HH24:MI') = ?", [$SHTIMEHM])
- ->where('SHCO', $DIVI)
- ->where('SHWHS', $WHS)
- ->where('SHSOURCE', $SHSOURCE)
+ ->where('SHCO', $dIVI)
+ ->where('SHWHS', $wHS)
+ ->where('SHSOURCE', $sHSOURCE)
->where('SHERROR', 'X')
- ->where('SHTYPE', $SHTYPE)
+ ->where('SHTYPE', $sHTYPE)
->first();
// Read The substring from SHDATA after M3-JSN-out
$word = 'M3-JSN-out';
- $SHDATA = isset($ICM699MS->SHDATA) ? $ICM699MS->SHDATA : '';
- $SHDATAJSON = '';
- $position = strpos($SHDATA, $word);
+ $sHDATA = isset($iCM699MS->SHDATA) ? $iCM699MS->SHDATA : '';
+ $sHDATAJSON = '';
+ $position = strpos($sHDATA, $word);
// Also Read CommTCP_read
$word2 = 'url:http://127.0.0.1:10005/api/TransferAPIURL?';
- $SHDATA2 = isset($ICM699MS->SHDATA) ? $ICM699MS->SHDATA : '';
- $position2 = strpos($SHDATA2, $word2);
+ $sHDATA2 = isset($iCM699MS->SHDATA) ? $iCM699MS->SHDATA : '';
+ $position2 = strpos($sHDATA2, $word2);
if ($position !== false) {
- $SHDATAJSON = substr($SHDATA, $position + strlen($word));
+ $sHDATAJSON = substr($sHDATA, $position + strlen($word));
} elseif ($position2 !== false) {
- $SHDATAJSONS = substr($SHDATA2, $position2 + strlen($word2));
- $SHDATAJSONA = [];
- parse_str($SHDATAJSONS, $SHDATAJSONA);
- $SHDATAJSON = json_encode($SHDATAJSONA);
+ $sHDATAJSONS = substr($sHDATA2, $position2 + strlen($word2));
+ $sHDATAJSONA = [];
+ parse_str($sHDATAJSONS, $sHDATAJSONA);
+ $sHDATAJSON = json_encode($sHDATAJSONA);
}
// Find the position of the opening and closing curly braces
- $startPos = strpos($SHDATAJSON, '{');
- $endPos = strrpos($SHDATAJSON, '}');
+ $startPos = strpos($sHDATAJSON, '{');
+ $endPos = strrpos($sHDATAJSON, '}');
// Extract the substring within the curly braces
- $SHDATAJSON = substr($SHDATAJSON, $startPos, $endPos - $startPos + 1);
+ $sHDATAJSON = substr($sHDATAJSON, $startPos, $endPos - $startPos + 1);
- $JSONTR = $SHDATAJSON != '' ? json_decode($SHDATAJSON) : '';
+ $jSONTR = $sHDATAJSON != '' ? json_decode($sHDATAJSON) : '';
- if ($JSONTR != '') {
- $PART = isset($JSONTR->PART) ? $JSONTR->PART : '';
- $LOCATIONFROM = isset($JSONTR->LOCATIONFROM) ? $JSONTR->LOCATIONFROM : '';
- $LOCATIONTO = isset($JSONTR->LOCATIONTO) ? $JSONTR->LOCATIONTO : '';
- $QUANTITY = isset($JSONTR->QUANTITY) ? $JSONTR->QUANTITY : '';
- $ORDERCATEGORY = isset($JSONTR->ORDERCATEGORY) ? $JSONTR->ORDERCATEGORY : '';
- $LOTNUMBER = isset($JSONTR->LOTNUMBER) ? $JSONTR->LOTNUMBER : '';
- $CONUMBER = isset($JSONTR->CONUMBER) ? $JSONTR->CONUMBER : '';
- $COLINENO = isset($JSONTR->COLINENO) ? $JSONTR->COLINENO : '';
- $DELIVERYNO = isset($JSONTR->DELIVERYNO) ? $JSONTR->DELIVERYNO : self::ZERO_PAD;
- $PICKLISTSUFFIX = isset($JSONTR->PICKLISTSUFFIX) ? $JSONTR->PICKLISTSUFFIX : '';
- $ENDFLAG = isset($JSONTR->ENDFLAG) ? $JSONTR->ENDFLAG : '';
- $TYPE = isset($JSONTR->TYPE) ? $JSONTR->TYPE : '';
- $COLINESUFFIX = isset($JSONTR->COLINESUFFIX) ? $JSONTR->COLINESUFFIX : '';
+ if ($jSONTR != '') {
+ $pART = isset($jSONTR->PART) ? $jSONTR->PART : '';
+ $lOCATIONFROM = isset($jSONTR->LOCATIONFROM) ? $jSONTR->LOCATIONFROM : '';
+ $lOCATIONTO = isset($jSONTR->LOCATIONTO) ? $jSONTR->LOCATIONTO : '';
+ $qUANTITY = isset($jSONTR->QUANTITY) ? $jSONTR->QUANTITY : '';
+ $oRDERCATEGORY = isset($jSONTR->ORDERCATEGORY) ? $jSONTR->ORDERCATEGORY : '';
+ $lOTNUMBER = isset($jSONTR->LOTNUMBER) ? $jSONTR->LOTNUMBER : '';
+ $cONUMBER = isset($jSONTR->CONUMBER) ? $jSONTR->CONUMBER : '';
+ $cOLINENO = isset($jSONTR->COLINENO) ? $jSONTR->COLINENO : '';
+ $dELIVERYNO = isset($jSONTR->DELIVERYNO) ? $jSONTR->DELIVERYNO : self::ZERO_PAD;
+ $pICKLISTSUFFIX = isset($jSONTR->PICKLISTSUFFIX) ? $jSONTR->PICKLISTSUFFIX : '';
+ $eNDFLAG = isset($jSONTR->ENDFLAG) ? $jSONTR->ENDFLAG : '';
+ $tYPE = isset($jSONTR->TYPE) ? $jSONTR->TYPE : '';
+ $cOLINESUFFIX = isset($jSONTR->COLINESUFFIX) ? $jSONTR->COLINESUFFIX : '';
}
// Set SHERROR to Z in ICM699M
- $ICM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
- ->where('SHMACPKR', $DELIVERYNO)
- ->where('SHDT', $SHDT)
- ->where('SHTIME', $SHTIME)
- ->where('SHCO', $DIVI)
- ->where('SHWHS', $WHS)
- ->where('SHSOURCE', $SHSOURCE)
+ $iCM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ ->where('SHMACPKR', $dELIVERYNO)
+ ->where('SHDT', $sHDT)
+ ->where('SHTIME', $sHTIME)
+ ->where('SHCO', $dIVI)
+ ->where('SHWHS', $wHS)
+ ->where('SHSOURCE', $sHSOURCE)
->where('SHERROR', 'X')
- ->where('SHTYPE', $SHTYPE)
- ->update(['SHERROR' => 'Z', 'SHACKUSER' => $SHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s')]);
+ ->where('SHTYPE', $sHTYPE)
+ ->update(['SHERROR' => 'Z', 'SHACKUSER' => $sHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s')]);
}
// Part Exists : proceed
- if ($PART != '') {
+ if ($pART != '') {
// Read from ICM688M2
// Get Parts And Lots from ICM688M2
- $ICM688M2SLTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m2')
+ $iCM688M2SLTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m2')
->select('A5BRADLN', 'A5PKSFX', 'A5PLANT', 'A5SENTPKR')
->distinct()
- ->where('A5CO', $DIVI)
- ->where('A5WHS', $WHS)
- ->where('A5MACPKR', $DELIVERYNO);
+ ->where('A5CO', $dIVI)
+ ->where('A5WHS', $wHS)
+ ->where('A5MACPKR', $dELIVERYNO);
// Get Pack Lines
- if ($COLINENO != '') {
- $ICM688M2SLTMP->where('A5PKLN', $COLINENO);
+ if ($cOLINENO != '') {
+ $iCM688M2SLTMP->where('A5PKLN', $cOLINENO);
}
- $ICM688M2SL = $ICM688M2SLTMP->first();
+ $iCM688M2SL = $iCM688M2SLTMP->first();
- $A5BRADLINE = isset($ICM688M2SL->A5BRADLN) ? $ICM688M2SL->A5BRADLN : '';
- $COLINESUFFIX = isset($ICM688M2SL->A5PKSFX) ? $ICM688M2SL->A5PKSFX : ''; // Case 551 : $COLINESUFFIX
- $A5PLANT = isset($ICM688M2SL->A5PLANT) ? $ICM688M2SL->A5PLANT : '';
- $A5SENTPKR = isset($ICM688M2SL->A5SENTPKR) ? $ICM688M2SL->A5SENTPKR : '';
+ $a5BRADLINE = isset($iCM688M2SL->A5BRADLN) ? $iCM688M2SL->A5BRADLN : '';
+ $cOLINESUFFIX = isset($iCM688M2SL->A5PKSFX) ? $iCM688M2SL->A5PKSFX : ''; // Case 551 : $cOLINESUFFIX
+ $a5PLANT = isset($iCM688M2SL->A5PLANT) ? $iCM688M2SL->A5PLANT : '';
+ $a5SENTPKR = isset($iCM688M2SL->A5SENTPKR) ? $iCM688M2SL->A5SENTPKR : '';
- $JSONIN = json_encode([
- 'DIVI' => $DIVI,
- 'WHS' => $WHS,
- 'PART' => $PART,
- 'LOCATIONFROM' => $LOCATIONFROM,
- 'LOCATIONTO' => $LOCATIONTO,
- 'QUANTITY' => $QUANTITY,
- 'ORDERCATEGORY' => $ORDERCATEGORY,
- 'LOTNUMBER' => $LOTNUMBER,
- 'CONUMBER' => $CONUMBER,
- 'COLINENO' => $COLINENO,
- 'DELIVERYNO' => $DELIVERYNO,
- 'PICKLISTSUFFIX' => $PICKLISTSUFFIX,
- 'ENDFLAG' => $ENDFLAG,
- 'TYPE' => $TYPE,
- 'COLINESUFFIX' => $COLINESUFFIX,
+ $jSONIN = json_encode([
+ 'DIVI' => $dIVI,
+ 'WHS' => $wHS,
+ 'PART' => $pART,
+ 'LOCATIONFROM' => $lOCATIONFROM,
+ 'LOCATIONTO' => $lOCATIONTO,
+ 'QUANTITY' => $qUANTITY,
+ 'ORDERCATEGORY' => $oRDERCATEGORY,
+ 'LOTNUMBER' => $lOTNUMBER,
+ 'CONUMBER' => $cONUMBER,
+ 'COLINENO' => $cOLINENO,
+ 'DELIVERYNO' => $dELIVERYNO,
+ 'PICKLISTSUFFIX' => $pICKLISTSUFFIX,
+ 'ENDFLAG' => $eNDFLAG,
+ 'TYPE' => $tYPE,
+ 'COLINESUFFIX' => $cOLINESUFFIX,
], JSON_UNESCAPED_SLASHES);
- $JSON = json_encode([
- 'DIVI' => $DIVI,
- 'WHS' => $WHS,
- 'PART' => $PART,
- 'LOCATIONFROM' => $LOCATIONFROM,
- 'LOCATIONTO' => $LOCATIONTO,
- 'QUANTITY' => $QUANTITY,
- 'ORDERCATEGORY' => $ORDERCATEGORY,
- 'LOTNUMBER' => $LOTNUMBER,
- 'CONUMBER' => $CONUMBER,
- 'COLINENO' => $A5BRADLINE,
- 'DELIVERYNO' => $DELIVERYNO,
- 'PICKLISTSUFFIX' => $PICKLISTSUFFIX,
- 'ENDFLAG' => $ENDFLAG,
- 'TYPE' => $TYPE,
- 'COLINESUFFIX' => $COLINESUFFIX,
+ $jSON = json_encode([
+ 'DIVI' => $dIVI,
+ 'WHS' => $wHS,
+ 'PART' => $pART,
+ 'LOCATIONFROM' => $lOCATIONFROM,
+ 'LOCATIONTO' => $lOCATIONTO,
+ 'QUANTITY' => $qUANTITY,
+ 'ORDERCATEGORY' => $oRDERCATEGORY,
+ 'LOTNUMBER' => $lOTNUMBER,
+ 'CONUMBER' => $cONUMBER,
+ 'COLINENO' => $a5BRADLINE,
+ 'DELIVERYNO' => $dELIVERYNO,
+ 'PICKLISTSUFFIX' => $pICKLISTSUFFIX,
+ 'ENDFLAG' => $eNDFLAG,
+ 'TYPE' => $tYPE,
+ 'COLINESUFFIX' => $cOLINESUFFIX,
], JSON_UNESCAPED_SLASHES);
// Write JSON Params to Logs Out
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Req-out',
- 'SHDATA' => $JSON,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $jSON,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -227,21 +230,21 @@ class TransferAPI extends Controller
$tokenResponse = Helper::checkReceiveTokenV2();
$tokenData = $tokenResponse->getData();
if ($tokenData->code == '200') {
- $IonToken = isset($tokenData->token) ? $tokenData->token : '';
+ $ionToken = isset($tokenData->token) ? $tokenData->token : '';
} else {
- $SHDATA = isset($tokenData->message) ? $tokenData->message : '';
+ $sHDATA = isset($tokenData->message) ? $tokenData->message : '';
// Write to Logs : Error
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $SHDATA,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $sHDATA,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -250,69 +253,69 @@ class TransferAPI extends Controller
// Call ionapi with Params
$endPointURL = env('ENDPOINTURL') . 'APIFLOWS/Sentinel/TransferAPI?ionapiRespStyle=sync';
- $token = $IonToken;
+ $token = $ionToken;
$response = Http::withHeaders([
'accept' => self::JSON_CONTENT_TYPE,
'Content-Type' => self::JSON_CONTENT_TYPE,
])
->withToken($token)
- ->withBody($JSON, self::JSON_CONTENT_TYPE)
+ ->withBody($jSON, self::JSON_CONTENT_TYPE)
->timeout(Config::get('arrays.curlTimeOut'))
->post($endPointURL);
$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;
+ $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;
$dateTime = new DateTime;
- $dateTime->setTimestamp($M3ResponseTimeTmp2);
- $M3ResponseTime = $M3ResponseTimeTmp != '' ? '-M3ResponseTime:' . $dateTime->format('d/m/Y H:i:s.v') : '-M3ResponseTime';
+ $dateTime->setTimestamp($m3ResponseTimeTmp2);
+ $m3ResponseTime = $m3ResponseTimeTmp != '' ? '-M3ResponseTime:' . $dateTime->format('d/m/Y H:i:s.v') : '-M3ResponseTime';
$transferStats = $response->transferStats;
- $M3transferTime = $transferStats->getTransferTime() != null ? '-M3transferTime:' . $transferStats->getTransferTime() : '-M3transferTime';
+ $m3transferTime = $transferStats->getTransferTime() != null ? '-M3transferTime:' . $transferStats->getTransferTime() : '-M3transferTime';
if ($responseStatusCode == '200') {
$responseContents = json_decode($response->getBody()->getContents());
$responseResult = $responseContents->result;
- $M3JSONResponse = json_encode($responseContents);
+ $m3JSONResponse = json_encode($responseContents);
// Check M3 Response for Errors
- $M3Errors = Helper::checkM3Errors($responseResult);
+ $m3Errors = Helper::checkM3Errors($responseResult);
} else {
- $M3JSONResponse = '';
- $M3Errors = 'Error: No Response from M3';
+ $m3JSONResponse = '';
+ $m3Errors = 'Error: No Response from M3';
}
- if ($M3Errors == '') {
+ if ($m3Errors == '') {
// Write to Logs Out : Success
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $responseStatusCode . 'TYPE :' . $TYPE . self::ORDER_CATEGORY_LABEL . $ORDERCATEGORY . '-' . $M3JSONResponse . $M3SessionId . $M3ResponseTime . $M3transferTime,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $responseStatusCode . 'TYPE :' . $tYPE . self::ORDER_CATEGORY_LABEL . $oRDERCATEGORY . '-' . $m3JSONResponse . $m3SessionId . $m3ResponseTime . $m3transferTime,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
// Log to ICM799M
- $ICM799MINS = DB::connection(config('m3.connection', 'pgsql'))->table('icm799m')
- ->insert(['IMDIV' => $DIVI,
- 'IMPLANT' => $A5PLANT,
- 'IMWHS' => $WHS,
- 'IMSENTPKR' => $A5SENTPKR,
- 'IMDELNO' => $DELIVERYNO,
- 'IMORDER' => $CONUMBER,
- 'IMLINE' => $COLINENO,
- 'IMBRADLN' => $A5BRADLINE,
- 'IMSUFFIX' => $PICKLISTSUFFIX,
- 'IMPART' => $PART,
- 'IMLOT' => $LOTNUMBER,
- 'IMQTY' => $QUANTITY,
- 'IMFRLOC' => $LOCATIONFROM,
- 'IMTOLOC' => $LOCATIONTO,
+ $iCM799MINS = DB::connection(config('m3.connection', 'pgsql'))->table('icm799m')
+ ->insert(['IMDIV' => $dIVI,
+ 'IMPLANT' => $a5PLANT,
+ 'IMWHS' => $wHS,
+ 'IMSENTPKR' => $a5SENTPKR,
+ 'IMDELNO' => $dELIVERYNO,
+ 'IMORDER' => $cONUMBER,
+ 'IMLINE' => $cOLINENO,
+ 'IMBRADLN' => $a5BRADLINE,
+ 'IMSUFFIX' => $pICKLISTSUFFIX,
+ 'IMPART' => $pART,
+ 'IMLOT' => $lOTNUMBER,
+ 'IMQTY' => $qUANTITY,
+ 'IMFRLOC' => $lOCATIONFROM,
+ 'IMTOLOC' => $lOCATIONTO,
'IMDATE' => date('Ymd'),
'IMTIME' => date('His'),
]);
@@ -323,25 +326,25 @@ class TransferAPI extends Controller
]);
} else {
// Write to Logs Out : Failed
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $responseStatusCode . '-' . $M3Errors . '-TYPE:' . $TYPE . self::ORDER_CATEGORY_LABEL . $ORDERCATEGORY . '-' . $M3JSONResponse .
- 'M3-JSN-out' . $JSONIN . $M3SessionId . $M3ResponseTime . $M3transferTime,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $responseStatusCode . '-' . $m3Errors . '-TYPE:' . $tYPE . self::ORDER_CATEGORY_LABEL . $oRDERCATEGORY . '-' . $m3JSONResponse .
+ 'M3-JSN-out' . $jSONIN . $m3SessionId . $m3ResponseTime . $m3transferTime,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
return response()->json([
'code' => '206',
'status' => 'Error',
- 'message' => $responseStatusCode . '-' . $M3Errors . '- TYPE :' . $TYPE . self::ORDER_CATEGORY_LABEL . $ORDERCATEGORY . '-' . $M3JSONResponse,
+ 'message' => $responseStatusCode . '-' . $m3Errors . '- TYPE :' . $tYPE . self::ORDER_CATEGORY_LABEL . $oRDERCATEGORY . '-' . $m3JSONResponse,
]);
}
}
@@ -356,18 +359,18 @@ class TransferAPI extends Controller
}
} else {
// Write to Logs Out : Error
- $DELIVERYNO = isset($DELIVERYNO) ? $DELIVERYNO : self::ZERO_PAD;
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $dELIVERYNO = isset($dELIVERYNO) ? $dELIVERYNO : self::ZERO_PAD;
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
'SHDATA' => self::NO_URL_PARAMETERS,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -382,17 +385,17 @@ class TransferAPI extends Controller
$getCurlErrors = str_contains($th->getMessage(), 'cURL error');
if ($getCurlErrors) {
// Write to Logs Out : Failed
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'Curl Error: Communication with M3 Timed Out' . ' M3-JSN-out' . $JSONIN,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => 'Curl Error: Communication with M3 Timed Out' . ' M3-JSN-out' . $jSONIN,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -403,18 +406,18 @@ class TransferAPI extends Controller
]);
} else {
// Write to Logs Out : Error
- $DELIVERYNO = isset($DELIVERYNO) ? $DELIVERYNO : self::ZERO_PAD;
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $dELIVERYNO = isset($dELIVERYNO) ? $dELIVERYNO : self::ZERO_PAD;
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Err-out',
'SHDATA' => 'An Error Occured - ' . substr($th, 0, 300),
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
Log::error($th);
@@ -438,70 +441,70 @@ class TransferAPI extends Controller
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
// Get the Calling User
- $SHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
+ $sHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
// Set SHSOURCE
- $SHSOURCE = 'UpdateShipmentNumber';
- $M3Errors = '';
+ $sHSOURCE = 'UpdateShipmentNumber';
+ $m3Errors = '';
// Get URL PARAMS
$urlParams = count($request->all()) > 0 ? $request->all() : '';
- $DIVI = isset($urlParams['COMPANY']) ? $urlParams['COMPANY'] : '';
- $WHS = isset($urlParams['WHS']) ? $urlParams['WHS'] : '';
- $PLANT = isset($urlParams['PLANT']) ? $urlParams['PLANT'] : '';
+ $dIVI = isset($urlParams['COMPANY']) ? $urlParams['COMPANY'] : '';
+ $wHS = isset($urlParams['WHS']) ? $urlParams['WHS'] : '';
+ $pLANT = isset($urlParams['PLANT']) ? $urlParams['PLANT'] : '';
try {
if ($urlParams != '') {
- $A4SPR15A01 = isset($urlParams['A4SPR15A01']) ? $urlParams['A4SPR15A01'] : '';
- $DELIVERYNO = isset($urlParams['DELIVERYNO']) ? $urlParams['DELIVERYNO'] : '';
- $TYPE = 'UpdateShipmentNumber';
+ $a4SPR15A01 = isset($urlParams['A4SPR15A01']) ? $urlParams['A4SPR15A01'] : '';
+ $dELIVERYNO = isset($urlParams['DELIVERYNO']) ? $urlParams['DELIVERYNO'] : '';
+ $tYPE = 'UpdateShipmentNumber';
$allMacpkrs = [];
- if ($A4SPR15A01 != '') {
+ if ($a4SPR15A01 != '') {
// Read from ICM688M1
- $ICM688M1SLTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
+ $iCM688M1SLTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
->select('A4MACPKR')
- ->where('A4CO', $DIVI)
- ->where('A4WHS', $WHS)
- ->where('A4PLANT', $PLANT)
- ->where('A4SPR15A01', $A4SPR15A01);
+ ->where('A4CO', $dIVI)
+ ->where('A4WHS', $wHS)
+ ->where('A4PLANT', $pLANT)
+ ->where('A4SPR15A01', $a4SPR15A01);
// Get Macpikers also if sent as Parameter
- if ($DELIVERYNO != '') {
- $ICM688M1SLTMP->where('A4MACPKR', $DELIVERYNO);
+ if ($dELIVERYNO != '') {
+ $iCM688M1SLTMP->where('A4MACPKR', $dELIVERYNO);
}
- $ICM688M1SL = $ICM688M1SLTMP->get();
+ $iCM688M1SL = $iCM688M1SLTMP->get();
// Loop ICM688M1 to get all A4MACPKR
- foreach ($ICM688M1SL as $key => $ICM688M1) {
+ foreach ($iCM688M1SL as $key => $ICM688M1) {
$allMacpkrs[] = $ICM688M1->A4MACPKR;
}
}
// A4SPR15A01 Exists : proceed
- if ($A4SPR15A01 != '' && count($allMacpkrs) > 0) {
- $JSON = json_encode([
- 'DIVI' => $DIVI,
- 'WHS' => $WHS,
+ if ($a4SPR15A01 != '' && count($allMacpkrs) > 0) {
+ $jSON = json_encode([
+ 'DIVI' => $dIVI,
+ 'WHS' => $wHS,
'ShipmentNumber' => [
- 'Number' => $A4SPR15A01,
+ 'Number' => $a4SPR15A01,
'DeliveryNumbers' => $allMacpkrs,
],
- 'TYPE' => $TYPE,
+ 'TYPE' => $tYPE,
'ENDFLAG' => '',
], JSON_UNESCAPED_SLASHES);
// Write JSON Params to Logs Out
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Req-out',
- 'SHDATA' => $JSON,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $jSON,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -509,21 +512,21 @@ class TransferAPI extends Controller
$tokenResponse = Helper::checkReceiveTokenV2();
$tokenData = $tokenResponse->getData();
if ($tokenData->code == '200') {
- $IonToken = isset($tokenData->token) ? $tokenData->token : '';
+ $ionToken = isset($tokenData->token) ? $tokenData->token : '';
} else {
- $SHDATA = isset($tokenData->message) ? $tokenData->message : '';
+ $sHDATA = isset($tokenData->message) ? $tokenData->message : '';
// Write to Logs : Error
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $SHDATA,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $sHDATA,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -532,50 +535,50 @@ class TransferAPI extends Controller
// Call ionapi with Params
$endPointURL = env('ENDPOINTURL') . 'APIFLOWS/Sentinel/TransferAPI?ionapiRespStyle=sync';
- $token = $IonToken;
+ $token = $ionToken;
$response = Http::withHeaders([
'accept' => self::JSON_CONTENT_TYPE,
'Content-Type' => self::JSON_CONTENT_TYPE,
])
->withToken($token)
- ->withBody($JSON, self::JSON_CONTENT_TYPE)
+ ->withBody($jSON, self::JSON_CONTENT_TYPE)
->timeout(Config::get('arrays.curlTimeOut'))
->post($endPointURL);
$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;
+ $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;
$dateTime = new DateTime;
- $dateTime->setTimestamp($M3ResponseTimeTmp2);
- $M3ResponseTime = $M3ResponseTimeTmp != '' ? '-M3ResponseTime:' . $dateTime->format('d/m/Y H:i:s.v') : '-M3ResponseTime';
+ $dateTime->setTimestamp($m3ResponseTimeTmp2);
+ $m3ResponseTime = $m3ResponseTimeTmp != '' ? '-M3ResponseTime:' . $dateTime->format('d/m/Y H:i:s.v') : '-M3ResponseTime';
$transferStats = $response->transferStats;
- $M3transferTime = $transferStats->getTransferTime() != null ? '-M3transferTime:' . $transferStats->getTransferTime() : '-M3transferTime';
+ $m3transferTime = $transferStats->getTransferTime() != null ? '-M3transferTime:' . $transferStats->getTransferTime() : '-M3transferTime';
if ($responseStatusCode == '200') {
$responseContents = json_decode($response->getBody()->getContents());
$responseResult = $responseContents->result;
- $M3JSONResponse = json_encode($responseContents);
+ $m3JSONResponse = json_encode($responseContents);
// Check M3 Response for Errors
- $M3Errors = Helper::checkM3Errors($responseResult);
+ $m3Errors = Helper::checkM3Errors($responseResult);
} else {
- $M3JSONResponse = '';
- $M3Errors = 'Error: No Response from M3';
+ $m3JSONResponse = '';
+ $m3Errors = 'Error: No Response from M3';
}
- if ($M3Errors == '') {
+ if ($m3Errors == '') {
// Write to Logs Out : Success
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => '',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $responseStatusCode . 'TYPE :' . $TYPE . '-' . $M3JSONResponse . $M3SessionId . $M3ResponseTime . $M3transferTime,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $responseStatusCode . 'TYPE :' . $tYPE . '-' . $m3JSONResponse . $m3SessionId . $m3ResponseTime . $m3transferTime,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -585,25 +588,25 @@ class TransferAPI extends Controller
]);
} else {
// Write to Logs Out : Failed
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => $responseStatusCode . '-' . $M3Errors . '-TYPE:' . $TYPE . '-' . $M3JSONResponse .
- 'M3-JSN-out' . $JSON . $M3SessionId . $M3ResponseTime . $M3transferTime,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => $responseStatusCode . '-' . $m3Errors . '-TYPE:' . $tYPE . '-' . $m3JSONResponse .
+ 'M3-JSN-out' . $jSON . $m3SessionId . $m3ResponseTime . $m3transferTime,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
return response()->json([
'code' => '206',
'status' => 'Error',
- 'message' => $responseStatusCode . '-' . $M3Errors . '- TYPE :' . $TYPE . '-' . $M3JSONResponse,
+ 'message' => $responseStatusCode . '-' . $m3Errors . '- TYPE :' . $tYPE . '-' . $m3JSONResponse,
]);
}
}
@@ -618,18 +621,18 @@ class TransferAPI extends Controller
}
} else {
// Write to Logs Out : Error
- $DELIVERYNO = isset($DELIVERYNO) ? $DELIVERYNO : self::ZERO_PAD;
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $dELIVERYNO = isset($dELIVERYNO) ? $dELIVERYNO : self::ZERO_PAD;
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
'SHDATA' => self::NO_URL_PARAMETERS,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -644,17 +647,17 @@ class TransferAPI extends Controller
$getCurlErrors = str_contains($th->getMessage(), 'cURL error');
if ($getCurlErrors) {
// Write to Logs Out : Failed
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Res-out',
- 'SHDATA' => 'Curl Error: Communication with M3 Timed Out' . ' M3-JSN-out' . $JSON,
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHDATA' => 'Curl Error: Communication with M3 Timed Out' . ' M3-JSN-out' . $jSON,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
@@ -665,18 +668,18 @@ class TransferAPI extends Controller
]);
} else {
// Write to Logs Out : Error
- $DELIVERYNO = isset($DELIVERYNO) ? $DELIVERYNO : self::ZERO_PAD;
- $data = ['SHMACPKR' => $DELIVERYNO,
+ $dELIVERYNO = isset($dELIVERYNO) ? $dELIVERYNO : self::ZERO_PAD;
+ $data = ['SHMACPKR' => $dELIVERYNO,
'SHDT' => date('Y-m-d'),
'SHTIME' => date('H:i:s'),
'SHERROR' => 'X',
'SHINTBOX' => '',
'SHTYPE' => 'M3-Err-out',
'SHDATA' => 'An Error Occured - ' . substr($th, 0, 300),
- 'SHUSER' => $SHUSER,
- 'SHSOURCE' => $SHSOURCE,
- 'SHCO' => $DIVI,
- 'SHWHS' => $WHS,
+ 'SHUSER' => $sHUSER,
+ 'SHSOURCE' => $sHSOURCE,
+ 'SHCO' => $dIVI,
+ 'SHWHS' => $wHS,
];
Helper::logToICM699M($data);
Log::error($th);
diff --git a/Modules/M3/Http/Controllers/API/TwoShipAPIs.php b/Modules/M3/Http/Controllers/API/TwoShipAPIs.php
index 940ef37f..9ba3e194 100644
--- a/Modules/M3/Http/Controllers/API/TwoShipAPIs.php
+++ b/Modules/M3/Http/Controllers/API/TwoShipAPIs.php
@@ -14,6 +14,7 @@ use Str;
class TwoShipAPIs extends Controller
{
private const SOURCE = 'TwoShipUpdateHold';
+
private const RESPONSE_TYPE = 'AggStopRsp';
public function TwoShipUpdateHold(Request $request)
@@ -27,6 +28,7 @@ class TwoShipAPIs extends Controller
if ($params === []) {
$this->log($macpkr ?: '000000', $co, $whs, $user, 'X', 'No URL Parameters Sent');
+
return response()->json(['code' => '405', 'status' => 'Error', 'message' => 'No URL Parameters Sent']);
}
@@ -37,17 +39,20 @@ class TwoShipAPIs extends Controller
$error = $this->responseError($response);
if ($error !== '') {
$this->log($macpkr, $co, $whs, $user, 'X', $response->status() . '-' . $error);
+
return response()->json(['code' => '405', 'status' => 'error', 'message' => 'Status: ' . $response->status() . '-' . $error]);
}
$this->log($macpkr, $co, $whs, $user, '', $response->body());
$this->markAggregationComplete($orders, $co, $whs);
+
return response()->json(['code' => '200', 'status' => 'Success']);
} catch (\Throwable $th) {
$message = str_contains($th->getMessage(), 'cURL error')
? 'Curl Error: Communication with 2Ship Timed Out.'
: '2Ship communication failed.';
$this->log($macpkr, $co, $whs, $user, 'X', $message);
+
return response()->json(['code' => '405', 'status' => 'error', 'message' => $message]);
}
}
@@ -76,6 +81,7 @@ class TwoShipAPIs extends Controller
$orders = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
->where('A4SHPAGGCD', $aggregation)->where('A4SHPAGGCD', '<>', 0)->where('A4CONCMPLT', '<>', 'y')
->where('A4CO', $co)->where('A4WHS', $whs)->pluck('A4MACPKR')->all();
+
return $orders !== [] ? $orders : [$macpkr];
}
@@ -87,6 +93,7 @@ class TwoShipAPIs extends Controller
'FindBy' => 'ByMultipleOrderNumbers',
'DataToBeUpdated' => ['UpdateAggregationSettings' => true, 'OrderAggregationSettingsInfo' => ['NotConsideredAggregation' => true]],
];
+
return Http::acceptJson()->asJson()->timeout((int) Config::get('arrays.PHPTimeOut'))
->post(Config::get('arrays.2Ship.end_point') . Config::get('arrays.2Ship.hold_update'), $payload);
}
@@ -97,6 +104,7 @@ class TwoShipAPIs extends Controller
return 'Error: No Response from 2Ship';
}
$body = $response->json();
+
return ($body['Success'] ?? true) === false ? '2Ship Error: ' . ($body['GlobalError'] ?? 'Unknown error') : '';
}
diff --git a/Modules/M3/Http/Controllers/BoxPackToPalletController.php b/Modules/M3/Http/Controllers/BoxPackToPalletController.php
index f6322d0a..46a1af6a 100644
--- a/Modules/M3/Http/Controllers/BoxPackToPalletController.php
+++ b/Modules/M3/Http/Controllers/BoxPackToPalletController.php
@@ -9,9 +9,13 @@ use Str;
class BoxPackToPalletController extends Controller
{
private const PALLET_TABLE_ALIAS = 'ICM659M as p';
+
private const CONVEYOR_SELECT = 'cnv.R652SORTK as CONVEYOR_NAME';
+
private const CARTON_TABLE_ALIAS = 'ICM695M1 as c';
+
private const CONVEYOR_VALUE_ALIAS = 'ICM688M1 as cv';
+
private const CONVEYOR_TABLE_ALIAS = 'ICM652M as cnv';
public static function index(Request $request)
@@ -22,7 +26,7 @@ class BoxPackToPalletController extends Controller
// Load Existing Boxes from ICM659M
public static function getBoxes(Request $request)
{
- $R659PALT = $request->R659PALT ?? abort(404, 'Manifest Not Found');
+ $r659PALT = $request->R659PALT ?? abort(404, 'Manifest Not Found');
$userWhsCoPlant = self::getUserWhsCoPlant();
@@ -43,7 +47,7 @@ class BoxPackToPalletController extends Controller
->leftJoin(self::CARTON_TABLE_ALIAS, 'p.R659BOX', '=', 'c.AYINTBOX')
->leftJoin(self::CONVEYOR_VALUE_ALIAS, 'c.AYMACPKR', '=', 'cv.A4MACPKR')
->leftJoin(self::CONVEYOR_TABLE_ALIAS, 'cv.A4APR8N001', '=', 'cnv.R652SEQ')
- ->where('p.R659PALT', $R659PALT)
+ ->where('p.R659PALT', $r659PALT)
->where('p.R659CO', trim($userWhsCoPlant['USERCO']))
->where('p.R659WHS', trim($userWhsCoPlant['USERWHS']))
->where('p.R659PLANT', trim($userWhsCoPlant['USERPL']))
@@ -63,7 +67,7 @@ class BoxPackToPalletController extends Controller
$palletHeader = $boxes->first();
- return view('m3::liberty-theme.pages.BoxPackToPalletScan', compact('boxes', 'palletHeader', 'R659PALT'));
+ return view('m3::liberty-theme.pages.BoxPackToPalletScan', ['boxes' => $boxes, 'palletHeader' => $palletHeader, 'R659PALT' => $r659PALT]);
}
// Scan Boxes
@@ -169,8 +173,19 @@ class BoxPackToPalletController extends Controller
private static function boxesForPallet($pallet, array $profile)
{
return DB::connection(config('m3.connection', 'pgsql'))->table(self::PALLET_TABLE_ALIAS)
- ->select('p.R659PALT', 'p.R659BOX', 'p.R659LOADED', 'p.R659USER', 'p.R659DATE', 'p.R659TIME',
- 'c.AYMACPKR', 'c.AYSPR15A01', 'cv.A4APR8N001', 'cv.A4SHSHCT', self::CONVEYOR_SELECT)
+ ->select(
+ 'p.R659PALT',
+ 'p.R659BOX',
+ 'p.R659LOADED',
+ 'p.R659USER',
+ 'p.R659DATE',
+ 'p.R659TIME',
+ 'c.AYMACPKR',
+ 'c.AYSPR15A01',
+ 'cv.A4APR8N001',
+ 'cv.A4SHSHCT',
+ self::CONVEYOR_SELECT,
+ )
->leftJoin(self::CARTON_TABLE_ALIAS, 'p.R659BOX', '=', 'c.AYINTBOX')
->leftJoin(self::CONVEYOR_VALUE_ALIAS, 'c.AYMACPKR', '=', 'cv.A4MACPKR')
->leftJoin(self::CONVEYOR_TABLE_ALIAS, 'cv.A4APR8N001', '=', 'cnv.R652SEQ')
@@ -182,36 +197,36 @@ class BoxPackToPalletController extends Controller
// Delete Box
public static function deleteBox(Request $request)
{
- $R659PALT = $request->R659PALT ?? abort(400, 'Pallet Not Found');
- $R659BOX = trim($request->R659BOX) ?? abort(400, 'Box Not Found');
+ $r659PALT = $request->R659PALT ?? abort(400, 'Pallet Not Found');
+ $r659BOX = trim($request->R659BOX) ?? abort(400, 'Box Not Found');
$userWhsCoPlant = self::getUserWhsCoPlant();
// Guard: only allow delete if R659LOADED is empty
$record = DB::connection(config('m3.connection', 'pgsql'))
->table('icm659m')
- ->where('R659PALT', $R659PALT)
- ->where('R659BOX', $R659BOX)
+ ->where('R659PALT', $r659PALT)
+ ->where('R659BOX', $r659BOX)
->first();
if (! $record) {
return response()->json([
'success' => false,
- 'message' => "Box {$R659BOX} not found on Pallet {$R659PALT}.",
+ 'message' => "Box {$r659BOX} not found on Pallet {$r659PALT}.",
], 404);
}
if (! empty(trim($record->R659LOADED))) {
return response()->json([
'success' => false,
- 'message' => "Box {$R659BOX} is already loaded and cannot be removed.",
+ 'message' => "Box {$r659BOX} is already loaded and cannot be removed.",
], 403);
}
DB::connection(config('m3.connection', 'pgsql'))
->table('icm659m')
- ->where('R659PALT', $R659PALT)
- ->where('R659BOX', $R659BOX)
+ ->where('R659PALT', $r659PALT)
+ ->where('R659BOX', $r659BOX)
->delete();
// Return refreshed list
@@ -232,7 +247,7 @@ class BoxPackToPalletController extends Controller
->leftJoin(self::CARTON_TABLE_ALIAS, 'p.R659BOX', '=', 'c.AYINTBOX')
->leftJoin(self::CONVEYOR_VALUE_ALIAS, 'c.AYMACPKR', '=', 'cv.A4MACPKR')
->leftJoin(self::CONVEYOR_TABLE_ALIAS, 'cv.A4APR8N001', '=', 'cnv.R652SEQ')
- ->where('p.R659PALT', $R659PALT)
+ ->where('p.R659PALT', $r659PALT)
->where('p.R659CO', trim($userWhsCoPlant['USERCO']))
->where('p.R659WHS', trim($userWhsCoPlant['USERWHS']))
->where('p.R659PLANT', trim($userWhsCoPlant['USERPL']))
@@ -245,7 +260,7 @@ class BoxPackToPalletController extends Controller
return response()->json([
'success' => true,
- 'message' => "Box {$R659BOX} removed from Pallet {$R659PALT}.",
+ 'message' => "Box {$r659BOX} removed from Pallet {$r659PALT}.",
'data' => $boxes,
]);
}
@@ -253,23 +268,23 @@ class BoxPackToPalletController extends Controller
// Get Logged User CO/WHS/PLANT
public static function getUserWhsCoPlant()
{
- $SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
+ $sHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
// Get users from ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
- ->where('R428US', '=', $SHUSER)
+ ->where('R428US', '=', $sHUSER)
->first();
- $R428US = isset($ICM428M->R428US) ? $ICM428M->R428US : '';
- $USERCO = isset($ICM428M->R428CO) ? $ICM428M->R428CO : '';
- $USERWH = isset($ICM428M->R428WH) ? $ICM428M->R428WH : '';
- $R428PL = isset($ICM428M->R428PL) ? $ICM428M->R428PL : '';
+ $r428US = isset($iCM428M->R428US) ? $iCM428M->R428US : '';
+ $uSERCO = isset($iCM428M->R428CO) ? $iCM428M->R428CO : '';
+ $uSERWH = isset($iCM428M->R428WH) ? $iCM428M->R428WH : '';
+ $r428PL = isset($iCM428M->R428PL) ? $iCM428M->R428PL : '';
$userWhsCoPlant = [
- 'R428US' => $R428US,
- 'USERCO' => $USERCO,
- 'USERWHS' => $USERWH,
- 'USERPL' => $R428PL,
+ 'R428US' => $r428US,
+ 'USERCO' => $uSERCO,
+ 'USERWHS' => $uSERWH,
+ 'USERPL' => $r428PL,
];
return $userWhsCoPlant;
diff --git a/Modules/M3/Http/Controllers/M3DeliveryController.php b/Modules/M3/Http/Controllers/M3DeliveryController.php
index 4c185171..04e5b288 100644
--- a/Modules/M3/Http/Controllers/M3DeliveryController.php
+++ b/Modules/M3/Http/Controllers/M3DeliveryController.php
@@ -20,14 +20,14 @@ class M3DeliveryController extends Controller
$co = $power_user->R428CO;
$plant = $power_user->R428PL;
$whs = $power_user->R428WH;
- $ICM664M = Schema::connection($connection)->hasTable('icm664m')
+ $iCM664M = Schema::connection($connection)->hasTable('icm664m')
? DB::connection($connection)->table('icm664m')->where('AVCO', $co)->where('AVPLANT', $plant)->where('AVWHS', $whs)->get() : collect();
- $IC670M = Schema::connection($connection)->hasTable('ic670m')
+ $iC670M = Schema::connection($connection)->hasTable('ic670m')
? DB::connection($connection)->table('ic670m')->where('WDCO', $co)->where('WDPL', $plant)->where('WDWHS', $whs)->get() : collect();
$shipvia = Schema::connection($connection)->hasTable('icm319m')
? DB::connection($connection)->table('icm319m')->select('AXCODE', 'AXDESC')->orderBy('AXCODE')->get() : collect();
- return view('m3::liberty-theme.pages.M3Delivery', compact('ICM664M', 'IC670M', 'power_user', 'shipvia'));
+ return view('m3::liberty-theme.pages.M3Delivery', ['ICM664M' => $iCM664M, 'IC670M' => $iC670M, 'power_user' => $power_user, 'shipvia' => $shipvia]);
}
//
diff --git a/Modules/M3/Http/Controllers/M3ErrorsDispController.php b/Modules/M3/Http/Controllers/M3ErrorsDispController.php
index 985331ff..c19c239d 100644
--- a/Modules/M3/Http/Controllers/M3ErrorsDispController.php
+++ b/Modules/M3/Http/Controllers/M3ErrorsDispController.php
@@ -22,21 +22,21 @@ class M3ErrorsDispController extends Controller
// Get users from ICM428M
$connection = config('m3.connection', 'pgsql');
- $ICM428M = Schema::connection($connection)->hasTable('icm428m')
+ $iCM428M = Schema::connection($connection)->hasTable('icm428m')
? DB::connection($connection)->table('icm428m')->select('R428US', 'R428FIRST', 'R428FAMILY')->get()
: collect();
- $ICM428MCOL = collect($ICM428M);
- $ICM428MCOL->filter(function ($value) {
+ $iCM428MCOL = collect($iCM428M);
+ $iCM428MCOL->filter(function ($value) {
return $value->R428US = trim($value->R428US);
});
- $ICM428MCOL->filter(function ($value) {
+ $iCM428MCOL->filter(function ($value) {
return $value->R428FIRST = trim($value->R428FIRST);
});
- $ICM428MCOL->filter(function ($value) {
+ $iCM428MCOL->filter(function ($value) {
return $value->R428FAMILY = trim($value->R428FAMILY);
});
- return view('m3::liberty-theme.pages.M3ErrorsDisplay', compact('macpkr', 'shsource', 'showerrors', 'skipdates', 'ICM428MCOL'));
+ return view('m3::liberty-theme.pages.M3ErrorsDisplay', ['macpkr' => $macpkr, 'shsource' => $shsource, 'showerrors' => $showerrors, 'skipdates' => $skipdates, 'ICM428MCOL' => $iCM428MCOL]);
}
public function datatables(Request $request)
@@ -139,45 +139,45 @@ class M3ErrorsDispController extends Controller
public static function update699M(Request $request)
{
- $SHMACPKR = $request->SHMACPKR != null ? trim($request->SHMACPKR) : '';
- $SHSOURCE = $request->SHSOURCE != null ? trim($request->SHSOURCE) : '';
- $SHCO = $request->SHCO != null ? trim($request->SHCO) : '';
- $SHWHS = $request->SHWHS != null ? trim($request->SHWHS) : '';
- $SHDT = $request->SHDT != null ? trim($request->SHDT) : '';
- $SHTIME = $request->SHTIME != null ? trim($request->SHTIME) : '';
- $SHTYPE = $request->SHTYPE != null ? trim($request->SHTYPE) : '';
- $SHACKNOTE = $request->SHACKNOTE != null ? trim(substr($request->SHACKNOTE, 0, 99)) : '';
- $SHUSER = m3_user() !== '' ? Str::upper(m3_user()) : '';
- $CLOSESIM = $request->CLOSESIM != null ? trim($request->CLOSESIM) : 'N';
+ $sHMACPKR = $request->SHMACPKR != null ? trim($request->SHMACPKR) : '';
+ $sHSOURCE = $request->SHSOURCE != null ? trim($request->SHSOURCE) : '';
+ $sHCO = $request->SHCO != null ? trim($request->SHCO) : '';
+ $sHWHS = $request->SHWHS != null ? trim($request->SHWHS) : '';
+ $sHDT = $request->SHDT != null ? trim($request->SHDT) : '';
+ $sHTIME = $request->SHTIME != null ? trim($request->SHTIME) : '';
+ $sHTYPE = $request->SHTYPE != null ? trim($request->SHTYPE) : '';
+ $sHACKNOTE = $request->SHACKNOTE != null ? trim(substr($request->SHACKNOTE, 0, 99)) : '';
+ $sHUSER = m3_user() !== '' ? Str::upper(m3_user()) : '';
+ $cLOSESIM = $request->CLOSESIM != null ? trim($request->CLOSESIM) : 'N';
- if ($CLOSESIM == 'N') {
- $ICM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
- ->where('SHMACPKR', $SHMACPKR)
- ->where('SHDT', $SHDT)
- ->where('SHTIME', $SHTIME)
- ->where('SHCO', $SHCO)
- ->where('SHWHS', $SHWHS)
- ->where('SHSOURCE', $SHSOURCE)
+ if ($cLOSESIM == 'N') {
+ $iCM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ ->where('SHMACPKR', $sHMACPKR)
+ ->where('SHDT', $sHDT)
+ ->where('SHTIME', $sHTIME)
+ ->where('SHCO', $sHCO)
+ ->where('SHWHS', $sHWHS)
+ ->where('SHSOURCE', $sHSOURCE)
->where('SHERROR', 'X')
- ->where('SHTYPE', $SHTYPE)
- ->update(['SHERROR' => 'Z', 'SHACKUSER' => $SHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s'), 'SHACKNOTE' => $SHACKNOTE]);
+ ->where('SHTYPE', $sHTYPE)
+ ->update(['SHERROR' => 'Z', 'SHACKUSER' => $sHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s'), 'SHACKNOTE' => $sHACKNOTE]);
} else {
- $ICM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
- ->where('SHCO', $SHCO)
- ->where('SHWHS', $SHWHS)
- ->where('SHSOURCE', $SHSOURCE)
+ $iCM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
+ ->where('SHCO', $sHCO)
+ ->where('SHWHS', $sHWHS)
+ ->where('SHSOURCE', $sHSOURCE)
->where('SHERROR', 'X')
- ->where('SHTYPE', $SHTYPE)
- ->update(['SHERROR' => 'Z', 'SHACKUSER' => $SHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s'), 'SHACKNOTE' => $SHACKNOTE]);
+ ->where('SHTYPE', $sHTYPE)
+ ->update(['SHERROR' => 'Z', 'SHACKUSER' => $sHUSER, 'SHACKDATE' => date('Y-m-d'), 'SHACKTIME' => date('H:i:s'), 'SHACKNOTE' => $sHACKNOTE]);
}
- if ($SHSOURCE == 'CloseShipmentCoChargeAPI') {
+ if ($sHSOURCE == 'CloseShipmentCoChargeAPI') {
// Update ICM688M1 : Change A4PICKSTS
DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
- ->where('A4MACPKR', $SHMACPKR)
- ->where('A4CO', $SHCO)
- ->where('A4WHS', $SHWHS)
+ ->where('A4MACPKR', $sHMACPKR)
+ ->where('A4CO', $sHCO)
+ ->where('A4WHS', $sHWHS)
->update(['A4PICKSTS' => 'a']);
}
@@ -216,7 +216,7 @@ class M3ErrorsDispController extends Controller
return app(SpreadsheetExport::class)->download(
$rows,
- 'transactionLog_' . $filters['startDate'] . '-' . $filters['endDate'] . '.xlsx'
+ 'transactionLog_' . $filters['startDate'] . '-' . $filters['endDate'] . '.xlsx',
);
} catch (\Throwable $th) {
Log::error($th);
@@ -281,12 +281,17 @@ class M3ErrorsDispController extends Controller
DB::raw('COALESCE(ICM688M1.A4SHSHNM, ICM666M.A1SHSHNM) AS CUSTOMER '),
DB::raw(" ICM699M.SHDT || ' ' || ICM699M.SHTIME AS SHDATETIME"),
DB::raw("CASE WHEN ICM699M.SHERROR !='Z' THEN TRIM(ICM699M.SHERROR) ELSE 'Closed' END AS ERROR"),
- 'ICM699M.SHTYPE', 'ICM699M.SHSOURCE',
+ 'ICM699M.SHTYPE',
+ 'ICM699M.SHSOURCE',
DB::raw("CASE WHEN ICM428M.R428FIRST IS NOT NULL THEN TRIM(ICM428M.R428FIRST) ||' '|| TRIM(ICM428M.R428FAMILY) ELSE TRIM(ICM699M.SHUSER) END AS USER"),
- 'ICM699M.SHCODE', 'ICM699M.SHCO', 'ICM699M.SHWHS',
+ 'ICM699M.SHCODE',
+ 'ICM699M.SHCO',
+ 'ICM699M.SHWHS',
DB::raw(" ICM699M.SHACKDATE ||' '||ICM699M.SHACKTIME AS ACKDATE"),
- 'ICM699M.SHACKUSER', 'ICM699M.SHINTBOX', 'ICM699M.SHACKNOTE',
- DB::raw('SUBSTR(ICM699M.SHDATA, 1, 200)')
+ 'ICM699M.SHACKUSER',
+ 'ICM699M.SHINTBOX',
+ 'ICM699M.SHACKNOTE',
+ DB::raw('SUBSTR(ICM699M.SHDATA, 1, 200)'),
)
->distinct()
->leftJoin('ICM428M', 'ICM699M.SHUSER', '=', 'ICM428M.R428US')
@@ -306,7 +311,7 @@ class M3ErrorsDispController extends Controller
return redirect()->back()->withInput()->with(
'message',
'Maximum allowed records for Excel Download is: ' . number_format($maxRecords)
- . ' current records: ' . number_format($count) . ' , change your search criteria.'
+ . ' current records: ' . number_format($count) . ' , change your search criteria.',
);
}
@@ -360,5 +365,4 @@ class M3ErrorsDispController extends Controller
$builder->where('SHTYPE', 'like', '%M3%');
}
}
-
}
diff --git a/Modules/M3/Http/Controllers/M3GetPDFFromCacheController.php b/Modules/M3/Http/Controllers/M3GetPDFFromCacheController.php
index 71cc726f..4e3bd13b 100644
--- a/Modules/M3/Http/Controllers/M3GetPDFFromCacheController.php
+++ b/Modules/M3/Http/Controllers/M3GetPDFFromCacheController.php
@@ -17,44 +17,44 @@ class M3GetPDFFromCacheController extends Controller
$parser = new Parser;
$aggno = $aggmsg = '';
- $IC670M = $PDFArray = $carrier = $trackingno = $ICM688M1 = [];
- $AYMACPKR = $WHDDA = $COMPANY = $PLANT = $WHS = '';
+ $iC670M = $pDFArray = $carrier = $trackingno = $iCM688M1 = [];
+ $aYMACPKR = $wHDDA = $cOMPANY = $pLANT = $wHS = '';
// PDF File PATH
$pdfFilePath = Config::get('arrays.PdfPath');
try {
// Initialise Vars
- $PDFArray = $trackingno = $carrier = $ICM688M1 = [];
+ $pDFArray = $trackingno = $carrier = $iCM688M1 = [];
- $SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
+ $sHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
- if ($SHUSER != '') {
+ if ($sHUSER != '') {
// Get User CO & WH
// Get user from ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
- ->where('R428US', '=', $SHUSER)
+ ->where('R428US', '=', $sHUSER)
->first();
- $R428US = isset($ICM428M->R428US) ? $ICM428M->R428US : '';
- $COMPANY = isset($ICM428M->R428CO) ? $ICM428M->R428CO : ''; // Company
- $PLANT = isset($ICM428M->R428PL) ? $ICM428M->R428PL : ''; // Plant
- $WHS = isset($ICM428M->R428WH) ? $ICM428M->R428WH : ''; // WareHouse
+ $r428US = isset($iCM428M->R428US) ? $iCM428M->R428US : '';
+ $cOMPANY = isset($iCM428M->R428CO) ? $iCM428M->R428CO : ''; // Company
+ $pLANT = isset($iCM428M->R428PL) ? $iCM428M->R428PL : ''; // Plant
+ $wHS = isset($iCM428M->R428WH) ? $iCM428M->R428WH : ''; // WareHouse
}
// Warehouse Table
- $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
+ $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
// ->where('WDCO',$userCO)->where('WDPL',$userPL)->where('WDWHS',$userWH)
// Get URL PARAMS
$urlParams = count($request->all()) > 0 ? $request->all() : '';
// dump($urlParams);
- $AYMACPKR = isset($urlParams['MACPKR']) ? trim($urlParams['MACPKR']) : ''; // Delivery note number
- $DOCTYPE = isset($urlParams['DOCTYPE']) ? trim($urlParams['DOCTYPE']) : ''; // Document type (PackingList, CarrierLabel, ContentLabel)
- $WHDDA = $COMPANY . $PLANT . $WHS;
+ $aYMACPKR = isset($urlParams['MACPKR']) ? trim($urlParams['MACPKR']) : ''; // Delivery note number
+ $dOCTYPE = isset($urlParams['DOCTYPE']) ? trim($urlParams['DOCTYPE']) : ''; // Document type (PackingList, CarrierLabel, ContentLabel)
+ $wHDDA = $cOMPANY . $pLANT . $wHS;
// Check Doctype fisrt
- $docTypes = $DOCTYPE != '' ? [$DOCTYPE] : ['PackingList', 'ContentLabel', 'CarrierLabel', 'GSLabel']; // document type (PackingList, CarrierLabel, ContentLabel)
+ $docTypes = $dOCTYPE != '' ? [$dOCTYPE] : ['PackingList', 'ContentLabel', 'CarrierLabel', 'GSLabel']; // document type (PackingList, CarrierLabel, ContentLabel)
if ($urlParams != '') {
// dump($urlParams);
@@ -63,108 +63,108 @@ class M3GetPDFFromCacheController extends Controller
// Document type (PackingList, CarrierLabel, ContentLabel)
// Get Aggregation Number if it exists
- $ICM695M1Agg = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
+ $iCM695M1Agg = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
->select('AYTRUCK')
- ->where('AYCO', $COMPANY)
- ->where('AYWHS', $WHS)
- ->where('AYMACPKR', $AYMACPKR)
+ ->where('AYCO', $cOMPANY)
+ ->where('AYWHS', $wHS)
+ ->where('AYMACPKR', $aYMACPKR)
->first();
- $aggno = isset($ICM695M1Agg->AYTRUCK) ? trim($ICM695M1Agg->AYTRUCK) : '';
+ $aggno = isset($iCM695M1Agg->AYTRUCK) ? trim($iCM695M1Agg->AYTRUCK) : '';
if ($aggno != '' && $aggno != '0') {
$aggmsg = "This delivery note is part of aggregation $aggno ";
- $ICM688M1 = DB::connection(config('m3.connection', 'pgsql'))->select("select A4MACPKR from ICM688M1 where A4SHPAGGCD='$aggno'");
- // foreach($ICM688M1 as $key => $ICM688M1R) {
- // $aggmsg.=' '.$ICM688M1R->A4MACPKR.'';
+ $iCM688M1 = DB::connection(config('m3.connection', 'pgsql'))->select("select A4MACPKR from ICM688M1 where A4SHPAGGCD='$aggno'");
+ // foreach($iCM688M1 as $key => $ICM688M1R) {
+ // $aggmsg.=' '.$ICM688M1R->A4MACPKR.'';
// }
// $aggmsg.=" )";
// 654 add 'AYSPR15A01', 'AYSPR30A01', 'AYTRUCK' carrier and tracking# and agg#
- $ICM695M1 = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
+ $iCM695M1 = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
->select('AYCO', 'AYWHS', 'AYMACPKR', 'AYINTBOX', 'AYSPR15A01', 'AYSPR30A01', 'AYTRUCK')
->distinct()
- ->where('AYCO', $COMPANY)
- ->where('AYWHS', $WHS)
- // ->where('AYMACPKR',$AYMACPKR)
+ ->where('AYCO', $cOMPANY)
+ ->where('AYWHS', $wHS)
+ // ->where('AYMACPKR',$aYMACPKR)
->where('AYTRUCK', $aggno)
->orderBy('AYMACPKR')
->get();
} else {
// 654 add 'AYSPR15A01', 'AYSPR30A01', 'AYTRUCK' carrier and tracking# and agg#
- $ICM695M1 = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
+ $iCM695M1 = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
->select('AYCO', 'AYWHS', 'AYMACPKR', 'AYINTBOX', 'AYSPR15A01', 'AYSPR30A01', 'AYTRUCK')
->distinct()
- ->where('AYCO', $COMPANY)
- ->where('AYWHS', $WHS)
- ->where('AYMACPKR', $AYMACPKR)
+ ->where('AYCO', $cOMPANY)
+ ->where('AYWHS', $wHS)
+ ->where('AYMACPKR', $aYMACPKR)
->orderBy('AYMACPKR')
->get();
}
$allLabels = [];
- if (count($ICM695M1) > 0) {
+ if (count($iCM695M1) > 0) {
$tmpCacheArr = $carrier = $trackingno = [];
// Loop the Results from $ICM595M1TMP
- foreach ($ICM695M1 as $key => $ICM695M1R) {
- $WHS = trim($ICM695M1R->AYWHS);
- $COMPANY = trim($ICM695M1R->AYCO);
- $AYMACPKR = trim($ICM695M1R->AYMACPKR);
- $DOCNUM = trim($ICM695M1R->AYINTBOX);
+ foreach ($iCM695M1 as $key => $ICM695M1R) {
+ $wHS = trim($ICM695M1R->AYWHS);
+ $cOMPANY = trim($ICM695M1R->AYCO);
+ $aYMACPKR = trim($ICM695M1R->AYMACPKR);
+ $dOCNUM = trim($ICM695M1R->AYINTBOX);
// 654
$carrier[] = trim($ICM695M1R->AYSPR15A01);
$trackingno[] = trim($ICM695M1R->AYSPR30A01);
$aggno = trim($ICM695M1R->AYTRUCK);
// Make Key and Test Validity
- if ($AYMACPKR != '' && $COMPANY != '' && $WHS != '') {
- $CarrierLabel = '';
- $ContentLabel = '';
- $PackingList = '';
+ if ($aYMACPKR != '' && $cOMPANY != '' && $wHS != '') {
+ $carrierLabel = '';
+ $contentLabel = '';
+ $packingList = '';
$cacheKeyPackingList = $cacheKeyCarrierLabel = $cacheKeyContentLabel = '';
// Get Unique Keys
foreach ($docTypes as $key => $value) {
// Check Parcel vs LTL
if ($value == 'ContentLabel') {
- $DOCNUMT = $DOCNUM;
- $ContentLabel = ! is_numeric($DOCNUM) ? 'LTL' : '';
+ $dOCNUMT = $dOCNUM;
+ $contentLabel = ! is_numeric($dOCNUM) ? 'LTL' : '';
}
if ($value == 'CarrierLabel') {
- $DOCNUMT = $DOCNUM;
+ $dOCNUMT = $dOCNUM;
// Keep Solon Logic to read LTL
- $DOCNUMT2 = $ContentLabel == 'LTL' ? $AYMACPKR : $DOCNUM;
- if ($DOCNUMT2 != $DOCNUMT) {
- $PDFKey2 = $value . '/' . $value . '_' . $AYMACPKR . '_' . $DOCNUMT2 . '_' . $COMPANY . '_' . $WHS;
- $tmpCacheArr[] = $PDFKey2;
+ $dOCNUMT2 = $contentLabel == 'LTL' ? $aYMACPKR : $dOCNUM;
+ if ($dOCNUMT2 != $dOCNUMT) {
+ $pDFKey2 = $value . '/' . $value . '_' . $aYMACPKR . '_' . $dOCNUMT2 . '_' . $cOMPANY . '_' . $wHS;
+ $tmpCacheArr[] = $pDFKey2;
}
}
if ($value == 'PackingList') {
- $DOCNUMT = $AYMACPKR;
+ $dOCNUMT = $aYMACPKR;
}
// Get GS1 Labels
if ($value == 'GSLabel') {
- $PDFKey = $value . '/' . $value . '_' . $AYMACPKR . '_' . $COMPANY . '_' . $WHS . '_' . $DOCNUM;
+ $pDFKey = $value . '/' . $value . '_' . $aYMACPKR . '_' . $cOMPANY . '_' . $wHS . '_' . $dOCNUM;
- // $PDFKey = $value.'/'.$value.'_'.$AYMACPKR.'_'.$COMPANY.'_'.$WHS;
+ // $pDFKey = $value.'/'.$value.'_'.$aYMACPKR.'_'.$cOMPANY.'_'.$wHS;
// }
// else{
- // $PDFKey = $value.'/'.$value.'_'.$AYMACPKR.'_'.$COMPANY.'_'.$WHS.'_'.$DOCNUM;
+ // $pDFKey = $value.'/'.$value.'_'.$aYMACPKR.'_'.$cOMPANY.'_'.$wHS.'_'.$dOCNUM;
// }
} else {
- $PDFKey = $value . '/' . $value . '_' . $AYMACPKR . '_' . $DOCNUMT . '_' . $COMPANY . '_' . $WHS;
+ $pDFKey = $value . '/' . $value . '_' . $aYMACPKR . '_' . $dOCNUMT . '_' . $cOMPANY . '_' . $wHS;
}
- $tmpCacheArr[] = $PDFKey;
+ $tmpCacheArr[] = $pDFKey;
}
}
}
- // Get unique values from array $PDFArray
+ // Get unique values from array $pDFArray
$tmpCacheArr = collect($tmpCacheArr)->unique();
foreach ($tmpCacheArr as $key => $value) {
@@ -175,7 +175,7 @@ class M3GetPDFFromCacheController extends Controller
// Transform content to base64
// $base64PDF = $pdfFile;
$base64PDF = base64_encode($pdfFile);
- $PDFArray[] = $base64PDF;
+ $pDFArray[] = $base64PDF;
}
}
} else {
@@ -184,11 +184,11 @@ class M3GetPDFFromCacheController extends Controller
}
} catch (\Throwable $th) {
}
- // dump($AYMACPKR);
- // dump($IC670M);
- // dump($ICM695M1);
+ // dump($aYMACPKR);
+ // dump($iC670M);
+ // dump($iCM695M1);
- return view('m3::liberty-theme.pages.M3GetPDF', compact('IC670M', 'PDFArray', 'AYMACPKR', 'WHDDA', 'aggmsg', 'carrier', 'trackingno', 'ICM688M1', 'COMPANY', 'PLANT', 'WHS'));
+ return view('m3::liberty-theme.pages.M3GetPDF', ['IC670M' => $iC670M, 'PDFArray' => $pDFArray, 'AYMACPKR' => $aYMACPKR, 'WHDDA' => $wHDDA, 'aggmsg' => $aggmsg, 'carrier' => $carrier, 'trackingno' => $trackingno, 'ICM688M1' => $iCM688M1, 'COMPANY' => $cOMPANY, 'PLANT' => $pLANT, 'WHS' => $wHS]);
// compact('IC670M','ViewTitle')
}
}
diff --git a/Modules/M3/Http/Controllers/MFOrdersController.php b/Modules/M3/Http/Controllers/MFOrdersController.php
index 0483e774..a3179c42 100644
--- a/Modules/M3/Http/Controllers/MFOrdersController.php
+++ b/Modules/M3/Http/Controllers/MFOrdersController.php
@@ -10,41 +10,41 @@ class MFOrdersController extends Controller
{
public static function index(Request $request)
{
- $MF = isset($request->id) ? trim($request->id) : '';
+ $mF = isset($request->id) ? trim($request->id) : '';
- // dd("MFOrders ".$MF);
+ // dd("MFOrders ".$mF);
// Get Users from ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
->where('R428US', '=', strtoupper(m3_user()))
->first();
- $user = $ICM428M->R428US;
- $co = $ICM428M->R428CO;
- $whs = $ICM428M->R428WH;
- $plant = $ICM428M->R428PL;
+ $user = $iCM428M->R428US;
+ $co = $iCM428M->R428CO;
+ $whs = $iCM428M->R428WH;
+ $plant = $iCM428M->R428PL;
// ICM705M1 Statement
$sqlstmt = "select APMANIFEST,APDOCKDOOR,APCARRIER,APTRUCKIDT,APSPARE1,APLDSTRU,APLDSTRD,APLDSTRT,
APLDCLOU,APLDCLOD,APLDCLOT,APCO,APWHS,APPLT,APSPARE2,APLDCLOZ
from ICM705M1
- where APMANIFEST = $MF and APCO='$co' and APWHS='$whs' and APPLT='$plant' limit 1";
+ where APMANIFEST = $mF and APCO='$co' and APWHS='$whs' and APPLT='$plant' limit 1";
- $ICM705M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
- $carrier = isset($ICM705M1[0]->APCARRIER) ? trim($ICM705M1[0]->APCARRIER) : '';
+ $iCM705M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
+ $carrier = isset($iCM705M1[0]->APCARRIER) ? trim($iCM705M1[0]->APCARRIER) : '';
- if ($MF != '') {
+ if ($mF != '') {
$status_ICM688M1_array = Config::get('arrays.status_ICM688M1_array');
$sqlstmt = "SELECT AYCO,AYPLANT,AYMACPKR,AYONO,A4SHSHNM,A4PICKSTS,AYSPR15A01,SUM(AYLNWGHT) AS TOTWEIGHT,COUNT(*) AS BOXPAL FROM ICM695M1
LEFT JOIN ICM688M1 ON AYCO=A4CO AND AYPLANT=A4PLANT AND AYMACPKR=A4MACPKR
- WHERE AYAPRF1551= $MF and AYCO='$co' and AYWHS='$whs' and AYPLANT='$plant'
+ WHERE AYAPRF1551= $mF and AYCO='$co' and AYWHS='$whs' and AYPLANT='$plant'
GROUP BY AYCO,AYPLANT,AYMACPKR,AYONO,A4SHSHNM,A4PICKSTS,AYSPR15A01";
- $ICM695M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
+ $iCM695M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
return view(
'm3::liberty-theme.pages.MFOrders',
- compact('ICM695M1', 'status_ICM688M1_array', 'MF', 'carrier'),
+ ['ICM695M1' => $iCM695M1, 'status_ICM688M1_array' => $status_ICM688M1_array, 'MF' => $mF, 'carrier' => $carrier],
);
} else {
abort(404, 'Manifest Not Found');
diff --git a/Modules/M3/Http/Controllers/OrderLinesOfClosedOrder.php b/Modules/M3/Http/Controllers/OrderLinesOfClosedOrder.php
index 3dbf92ea..0f57f42c 100644
--- a/Modules/M3/Http/Controllers/OrderLinesOfClosedOrder.php
+++ b/Modules/M3/Http/Controllers/OrderLinesOfClosedOrder.php
@@ -17,22 +17,22 @@ class OrderLinesOfClosedOrder extends Controller
public static function index(Request $request)
{
- $IC670M = $ICM688M2 = [];
- $WHDDA = $COMPANY = $PLANT = $WHS = '';
- $REPORTDATEDisp = today()->format('Ymd');
+ $iC670M = $iCM688M2 = [];
+ $wHDDA = $cOMPANY = $pLANT = $wHS = '';
+ $rEPORTDATEDisp = today()->format('Ymd');
$allReportsUrls = [];
try {
- [$COMPANY, $PLANT, $WHS] = self::userWarehouseContext('110', '144', '322');
+ [$cOMPANY, $pLANT, $wHS] = self::userWarehouseContext('110', '144', '322');
// Warehouse Table
- $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
+ $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
// Get URL PARAMS
$urlParams = count($request->all()) > 0 ? $request->all() : '';
- $REPORTDATEDisp = isset($urlParams['REPORTDATEDisp']) ? \DateTime::createFromFormat('Y-m-d', trim($urlParams['REPORTDATEDisp']))->format('Ymd') : today()->format('Ymd');
+ $rEPORTDATEDisp = isset($urlParams['REPORTDATEDisp']) ? \DateTime::createFromFormat('Y-m-d', trim($urlParams['REPORTDATEDisp']))->format('Ymd') : today()->format('Ymd');
- $WHDDA = $COMPANY . $PLANT . $WHS;
- if ($REPORTDATEDisp != '' && $COMPANY != '' && $WHS != '' && $PLANT != '') {
+ $wHDDA = $cOMPANY . $pLANT . $wHS;
+ if ($rEPORTDATEDisp != '' && $cOMPANY != '' && $wHS != '' && $pLANT != '') {
// Case 729: Add Currency code A1SHCURR FROM ICM666M
$selectContent = "
SELECT A5MACPKR, A5ONO,
@@ -60,24 +60,24 @@ class OrderLinesOfClosedOrder extends Controller
WHERE A5MACPKR IN (
SELECT DISTINCT AYMACPKR
FROM ICM695M1
- WHERE AYSTATUS IN ('Z','z') AND AYAPR8N002 = $REPORTDATEDisp
+ WHERE AYSTATUS IN ('Z','z') AND AYAPR8N002 = $rEPORTDATEDisp
)
- AND A5CO=$COMPANY AND A5WHS=$WHS AND A5PLANT=$PLANT";
+ AND A5CO=$cOMPANY AND A5WHS=$wHS AND A5PLANT=$pLANT";
- $ICM688M2 = DB::connection(config('m3.connection', 'pgsql'))
+ $iCM688M2 = DB::connection(config('m3.connection', 'pgsql'))
->select($selectContent);
} else {
- $ICM688M2 = collect();
+ $iCM688M2 = collect();
}
// Get List of Files
- $allReportsUrls = self::reportUrls($WHS);
+ $allReportsUrls = self::reportUrls($wHS);
} catch (\Throwable $th) {
Log::error($th);
}
- return view('m3::liberty-theme.pages.OrderLinesOfClosed', compact('IC670M', 'ICM688M2', 'WHDDA', 'COMPANY', 'PLANT', 'WHS', 'REPORTDATEDisp', 'allReportsUrls'));
+ return view('m3::liberty-theme.pages.OrderLinesOfClosed', ['IC670M' => $iC670M, 'ICM688M2' => $iCM688M2, 'WHDDA' => $wHDDA, 'COMPANY' => $cOMPANY, 'PLANT' => $pLANT, 'WHS' => $wHS, 'REPORTDATEDisp' => $rEPORTDATEDisp, 'allReportsUrls' => $allReportsUrls]);
}
public static function exporttoExcel(Request $request)
@@ -88,10 +88,10 @@ class OrderLinesOfClosedOrder extends Controller
ini_set('memory_limit', '1024M');
try {
- [$COMPANY, $PLANT, $WHS] = self::userWarehouseContext();
+ [$cOMPANY, $pLANT, $wHS] = self::userWarehouseContext();
// Warehouse Table
- $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
+ $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
// Get URL PARAMS
$urlParams = count($request->all()) > 0 ? $request->all() : '';
@@ -101,8 +101,8 @@ class OrderLinesOfClosedOrder extends Controller
$reportDateWD = isset($urlParams['REPORTDATE']) ? trim($urlParams['REPORTDATE']) : today()->format('Y-m-d');
$toreportDateWD = isset($urlParams['TOREPORTDATE']) ? trim($urlParams['TOREPORTDATE']) : today()->format('Y-m-d');
- $WHDDA = $COMPANY . $PLANT . $WHS;
- if ($reportDate != '' && $COMPANY != '' && $WHS != '' && $PLANT != '') {
+ $wHDDA = $cOMPANY . $pLANT . $wHS;
+ if ($reportDate != '' && $cOMPANY != '' && $wHS != '' && $pLANT != '') {
// Case 729: Add Currency code A1SHCURR FROM ICM666M
$selectContent = "
SELECT (SHDT || ' ' || SHTIME) AS DATECLOSED, A5MACPKR, A5ONO,
@@ -130,9 +130,9 @@ class OrderLinesOfClosedOrder extends Controller
FROM ICM695M1
WHERE AYSTATUS IN ('Z','z') AND AYAPR8N002 BETWEEN $reportDate AND $toreportDate
)
- AND A5CO=$COMPANY AND A5WHS=$WHS AND A5PLANT=$PLANT";
+ AND A5CO=$cOMPANY AND A5WHS=$wHS AND A5PLANT=$pLANT";
- $ICM688M2 = DB::connection(config('m3.connection', 'pgsql'))
+ $iCM688M2 = DB::connection(config('m3.connection', 'pgsql'))
->select($selectContent);
$newItem = ['DATECLOSED' => 'Close Date', 'A5MACPKR' => 'Delivery #', 'A5ONO' => 'Order #',
@@ -140,25 +140,25 @@ class OrderLinesOfClosedOrder extends Controller
'A4REFORD' => 'Order Type', 'A5PART' => 'Part #', 'A5RSVQTY' => 'Reserved',
'A5PACKED' => 'Packed', 'CALCULATED_COLUMN' => 'Back Order Qty', 'ANOTHER_CALCULATED_COLUMN' => 'Value Packed $', 'A4SHSHNM' => 'Customer name',
'REASON' => 'Failure Reason', 'A1SHCURR' => 'Currency Code', 'FREIGHT' => 'Freight'];
- $ICM688M2Col = collect($ICM688M2);
- $ICM688M2Col->prepend($newItem);
+ $iCM688M2Col = collect($iCM688M2);
+ $iCM688M2Col->prepend($newItem);
// Count records before exporting to excel : Max 20K records are allowed
- $ICM688M2Count = $ICM688M2Col->count();
+ $iCM688M2Count = $iCM688M2Col->count();
// Set Max allowed records
$maxRecords = Config::get('arrays.maxRecCL');
- if ($ICM688M2Count > $maxRecords) {
+ if ($iCM688M2Count > $maxRecords) {
return redirect()->back()->withInput()->with('message', 'Maximum allowed records for Excel Download is: ' . number_format($maxRecords) .
- ' current records: ' . number_format($ICM688M2Count) . ' , change your search criteria.');
+ ' current records: ' . number_format($iCM688M2Count) . ' , change your search criteria.');
}
} else {
- $ICM688M2Col = '';
+ $iCM688M2Col = '';
}
// Download Excel
// Add true at the end to include fields names in the Header
- return app(SpreadsheetExport::class)->download($ICM688M2Col, 'Closedorderlinesreport_' . $reportDateWD . '-' . $toreportDateWD . self::XLSX_EXTENSION);
+ return app(SpreadsheetExport::class)->download($iCM688M2Col, 'Closedorderlinesreport_' . $reportDateWD . '-' . $toreportDateWD . self::XLSX_EXTENSION);
} catch (\Throwable $th) {
Log::error($th);
}
@@ -172,10 +172,10 @@ class OrderLinesOfClosedOrder extends Controller
ini_set('memory_limit', '1024M');
try {
- [$COMPANY, $PLANT, $WHS] = self::userWarehouseContext();
+ [$cOMPANY, $pLANT, $wHS] = self::userWarehouseContext();
// Warehouse Table
- $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
+ $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
// Get URL PARAMS
$urlParams = count($request->all()) > 0 ? $request->all() : '';
@@ -185,10 +185,10 @@ class OrderLinesOfClosedOrder extends Controller
$reportDateWD = isset($urlParams['REPORTDATE']) ? trim($urlParams['REPORTDATE']) : today()->format('Y-m-d');
$toreportDateWD = isset($urlParams['TOREPORTDATE']) ? trim($urlParams['TOREPORTDATE']) : today()->format('Y-m-d');
- $WHDDA = $COMPANY . $PLANT . $WHS;
- if ($reportDate != '' && $COMPANY != '' && $WHS != '' && $PLANT != '') {
+ $wHDDA = $cOMPANY . $pLANT . $wHS;
+ if ($reportDate != '' && $cOMPANY != '' && $wHS != '' && $pLANT != '') {
// Case 729: Add Currency code A1SHCURR FROM ICM666M
- $ICM688M2 = DB::connection(config('m3.connection', 'pgsql'))
+ $iCM688M2 = DB::connection(config('m3.connection', 'pgsql'))
->select("
SELECT (SHDT || ' ' || SHTIME) AS DATECLOSED, A5MACPKR, A5ONO,
A4OFSTRM,
@@ -215,7 +215,7 @@ class OrderLinesOfClosedOrder extends Controller
FROM ICM695M1
WHERE AYSTATUS IN ('Z','z') AND AYAPR8N002 BETWEEN $reportDate AND $toreportDate
)
- AND A5CO=$COMPANY AND A5WHS=$WHS AND A5PLANT=$PLANT
+ AND A5CO=$cOMPANY AND A5WHS=$wHS AND A5PLANT=$pLANT
");
$newItem = ['DATECLOSED' => 'Close Date', 'A5MACPKR' => 'Delivery #', 'A5ONO' => 'Order #',
@@ -223,27 +223,25 @@ class OrderLinesOfClosedOrder extends Controller
'A4REFORD' => 'Order Type', 'A5PART' => 'Part #', 'A5RSVQTY' => 'Reserved',
'A5PACKED' => 'Packed', 'CALCULATED_COLUMN' => 'Back Order Qty', 'ANOTHER_CALCULATED_COLUMN' => 'Value Packed $', 'A4SHSHNM' => 'Customer name',
'REASON' => 'Failure Reason', 'A1SHCURR' => 'Currency Code', 'FREIGHT' => 'Freight'];
- $ICM688M2Col = collect($ICM688M2);
- $ICM688M2Col->prepend($newItem);
+ $iCM688M2Col = collect($iCM688M2);
+ $iCM688M2Col->prepend($newItem);
// Count records before exporting to excel : Max 20K records are allowed
- $ICM688M2Count = $ICM688M2Col->count();
+ $iCM688M2Count = $iCM688M2Col->count();
// Set Max allowed records
$maxRecords = Config::get('arrays.maxRecCL');
- if ($ICM688M2Count > $maxRecords) {
+ if ($iCM688M2Count > $maxRecords) {
return redirect()->back()->withInput()->with('message', 'Maximum allowed records for Excel Download is: ' . number_format($maxRecords) .
- ' current records: ' . number_format($ICM688M2Count) . ' , change your search criteria.');
+ ' current records: ' . number_format($iCM688M2Count) . ' , change your search criteria.');
}
} else {
- $ICM688M2Col = '';
+ $iCM688M2Col = '';
}
- $prevMonthFile = self::storedReportName($WHS, $reportDateWD, $toreportDateWD);
+ $prevMonthFile = self::storedReportName($wHS, $reportDateWD, $toreportDateWD);
// MAK Store the File to Storage
- app(SpreadsheetExport::class)->store($ICM688M2Col, $prevMonthFile, 'publicCL');
-
-
+ app(SpreadsheetExport::class)->store($iCM688M2Col, $prevMonthFile, 'publicCL');
return back();
} catch (\Throwable $th) {
diff --git a/Modules/M3/Http/Controllers/ReplenishSettingsController.php b/Modules/M3/Http/Controllers/ReplenishSettingsController.php
index 89e3608f..bd289296 100644
--- a/Modules/M3/Http/Controllers/ReplenishSettingsController.php
+++ b/Modules/M3/Http/Controllers/ReplenishSettingsController.php
@@ -14,25 +14,25 @@ class ReplenishSettingsController extends Controller
public static function index(Request $request)
{
// Replenishment Table
- // $REFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')->get();
+ // $rEFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')->get();
// Warehouse Table
- // $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
+ // $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
// Get Logged user Id
$userId = m3_user() !== '' ? strtoupper(m3_user()) : '';
// $userId = 'E1135818'; // Brad : E1135818 Malak : E2011812 ACOM_PDF
$connection = config('m3.connection', 'pgsql');
- $ICM428M = Schema::connection($connection)->hasTable('icm428m')
+ $iCM428M = Schema::connection($connection)->hasTable('icm428m')
? DB::connection($connection)->table('icm428m')->where('R428US', $userId)->where('R428STS', 'A')->first()
: null;
- $userCO = isset($ICM428M->R428CO) ? $ICM428M->R428CO : '';
- $userPL = isset($ICM428M->R428PL) ? $ICM428M->R428PL : '';
- $userWH = isset($ICM428M->R428WH) ? $ICM428M->R428WH : '';
+ $userCO = isset($iCM428M->R428CO) ? $iCM428M->R428CO : '';
+ $userPL = isset($iCM428M->R428PL) ? $iCM428M->R428PL : '';
+ $userWH = isset($iCM428M->R428WH) ? $iCM428M->R428WH : '';
if ($userCO != '') {
// Warehouse Table
- $IC670M = Schema::connection($connection)->hasTable('ic670m')
+ $iC670M = Schema::connection($connection)->hasTable('ic670m')
? DB::connection($connection)->table('ic670m')
->where('WDCO', $userCO)
->where('WDPL', $userPL)
@@ -40,16 +40,16 @@ class ReplenishSettingsController extends Controller
->get()
: [];
} else {
- $IC670M = [];
+ $iC670M = [];
}
// FROM PRDAT.REFERPS t1 LEFT JOIN ( SELECT R658CO,R658PL,R658WH,R658LC,R658PN,R658MQ,R658RQ,R658TL,R658RMQ,
// TRIM(R658WH)||TRIM(R658LC)||TRIM(R658PN) AS FULLID FROM EWOBJTST.ICM658M
// ) t2 ON t1.REFKEY = t2.FULLID WHERE t1.REFCAT = '658'";
- // $REFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
- // dd($REFCAT658);
+ // $rEFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
+ // dd($rEFCAT658);
- return view('m3::liberty-theme.pages.ReplenishSettings', compact('IC670M'));
+ return view('m3::liberty-theme.pages.ReplenishSettings', ['IC670M' => $iC670M]);
// 'REFCAT658',
}
@@ -62,47 +62,47 @@ class ReplenishSettingsController extends Controller
$formInputs['R658IZLCF'] = isset($formInputs['R658IZLCF']) ? $formInputs['R658IZLCF'] : '0';
- $ICM658MINS = ICM658M::insert($formInputs);
+ $iCM658MINS = ICM658M::insert($formInputs);
return redirect()->route('m3.replenishmentSettings.index');
}
public function update(Request $request)
{
- $R658PN = (trim($request->R658PN) ?? trim($request->R658PN)) != null ? trim($request->R658PN) : '';
- $R658CO = (trim($request->R658CO) ?? trim($request->R658CO)) != null ? trim($request->R658CO) : '';
- $R658PL = (trim($request->R658PL) ?? trim($request->R658PL)) != null ? trim($request->R658PL) : '';
- $R658WH = (trim($request->R658WH) ?? trim($request->R658WH)) != null ? trim($request->R658WH) : '';
- $R658MQ = trim($request->R658MQ);
- $R658RQ = trim($request->R658RQ);
- $R658RMQ = trim($request->R658RMQ);
- $R658TL = trim($request->R658TL);
- $R658IZLCF = (trim($request->R658IZLCF) ?? trim($request->R658IZLCF)) != null ? trim($request->R658IZLCF) : '0';
+ $r658PN = (trim($request->R658PN) ?? trim($request->R658PN)) != null ? trim($request->R658PN) : '';
+ $r658CO = (trim($request->R658CO) ?? trim($request->R658CO)) != null ? trim($request->R658CO) : '';
+ $r658PL = (trim($request->R658PL) ?? trim($request->R658PL)) != null ? trim($request->R658PL) : '';
+ $r658WH = (trim($request->R658WH) ?? trim($request->R658WH)) != null ? trim($request->R658WH) : '';
+ $r658MQ = trim($request->R658MQ);
+ $r658RQ = trim($request->R658RQ);
+ $r658RMQ = trim($request->R658RMQ);
+ $r658TL = trim($request->R658TL);
+ $r658IZLCF = (trim($request->R658IZLCF) ?? trim($request->R658IZLCF)) != null ? trim($request->R658IZLCF) : '0';
DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')
- ->where('R658PN', $R658PN)
- ->where('R658CO', $R658CO)
- ->where('R658PL', $R658PL)
- ->where('R658WH', $R658WH)
- ->update(['R658MQ' => $R658MQ, 'R658RQ' => $R658RQ, 'R658RMQ' => $R658RMQ, 'R658TL' => $R658TL, 'R658IZLCF' => $R658IZLCF]);
+ ->where('R658PN', $r658PN)
+ ->where('R658CO', $r658CO)
+ ->where('R658PL', $r658PL)
+ ->where('R658WH', $r658WH)
+ ->update(['R658MQ' => $r658MQ, 'R658RQ' => $r658RQ, 'R658RMQ' => $r658RMQ, 'R658TL' => $r658TL, 'R658IZLCF' => $r658IZLCF]);
return redirect()->route('m3.replenishmentSettings.index');
}
public function deleteRec(Request $request)
{
- $R658PN = trim($request->R658PN);
- $R658CO = trim($request->R658CO);
- $R658LC = trim($request->R658LC);
- $R658PL = trim($request->R658PL);
- $R658WH = trim($request->R658WH);
+ $r658PN = trim($request->R658PN);
+ $r658CO = trim($request->R658CO);
+ $r658LC = trim($request->R658LC);
+ $r658PL = trim($request->R658PL);
+ $r658WH = trim($request->R658WH);
$deleteRecord = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')
- ->where('R658PN', $R658PN)
- ->where('R658CO', $R658CO)
- ->where('R658LC', $R658LC)
- ->where('R658PL', $R658PL)
- ->where('R658WH', $R658WH)
+ ->where('R658PN', $r658PN)
+ ->where('R658CO', $r658CO)
+ ->where('R658LC', $r658LC)
+ ->where('R658PL', $r658PL)
+ ->where('R658WH', $r658WH)
->delete();
return response()->json(['success' => 'Record Deleted']);
@@ -114,18 +114,18 @@ class ReplenishSettingsController extends Controller
parse_str($request['data'], $params);
$paramsObj = (object) $params;
- $R658PN = trim($paramsObj->R658PN);
- $R658CO = trim($paramsObj->R658CO);
- $R658LC = trim($paramsObj->R658LC);
- $R658PL = trim($paramsObj->R658PL);
- $R658WH = trim($paramsObj->R658WH);
+ $r658PN = trim($paramsObj->R658PN);
+ $r658CO = trim($paramsObj->R658CO);
+ $r658LC = trim($paramsObj->R658LC);
+ $r658PL = trim($paramsObj->R658PL);
+ $r658WH = trim($paramsObj->R658WH);
$recordExistSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')
- ->where('R658PN', $R658PN)
- ->where('R658CO', $R658CO)
- ->where('R658LC', $R658LC)
- ->where('R658PL', $R658PL)
- ->where('R658WH', $R658WH)
+ ->where('R658PN', $r658PN)
+ ->where('R658CO', $r658CO)
+ ->where('R658LC', $r658LC)
+ ->where('R658PL', $r658PL)
+ ->where('R658WH', $r658WH)
->first();
$recordExists = $recordExistSQL == null ? true : false;
@@ -135,25 +135,25 @@ class ReplenishSettingsController extends Controller
public function datatables(Request $request)
{
// Replenishment Table
- // $REFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')->get();
+ // $rEFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')->get();
// Warehouse Table
- // $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
+ // $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
// Get Logged user Id
$userId = m3_user() !== '' ? strtoupper(m3_user()) : '';
// $userId = 'E1135818'; // Brad : E1135818 Malak : E2011812 ACOM_PDF
$connection = config('m3.connection', 'pgsql');
- $ICM428M = Schema::connection($connection)->hasTable('icm428m')
+ $iCM428M = Schema::connection($connection)->hasTable('icm428m')
? DB::connection($connection)->table('icm428m')->where('R428US', $userId)->where('R428STS', 'A')->first()
: null;
- $userCO = isset($ICM428M->R428CO) ? $ICM428M->R428CO : '';
- $userPL = isset($ICM428M->R428PL) ? $ICM428M->R428PL : '';
- $userWH = isset($ICM428M->R428WH) ? $ICM428M->R428WH : '';
+ $userCO = isset($iCM428M->R428CO) ? $iCM428M->R428CO : '';
+ $userPL = isset($iCM428M->R428PL) ? $iCM428M->R428PL : '';
+ $userWH = isset($iCM428M->R428WH) ? $iCM428M->R428WH : '';
if ($userCO != '') {
// Replenishment Table
- $REFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')
+ $rEFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')
->select('*')
->where('R658CO', $userCO)
->where('R658PL', $userPL)
@@ -161,22 +161,21 @@ class ReplenishSettingsController extends Controller
->orderBy('R658CO', 'asc');
// Warehouse Table
- // $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')
+ // $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')
// ->where('WDCO',$userCO)
// ->where('WDPL',$userPL)
// ->where('WDWHS',$userWH)
// ->get();
} else {
- $REFCAT658 = [];
+ $rEFCAT658 = [];
}
// FROM PRDAT.REFERPS t1 LEFT JOIN ( SELECT R658CO,R658PL,R658WH,R658LC,R658PN,R658MQ,R658RQ,R658TL,R658RMQ,
// TRIM(R658WH)||TRIM(R658LC)||TRIM(R658PN) AS FULLID FROM EWOBJTST.ICM658M
// ) t2 ON t1.REFKEY = t2.FULLID WHERE t1.REFCAT = '658'";
- // $REFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
- // dd($REFCAT658);
+ // $rEFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
+ // dd($rEFCAT658);
-
- return Datatables::of($REFCAT658)->addIndexColumn()->make(true);
+ return Datatables::of($rEFCAT658)->addIndexColumn()->make(true);
}
}
diff --git a/Modules/M3/Http/Controllers/ShipToController.php b/Modules/M3/Http/Controllers/ShipToController.php
index d2909a4c..116c6860 100644
--- a/Modules/M3/Http/Controllers/ShipToController.php
+++ b/Modules/M3/Http/Controllers/ShipToController.php
@@ -38,12 +38,12 @@ class ShipToController extends Controller
public function create()
{
// US
- $USstates = USStates::all();
+ $uSstates = USStates::all();
// CA
- $CAstates = CAProvinces::all();
+ $cAstates = CAProvinces::all();
// All States
- $states = array_merge($USstates, $CAstates);
+ $states = array_merge($uSstates, $cAstates);
return view('m3::liberty-theme.pages.ship-to.create', compact('states'));
}
@@ -104,12 +104,12 @@ class ShipToController extends Controller
public function edit($aushshzp, $aushwhs)
{
// US
- $USstates = USStates::all();
+ $uSstates = USStates::all();
// CA
- $CAstates = CAProvinces::all();
+ $cAstates = CAProvinces::all();
// All States
- $states = array_merge($USstates, $CAstates);
+ $states = array_merge($uSstates, $cAstates);
$shipTo = ShipTo::where('AUSHSHZP', $aushshzp)
->where('AUSHWHS', $aushwhs)
diff --git a/Modules/M3/Http/Controllers/carrierMaintController.php b/Modules/M3/Http/Controllers/carrierMaintController.php
index cb803827..0f669b2f 100644
--- a/Modules/M3/Http/Controllers/carrierMaintController.php
+++ b/Modules/M3/Http/Controllers/carrierMaintController.php
@@ -13,14 +13,14 @@ class carrierMaintController extends Controller
public static function index(Request $request)
{
$currentUser = Helper::getUserCOWHSPLT();
- $UserCO = $currentUser['UserCO'] ?? '';
- $ICM160M = [];
+ $userCO = $currentUser['UserCO'] ?? '';
+ $iCM160M = [];
$power_user = [];
$schema = Schema::connection(config('m3.connection', 'pgsql'));
if ($schema->hasTable('icm160m')) {
- $ICM160M = DB::connection(config('m3.connection', 'pgsql'))->select('
+ $iCM160M = DB::connection(config('m3.connection', 'pgsql'))->select('
select canum, canam, substr(CATPID,1,3) as TwoshipCarrierCode, substr(CATPID,4,1) as ParcelCarrierCode, caspr10A01, caspr1A01
- from icm160m WHERE CACO=?', [$UserCO]);
+ from icm160m WHERE CACO=?', [$userCO]);
}
if ($schema->hasTable('icm428m')) {
$power_user = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
@@ -28,7 +28,7 @@ class carrierMaintController extends Controller
->where('R428US', strtoupper(m3_user()))->get()->all();
}
- return view('m3::liberty-theme.pages.carrierMaint', compact('ICM160M', 'power_user'));
+ return view('m3::liberty-theme.pages.carrierMaint', ['ICM160M' => $iCM160M, 'power_user' => $power_user]);
}
@@ -36,7 +36,7 @@ class carrierMaintController extends Controller
public static function savecarrierAdd(Request $request)
{
$currentUser = Helper::getUserCOWHSPLT();
- $UserCO = $currentUser['UserCO'] ?? '';
+ $userCO = $currentUser['UserCO'] ?? '';
// $UserPL = $currentUser['UserPL'] ?? '';
// Insert record to ICM160M
@@ -44,16 +44,16 @@ class carrierMaintController extends Controller
if ($request->CANUM == null) {
return 'null';
}
- $icm160m = DB::connection(config('m3.connection', 'pgsql'))->select("select count(*) as COUNT1 from ICM160M where CANUM='$request->CANUM' AND CACO='$UserCO'");
+ $icm160m = DB::connection(config('m3.connection', 'pgsql'))->select("select count(*) as COUNT1 from ICM160M where CANUM='$request->CANUM' AND CACO='$userCO'");
if ($icm160m[0]->COUNT1 == '1') {
return 'exists';
} else {
- $CASPR10A01 = isset($request->CASPR10A01) && $request->CASPR10A01 != null ? $request->CASPR10A01 : ' ';
- $CASPR1A01 = isset($request->CASPR1A01) && $request->CASPR1A01 != null ? $request->CASPR1A01 : ' ';
+ $cASPR10A01 = isset($request->CASPR10A01) && $request->CASPR10A01 != null ? $request->CASPR10A01 : ' ';
+ $cASPR1A01 = isset($request->CASPR1A01) && $request->CASPR1A01 != null ? $request->CASPR1A01 : ' ';
$data = ['CANUM' => $request->CANUM, 'CANAM' => $request->CANAM,
'CATPID' => str_pad(substr($request->TWOSHIPCARRIERCODE, 0, 3), 3, ' ') . substr($request->PARCELCARRIERCODE, 0, 1),
- 'CASPR10A01' => $CASPR10A01, 'CASPR1A01' => $CASPR1A01, 'CACO' => $UserCO]; // ,'CAPLNT'=>$UserPL,'CAWHS'=>$UserWHS
+ 'CASPR10A01' => $cASPR10A01, 'CASPR1A01' => $cASPR1A01, 'CACO' => $userCO]; // ,'CAPLNT'=>$UserPL,'CAWHS'=>$UserWHS
$insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm160m')->insert($data);
if ($insertSQL) {
return 'success';
@@ -64,7 +64,7 @@ class carrierMaintController extends Controller
public static function savecarrierAdd2(Request $request)
{
$currentUser = Helper::getUserCOWHSPLT();
- $UserCO = $currentUser['UserCO'] ?? '';
+ $userCO = $currentUser['UserCO'] ?? '';
// $UserPL = $currentUser['UserPL'] ?? '';
// Insert record to ICM160M
@@ -72,11 +72,11 @@ class carrierMaintController extends Controller
return 'null';
}
- $CASPR10A01 = isset($request->CASPR10A01) && $request->CASPR10A01 != null ? $request->CASPR10A01 : ' ';
- $CASPR1A01 = isset($request->CASPR1A01) && $request->CASPR1A01 != null ? $request->CASPR1A01 : ' ';
+ $cASPR10A01 = isset($request->CASPR10A01) && $request->CASPR10A01 != null ? $request->CASPR10A01 : ' ';
+ $cASPR1A01 = isset($request->CASPR1A01) && $request->CASPR1A01 != null ? $request->CASPR1A01 : ' ';
$data = ['CANUM' => $request->CANUM, 'CANAM' => $request->CANAM, 'CATPID' => str_pad(substr($request->TWOSHIPCARRIERCODE, 0, 3), 3, ' ') . substr($request->PARCELCARRIERCODE, 0, 1),
- 'CASPR10A01' => $CASPR10A01, 'CASPR1A01' => $CASPR1A01, 'CACO' => $UserCO]; // ,'CAPLNT'=>$UserPL,'CAWHS'=>$UserWHS
+ 'CASPR10A01' => $cASPR10A01, 'CASPR1A01' => $cASPR1A01, 'CACO' => $userCO]; // ,'CAPLNT'=>$UserPL,'CAWHS'=>$UserWHS
$insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm160m')->insert($data);
if ($insertSQL) {
return 'success';
@@ -88,7 +88,7 @@ class carrierMaintController extends Controller
public static function savecarrierEdit(Request $request)
{
$currentUser = Helper::getUserCOWHSPLT();
- $UserCO = $currentUser['UserCO'] ?? '';
+ $userCO = $currentUser['UserCO'] ?? '';
if ($request->CANUM == null) {
return 'null';
@@ -96,7 +96,7 @@ class carrierMaintController extends Controller
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM160M
set CANAM='$request->CANAM', CATPID='" . str_pad(substr($request->TWOSHIPCARRIERCODE, 0, 3), 3, ' ') . substr($request->PARCELCARRIERCODE, 0, 1) . "',
CASPR10A01='$request->CASPR10A01', CASPR1A01='$request->CASPR1A01'
- where CANUM='$request->CANUM' AND CACO='$UserCO'");
+ where CANUM='$request->CANUM' AND CACO='$userCO'");
return 'success';
diff --git a/Modules/M3/Http/Controllers/execSummaryController.php b/Modules/M3/Http/Controllers/execSummaryController.php
index e50ef2d3..13deb074 100644
--- a/Modules/M3/Http/Controllers/execSummaryController.php
+++ b/Modules/M3/Http/Controllers/execSummaryController.php
@@ -10,22 +10,23 @@ use Str;
class execSummaryController extends Controller
{
private const WAREHOUSE_IN_CLAUSE = "' and a5whs in (";
+
public static function index(Request $request)
{
- $IC670M = collect();
- $WHDDA = '';
- $COMPANY = '110';
- $PLANT = '144';
- $WHS = '322';
+ $iC670M = collect();
+ $wHDDA = '';
+ $cOMPANY = '110';
+ $pLANT = '144';
+ $wHS = '322';
try {
// Ajax Call
if ($request->ajax()) {
- $WHDDA = isset($request->WHDDA) ? $request->WHDDA : [];
- $WHArr = [];
- foreach ($WHDDA as $key => $WHDDAV) {
- $CO = substr($WHDDAV, 0, 3);
- $WHArr[] = substr($WHDDAV, 6, 3);
+ $wHDDA = isset($request->WHDDA) ? $request->WHDDA : [];
+ $wHArr = [];
+ foreach ($wHDDA as $key => $WHDDAV) {
+ $cO = substr($WHDDAV, 0, 3);
+ $wHArr[] = substr($WHDDAV, 6, 3);
}
$reportPeriod = isset($request->reportPeriod) ? $request->reportPeriod : ''; // monthly , quarter , year , daily
@@ -34,7 +35,7 @@ class execSummaryController extends Controller
$checkWeight = isset($request->checkWeight) ? $request->checkWeight : ''; // on
$checkLines = isset($request->checkLines) ? $request->checkLines : ''; // on
- if (count($WHArr) > 0 && $CO != '' && $reportPeriod != '') {
+ if (count($wHArr) > 0 && $cO != '' && $reportPeriod != '') {
switch ($reportPeriod) {
case 'year':
// Set Dates based on reportPeriod type
@@ -50,7 +51,7 @@ class execSummaryController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDate and ayapr8N002<=$toreportDate )
- ) and a5co='" . $CO . "' and a5whs in(" . implode(',', $WHArr) . ')
+ ) and a5co='" . $cO . "' and a5whs in(" . implode(',', $wHArr) . ')
)
select substr(ayapr8N002,1,4) as years,count(*) as lines,sum(a5rsvqty) as reserveqty,sum(a5packed) as packed,sum(a5lnwght*a5packed/a5rsvqty) as weight,sum(dollars) as dollars,a5whs as whs from tempfile
group by substr(ayapr8N002,1,4),a5whs order by 1 ';
@@ -70,7 +71,7 @@ class execSummaryController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDate and ayapr8N002<=$toreportDate )
- ) and a5co='" . $CO . self::WAREHOUSE_IN_CLAUSE . implode(',', $WHArr) . ")
+ ) and a5co='" . $cO . self::WAREHOUSE_IN_CLAUSE . implode(',', $wHArr) . ")
)
select substr(ayapr8N002,3,2) ||'-' || 'Q' || EXTRACT(QUARTER FROM TO_DATE(CAST(ayapr8n002 AS TEXT),'YYYYMMDD')) as years,count(*) as lines,
sum(a5rsvqty) as reserveqty, sum(a5packed) as packed,sum (a5lnwght*a5packed/a5rsvqty) as weight,sum(dollars) as dollars, a5whs as whs
@@ -92,7 +93,7 @@ class execSummaryController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDate and ayapr8N002<=$toreportDate )
- ) and a5co='" . $CO . self::WAREHOUSE_IN_CLAUSE . implode(',', $WHArr) . ")
+ ) and a5co='" . $cO . self::WAREHOUSE_IN_CLAUSE . implode(',', $wHArr) . ")
)
select substr(ayapr8N002,1,4) || '-' || substr(ayapr8N002,5,2) as years,count(*) as lines,sum(a5rsvqty) as reserveqty,sum(a5packed) as packed,
sum(a5lnwght*a5packed/a5rsvqty) as weight,sum(dollars) as dollars, a5whs as whs
@@ -114,7 +115,7 @@ class execSummaryController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDate and ayapr8N002<=$toreportDate )
- ) and a5co='" . $CO . self::WAREHOUSE_IN_CLAUSE . implode(',', $WHArr) . ')
+ ) and a5co='" . $cO . self::WAREHOUSE_IN_CLAUSE . implode(',', $wHArr) . ')
)
select substr(ayapr8N002,7,2) as years,count(*) as lines,sum(a5rsvqty) as reserveqty,sum(a5packed) as packed,
sum(a5lnwght*a5packed/a5rsvqty) as weight, sum(dollars) as dollars, a5whs as whs
@@ -139,28 +140,28 @@ class execSummaryController extends Controller
}
// Init Page
- $SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
- if ($SHUSER != '') {
+ $sHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
+ if ($sHUSER != '') {
// Get User CO & WH from Table ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
- ->where('R428US', '=', $SHUSER)
+ ->where('R428US', '=', $sHUSER)
->first();
- $R428US = isset($ICM428M->R428US) ? $ICM428M->R428US : ''; // User
- $COMPANY = isset($ICM428M->R428CO) ? $ICM428M->R428CO : '110'; // Company
- $PLANT = isset($ICM428M->R428PL) ? $ICM428M->R428PL : '144'; // Plant
- $WHS = isset($ICM428M->R428WH) ? $ICM428M->R428WH : '322'; // WareHouse
+ $r428US = isset($iCM428M->R428US) ? $iCM428M->R428US : ''; // User
+ $cOMPANY = isset($iCM428M->R428CO) ? $iCM428M->R428CO : '110'; // Company
+ $pLANT = isset($iCM428M->R428PL) ? $iCM428M->R428PL : '144'; // Plant
+ $wHS = isset($iCM428M->R428WH) ? $iCM428M->R428WH : '322'; // WareHouse
}
- $WHDDA = $COMPANY . $PLANT . $WHS;
- // dump($WHDDA);
+ $wHDDA = $cOMPANY . $pLANT . $wHS;
+ // dump($wHDDA);
// Warehouse Table
- $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
+ $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
} catch (\Throwable $th) {
Log::error($th);
}
- return view('m3::liberty-theme.pages.execSummary', compact('IC670M', 'WHDDA'));
+ return view('m3::liberty-theme.pages.execSummary', ['IC670M' => $iC670M, 'WHDDA' => $wHDDA]);
// ,'ICM688M2',,'COMPANY','PLANT','WHS','reportDate'
}
}
diff --git a/Modules/M3/Http/Controllers/execSummaryLineController.php b/Modules/M3/Http/Controllers/execSummaryLineController.php
index a86c132c..02bafa0f 100644
--- a/Modules/M3/Http/Controllers/execSummaryLineController.php
+++ b/Modules/M3/Http/Controllers/execSummaryLineController.php
@@ -10,8 +10,11 @@ use Str;
class execSummaryLineController extends Controller
{
private const WAREHOUSE_IN_CLAUSE = "' and a5whs in (";
+
private const FIRST_DAY_THIS_MONTH = 'first day of this month';
+
private const LAST_DAY_THIS_MONTH = 'last day of this month';
+
private const ONE_YEAR_AGO = '-1 year';
public static function index(Request $request)
@@ -19,11 +22,11 @@ class execSummaryLineController extends Controller
try {
// Ajax Call
if ($request->ajax()) {
- $WHDDA = isset($request->WHDDA) ? $request->WHDDA : [];
- $WHArr = [];
- foreach ($WHDDA as $key => $WHDDAV) {
- $CO = substr($WHDDAV, 0, 3);
- $WHArr[] = substr($WHDDAV, 6, 3);
+ $wHDDA = isset($request->WHDDA) ? $request->WHDDA : [];
+ $wHArr = [];
+ foreach ($wHDDA as $key => $WHDDAV) {
+ $cO = substr($WHDDAV, 0, 3);
+ $wHArr[] = substr($WHDDAV, 6, 3);
}
$reportPeriod = isset($request->reportPeriod) ? $request->reportPeriod : ''; // monthly , quarter , year , daily
@@ -32,7 +35,7 @@ class execSummaryLineController extends Controller
$checkWeight = isset($request->checkWeight) ? $request->checkWeight : ''; // on
$checkLines = isset($request->checkLines) ? $request->checkLines : ''; // on
- if (count($WHArr) > 0 && $CO != '' && $reportPeriod != '') {
+ if (count($wHArr) > 0 && $cO != '' && $reportPeriod != '') {
switch ($reportPeriod) {
case 'year':
// Set Dates based on reportPeriod type
@@ -48,7 +51,7 @@ class execSummaryLineController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDate and ayapr8N002<=$toreportDate )
- ) and a5co='" . $CO . "' and a5whs in(" . implode(',', $WHArr) . ')
+ ) and a5co='" . $cO . "' and a5whs in(" . implode(',', $wHArr) . ')
)
select substr(ayapr8N002,1,4) as years,count(*) as lines,sum(a5rsvqty) as reserveqty,sum(a5packed) as packed,sum(a5lnwght*a5packed/a5rsvqty) as weight,sum(dollars) as dollars,a5whs as whs from tempfile
group by substr(ayapr8N002,1,4),a5whs order by 1 ';
@@ -69,7 +72,7 @@ class execSummaryLineController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDate and ayapr8N002<=$toreportDate )
- ) and a5co='" . $CO . self::WAREHOUSE_IN_CLAUSE . implode(',', $WHArr) . ")
+ ) and a5co='" . $cO . self::WAREHOUSE_IN_CLAUSE . implode(',', $wHArr) . ")
)
select 'Q' || EXTRACT(QUARTER FROM TO_DATE(CAST(ayapr8n002 AS TEXT),'YYYYMMDD')) ||'-' || substr(ayapr8N002,3,2) as years,count(*) as lines,
sum(a5rsvqty) as reserveqty, sum(a5packed) as packed,sum (a5lnwght*a5packed/a5rsvqty) as weight,sum(dollars) as dollars, a5whs as whs
@@ -98,7 +101,7 @@ class execSummaryLineController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDate and ayapr8N002<=$toreportDate )
- ) and a5co='" . $CO . self::WAREHOUSE_IN_CLAUSE . implode(',', $WHArr) . ")
+ ) and a5co='" . $cO . self::WAREHOUSE_IN_CLAUSE . implode(',', $wHArr) . ")
)
select substr(ayapr8N002,1,4) || '-' || substr(ayapr8N002,5,2) as years,count(*) as lines,sum(a5rsvqty) as reserveqty,sum(a5packed) as packed,
sum(a5lnwght*a5packed/a5rsvqty) as weight,sum(dollars) as dollars, a5whs as whs
@@ -110,7 +113,7 @@ class execSummaryLineController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDateLY and ayapr8N002<=$toreportDateLY )
- ) and a5co='" . $CO . self::WAREHOUSE_IN_CLAUSE . implode(',', $WHArr) . ")
+ ) and a5co='" . $cO . self::WAREHOUSE_IN_CLAUSE . implode(',', $wHArr) . ")
)
select substr(ayapr8N002,1,4) || '-' || substr(ayapr8N002,5,2) as years,count(*) as lines,sum(a5rsvqty) as reserveqty,sum(a5packed) as packed,
sum(a5lnwght*a5packed/a5rsvqty) as weight,sum(dollars) as dollars, a5whs as whs
@@ -137,7 +140,7 @@ class execSummaryLineController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDate and ayapr8N002<=$toreportDate )
- ) and a5co='" . $CO . self::WAREHOUSE_IN_CLAUSE . implode(',', $WHArr) . ')
+ ) and a5co='" . $cO . self::WAREHOUSE_IN_CLAUSE . implode(',', $wHArr) . ')
)
select substr(ayapr8N002,7,2) as years,count(*) as lines,sum(a5rsvqty) as reserveqty,sum(a5packed) as packed,
sum(a5lnwght*a5packed/a5rsvqty) as weight, sum(dollars) as dollars, a5whs as whs
@@ -149,7 +152,7 @@ class execSummaryLineController extends Controller
(select max(ayapr8N002) as ayapr8N002 from icm695m1 where a5macpkr=aymacpkr fetch first 1 rows only)
from icm688m2 where a5macpkr in (
select distinct aymacpkr from icm695m1 where (AYSTATUS in ('Z','z') and ayapr8N002>=$reportDateLY and ayapr8N002<=$toreportDateLY )
- ) and a5co='" . $CO . self::WAREHOUSE_IN_CLAUSE . implode(',', $WHArr) . ')
+ ) and a5co='" . $cO . self::WAREHOUSE_IN_CLAUSE . implode(',', $wHArr) . ')
)
select substr(ayapr8N002,7,2) as years,count(*) as lines,sum(a5rsvqty) as reserveqty,sum(a5packed) as packed,
sum(a5lnwght*a5packed/a5rsvqty) as weight, sum(dollars) as dollars, a5whs as whs
@@ -175,28 +178,28 @@ class execSummaryLineController extends Controller
}
// Init Page
- $SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
- if ($SHUSER != '') {
+ $sHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
+ if ($sHUSER != '') {
// Get User CO & WH from Table ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
- ->where('R428US', '=', $SHUSER)
+ ->where('R428US', '=', $sHUSER)
->first();
- $R428US = isset($ICM428M->R428US) ? $ICM428M->R428US : ''; // User
- $COMPANY = isset($ICM428M->R428CO) ? $ICM428M->R428CO : '110'; // Company
- $PLANT = isset($ICM428M->R428PL) ? $ICM428M->R428PL : '144'; // Plant
- $WHS = isset($ICM428M->R428WH) ? $ICM428M->R428WH : '322'; // WareHouse
+ $r428US = isset($iCM428M->R428US) ? $iCM428M->R428US : ''; // User
+ $cOMPANY = isset($iCM428M->R428CO) ? $iCM428M->R428CO : '110'; // Company
+ $pLANT = isset($iCM428M->R428PL) ? $iCM428M->R428PL : '144'; // Plant
+ $wHS = isset($iCM428M->R428WH) ? $iCM428M->R428WH : '322'; // WareHouse
}
- $WHDDA = $COMPANY . $PLANT . $WHS;
- // dump($WHDDA);
+ $wHDDA = $cOMPANY . $pLANT . $wHS;
+ // dump($wHDDA);
// Warehouse Table
- $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
+ $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
} catch (\Throwable $th) {
Log::error($th);
}
- return view('m3::liberty-theme.pages.execSummaryLine', compact('IC670M', 'WHDDA'));
+ return view('m3::liberty-theme.pages.execSummaryLine', ['IC670M' => $iC670M, 'WHDDA' => $wHDDA]);
// ,'ICM688M2',,'COMPANY','PLANT','WHS','reportDate'
}
}
diff --git a/Modules/M3/Http/Controllers/fillBOL2Controller.php b/Modules/M3/Http/Controllers/fillBOL2Controller.php
index e6e0f242..3ac9c7b1 100644
--- a/Modules/M3/Http/Controllers/fillBOL2Controller.php
+++ b/Modules/M3/Http/Controllers/fillBOL2Controller.php
@@ -24,8 +24,8 @@ class fillBOL2Controller extends Controller
public function fillBOL(Request $request)
{
- // # $BOL = BOL::findOrFail($request);
- $BOL = $request;
+ // # $bOL = BOL::findOrFail($request);
+ $bOL = $request;
$data = [
'bol_number' => $request->input('BOL_number') ?? '1234567890',
@@ -58,8 +58,8 @@ Line 4
Line 5',
'DTESHIPED.1' => date('d/m/Y'),
- 'invoice_number' => $BOL['BOL_number'],
- 'amount_due' => number_format($BOL['amount'], 2),
+ 'invoice_number' => $bOL['BOL_number'],
+ 'amount_due' => number_format($bOL['amount'], 2),
'TYPEANDESCPTN.1' => 'TOTAL: 20 SKIDS 8320 #',
'TYPEANDESCPTN.10' => 'ROTTERDAM ETA: 11/22',
'TYPEANDESCPTN.13' => 'CONTAINER:',
@@ -69,7 +69,7 @@ Line 5',
'TYPEANDESCPTN.6' => 'VESSEL: INDEPENDENT HORIZON V. 1023E',
'TYPEANDESCPTN.7' => 'SEAL: 637053',
'TYPEANDESCPTN.9' => 'CHESTER, PA ETD: 11/05',
- 'BOFLADNGAGYCD' => $BOL['BOL_number'],
+ 'BOFLADNGAGYCD' => $bOL['BOL_number'],
'CLASSORATE1' => '50',
'CNMETRKLICNSE' => 'ICL / Expeditors',
'CONSIGTONMADDR' => 'ERICO EUROPE BV JULES VERNEWEG 75 TILBURG . 5015 BG',
diff --git a/Modules/M3/Http/Controllers/fillBOLController.php b/Modules/M3/Http/Controllers/fillBOLController.php
index b89f281f..cba7bbbc 100644
--- a/Modules/M3/Http/Controllers/fillBOLController.php
+++ b/Modules/M3/Http/Controllers/fillBOLController.php
@@ -6,7 +6,6 @@ use Illuminate\Http\Request;
use mikehaertl\pdftk\Pdf;
use Storage;
-
class fillBOLController extends Controller
{
public static function index(Request $request)
@@ -18,8 +17,8 @@ class fillBOLController extends Controller
public static function fillBOL(Request $request)
{
- // # $BOL = BOL::findOrFail($request);
- $BOL = $request;
+ // # $bOL = BOL::findOrFail($request);
+ $bOL = $request;
$pdf = new Pdf(Storage::disk('public')->path('ETN-BOL.pdf'));
// $pdf = new Pdf(Storage::disk('public')->path('ETN-BOL.pdf'), [
@@ -34,7 +33,7 @@ class fillBOLController extends Controller
// dd($test);
- $newfile = "BOL-{$BOL['BOL_number']}.pdf";
+ $newfile = "BOL-{$bOL['BOL_number']}.pdf";
var_dump($newfile);
$test = Storage::disk('public')->put($newfile, '');
@@ -48,8 +47,8 @@ class fillBOLController extends Controller
$result = $pdf->fillForm([
'DTESHIPED.1' => date('d/m/Y'),
- 'invoice_number' => $BOL['BOL_number'],
- 'amount_due' => number_format($BOL['amount'], 2),
+ 'invoice_number' => $bOL['BOL_number'],
+ 'amount_due' => number_format($bOL['amount'], 2),
'TYPEANDESCPTN.1' => 'TOTAL: 20 SKIDS 8320 #',
'TYPEANDESCPTN.10' => 'ROTTERDAM ETA: 11/22',
'TYPEANDESCPTN.13' => 'CONTAINER:',
@@ -59,7 +58,7 @@ class fillBOLController extends Controller
'TYPEANDESCPTN.6' => 'VESSEL: INDEPENDENT HORIZON V. 1023E',
'TYPEANDESCPTN.7' => 'SEAL: 637053',
'TYPEANDESCPTN.9' => 'CHESTER, PA ETD: 11/05',
- 'BOFLADNGAGYCD' => $BOL['BOL_number'],
+ 'BOFLADNGAGYCD' => $bOL['BOL_number'],
'CLASSORATE1' => '50',
'CNMETRKLICNSE' => 'ICL / Expeditors',
'CONSIGTONMADDR' => 'ERICO EUROPE BV JULES VERNEWEG 75 TILBURG . 5015 BG',
diff --git a/Modules/M3/Http/Controllers/palletQtyController.php b/Modules/M3/Http/Controllers/palletQtyController.php
index 85342f0c..e031330e 100644
--- a/Modules/M3/Http/Controllers/palletQtyController.php
+++ b/Modules/M3/Http/Controllers/palletQtyController.php
@@ -22,12 +22,12 @@ class palletQtyController extends Controller
$co = $power_user->R428CO;
$plant = $power_user->R428PL;
$whs = $power_user->R428WH;
- $ICM709M = Schema::connection($connection)->hasTable('icm709m')
+ $iCM709M = Schema::connection($connection)->hasTable('icm709m')
? DB::connection($connection)->table('icm709m')->where('AT9CO', $co)->where('AT9PLT', $plant)->where('AT9WHS', $whs)->get() : collect();
- $IC670M = Schema::connection($connection)->hasTable('ic670m')
+ $iC670M = Schema::connection($connection)->hasTable('ic670m')
? DB::connection($connection)->table('ic670m')->where('WDCO', $co)->where('WDPL', $plant)->where('WDWHS', $whs)->get() : collect();
- return view('m3::liberty-theme.pages.palletQty', compact('ICM709M', 'IC670M', 'power_user'));
+ return view('m3::liberty-theme.pages.palletQty', ['ICM709M' => $iCM709M, 'IC670M' => $iC670M, 'power_user' => $power_user]);
}
//
diff --git a/Modules/M3/Http/Controllers/pendingClosureController.php b/Modules/M3/Http/Controllers/pendingClosureController.php
index 23d68ae7..239e213f 100644
--- a/Modules/M3/Http/Controllers/pendingClosureController.php
+++ b/Modules/M3/Http/Controllers/pendingClosureController.php
@@ -13,14 +13,14 @@ class pendingClosureController extends Controller
{
// Get Users from ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
->where('R428US', '=', strtoupper(m3_user()))
->first();
- $user = $ICM428M->R428US;
- $co = $ICM428M->R428CO;
- $whs = $ICM428M->R428WH;
- $plant = $ICM428M->R428PL;
+ $user = $iCM428M->R428US;
+ $co = $iCM428M->R428CO;
+ $whs = $iCM428M->R428WH;
+ $plant = $iCM428M->R428PL;
// ICM705M1 Statement
$sqlstmt = "select APMANIFEST,APDOCKDOOR,APCARRIER,APTRUCKIDT,APSPARE1,APLDSTRU,APLDSTRD,APLDSTRT,
@@ -28,40 +28,40 @@ class pendingClosureController extends Controller
from ICM705M1
where APSPARE2 in ('','P') and APCO='$co' and APWHS='$whs' and APPLT='$plant'";
- $ICM705M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
+ $iCM705M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
- $ICM698Ma = [];
- $ICM699Ma = [];
- foreach ($ICM705M1 as $key => $val) {
+ $iCM698Ma = [];
+ $iCM699Ma = [];
+ foreach ($iCM705M1 as $key => $val) {
$sqlstmt1 = "select LGUSER,LGCONFDT,LGCONFTM
from ICM698M
where LGCO='$val->APCO' and LGWHS='$val->APWHS'and LGURL='op605api.php'
and LGRESPONSE like 'Close of Sentinel Manifest%'
and LGRESPONSE like '%' || right('000000000' || '$val->APMANIFEST',9) || '%'";
- $ICM698M = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt1);
- $ICM698Ma[$val->APMANIFEST]['TMSUSER'] = '';
- $ICM698Ma[$val->APMANIFEST]['TMSDATE'] = '';
- $ICM698Ma[$val->APMANIFEST]['TMSTIME'] = '';
- foreach ($ICM698M as $key2 => $val2) {
- $ICM698Ma[$val->APMANIFEST]['TMSUSER'] = $val2->LGUSER;
- $ICM698Ma[$val->APMANIFEST]['TMSDATE'] = $val2->LGCONFDT;
- $ICM698Ma[$val->APMANIFEST]['TMSTIME'] = $val2->LGCONFTM;
+ $iCM698M = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt1);
+ $iCM698Ma[$val->APMANIFEST]['TMSUSER'] = '';
+ $iCM698Ma[$val->APMANIFEST]['TMSDATE'] = '';
+ $iCM698Ma[$val->APMANIFEST]['TMSTIME'] = '';
+ foreach ($iCM698M as $key2 => $val2) {
+ $iCM698Ma[$val->APMANIFEST]['TMSUSER'] = $val2->LGUSER;
+ $iCM698Ma[$val->APMANIFEST]['TMSDATE'] = $val2->LGCONFDT;
+ $iCM698Ma[$val->APMANIFEST]['TMSTIME'] = $val2->LGCONFTM;
}
- $ICM699MSel1 = "select SHMACPKR,SHDT,SHTIME from ICM699M
+ $iCM699MSel1 = "select SHMACPKR,SHDT,SHTIME from ICM699M
WHERE SHMACPKR='$val->APMANIFEST' AND SHCO='$co' AND SHWHS='$whs'
AND SHSOURCE='CloseShipmentCoChargeAPI' AND SHERROR='' AND SHTYPE='M3-Req-out' limit 1";
- $ICM699MSel = DB::connection(config('m3.connection', 'pgsql'))->select($ICM699MSel1);
- foreach ($ICM699MSel as $key2 => $val2) {
- $ICM699Ma[$val2->SHMACPKR]['SHDT'] = $val2->SHDT;
- $ICM699Ma[$val2->SHMACPKR]['SHTIME'] = $val2->SHTIME;
+ $iCM699MSel = DB::connection(config('m3.connection', 'pgsql'))->select($iCM699MSel1);
+ foreach ($iCM699MSel as $key2 => $val2) {
+ $iCM699Ma[$val2->SHMACPKR]['SHDT'] = $val2->SHDT;
+ $iCM699Ma[$val2->SHMACPKR]['SHTIME'] = $val2->SHTIME;
}
}
$sqlstmt = "select count(*) as COUNT1 from ICM699M
where SHCO='$co' and SHWHS='$whs' and SHTYPE like '%M3%' and SHERROR='X'
and SHSOURCE='CloseShipmentCoChargeAPI'";
- $ICM699M = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
+ $iCM699M = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
// Get Unprocessed Orders
$unprocessedArr = [];
@@ -72,15 +72,15 @@ class pendingClosureController extends Controller
SELECT APMANIFEST,APSPARE2 FROM ICM705M1 WHERE APMANIFEST IN (SELECT DISTINCT MF FROM TEMPFILE) AND APSPARE2='X' AND APWHS='$whs' ";
// AND APSPARE2!=''
// dump($sqlstmt3);
- $UproccessedOrders = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt3);
- foreach ($UproccessedOrders as $key => $UproccessedOrder) {
+ $uproccessedOrders = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt3);
+ foreach ($uproccessedOrders as $key => $UproccessedOrder) {
$unprocessedArr[] = ' ' .
trim($UproccessedOrder->APMANIFEST) . '';
}
return view(
'm3::liberty-theme.pages.pendingClosure',
- compact('ICM705M1', 'ICM698Ma', 'ICM699M', 'user', 'request', 'unprocessedArr', 'ICM699Ma'),
+ ['ICM705M1' => $iCM705M1, 'ICM698Ma' => $iCM698Ma, 'ICM699M' => $iCM699M, 'user' => $user, 'request' => $request, 'unprocessedArr' => $unprocessedArr, 'ICM699Ma' => $iCM699Ma],
);
}
@@ -90,16 +90,16 @@ class pendingClosureController extends Controller
// Get URL PARAMS
$urlParams = count($request->all()) > 0 ? $request->all() : '';
// $SHUSER = isset($urlParams["SHUSER"]) ? $urlParams["SHUSER"] : '';
- $MANIFEST = isset($urlParams['MANIFEST']) ? $urlParams['MANIFEST'] : '';
- $APCO = isset($urlParams['APCO']) ? $urlParams['APCO'] : '';
- $APWHS = isset($urlParams['APWHS']) ? $urlParams['APWHS'] : '';
+ $mANIFEST = isset($urlParams['MANIFEST']) ? $urlParams['MANIFEST'] : '';
+ $aPCO = isset($urlParams['APCO']) ? $urlParams['APCO'] : '';
+ $aPWHS = isset($urlParams['APWHS']) ? $urlParams['APWHS'] : '';
try {
DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
- ->where('APCO', $APCO)
- ->where('APWHS', $APWHS)
- ->where('APMANIFEST', '=', $MANIFEST)
+ ->where('APCO', $aPCO)
+ ->where('APWHS', $aPWHS)
+ ->where('APMANIFEST', '=', $mANIFEST)
->update(['APSPARE2' => '']);
return response()->json([
diff --git a/Modules/M3/Http/Controllers/sentinelController.php b/Modules/M3/Http/Controllers/sentinelController.php
index b58888d9..60681673 100644
--- a/Modules/M3/Http/Controllers/sentinelController.php
+++ b/Modules/M3/Http/Controllers/sentinelController.php
@@ -10,22 +10,22 @@ class sentinelController extends Controller
public static function packSyst5Func(Request $request)
{
- $AYINTBOX = isset($request->AYINTBOX) ? trim($request->AYINTBOX) : '';
- $AYCO = isset($request->AYCO) ? trim($request->AYCO) : '';
- $AYWHS = isset($request->AYWHS) ? trim($request->AYWHS) : '';
- $AYUSER = isset($request->AYUSER) ? trim($request->AYUSER) : '';
+ $aYINTBOX = isset($request->AYINTBOX) ? trim($request->AYINTBOX) : '';
+ $aYCO = isset($request->AYCO) ? trim($request->AYCO) : '';
+ $aYWHS = isset($request->AYWHS) ? trim($request->AYWHS) : '';
+ $aYUSER = isset($request->AYUSER) ? trim($request->AYUSER) : '';
- if ($AYINTBOX != '') {
+ if ($aYINTBOX != '') {
// Get the record from ICM695M1
- $ICM695M1Sel = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
+ $iCM695M1Sel = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
->select()
- ->where('AYINTBOX', $AYINTBOX)
- ->where('AYCO', $AYCO)
- ->where('AYWHS', $AYWHS)
+ ->where('AYINTBOX', $aYINTBOX)
+ ->where('AYCO', $aYCO)
+ ->where('AYWHS', $aYWHS)
->where('AYSTATUS', '')
->first();
- $allowDeletion = isset($ICM695M1Sel->AYSENTPKR) ? ($ICM695M1Sel->AYSENTPKR != '' ? true : false) : false;
+ $allowDeletion = isset($iCM695M1Sel->AYSENTPKR) ? ($iCM695M1Sel->AYSENTPKR != '' ? true : false) : false;
if ($allowDeletion) {
$timestamp = date('Y-m-d H:i:s.u');
@@ -33,25 +33,25 @@ class sentinelController extends Controller
$time1 = date('His');
// Delete Records from ICM695M1 And ICM695M2
- $ICM695M1Del = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
- ->where('AYINTBOX', $AYINTBOX)
- ->where('AYCO', $AYCO)
- ->where('AYWHS', $AYWHS)
+ $iCM695M1Del = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m1')
+ ->where('AYINTBOX', $aYINTBOX)
+ ->where('AYCO', $aYCO)
+ ->where('AYWHS', $aYWHS)
->delete();
- $ICM695M2Del = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m2')
- ->where('AZINTBOX', $AYINTBOX)
- ->where('AZCO', $AYCO)
- ->where('AZWHS', $AYWHS)
+ $iCM695M2Del = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m2')
+ ->where('AZINTBOX', $aYINTBOX)
+ ->where('AZCO', $aYCO)
+ ->where('AZWHS', $aYWHS)
->delete();
// Log the event as an unusual transaction to appear on SPD bottom right:
- $InsertValues = "'$ICM695M1Sel->AYCO', '$ICM695M1Sel->AYWHS', '$ICM695M1Sel->AYSENTPKR', '$ICM695M1Sel->AYMACPKR', '$ICM695M1Sel->AYONO', '$ICM695M1Sel->AYRLNO', '$ICM695M1Sel->AYSHNO', '', 'Box $AYINTBOX emptied and repacked',
- '$timestamp', '$date1', '$time1', '$AYUSER','$timestamp', '$date1', '$time1', '$AYUSER','$AYINTBOX'";
+ $insertValues = "'$iCM695M1Sel->AYCO', '$iCM695M1Sel->AYWHS', '$iCM695M1Sel->AYSENTPKR', '$iCM695M1Sel->AYMACPKR', '$iCM695M1Sel->AYONO', '$iCM695M1Sel->AYRLNO', '$iCM695M1Sel->AYSHNO', '', 'Box $aYINTBOX emptied and repacked',
+ '$timestamp', '$date1', '$time1', '$aYUSER','$timestamp', '$date1', '$time1', '$aYUSER','$aYINTBOX'";
- $ICM689MInsert = DB::connection(config('m3.connection', 'pgsql'))->insert("INSERT INTO ICM689M
+ $iCM689MInsert = DB::connection(config('m3.connection', 'pgsql'))->insert("INSERT INTO ICM689M
(A7CO, A7WHS, A7SENTPKR, A7MACPKR, A7ONO, A7RLNO, A7SHNO, A7SOURCE, A7ERRMSG, A7DISRAITS, A7DISRAID, A7DISRAIT, A7DISRAIU, A7DISRESTS ,A7DISRESD ,A7DISREST ,A7DISRESU , A7SPR15A01)
- values ($InsertValues)");
+ values ($insertValues)");
return response()->json(['success' => true, 'message' => 'Line Deleted']);
} else {
diff --git a/Modules/M3/Http/Controllers/userControlController.php b/Modules/M3/Http/Controllers/userControlController.php
index 58fffeaa..d787787c 100644
--- a/Modules/M3/Http/Controllers/userControlController.php
+++ b/Modules/M3/Http/Controllers/userControlController.php
@@ -12,9 +12,13 @@ use Modules\M3\Services\PostgresProgramBridge;
class userControlController extends Controller
{
private const AUTH_FAILURE_MESSAGE = 'Could not connect due to wrong user or password.';
+
private const DATABASE_NOT_FOUND_MESSAGE = 'Database not found. Try WRKRDBDIRE to check.';
+
private const CONNECTION_ERROR_PREFIX = 'Could not connect. Error: ';
+
private const PROGRAM_ERROR_PREFIX = 'Error calling program. Code: ';
+
private const MESSAGE_SEPARATOR = ' Msg: ';
public static function index(Request $request)
@@ -26,15 +30,15 @@ class userControlController extends Controller
}
$co = $profile->R428CO ?? '';
$whs = $profile->R428WH ?? '';
- $ICM428M = Schema::connection($connection)->hasTable('icm428m')
+ $iCM428M = Schema::connection($connection)->hasTable('icm428m')
? DB::connection($connection)->table('icm428m')->where('R428CO', $co)->where('R428WH', $whs)->get() : collect();
- $USER_INFO = Schema::connection($connection)->hasTable('icm428m')
+ $uSER_INFO = Schema::connection($connection)->hasTable('icm428m')
? DB::connection($connection)->table('icm428m')->selectRaw('R428US as USERPRF, R428STS as STATUS, NULL as DATE_EXPIRED, NULL as EXPIRED')->get()->all() : [];
$power_user = [(object) ['R428PWRUSR' => $profile->R428PWRUSR ?? 'N', 'R428CO' => $co, 'R428PL' => $profile->R428PL ?? '', 'R428WH' => $whs]];
- $IC670M = Schema::connection($connection)->hasTable('ic670m')
+ $iC670M = Schema::connection($connection)->hasTable('ic670m')
? DB::connection($connection)->table('ic670m')->get() : collect();
- return view('m3::liberty-theme.pages.userControl', compact('ICM428M', 'IC670M', 'power_user', 'USER_INFO'));
+ return view('m3::liberty-theme.pages.userControl', ['ICM428M' => $iCM428M, 'IC670M' => $iC670M, 'power_user' => $power_user, 'USER_INFO' => $uSER_INFO]);
}
//
@@ -97,7 +101,7 @@ class userControlController extends Controller
// # $result = $conn->PgmCall(Config::get('eproconf.misc.PGM1'), Config::get('eproconf.misc.libname4'), $params, array(), array());
$result = $conn->PgmCall('ICMUSRPRF', 'EWOBJ', $params, [], []);
if (! $result) {
- $PGMERRORS = self::PROGRAM_ERROR_PREFIX . $conn->getErrorCode() . self::MESSAGE_SEPARATOR . $conn->getErrorMsg();
+ $pGMERRORS = self::PROGRAM_ERROR_PREFIX . $conn->getErrorCode() . self::MESSAGE_SEPARATOR . $conn->getErrorMsg();
return 'error profile2';
} else {
@@ -145,17 +149,17 @@ class userControlController extends Controller
// Update record to ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->select("select * from ICM428M where R428US='$request->R428US'");
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->select("select * from ICM428M where R428US='$request->R428US'");
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM428M
set R428CO='$request->R428CO', R428PL='$request->R428PL', R428WH='$request->R428WH', R428STS='$request->R428STS', R428FIRST='$request->R428FIRST',
R428FAMILY='$request->R428FAMILY', R428EMAIL='$request->R428EMAIL', R428EMPCDE=$request->R428EMPCDE, R428ADMUSR='$request->R428ADMUSR',
R428PWRUSR='$request->R428PWRUSR',
- MENU2OPT='" . substr($ICM428M[0]->MENU2OPT, 0, 2) . $request->MENU2OPT3 . substr($ICM428M[0]->MENU2OPT, 3, 3) . $request->MENU2OPT7 . $request->MENU2OPT8 . "',
- MENU3OPT='" . $request->MENU3OPT1 . $request->MENU3OPT2 . substr($ICM428M[0]->MENU3OPT, 2, -1) . "',
- MENU4OPT='" . $request->MENU4OPT1 . $request->MENU4OPT2 . $request->MENU4OPT3 . substr($ICM428M[0]->MENU4OPT, 3, -1) . "',
- MENU5OPT='" . $request->MENU5OPT1 . $request->MENU5OPT2 . $request->MENU5OPT3 . substr($ICM428M[0]->MENU5OPT, 3, 1) . $request->MENU5OPT5 . substr($ICM428M[0]->MENU5OPT, 5, -1) . "',
- MENU6OPT='" . $request->MENU6OPT1 . $request->MENU6OPT2 . $request->MENU6OPT3 . substr($ICM428M[0]->MENU6OPT, 3, -1) . "',
+ MENU2OPT='" . substr($iCM428M[0]->MENU2OPT, 0, 2) . $request->MENU2OPT3 . substr($iCM428M[0]->MENU2OPT, 3, 3) . $request->MENU2OPT7 . $request->MENU2OPT8 . "',
+ MENU3OPT='" . $request->MENU3OPT1 . $request->MENU3OPT2 . substr($iCM428M[0]->MENU3OPT, 2, -1) . "',
+ MENU4OPT='" . $request->MENU4OPT1 . $request->MENU4OPT2 . $request->MENU4OPT3 . substr($iCM428M[0]->MENU4OPT, 3, -1) . "',
+ MENU5OPT='" . $request->MENU5OPT1 . $request->MENU5OPT2 . $request->MENU5OPT3 . substr($iCM428M[0]->MENU5OPT, 3, 1) . $request->MENU5OPT5 . substr($iCM428M[0]->MENU5OPT, 5, -1) . "',
+ MENU6OPT='" . $request->MENU6OPT1 . $request->MENU6OPT2 . $request->MENU6OPT3 . substr($iCM428M[0]->MENU6OPT, 3, -1) . "',
R42811A='" . $request->R42811A . "',R42821A='" . $request->R42821A . "'
where R428US='$request->R428US'");
@@ -167,7 +171,7 @@ class userControlController extends Controller
public static function callCL(Request $request)
{
- $PGMERRORS = '';
+ $pGMERRORS = '';
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
try {
@@ -182,18 +186,17 @@ class userControlController extends Controller
case 8001:
// "Authorization failure on distributed database connection attempt"
// Usually means a wrong DB2 user or password
- $PGMERRORS = self::AUTH_FAILURE_MESSAGE;
+ $pGMERRORS = self::AUTH_FAILURE_MESSAGE;
break;
case 42705:
- $PGMERRORS = self::DATABASE_NOT_FOUND_MESSAGE;
+ $pGMERRORS = self::DATABASE_NOT_FOUND_MESSAGE;
break;
default:
- $PGMERRORS = self::CONNECTION_ERROR_PREFIX . $code . ' ' . $msg;
+ $pGMERRORS = self::CONNECTION_ERROR_PREFIX . $code . ' ' . $msg;
break;
}
}
-
// Add LIB
// $result = $conn->CLCommand('ADDLIBLE LIB(MPDAT10)');
@@ -209,18 +212,16 @@ class userControlController extends Controller
// Add Delivery Note Param
// $params[] = $conn->AddParameterPackDec('in', 11, 0, 'ParamIn','','00000087125');
-
// Start Time Tracking
// $start = microtime(true);
-
// Config::get('eproconf.misc.PGM1'), Config::get('eproconf.misc.libname4')
// ICM700C EWOBJTST ICM700C ICM700CSBM
$result = $conn->PgmCall('ICMCHGPRF', 'EWOBJ', $params, [], []);
if (! $result) {
- $PGMERRORS = self::PROGRAM_ERROR_PREFIX . $conn->getErrorCode() . self::MESSAGE_SEPARATOR . $conn->getErrorMsg();
- echo "";
+ $pGMERRORS = self::PROGRAM_ERROR_PREFIX . $conn->getErrorCode() . self::MESSAGE_SEPARATOR . $conn->getErrorMsg();
+ echo "";
return 'error';
exit();
@@ -238,9 +239,9 @@ class userControlController extends Controller
echo "";
}
- // if ($PGMERRORS!="") {
- // // return back()->withMessage('Can not Create PR: '.$PGMERRORS);
- // dump($PGMERRORS);
+ // if ($pGMERRORS!="") {
+ // // return back()->withMessage('Can not Create PR: '.$pGMERRORS);
+ // dump($pGMERRORS);
// }
// else{
// // return $AWREQN;
@@ -255,7 +256,7 @@ class userControlController extends Controller
ini_set('max_input_time', Config::get('arrays.PHPTimeOut'));
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
- $PGMERRORS = '';
+ $pGMERRORS = '';
// echo "request="; var_dump($request);
@@ -276,13 +277,13 @@ class userControlController extends Controller
case 8001:
// "Authorization failure on distributed database connection attempt"
// Usually means a wrong DB2 user or password
- $PGMERRORS = self::AUTH_FAILURE_MESSAGE;
+ $pGMERRORS = self::AUTH_FAILURE_MESSAGE;
break;
case 42705:
- $PGMERRORS = self::DATABASE_NOT_FOUND_MESSAGE;
+ $pGMERRORS = self::DATABASE_NOT_FOUND_MESSAGE;
break;
default:
- $PGMERRORS = self::CONNECTION_ERROR_PREFIX . $code . ' ' . $msg;
+ $pGMERRORS = self::CONNECTION_ERROR_PREFIX . $code . ' ' . $msg;
break;
}
}
@@ -296,9 +297,9 @@ class userControlController extends Controller
// echo "";
if (! $result) {
- $PGMERRORS = self::PROGRAM_ERROR_PREFIX . $conn->getErrorCode() . self::MESSAGE_SEPARATOR . $conn->getErrorMsg();
- dump($PGMERRORS);
- echo "";
+ $pGMERRORS = self::PROGRAM_ERROR_PREFIX . $conn->getErrorCode() . self::MESSAGE_SEPARATOR . $conn->getErrorMsg();
+ dump($pGMERRORS);
+ echo "";
return 'error pwd';
}
@@ -308,6 +309,7 @@ class userControlController extends Controller
}
}
+
private static function programBridgeConnectionError(\Throwable $exception): string
{
$code = (int) $exception->getCode();
@@ -318,5 +320,4 @@ class userControlController extends Controller
default => 'error profile5',
};
}
-
}
diff --git a/Modules/M3/Http/Controllers/userPickingStats4.php b/Modules/M3/Http/Controllers/userPickingStats4.php
index 530c1343..60c0b752 100644
--- a/Modules/M3/Http/Controllers/userPickingStats4.php
+++ b/Modules/M3/Http/Controllers/userPickingStats4.php
@@ -34,7 +34,7 @@ class userPickingStats4 extends Controller
// Get Users from ICM428M
$co = '';
$whs = '';
- $ICM428M = [];
+ $iCM428M = [];
$schema = Schema::connection(config('m3.connection', 'pgsql'));
if ($schema->hasTable('icm428m')) {
$profile = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
@@ -44,7 +44,7 @@ class userPickingStats4 extends Controller
$co = $profile->R428CO ?? '';
$whs = $profile->R428WH ?? '';
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->selectRaw("R428US as userprf, (trim(R428FIRST) || ' ' || trim(R428FAMILY)) as name, R428EMPCDE as empno")
->where('R428STS', 'A')->where('R428EMPCDE', '!=', 0)
->where('R428CO', $co)->where('R428WH', $whs)->get()->all();
@@ -53,7 +53,7 @@ class userPickingStats4 extends Controller
$user_array = [];
// while($row = odbc_fetch_object($result)) {
$x = 0;
- foreach ($ICM428M as $key => $row) {
+ foreach ($iCM428M as $key => $row) {
$user_array[$x]['userprf'] = trim($row->USERPRF);
$user_array[$x]['name'] = trim($row->NAME);
$user_array[$x]['empno'] = $row->EMPNO;
@@ -92,7 +92,6 @@ class userPickingStats4 extends Controller
and oppno in ($payrollCodes)
group by oppno";
-
$lbpf1 = $schema->hasTable('lbpf')
? DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt)
: [];
@@ -110,8 +109,6 @@ class userPickingStats4 extends Controller
$statistic4 = [];
}
-
-
// initialize arrays
$monitor_array = $totals_array = $perf_array = [];
$totals_array['value'] = 0;
@@ -121,7 +118,6 @@ class userPickingStats4 extends Controller
$totals_array['entries'] = 0;
$diff = 0;
-
foreach ($lbpf1 as $key => $val) {
$monitor_array[$val->OPPNO]['tot_hours'] = $val->HRS;
// Initialize these variables in case not existant in statistic4
@@ -294,7 +290,6 @@ class userPickingStats4 extends Controller
$no_data = 'Y';
}
-
return view(
'm3::liberty-theme.pages.userPickingStats4',
compact('statistic4', 'starting', 'user', 'user_array', 'monitor_array', 'totals_array', 'perf_array', 'request', 'no_data'),
diff --git a/Modules/M3/Http/Controllers/userPickingStats5.php b/Modules/M3/Http/Controllers/userPickingStats5.php
index 347ea7b7..81a36086 100644
--- a/Modules/M3/Http/Controllers/userPickingStats5.php
+++ b/Modules/M3/Http/Controllers/userPickingStats5.php
@@ -32,7 +32,13 @@ class userPickingStats5 extends Controller
$user_array = $userArray;
return view('m3::liberty-theme.pages.userPickingStats5', compact(
- 'statistic5', 'totals_array', 'user_array', 'user', 'starting', 'ending', 'request'
+ 'statistic5',
+ 'totals_array',
+ 'user_array',
+ 'user',
+ 'starting',
+ 'ending',
+ 'request',
));
}
@@ -84,6 +90,7 @@ class userPickingStats5 extends Controller
}
$days = (int) (new DateTime($starting))->diff(new DateTime($ending))->format('%a');
+
return [$starting, $ending, $days];
}
@@ -96,7 +103,7 @@ class userPickingStats5 extends Controller
{
$statistics = [];
$count = 0;
- $url = 'http://' . $request->server('HTTP_HOST') . '/userPickingStats4';
+ $url = $request->getSchemeAndHttpHost() . '/userPickingStats4';
for ($day = 0; $day <= $days; $day++) {
$date = date('Y-m-d', strtotime($starting . "+$day days"));
@@ -128,6 +135,7 @@ class userPickingStats5 extends Controller
}
$data['day'] = $data['day'] ?? $date;
$data['performance'] = $data['performance'] ?? 0;
+
return $data;
}
diff --git a/Modules/M3/Http/Controllers/userProfileController.php b/Modules/M3/Http/Controllers/userProfileController.php
index 01cd059a..6dd873ad 100644
--- a/Modules/M3/Http/Controllers/userProfileController.php
+++ b/Modules/M3/Http/Controllers/userProfileController.php
@@ -14,17 +14,17 @@ class userProfileController extends Controller
// Get Current USER
$loggedUser = strtoupper(m3_user());
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL', 'R428FIRST', 'R428FAMILY')
->where('R428US', '=', $loggedUser)
->where('R42821A', '=', 'Y')
->first();
- $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
+ $iC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
// Check if user is eligible for Profile update
- if (isset($ICM428M->R428US)) {
- return view('m3::liberty-theme.pages.userProfile', compact('ICM428M', 'IC670M'));
+ if (isset($iCM428M->R428US)) {
+ return view('m3::liberty-theme.pages.userProfile', ['ICM428M' => $iCM428M, 'IC670M' => $iC670M]);
} else {
abort(404);
}
@@ -34,18 +34,18 @@ class userProfileController extends Controller
public static function updateUserProfile(Request $request)
{
- $R428US = isset($request->R428US) ? trim($request->R428US) : '';
- $R428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
+ $r428US = isset($request->R428US) ? trim($request->R428US) : '';
+ $r428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
- $R428CO = substr($R428DPW, 0, 3);
- $R428PL = substr($R428DPW, 3, 3);
- $R428WH = substr($R428DPW, 6, 3);
+ $r428CO = substr($r428DPW, 0, 3);
+ $r428PL = substr($r428DPW, 3, 3);
+ $r428WH = substr($r428DPW, 6, 3);
- if ($R428US != '') {
+ if ($r428US != '') {
// Update record to ICM428M
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM428M
- set R428CO='$R428CO', R428PL='$R428PL', R428WH='$R428WH'
- where R428US='$R428US'");
+ set R428CO='$r428CO', R428PL='$r428PL', R428WH='$r428WH'
+ where R428US='$r428US'");
return redirect('/userprofile')->with('success', 'Profile updated successfully!');
} else {
@@ -57,18 +57,18 @@ class userProfileController extends Controller
public static function updateUserProfileAjax(Request $request)
{
- $R428US = isset($request->R428US) ? trim($request->R428US) : '';
- $R428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
+ $r428US = isset($request->R428US) ? trim($request->R428US) : '';
+ $r428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
- $R428CO = substr($R428DPW, 0, 3);
- $R428PL = substr($R428DPW, 3, 3);
- $R428WH = substr($R428DPW, 6, 3);
+ $r428CO = substr($r428DPW, 0, 3);
+ $r428PL = substr($r428DPW, 3, 3);
+ $r428WH = substr($r428DPW, 6, 3);
- if ($R428US != '') {
+ if ($r428US != '') {
// Update record to ICM428M
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM428M
- set R428CO='$R428CO', R428PL='$R428PL', R428WH='$R428WH'
- where R428US='$R428US'");
+ set R428CO='$r428CO', R428PL='$r428PL', R428WH='$r428WH'
+ where R428US='$r428US'");
return response()->json(['success' => true]);
} else {
diff --git a/Modules/M3/Http/Controllers/utilitiesContoller.php b/Modules/M3/Http/Controllers/utilitiesContoller.php
index 30bc6d94..a2e91e37 100644
--- a/Modules/M3/Http/Controllers/utilitiesContoller.php
+++ b/Modules/M3/Http/Controllers/utilitiesContoller.php
@@ -24,8 +24,8 @@ class utilitiesContoller extends Controller
dd('SentM3Test');
// Get The Next ID by Calling POM002C
- $PGMERRORS = '';
- $AWREQN = '';
+ $pGMERRORS = '';
+ $aWREQN = '';
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
try {
@@ -40,13 +40,13 @@ class utilitiesContoller extends Controller
case 8001:
// "Authorization failure on distributed database connection attempt"
// Usually means a wrong DB2 user or password
- $PGMERRORS = 'Could not connect due to wrong user or password.';
+ $pGMERRORS = 'Could not connect due to wrong user or password.';
break;
case 42705:
- $PGMERRORS = 'Database not found. Try WRKRDBDIRE to check.';
+ $pGMERRORS = 'Database not found. Try WRKRDBDIRE to check.';
break;
default:
- $PGMERRORS = 'Could not connect. Error: ' . $code . ' ' . $msg;
+ $pGMERRORS = 'Could not connect. Error: ' . $code . ' ' . $msg;
break;
}
}
@@ -66,7 +66,6 @@ class utilitiesContoller extends Controller
// Add Delivery Note Param
$params[] = $conn->AddParameterPackDec('in', 11, 0, 'ParamIn', '', '00000087125');
-
// Start Time Tracking
$start = microtime(true);
@@ -77,15 +76,15 @@ class utilitiesContoller extends Controller
$result = $conn->PgmCall('ICM700CSBM', 'EWOBJTST', $params, [], []);
if (! $result) {
- $PGMERRORS = 'Error calling program. Code: ' . $conn->getErrorCode() . ' Msg: ' . $conn->getErrorMsg();
+ $pGMERRORS = 'Error calling program. Code: ' . $conn->getErrorCode() . ' Msg: ' . $conn->getErrorMsg();
}
// Successful Call
else {
dump($result);
}
- if ($PGMERRORS != '') {
- dump($PGMERRORS);
+ if ($pGMERRORS != '') {
+ dump($pGMERRORS);
} else {
}
// Get Execution Time
@@ -142,39 +141,39 @@ class utilitiesContoller extends Controller
dump('Run Fix IMSENTPKR...');
- $SHUSER = 'TWOSHIP';
+ $sHUSER = 'TWOSHIP';
// Get User CO & WH
// Get users from ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH')
- ->where('R428US', '=', $SHUSER)
+ ->where('R428US', '=', $sHUSER)
->first();
- $DIVI = isset($ICM428M->R428CO) ? $ICM428M->R428CO : '';
- $WHS = isset($ICM428M->R428WH) ? $ICM428M->R428WH : '';
+ $dIVI = isset($iCM428M->R428CO) ? $iCM428M->R428CO : '';
+ $wHS = isset($iCM428M->R428WH) ? $iCM428M->R428WH : '';
// Get Parts And Lots from ICM688M2
- $ICM688M2SLTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m2')
+ $iCM688M2SLTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m2')
->select('A5MACPKR', 'A5SENTPKR', 'A5PICKSTRD')
->distinct()
- ->where('A5CO', $DIVI)
- ->where('A5WHS', $WHS)
+ ->where('A5CO', $dIVI)
+ ->where('A5WHS', $wHS)
->where('A5PICKSTRD', '!=', '0')
->orderBy('A5PICKSTRD', 'ASC')
->get();
- foreach ($ICM688M2SLTMP as $key => $ICM688M2SL) {
+ foreach ($iCM688M2SLTMP as $key => $ICM688M2SL) {
// $counter == 10 ? exit : '';
- $A5MACPKR = isset($ICM688M2SL->A5MACPKR) ? $ICM688M2SL->A5MACPKR : '';
- $A5SENTPKR = isset($ICM688M2SL->A5SENTPKR) ? $ICM688M2SL->A5SENTPKR : '';
+ $a5MACPKR = isset($ICM688M2SL->A5MACPKR) ? $ICM688M2SL->A5MACPKR : '';
+ $a5SENTPKR = isset($ICM688M2SL->A5SENTPKR) ? $ICM688M2SL->A5SENTPKR : '';
- dump('ICM688M2 Record: ' . $A5MACPKR . '-' . $A5SENTPKR);
+ dump('ICM688M2 Record: ' . $a5MACPKR . '-' . $a5SENTPKR);
- $ICM799MINS = DB::connection(config('m3.connection', 'pgsql'))->table('icm799m')
- ->where('IMDELNO', '=', $A5MACPKR)
- ->update(['IMSENTPKR' => $A5SENTPKR]);
+ $iCM799MINS = DB::connection(config('m3.connection', 'pgsql'))->table('icm799m')
+ ->where('IMDELNO', '=', $a5MACPKR)
+ ->update(['IMSENTPKR' => $a5SENTPKR]);
}
}
@@ -192,27 +191,27 @@ class utilitiesContoller extends Controller
// Get the Calling User
// $userId = 'TWOSHIP';
- // $SHUSER = isset($userId) ? $userId : (m3_user() !== '' ? Str::upper(trim(m3_user())) : '');
+ // $sHUSER = isset($userId) ? $userId : (m3_user() !== '' ? Str::upper(trim(m3_user())) : '');
// Get Manifest Array
- $GSArray = $request->query();
+ $gSArray = $request->query();
- $SHUSER = isset($GSArray['User']) ? trim($GSArray['User']) : '';
+ $sHUSER = isset($gSArray['User']) ? trim($gSArray['User']) : '';
- if ($SHUSER != '') {
+ if ($sHUSER != '') {
// Get User CO & WH from Table ICM428M
- $ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
+ $iCM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->select('R428US', 'R428CO', 'R428WH', 'R428PL')
- ->where('R428US', '=', $SHUSER)
+ ->where('R428US', '=', $sHUSER)
->first();
- $R428US = isset($ICM428M->R428US) ? $ICM428M->R428US : ''; // User
- $COMPANY = isset($ICM428M->R428CO) ? $ICM428M->R428CO : ''; // Company
- $PLANT = isset($ICM428M->R428PL) ? $ICM428M->R428PL : ''; // Plant
- $WHS = isset($ICM428M->R428WH) ? $ICM428M->R428WH : ''; // WareHouse
+ $r428US = isset($iCM428M->R428US) ? $iCM428M->R428US : ''; // User
+ $cOMPANY = isset($iCM428M->R428CO) ? $iCM428M->R428CO : ''; // Company
+ $pLANT = isset($iCM428M->R428PL) ? $iCM428M->R428PL : ''; // Plant
+ $wHS = isset($iCM428M->R428WH) ? $iCM428M->R428WH : ''; // WareHouse
- $Macpkr = $GSArray['Macpkr'];
- $packageType = trim($GSArray['packageType']); // 1 => Pallet , 0 => Carton
+ $macpkr = $gSArray['Macpkr'];
+ $packageType = trim($gSArray['packageType']); // 1 => Pallet , 0 => Carton
$packageTypeDesc = $packageType == 1 ? 'Pallet' : 'Carton';
$manufactID = '0826528'; // MAK : get ID from Nvent and save to Config File
$total_length = 9;
@@ -246,23 +245,23 @@ class utilitiesContoller extends Controller
';
// Get number of Pallets
- $packageCount = count($GSArray['PackagesArray']);
+ $packageCount = count($gSArray['PackagesArray']);
$packageNum = 1;
// Get GS1 Label MAX ID from ICM695M3 :
- $GS1SEQUENCESel = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m3')->max('ID');
- $GS1SEQUENCE = isset($GS1SEQUENCESel) ? $GS1SEQUENCESel : 0;
+ $gS1SEQUENCESel = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m3')->max('ID');
+ $gS1SEQUENCE = isset($gS1SEQUENCESel) ? $gS1SEQUENCESel : 0;
// Loop PackagesArray : Build Table for PDF and Insert to ICM695m3
- foreach ($GSArray['PackagesArray'] as $key => $value) {
+ foreach ($gSArray['PackagesArray'] as $key => $value) {
$table_style = $packageNum < $packageCount ? ' style="page-break-after: always;" ' : '';
- $A2INTBOX = trim($value);
+ $a2INTBOX = trim($value);
- $GS1SEQUENCE++;
- $GS1SEQUENCEID = str_pad($GS1SEQUENCE, $total_length, '0', STR_PAD_LEFT);
+ $gS1SEQUENCE++;
+ $gS1SEQUENCEID = str_pad($gS1SEQUENCE, $total_length, '0', STR_PAD_LEFT);
// Build GS1 18 Digits Code
- $gs1_128_bc_1 = '00' . $packageType . $manufactID . $GS1SEQUENCEID;
+ $gs1_128_bc_1 = '00' . $packageType . $manufactID . $gS1SEQUENCEID;
// Calculate Check Digit
$digits = str_split($gs1_128_bc_1);
@@ -286,17 +285,17 @@ class utilitiesContoller extends Controller
// SSCC 18 Digits Code
$gs1_128_bc = $gs1_128_bc_1 . $checkDigit;
- $gs1_128_bc_desc = '(00)' . $packageType . $manufactID . $GS1SEQUENCEID . $checkDigit;
+ $gs1_128_bc_desc = '(00)' . $packageType . $manufactID . $gS1SEQUENCEID . $checkDigit;
$data = [
- 'ship_to' => $GSArray['Recipient_CompanyName'] . ' ' . $GSArray['Recipient_Address1'] . ' ' .
- $GSArray['Recipient_City'] . ',' . $GSArray['Recipient_State']
- . ' ' . $GSArray['Recipient_PostalCode'],
- 'from' => $GSArray['Sender_CompanyName'] . ' ' . $GSArray['Sender_Address1'] . ' ' .
- $GSArray['Sender_City'] . ',' . $GSArray['Sender_State']
- . ' ' . $GSArray['Sender_PostalCode'],
- 'ship_to_lbl' => '420' . $GSArray['Recipient_PostalCode'],
- 'ship_to_desc' => '(420)' . $GSArray['Recipient_PostalCode'],
+ 'ship_to' => $gSArray['Recipient_CompanyName'] . ' ' . $gSArray['Recipient_Address1'] . ' ' .
+ $gSArray['Recipient_City'] . ',' . $gSArray['Recipient_State']
+ . ' ' . $gSArray['Recipient_PostalCode'],
+ 'from' => $gSArray['Sender_CompanyName'] . ' ' . $gSArray['Sender_Address1'] . ' ' .
+ $gSArray['Sender_City'] . ',' . $gSArray['Sender_State']
+ . ' ' . $gSArray['Sender_PostalCode'],
+ 'ship_to_lbl' => '420' . $gSArray['Recipient_PostalCode'],
+ 'ship_to_desc' => '(420)' . $gSArray['Recipient_PostalCode'],
'pro' => '190071217845706', // MAK : Check missing info with Brad
'item_number' => '10000B',
'upc' => '098506095310',
@@ -328,15 +327,15 @@ class utilitiesContoller extends Controller
' . $data['ship_to_desc'] . '
|
- Carrier: ' . $GSArray['CarrierName'] . '
- PRO #: ' . $GSArray['trackingno'] . '
- B/L #: ' . $GSArray['BOLnumber'] . '
- Ref : ' . $A2INTBOX . '
+ Carrier: ' . $gSArray['CarrierName'] . '
+ PRO #: ' . $gSArray['trackingno'] . '
+ B/L #: ' . $gSArray['BOLnumber'] . '
+ Ref : ' . $a2INTBOX . '
|