M3 Security Fixes for pass 29
This commit is contained in:
@@ -14,7 +14,6 @@ use Modules\M3\Http\Controllers\Controller;
|
||||
use Modules\M3\Http\Controllers\GetContentsController;
|
||||
use Str;
|
||||
|
||||
// use Request;
|
||||
class CloseShipment extends Controller
|
||||
{
|
||||
private const ZERO_PAD = '000000';
|
||||
@@ -55,7 +54,6 @@ class CloseShipment extends Controller
|
||||
$pdfFilePath = Config::get('arrays.PdfPath');
|
||||
$DELIVERYNO = $MANIFEST != '' ? $MANIFEST : self::ZERO_PAD;
|
||||
|
||||
// Log::channel('dailyCron')->info("Close Manifest:".$MANIFEST.'-WHS: '.$WHS."-CO:".$COMPANY);
|
||||
|
||||
if ($urlParams != '') {
|
||||
// Write to Logs : JSON
|
||||
@@ -65,7 +63,6 @@ class CloseShipment extends Controller
|
||||
'MANIFEST-MACPKR' => $MANIFEST,
|
||||
'TRANSTYPE' => $TRANSTYPE,
|
||||
]);
|
||||
// dd($JSONIN);
|
||||
|
||||
$data = [
|
||||
'SHMACPKR' => $DELIVERYNO,
|
||||
@@ -81,13 +78,11 @@ class CloseShipment extends Controller
|
||||
'SHWHS' => $WHS,
|
||||
];
|
||||
Helper::logToICM699M($data);
|
||||
// dd($JSONIN);
|
||||
|
||||
// Get Token
|
||||
$tokenResponse = Helper::checkReceiveTokenV2();
|
||||
|
||||
$tokenData = $tokenResponse->getData();
|
||||
// dd($IonToken->code);
|
||||
|
||||
if ($tokenData->code == '200') {
|
||||
$IonToken = isset($tokenData->token) ? $tokenData->token : '';
|
||||
@@ -160,14 +155,12 @@ class CloseShipment extends Controller
|
||||
->where('SHERROR', 'Z')
|
||||
->where('SHTYPE', 'M3-QtyChg')
|
||||
->get();
|
||||
// dd($ICM699MQtyChg);
|
||||
foreach ($ICM699MQtyChg as $key => $ICM699MQtyChgR) {
|
||||
$string = $ICM699MQtyChgR->SHDATA;
|
||||
$start = 'PickerLine:';
|
||||
$end = ' -';
|
||||
$LineAck[] = Helper::getSubstringBetween($string, $start, $end);
|
||||
}
|
||||
// dd($LineAck);
|
||||
} elseif ($TRANSTYPE == 'Z') {
|
||||
$ICM695M1PREP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
|
||||
->select()
|
||||
@@ -179,7 +172,6 @@ class CloseShipment extends Controller
|
||||
}
|
||||
|
||||
$ICM695M1TMP = $ICM695M1PREP->get();
|
||||
// dump($ICM695M1TMP);
|
||||
// Log::channel('dailyCron')->info($ICM695M1TMP);
|
||||
|
||||
// PFC if MACKPKR already Closed : Case 671
|
||||
@@ -193,10 +185,8 @@ class CloseShipment extends Controller
|
||||
return trim($post->AYMACPKR);
|
||||
});
|
||||
}
|
||||
// dump($ICM695M1TMPCOLF);
|
||||
|
||||
$ICM695M1TMPCOLFA = $ICM695M1TMPCOLF->toArray();
|
||||
// dump($ICM695M1TMPCOLFA);
|
||||
|
||||
$ICM699MSuccess = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
->select('SHMACPKR')
|
||||
@@ -208,12 +198,10 @@ class CloseShipment extends Controller
|
||||
->where('SHTYPE', 'M3-Res-out')
|
||||
->where('SHDATA', 'like', '%Success%')
|
||||
->get();
|
||||
// dump($ICM699MSuccess);
|
||||
$ICM699MSuccessCol = collect($ICM699MSuccess);
|
||||
$ICM699MSuccessColF = $ICM699MSuccessCol->map(function ($post) {
|
||||
return $post->SHMACPKR;
|
||||
});
|
||||
// dump($ICM699MSuccessColF);
|
||||
$ICM699MSuccessColFAr = $ICM699MSuccessColF->toArray();
|
||||
|
||||
if ($TRANSTYPE == 'Z') {
|
||||
@@ -229,9 +217,7 @@ class CloseShipment extends Controller
|
||||
}
|
||||
$ICM695M1TMP = $ICM695M1TMPF;
|
||||
|
||||
// Log::channel('dailyCron')->info($ICM695M1TMP);
|
||||
|
||||
// dd($ICM695M1TMP);
|
||||
$FreightTermsTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm321m')
|
||||
->selectRaw('TRIM(ARCODE) as FREIGHTTERMS,ARCHARGE as BILLABLE')
|
||||
->get();
|
||||
@@ -311,7 +297,6 @@ class CloseShipment extends Controller
|
||||
->where('AYWHS', $AYWHS)
|
||||
->orderBy('AYINTBOX')
|
||||
->get();
|
||||
// dd($ICM695M1JOINTMP);
|
||||
|
||||
foreach ($ICM695M1JOINTMP as $key => $ICM695M1JOINR) {
|
||||
$A4SHIPVIA = isset($ICM695M1JOINR->A4SHIPVIA) ? trim(str_replace('&', '_', $ICM695M1JOINR->A4SHIPVIA)) : '';
|
||||
@@ -421,7 +406,6 @@ class CloseShipment extends Controller
|
||||
->first();
|
||||
|
||||
$AlreadySentToM3 = isset($ICM699MS->SHMACPKR) ? trim($ICM699MS->SHMACPKR) : '';
|
||||
// dump($AlreadySentToM3);
|
||||
|
||||
if ($AlreadySentToM3 != '') {
|
||||
// Add Message
|
||||
@@ -482,7 +466,6 @@ class CloseShipment extends Controller
|
||||
$DOCNUMT = $AYINTBOX;
|
||||
$PDFKey = $value . '/' . $value . '_' . $AYMACPKR . '_' . $DOCNUMT . '_' . $COMPANY . '_' . $WHS;
|
||||
$pdfFileName = $pdfFilePath . $PDFKey . '.pdf';
|
||||
// dd($pdfFileName);
|
||||
|
||||
if (File::exists($pdfFileName)) {
|
||||
$CarrierLabel = route('m3.M3GetPDFFromCache.index', ['MACPKR' => $AYMACPKR, 'DOCTYPE' => $DOCTYPE]);
|
||||
@@ -494,7 +477,6 @@ class CloseShipment extends Controller
|
||||
$DOCNUMT = $AYINTBOX;
|
||||
$PDFKey = $value . '/' . $value . '_' . $AYMACPKR . '_' . $DOCNUMT . '_' . $COMPANY . '_' . $WHS;
|
||||
$pdfFileName = $pdfFilePath . $PDFKey . '.pdf';
|
||||
// dd($pdfFileName);
|
||||
|
||||
if (File::exists($pdfFileName)) {
|
||||
$ContentLabel = route('m3.M3GetPDFFromCache.index', ['MACPKR' => $AYMACPKR, 'DOCTYPE' => $DOCTYPE]);
|
||||
@@ -535,7 +517,6 @@ class CloseShipment extends Controller
|
||||
'CONTENTLABELDOC' => $ContentLabel,
|
||||
];
|
||||
}
|
||||
// dump($PACKAGES);
|
||||
|
||||
// Check Packages array before proceeding with CloseShipment
|
||||
if (count($PACKAGES) > 0) {
|
||||
@@ -545,12 +526,10 @@ class CloseShipment extends Controller
|
||||
$DOCNUMT = $AYMACPKR;
|
||||
$PDFKey = $DOCTYPE . '/' . $DOCTYPE . '_' . $AYMACPKR . '_' . $DOCNUMT . '_' . $COMPANY . '_' . $WHS;
|
||||
$pdfFileName = $pdfFilePath . $PDFKey . '.pdf';
|
||||
// dd($pdfFileName);
|
||||
|
||||
if (File::exists($pdfFileName)) {
|
||||
$PackingList = route('m3.M3GetPDFFromCache.index', ['MACPKR' => $AYMACPKR, 'DOCTYPE' => $DOCTYPE]);
|
||||
}
|
||||
// dd($PackingList);
|
||||
|
||||
// Add Cocharge
|
||||
if (count($JSONCoCharge) > 0) {
|
||||
@@ -604,7 +583,6 @@ class CloseShipment extends Controller
|
||||
'ENDFLAG' => $EndFlag,
|
||||
]);
|
||||
}
|
||||
// dump($JSONCS);
|
||||
|
||||
// No Errors Proceed in Calling M3 CLose API
|
||||
if ($ErrorMsgs == '') {
|
||||
@@ -670,7 +648,6 @@ class CloseShipment extends Controller
|
||||
// Check M3 Response for Errors
|
||||
$responseResult = $responseContents->result;
|
||||
$M3Errors = Helper::checkM3Errors($responseResult);
|
||||
// dd($M3Errors);
|
||||
|
||||
// If you get a successful response, update database file ICM688M1/A4RATEm3=X
|
||||
// Update ICM688M1 : Change A4RATEM3
|
||||
@@ -811,7 +788,6 @@ class CloseShipment extends Controller
|
||||
}
|
||||
// Close Shipment for Zero Picks
|
||||
elseif (count($ICM695M1TMP) > 0 && $TRANSTYPE == 'Z') {
|
||||
// dd($ICM695M1TMP);
|
||||
$ErrorMsgs = '';
|
||||
|
||||
foreach ($ICM695M1TMP as $key => $ICM695M1JOINR) {
|
||||
@@ -825,7 +801,6 @@ class CloseShipment extends Controller
|
||||
$A4CLOSEM3 = trim($ICM695M1JOINR->A4CLOSEM3);
|
||||
$AYWHS = trim($ICM695M1JOINR->A4WHS);
|
||||
$AYCO = trim($ICM695M1JOINR->A4CO);
|
||||
// dump($AYMACPKR);
|
||||
|
||||
// Construct Json for CloseShipment Without PDF Files
|
||||
$JSONCS = json_encode([
|
||||
@@ -939,7 +914,6 @@ class CloseShipment extends Controller
|
||||
'SHCO' => $COMPANY,
|
||||
'SHWHS' => $WHS,
|
||||
];
|
||||
// dump($data);
|
||||
Helper::logToICM699M($data);
|
||||
// Add Message
|
||||
$ErrorMsgs = $ErrorMsgs . $M3Errors . '-';
|
||||
@@ -1031,7 +1005,6 @@ class CloseShipment extends Controller
|
||||
]);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
// Log::error($th);
|
||||
$getCurlErrors = str_contains($th->getMessage(), 'cURL error');
|
||||
if ($getCurlErrors) {
|
||||
// dd($getCurlErrors);
|
||||
|
||||
@@ -19,7 +19,6 @@ class M3Controller extends Controller
|
||||
// Split Data and Write to ICM666M2
|
||||
public function insertToICM666M2($dataSplit, $commentData)
|
||||
{
|
||||
// dump($commentData);
|
||||
// dump($dataSplit);
|
||||
|
||||
$commentDataSS = explode("\n", $dataSplit);
|
||||
@@ -29,7 +28,6 @@ class M3Controller extends Controller
|
||||
$fullData = $commentData;
|
||||
$fullData['AXCOMMENT'] = $substring;
|
||||
$fullData['AXLINENO'] = $AXLINENO;
|
||||
// dump($fullData);
|
||||
$insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm666m2')->insert($fullData);
|
||||
|
||||
$AXLINENO++;
|
||||
@@ -217,12 +215,10 @@ class M3Controller extends Controller
|
||||
|
||||
$commentData = ['AXCO' => $AXCO, 'AXPLANT' => $AXPLANT, 'AXWHS' => $AXWHS, 'AXDELNO' => $AXDELNO, 'AXONO' => $AXONO,
|
||||
'AXRLNO' => $AXRLNO, 'AXSHNO' => $AXSHNO, 'AXDOCUMENT' => $AXDOCUMENT];
|
||||
// dump($commentData);
|
||||
|
||||
switch ($AXDOCUMENT) {
|
||||
case 'Picker':
|
||||
$Picker = isset($comment) ? Helper::sanityzeString($comment) : 'null';
|
||||
// dump($Picker);
|
||||
if ($Picker != 'null') {
|
||||
$this->insertToICM666M2($Picker, $commentData);
|
||||
}
|
||||
@@ -230,7 +226,6 @@ class M3Controller extends Controller
|
||||
|
||||
case 'Packer':
|
||||
$Packer = isset($comment) ? Helper::sanityzeString($comment) : 'null';
|
||||
// dump($Packer);
|
||||
if ($Packer != 'null') {
|
||||
$this->insertToICM666M2($Packer, $commentData);
|
||||
}
|
||||
@@ -238,7 +233,6 @@ class M3Controller extends Controller
|
||||
|
||||
case 'Carrier':
|
||||
$Carrier = isset($comment) ? Helper::sanityzeString($comment) : 'null';
|
||||
// dump($Carrier);
|
||||
if ($Carrier != 'null') {
|
||||
$this->insertToICM666M2($Carrier, $commentData);
|
||||
}
|
||||
@@ -246,7 +240,6 @@ class M3Controller extends Controller
|
||||
|
||||
case 'Other':
|
||||
$Other = isset($comment) ? Helper::sanityzeString($comment) : 'null';
|
||||
// dump($Other);
|
||||
if ($Other != 'null') {
|
||||
$this->insertToICM666M2($Other, $commentData);
|
||||
}
|
||||
@@ -399,7 +392,6 @@ class M3Controller extends Controller
|
||||
$InsertArray[$value[0]] = $fieldValue;
|
||||
}
|
||||
}
|
||||
// Log::info($InsertArray);
|
||||
|
||||
// Check ICM709M
|
||||
$ICM709MSEL = DB::connection(config('m3.connection', 'pgsql'))->table('icm709m')
|
||||
@@ -418,7 +410,6 @@ class M3Controller extends Controller
|
||||
$HazMat = isset($ICM709MSEL->AT9WRN) ? $ICM709MSEL->AT9WRN : '';
|
||||
$InsertArray['A1MATWRN'] = $HazMat;
|
||||
|
||||
// if ($PalletQty!='') {
|
||||
// $InsertArray['A1USRN01']=$palletQty;
|
||||
// }
|
||||
|
||||
@@ -461,7 +452,6 @@ class M3Controller extends Controller
|
||||
|
||||
// define several input/output params
|
||||
$params = [];
|
||||
// $params[] = $conn->AddParameterChar('out',7,'eqNumber');
|
||||
|
||||
// AddParameterChar($io, $size, $comment, $varName, $value, $varying, $dimension)
|
||||
// Add Warehouse Param
|
||||
@@ -473,7 +463,6 @@ class M3Controller extends Controller
|
||||
// Add Delivery Note Param
|
||||
$PickerNumberNoZero = ltrim(strval($PickerNumber), '0');
|
||||
$params[] = $conn->AddParameterChar('in', 11, 'PickerNumber', '', $PickerNumberNoZero);
|
||||
// $params[] = $conn->AddParameterZoned('in', 11, 0, 'ParamIn');
|
||||
|
||||
// Start Time Tracking
|
||||
$start = microtime(true);
|
||||
@@ -523,7 +512,6 @@ class M3Controller extends Controller
|
||||
'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);
|
||||
|
||||
// Log::error($th);
|
||||
return response()->json([
|
||||
'code' => '405',
|
||||
'status' => 'error',
|
||||
|
||||
@@ -56,7 +56,6 @@ class ReplenAPI extends Controller
|
||||
foreach ($PART as $key => $value) {
|
||||
$PARTS[] = ['PART' => $value, 'LOT' => ''];
|
||||
}
|
||||
// dump($PARTS);
|
||||
|
||||
$JSON = json_encode(['WHS' => $WHS, 'PARTS' => $PARTS]);
|
||||
|
||||
@@ -68,7 +67,6 @@ class ReplenAPI extends Controller
|
||||
// Get Token
|
||||
$tokenResponse = Helper::checkReceiveTokenV2();
|
||||
$tokenData = $tokenResponse->getData();
|
||||
// dd($IonToken->code);
|
||||
if ($tokenData->code == '200') {
|
||||
$IonToken = isset($tokenData->token) ? $tokenData->token : '';
|
||||
} else {
|
||||
@@ -106,9 +104,7 @@ class ReplenAPI extends Controller
|
||||
$JsonSanytized = Helper::sanityzeString($responseJSON);
|
||||
// Array
|
||||
$responseArray = json_decode($JsonSanytized, true);
|
||||
// LOG::info( $responseArray);
|
||||
$responseTMP = $responseArray['result'];
|
||||
// LOG::info($responseTMP);
|
||||
} else {
|
||||
$M3Errors = 'Error: No Response from M3';
|
||||
}
|
||||
@@ -135,7 +131,6 @@ class ReplenAPI extends Controller
|
||||
|
||||
$dataToWrite2 = [];
|
||||
foreach ($responseTMP as $key => $value) {
|
||||
// dump($value);
|
||||
$dataToWrite = [];
|
||||
|
||||
foreach ($value as $key2 => $content) {
|
||||
@@ -143,13 +138,11 @@ class ReplenAPI extends Controller
|
||||
$dataToWrite[$key2] = $content;
|
||||
} else {
|
||||
foreach ($content as $key3 => $content2) {
|
||||
// dump($content2);
|
||||
$dataToWrite2[] = array_merge($dataToWrite, $content2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// LOG::info($dataToWrite2);
|
||||
|
||||
// Delete Old Records from IC630M
|
||||
foreach ($dataToWrite2 as $key => $value) {
|
||||
@@ -167,12 +160,10 @@ class ReplenAPI extends Controller
|
||||
->where('WSELOC', $value['Warehouse'])
|
||||
->where('VLOCID', $value['Location'])
|
||||
->first();
|
||||
// dd($DE640MSQLSEL);
|
||||
|
||||
$LocationExist = isset($DE640MSQLSEL->VLOCID) ? trim($DE640MSQLSEL->VLOCID) : '';
|
||||
$WHExist = isset($DE640MSQLSEL->WSELOC) ? trim($DE640MSQLSEL->WSELOC) : '';
|
||||
$COExist = isset($DE640MSQLSEL->LVCO) ? trim($DE640MSQLSEL->LVCO) : '';
|
||||
// dd($LocationExist .': '.$WHExist.': '.$COExist);
|
||||
|
||||
// if No records Founds insert New Record
|
||||
if ($LocationExist == '' && $WHExist == '' && $COExist == '') {
|
||||
@@ -220,7 +211,6 @@ class ReplenAPI extends Controller
|
||||
|
||||
DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')->insert($SQLInsertPrep630M);
|
||||
}
|
||||
// dump($SQLInsertPrep);
|
||||
|
||||
// Send Response
|
||||
return response()->json([
|
||||
@@ -273,7 +263,6 @@ class ReplenAPI extends Controller
|
||||
'SHDATA' => 'An Error Occured - ' . substr($th, 0, 300), 'SHUSER' => $SHUSER, 'SHSOURCE' => $SHSOURCE, 'SHCO' => $CO, 'SHWHS' => $WHS];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
// Log::error($th);
|
||||
return response()->json([
|
||||
'code' => '405',
|
||||
'status' => 'error',
|
||||
|
||||
@@ -26,7 +26,6 @@ class TransferAPI extends Controller
|
||||
ini_set('max_execution_time', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('max_input_time', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
|
||||
// dd($request->all());
|
||||
|
||||
// Get the Calling User
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
|
||||
@@ -95,7 +94,6 @@ class TransferAPI extends Controller
|
||||
->where('SHERROR', 'X')
|
||||
->where('SHTYPE', $SHTYPE)
|
||||
->first();
|
||||
// dump($ICM699MS->SHDATA);
|
||||
|
||||
// Read The substring from SHDATA after M3-JSN-out
|
||||
$word = 'M3-JSN-out';
|
||||
@@ -120,10 +118,8 @@ class TransferAPI extends Controller
|
||||
$endPos = strrpos($SHDATAJSON, '}');
|
||||
// Extract the substring within the curly braces
|
||||
$SHDATAJSON = substr($SHDATAJSON, $startPos, $endPos - $startPos + 1);
|
||||
// dd($SHDATAJSON);
|
||||
|
||||
$JSONTR = $SHDATAJSON != '' ? json_decode($SHDATAJSON) : '';
|
||||
// dd($JSONTR);
|
||||
|
||||
if ($JSONTR != '') {
|
||||
$PART = isset($JSONTR->PART) ? $JSONTR->PART : '';
|
||||
@@ -140,7 +136,6 @@ class TransferAPI extends Controller
|
||||
$TYPE = isset($JSONTR->TYPE) ? $JSONTR->TYPE : '';
|
||||
$COLINESUFFIX = isset($JSONTR->COLINESUFFIX) ? $JSONTR->COLINESUFFIX : '';
|
||||
}
|
||||
// dd($JSONTR);
|
||||
|
||||
// Set SHERROR to Z in ICM699M
|
||||
$ICM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
@@ -171,7 +166,6 @@ class TransferAPI extends Controller
|
||||
$ICM688M2SLTMP->where('A5PKLN', $COLINENO);
|
||||
}
|
||||
$ICM688M2SL = $ICM688M2SLTMP->first();
|
||||
// dd($ICM688M2SL->A5BRADLN);
|
||||
|
||||
$A5BRADLINE = isset($ICM688M2SL->A5BRADLN) ? $ICM688M2SL->A5BRADLN : '';
|
||||
$COLINESUFFIX = isset($ICM688M2SL->A5PKSFX) ? $ICM688M2SL->A5PKSFX : ''; // Case 551 : $COLINESUFFIX
|
||||
@@ -213,7 +207,6 @@ class TransferAPI extends Controller
|
||||
'TYPE' => $TYPE,
|
||||
'COLINESUFFIX' => $COLINESUFFIX,
|
||||
], JSON_UNESCAPED_SLASHES);
|
||||
// dd($JSON);
|
||||
|
||||
// Write JSON Params to Logs Out
|
||||
$data = ['SHMACPKR' => $DELIVERYNO,
|
||||
@@ -273,12 +266,9 @@ class TransferAPI extends Controller
|
||||
$M3ResponseTimeTmp2 = floatval($M3ResponseTimeTmp) / 1000; // $M3ResponseTimeTmp / 1000;
|
||||
$dateTime = new DateTime;
|
||||
$dateTime->setTimestamp($M3ResponseTimeTmp2);
|
||||
// dump( $dateTime->format('d/m/Y H:i:s.v') );
|
||||
$M3ResponseTime = $M3ResponseTimeTmp != '' ? '-M3ResponseTime:' . $dateTime->format('d/m/Y H:i:s.v') : '-M3ResponseTime';
|
||||
// dump($M3ResponseTime);
|
||||
$transferStats = $response->transferStats;
|
||||
$M3transferTime = $transferStats->getTransferTime() != null ? '-M3transferTime:' . $transferStats->getTransferTime() : '-M3transferTime';
|
||||
// dd($M3transferTime);
|
||||
|
||||
if ($responseStatusCode == '200') {
|
||||
$responseContents = json_decode($response->getBody()->getContents());
|
||||
@@ -389,7 +379,6 @@ class TransferAPI extends Controller
|
||||
]);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
// Log::error($th);
|
||||
$getCurlErrors = str_contains($th->getMessage(), 'cURL error');
|
||||
if ($getCurlErrors) {
|
||||
// Write to Logs Out : Failed
|
||||
@@ -447,7 +436,6 @@ class TransferAPI extends Controller
|
||||
ini_set('max_execution_time', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('max_input_time', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
|
||||
// dd($request->all());
|
||||
|
||||
// Get the Calling User
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
|
||||
@@ -460,7 +448,6 @@ class TransferAPI extends Controller
|
||||
$DIVI = isset($urlParams['COMPANY']) ? $urlParams['COMPANY'] : '';
|
||||
$WHS = isset($urlParams['WHS']) ? $urlParams['WHS'] : '';
|
||||
$PLANT = isset($urlParams['PLANT']) ? $urlParams['PLANT'] : '';
|
||||
// dump($urlParams);
|
||||
|
||||
try {
|
||||
if ($urlParams != '') {
|
||||
@@ -468,7 +455,6 @@ class TransferAPI extends Controller
|
||||
$DELIVERYNO = isset($urlParams['DELIVERYNO']) ? $urlParams['DELIVERYNO'] : '';
|
||||
$TYPE = 'UpdateShipmentNumber';
|
||||
$allMacpkrs = [];
|
||||
// dd($A4SPR15A01);
|
||||
|
||||
if ($A4SPR15A01 != '') {
|
||||
// Read from ICM688M1
|
||||
@@ -503,7 +489,6 @@ class TransferAPI extends Controller
|
||||
'ENDFLAG' => '',
|
||||
|
||||
], JSON_UNESCAPED_SLASHES);
|
||||
// dd($JSON);
|
||||
|
||||
// Write JSON Params to Logs Out
|
||||
$data = ['SHMACPKR' => $DELIVERYNO,
|
||||
@@ -656,7 +641,6 @@ class TransferAPI extends Controller
|
||||
]);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
// Log::error($th);
|
||||
$getCurlErrors = str_contains($th->getMessage(), 'cURL error');
|
||||
if ($getCurlErrors) {
|
||||
// Write to Logs Out : Failed
|
||||
|
||||
@@ -25,7 +25,6 @@ class BoxPackToPalletController extends Controller
|
||||
$R659PALT = $request->R659PALT ?? abort(404, 'Manifest Not Found');
|
||||
|
||||
$userWhsCoPlant = self::getUserWhsCoPlant();
|
||||
// dump($userWhsCoPlant);
|
||||
|
||||
$boxes = DB::connection(config('m3.connection', 'pgsql'))->table(self::PALLET_TABLE_ALIAS)
|
||||
->select(
|
||||
@@ -54,7 +53,6 @@ class BoxPackToPalletController extends Controller
|
||||
->get()
|
||||
->unique('R659BOX')
|
||||
->values();
|
||||
// dump($boxes);
|
||||
|
||||
if ($request->ajax()) {
|
||||
return response()->json([
|
||||
@@ -64,7 +62,6 @@ class BoxPackToPalletController extends Controller
|
||||
}
|
||||
|
||||
$palletHeader = $boxes->first();
|
||||
// dump($boxes);
|
||||
|
||||
return view('m3::liberty-theme.pages.BoxPackToPalletScan', compact('boxes', 'palletHeader', 'R659PALT'));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Modules\M3\Http\Controllers;
|
||||
use DB;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
// use Modules\M3\Models\ICM709M;
|
||||
//
|
||||
|
||||
class GetContentsController extends Controller
|
||||
@@ -61,7 +60,6 @@ class GetContentsController extends Controller
|
||||
$results = DB::table('ICM704M')->get();
|
||||
|
||||
return $results->mapWithKeys(function ($row) {
|
||||
// dump($row);
|
||||
return [
|
||||
trim($row->AONMIT) => [
|
||||
'LTLClassId' => number_format(trim($row->AOFCID), 1),
|
||||
@@ -145,7 +143,6 @@ class GetContentsController extends Controller
|
||||
$packagesGS1Array = [];
|
||||
|
||||
foreach ($results as $index => $row) {
|
||||
// dump($row);
|
||||
$internalBox = trim($row->AYINTBOX);
|
||||
|
||||
$package595m1[$internalBox] = [
|
||||
|
||||
@@ -15,7 +15,6 @@ class M3ErrorsDispController extends Controller
|
||||
{
|
||||
public static function index(Request $request)
|
||||
{
|
||||
// dump($request->all());
|
||||
$macpkr = isset($request->macpkr) ? trim($request->macpkr) : '';
|
||||
$shsource = isset($request->shsource) ? trim($request->shsource) : '';
|
||||
$showerrors = isset($request->showerrors) ? trim($request->showerrors) : 'N';
|
||||
@@ -140,7 +139,6 @@ class M3ErrorsDispController extends Controller
|
||||
|
||||
public static function update699M(Request $request)
|
||||
{
|
||||
// dump($request->all());
|
||||
$SHMACPKR = $request->SHMACPKR != null ? trim($request->SHMACPKR) : '';
|
||||
$SHSOURCE = $request->SHSOURCE != null ? trim($request->SHSOURCE) : '';
|
||||
$SHCO = $request->SHCO != null ? trim($request->SHCO) : '';
|
||||
@@ -195,7 +193,6 @@ class M3ErrorsDispController extends Controller
|
||||
ini_set('memory_limit', '1024M');
|
||||
|
||||
try {
|
||||
// dd($request->all());
|
||||
$SHMACPKR = $request->SHMACPKR != null ? trim($request->SHMACPKR) : '';
|
||||
$SHSOURCE = $request->SHSOURCE != null ? trim($request->SHSOURCE) : '';
|
||||
$STARTDATE = $request->STARTDATE != null ? trim($request->STARTDATE) : today()->subDays(1)->format('Y-m-d');
|
||||
@@ -353,7 +350,6 @@ class M3ErrorsDispController extends Controller
|
||||
'SHDATA' => 'Error description',
|
||||
];
|
||||
$ICM699MCol->prepend($newItem);
|
||||
// dd($ICM699MCol);
|
||||
|
||||
// Download Excel File
|
||||
return app(SpreadsheetExport::class)->download($ICM699MCol, 'transactionLog_' . $STARTDATE . '-' . $ENDDATE . '.xlsx');
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Modules\M3\Http\Controllers;
|
||||
use Config;
|
||||
use DB;
|
||||
use File;
|
||||
// use Datatables;
|
||||
use Illuminate\Http\Request;
|
||||
use Smalot\PdfParser\Parser;
|
||||
use Str;
|
||||
@@ -20,7 +19,6 @@ class M3GetPDFFromCacheController extends Controller
|
||||
$aggno = $aggmsg = '';
|
||||
$IC670M = $PDFArray = $carrier = $trackingno = $ICM688M1 = [];
|
||||
$AYMACPKR = $WHDDA = $COMPANY = $PLANT = $WHS = '';
|
||||
// $carrier = $trackingno = "";
|
||||
|
||||
// PDF File PATH
|
||||
$pdfFilePath = Config::get('arrays.PdfPath');
|
||||
@@ -29,7 +27,6 @@ class M3GetPDFFromCacheController extends Controller
|
||||
$PDFArray = $trackingno = $carrier = $ICM688M1 = [];
|
||||
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// dd($SHUSER);
|
||||
|
||||
if ($SHUSER != '') {
|
||||
// Get User CO & WH
|
||||
@@ -55,7 +52,6 @@ class M3GetPDFFromCacheController extends Controller
|
||||
$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;
|
||||
// dump($WHDDA);
|
||||
|
||||
// Check Doctype fisrt
|
||||
$docTypes = $DOCTYPE != '' ? [$DOCTYPE] : ['PackingList', 'ContentLabel', 'CarrierLabel', 'GSLabel']; // document type (PackingList, CarrierLabel, ContentLabel)
|
||||
@@ -73,15 +69,12 @@ class M3GetPDFFromCacheController extends Controller
|
||||
->where('AYWHS', $WHS)
|
||||
->where('AYMACPKR', $AYMACPKR)
|
||||
->first();
|
||||
// dump($ICM695M1Agg);
|
||||
$aggno = isset($ICM695M1Agg->AYTRUCK) ? trim($ICM695M1Agg->AYTRUCK) : '';
|
||||
|
||||
if ($aggno != '' && $aggno != '0') {
|
||||
// dump($aggno);
|
||||
|
||||
$aggmsg = "This delivery note is part of aggregation $aggno ";
|
||||
$ICM688M1 = DB::connection(config('m3.connection', 'pgsql'))->select("select A4MACPKR from ICM688M1 where A4SHPAGGCD='$aggno'");
|
||||
// dump($ICM688M1);
|
||||
// foreach($ICM688M1 as $key => $ICM688M1R) {
|
||||
// $aggmsg.=' <a href="M3GetPDFFromCache?MACPKR='.$ICM688M1R->A4MACPKR.'&COMPANY='.$COMPANY.'&PLANT='.$PLANT.'&WHS='.$WHS.'">'.$ICM688M1R->A4MACPKR.'</a>';
|
||||
// }
|
||||
@@ -108,7 +101,6 @@ class M3GetPDFFromCacheController extends Controller
|
||||
->orderBy('AYMACPKR')
|
||||
->get();
|
||||
}
|
||||
// dump($ICM695M1);
|
||||
|
||||
$allLabels = [];
|
||||
|
||||
@@ -127,7 +119,6 @@ class M3GetPDFFromCacheController extends Controller
|
||||
|
||||
// Make Key and Test Validity
|
||||
if ($AYMACPKR != '' && $COMPANY != '' && $WHS != '') {
|
||||
// echo "<script>alert('2');</script>";
|
||||
$CarrierLabel = '';
|
||||
$ContentLabel = '';
|
||||
$PackingList = '';
|
||||
@@ -160,7 +151,6 @@ class M3GetPDFFromCacheController extends Controller
|
||||
if ($value == 'GSLabel') {
|
||||
$PDFKey = $value . '/' . $value . '_' . $AYMACPKR . '_' . $COMPANY . '_' . $WHS . '_' . $DOCNUM;
|
||||
|
||||
// if ($ContentLabel=='LTL' ) {
|
||||
// $PDFKey = $value.'/'.$value.'_'.$AYMACPKR.'_'.$COMPANY.'_'.$WHS;
|
||||
// }
|
||||
// else{
|
||||
@@ -173,35 +163,27 @@ class M3GetPDFFromCacheController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
// dump($tmpCacheArr);
|
||||
|
||||
// Get unique values from array $PDFArray
|
||||
$tmpCacheArr = collect($tmpCacheArr)->unique();
|
||||
// dump($tmpCacheArr);
|
||||
foreach ($tmpCacheArr as $key => $value) {
|
||||
// $isCarrierLabel = Str::contains($value, 'CarrierLabel');
|
||||
|
||||
$pdfFileName = $pdfFilePath . $value . '.pdf';
|
||||
if (File::exists($pdfFileName)) {
|
||||
// dump($pdfFileName);
|
||||
|
||||
$pdfFile = File::get($pdfFileName);
|
||||
// Transform content to base64
|
||||
// $base64PDF = $pdfFile;
|
||||
$base64PDF = base64_encode($pdfFile);
|
||||
// dd($base64PDF);
|
||||
$PDFArray[] = $base64PDF;
|
||||
}
|
||||
}
|
||||
// dump($PDFArray);
|
||||
} else {
|
||||
// Nothing Found
|
||||
}
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
// Log::error($th);
|
||||
}
|
||||
// dump($PDFArray);
|
||||
// dump($AYMACPKR);
|
||||
// dump($IC670M);
|
||||
// dump($ICM695M1);
|
||||
|
||||
@@ -30,7 +30,6 @@ class MFOrdersController extends Controller
|
||||
where APMANIFEST = $MF and APCO='$co' and APWHS='$whs' and APPLT='$plant' limit 1";
|
||||
|
||||
$ICM705M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
|
||||
// dump($ICM705M1);
|
||||
$carrier = isset($ICM705M1[0]->APCARRIER) ? trim($ICM705M1[0]->APCARRIER) : '';
|
||||
|
||||
if ($MF != '') {
|
||||
@@ -42,7 +41,6 @@ class MFOrdersController extends Controller
|
||||
GROUP BY AYCO,AYPLANT,AYMACPKR,AYONO,A4SHSHNM,A4PICKSTS,AYSPR15A01";
|
||||
|
||||
$ICM695M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
|
||||
// dump($ICM695M1);
|
||||
|
||||
return view(
|
||||
'm3::liberty-theme.pages.MFOrders',
|
||||
|
||||
@@ -23,7 +23,6 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
$allReportsUrls = [];
|
||||
try {
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// dd($SHUSER);
|
||||
|
||||
if ($SHUSER != '') {
|
||||
// Get User CO & WH from Table ICM428M
|
||||
@@ -43,11 +42,9 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
// Get URL PARAMS
|
||||
$urlParams = count($request->all()) > 0 ? $request->all() : '';
|
||||
// dump($urlParams);
|
||||
$REPORTDATEDisp = isset($urlParams['REPORTDATEDisp']) ? \DateTime::createFromFormat('Y-m-d', trim($urlParams['REPORTDATEDisp']))->format('Ymd') : today()->format('Ymd');
|
||||
|
||||
$WHDDA = $COMPANY . $PLANT . $WHS;
|
||||
// dump($WHDDA);
|
||||
if ($REPORTDATEDisp != '' && $COMPANY != '' && $WHS != '' && $PLANT != '') {
|
||||
// Case 729: Add Currency code A1SHCURR FROM ICM666M
|
||||
$selectContent = "
|
||||
@@ -79,11 +76,9 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
WHERE AYSTATUS IN ('Z','z') AND AYAPR8N002 = $REPORTDATEDisp
|
||||
)
|
||||
AND A5CO=$COMPANY AND A5WHS=$WHS AND A5PLANT=$PLANT";
|
||||
// dump($selectContent);
|
||||
|
||||
$ICM688M2 = DB::connection(config('m3.connection', 'pgsql'))
|
||||
->select($selectContent);
|
||||
// dd($ICM688M2);
|
||||
} else {
|
||||
$ICM688M2 = collect();
|
||||
}
|
||||
@@ -118,7 +113,6 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
try {
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// dd($SHUSER);
|
||||
|
||||
if ($SHUSER != '') {
|
||||
// Get User CO & WH from Table ICM428M
|
||||
@@ -138,7 +132,6 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
// Get URL PARAMS
|
||||
$urlParams = count($request->all()) > 0 ? $request->all() : '';
|
||||
// dd($urlParams);
|
||||
$reportDate = isset($urlParams['REPORTDATE']) ? \DateTime::createFromFormat('Y-m-d', trim($urlParams['REPORTDATE']))->format('Ymd') : today()->format('Ymd');
|
||||
$toreportDate = isset($urlParams['TOREPORTDATE']) ? \DateTime::createFromFormat('Y-m-d', trim($urlParams['TOREPORTDATE']))->format('Ymd') : today()->format('Ymd');
|
||||
|
||||
@@ -146,7 +139,6 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
$toreportDateWD = isset($urlParams['TOREPORTDATE']) ? trim($urlParams['TOREPORTDATE']) : today()->format('Y-m-d');
|
||||
|
||||
$WHDDA = $COMPANY . $PLANT . $WHS;
|
||||
// dump($WHDDA);
|
||||
if ($reportDate != '' && $COMPANY != '' && $WHS != '' && $PLANT != '') {
|
||||
// Case 729: Add Currency code A1SHCURR FROM ICM666M
|
||||
$selectContent = "
|
||||
@@ -187,7 +179,6 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
'REASON' => 'Failure Reason', 'A1SHCURR' => 'Currency Code', 'FREIGHT' => 'Freight'];
|
||||
$ICM688M2Col = collect($ICM688M2);
|
||||
$ICM688M2Col->prepend($newItem);
|
||||
// dd($ICM688M2Col);
|
||||
|
||||
// Count records before exporting to excel : Max 20K records are allowed
|
||||
$ICM688M2Count = $ICM688M2Col->count();
|
||||
@@ -205,7 +196,6 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
// 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 $ICM688M2Col->downloadExcel('Closedorderlinesreport_'.$reportDateWD.'-'.$toreportDateWD.'.csv',\Maatwebsite\Excel\Excel::CSV,false);
|
||||
} catch (\Throwable $th) {
|
||||
Log::error($th);
|
||||
}
|
||||
@@ -220,7 +210,6 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
try {
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// dd($SHUSER);
|
||||
|
||||
if ($SHUSER != '') {
|
||||
// Get User CO & WH from Table ICM428M
|
||||
@@ -240,16 +229,13 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
// Get URL PARAMS
|
||||
$urlParams = count($request->all()) > 0 ? $request->all() : '';
|
||||
// dd($urlParams);
|
||||
$reportDate = isset($urlParams['REPORTDATE']) ? \DateTime::createFromFormat('Y-m-d', trim($urlParams['REPORTDATE']))->format('Ymd') : today()->format('Ymd');
|
||||
$toreportDate = isset($urlParams['TOREPORTDATE']) ? \DateTime::createFromFormat('Y-m-d', trim($urlParams['TOREPORTDATE']))->format('Ymd') : today()->format('Ymd');
|
||||
// dump($reportDate);
|
||||
// dd($toreportDate);
|
||||
$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;
|
||||
// dump($WHDDA);
|
||||
if ($reportDate != '' && $COMPANY != '' && $WHS != '' && $PLANT != '') {
|
||||
// Case 729: Add Currency code A1SHCURR FROM ICM666M
|
||||
$ICM688M2 = DB::connection(config('m3.connection', 'pgsql'))
|
||||
@@ -289,7 +275,6 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
'REASON' => 'Failure Reason', 'A1SHCURR' => 'Currency Code', 'FREIGHT' => 'Freight'];
|
||||
$ICM688M2Col = collect($ICM688M2);
|
||||
$ICM688M2Col->prepend($newItem);
|
||||
// dd($ICM688M2Col);
|
||||
|
||||
// Count records before exporting to excel : Max 20K records are allowed
|
||||
$ICM688M2Count = $ICM688M2Col->count();
|
||||
@@ -312,11 +297,8 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
// MAK Store the File to Storage
|
||||
app(SpreadsheetExport::class)->store($ICM688M2Col, $prevMonthFile, 'publicCL');
|
||||
|
||||
// $ICM688M2Col->storeExcel('Closedorderlinesreport_'.$reportDateWD.'-'.$toreportDateWD.'.csv', 'publicCL',\Maatwebsite\Excel\Excel::CSV);
|
||||
|
||||
// $ICM688M2Col->storeExcel('Closedorderlinesreport_'.$reportDateWD.'-'.$toreportDateWD.'.ods', 'publicCL',\Maatwebsite\Excel\Excel::ODS);
|
||||
|
||||
// dump('Done Saving Excel...');
|
||||
return back();
|
||||
} catch (\Throwable $th) {
|
||||
Log::error($th);
|
||||
@@ -326,13 +308,11 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
// Download File
|
||||
public static function downloadFiles(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
$fileName = $request->filename;
|
||||
if (Storage::disk('publicCL')->exists($fileName)) {
|
||||
// File exists, retrieve content or URL
|
||||
// $content = Storage::disk('publicCL')->get($fileName);
|
||||
$fileUrl = Storage::disk('publicCL')->url($fileName);
|
||||
// dd($fileUrl);
|
||||
$fileNameOnly = strpos($fileName, '/') != false ? substr($fileName, strpos($fileName, '/') + 1) : $fileName;
|
||||
|
||||
// Download the file
|
||||
|
||||
@@ -40,11 +40,9 @@ class ReplenishSettingsController extends Controller
|
||||
->get()
|
||||
: [];
|
||||
} else {
|
||||
// $REFCAT658 =[];
|
||||
$IC670M = [];
|
||||
}
|
||||
|
||||
// $sqlstmt="SELECT t1.REFKEY,t2.FULLID ,t2.*
|
||||
// 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'";
|
||||
@@ -57,24 +55,20 @@ class ReplenishSettingsController extends Controller
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// dd( $request->all() );
|
||||
|
||||
$formInputs = $request->all();
|
||||
$formInputs = array_filter($formInputs);
|
||||
unset($formInputs['_token']);
|
||||
|
||||
$formInputs['R658IZLCF'] = isset($formInputs['R658IZLCF']) ? $formInputs['R658IZLCF'] : '0';
|
||||
// dd($formInputs);
|
||||
|
||||
$ICM658MINS = ICM658M::insert($formInputs);
|
||||
|
||||
// dd($ICM658MINS);
|
||||
return redirect()->route('m3.replenishmentSettings.index');
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
$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) : '';
|
||||
@@ -97,7 +91,6 @@ class ReplenishSettingsController extends Controller
|
||||
|
||||
public function deleteRec(Request $request)
|
||||
{
|
||||
// dd( $request->all() );
|
||||
$R658PN = trim($request->R658PN);
|
||||
$R658CO = trim($request->R658CO);
|
||||
$R658LC = trim($request->R658LC);
|
||||
@@ -117,11 +110,9 @@ class ReplenishSettingsController extends Controller
|
||||
|
||||
public function checkRecExit(Request $request)
|
||||
{
|
||||
// dd( $request->all() );
|
||||
$params = [];
|
||||
parse_str($request['data'], $params);
|
||||
$paramsObj = (object) $params;
|
||||
// dd($paramsObj);
|
||||
|
||||
$R658PN = trim($paramsObj->R658PN);
|
||||
$R658CO = trim($paramsObj->R658CO);
|
||||
@@ -136,7 +127,6 @@ class ReplenishSettingsController extends Controller
|
||||
->where('R658PL', $R658PL)
|
||||
->where('R658WH', $R658WH)
|
||||
->first();
|
||||
// dd($recordExists);
|
||||
$recordExists = $recordExistSQL == null ? true : false;
|
||||
|
||||
return response()->json(['recordExists' => $recordExists]);
|
||||
@@ -178,17 +168,14 @@ class ReplenishSettingsController extends Controller
|
||||
// ->get();
|
||||
} else {
|
||||
$REFCAT658 = [];
|
||||
// $IC670M =[];
|
||||
}
|
||||
|
||||
// $sqlstmt="SELECT t1.REFKEY,t2.FULLID ,t2.*
|
||||
// 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);
|
||||
|
||||
// dd( Datatables::of($REFCAT658)->addIndexColumn()->make(true) );
|
||||
|
||||
return Datatables::of($REFCAT658)->addIndexColumn()->make(true);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,6 @@ class ShipToController extends Controller
|
||||
$model = new ShipTo;
|
||||
$model->fill($validated);
|
||||
$success = $model->save();
|
||||
// ShipTo::create($validated);
|
||||
if ($success) {
|
||||
return redirect()->route('m3.ship-to.index')->with('success', 'Record created successfully.');
|
||||
} else {
|
||||
|
||||
@@ -37,7 +37,6 @@ class carrierMaintController extends Controller
|
||||
{
|
||||
$currentUser = Helper::getUserCOWHSPLT();
|
||||
$UserCO = $currentUser['UserCO'] ?? '';
|
||||
// $UserWHS = $currentUser['UserWHS'] ?? '';
|
||||
// $UserPL = $currentUser['UserPL'] ?? '';
|
||||
|
||||
// Insert record to ICM160M
|
||||
@@ -66,7 +65,6 @@ class carrierMaintController extends Controller
|
||||
{
|
||||
$currentUser = Helper::getUserCOWHSPLT();
|
||||
$UserCO = $currentUser['UserCO'] ?? '';
|
||||
// $UserWHS = $currentUser['UserWHS'] ?? '';
|
||||
// $UserPL = $currentUser['UserPL'] ?? '';
|
||||
|
||||
// Insert record to ICM160M
|
||||
|
||||
@@ -21,12 +21,10 @@ class execSummaryController extends Controller
|
||||
try {
|
||||
// Ajax Call
|
||||
if ($request->ajax()) {
|
||||
// dump($request->all());
|
||||
$WHDDA = isset($request->WHDDA) ? $request->WHDDA : [];
|
||||
$WHArr = [];
|
||||
foreach ($WHDDA as $key => $WHDDAV) {
|
||||
$CO = substr($WHDDAV, 0, 3);
|
||||
// $R428PL = substr($WHDDAV, 3, 3);
|
||||
$WHArr[] = substr($WHDDAV, 6, 3);
|
||||
}
|
||||
|
||||
@@ -108,7 +106,6 @@ class execSummaryController extends Controller
|
||||
$reportDate = $firstDay->modify('first day of this month')->format('Ymd');
|
||||
|
||||
$toreportDate = $firstDay->modify('last day of this month')->format('Ymd');
|
||||
// $lastDay = isset($request->TOREPORTDATE) ? \DateTime::createFromFormat('Y-m', trim($request->TOREPORTDATE)) : '';
|
||||
// $toreportDate =$lastDay->modify('last day of this month')->format('Ymd');
|
||||
|
||||
// Build SQL
|
||||
@@ -129,7 +126,6 @@ class execSummaryController extends Controller
|
||||
$selectContent = '';
|
||||
break;
|
||||
}
|
||||
// dump($reportDate);
|
||||
// dump($toreportDate);
|
||||
// dump($selectContent);
|
||||
|
||||
@@ -137,7 +133,6 @@ class execSummaryController extends Controller
|
||||
} else {
|
||||
$execSummaryRes = collect();
|
||||
}
|
||||
// dump($execSummaryRes);
|
||||
|
||||
return response()->json(['success' => true, 'reportPeriod' => $reportPeriod, 'result' => $execSummaryRes, 'checkSales' => $checkSales,
|
||||
'checkWeight' => $checkWeight, 'checkLines' => $checkLines]);
|
||||
@@ -145,7 +140,6 @@ class execSummaryController extends Controller
|
||||
|
||||
// Init Page
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// dd($SHUSER);
|
||||
if ($SHUSER != '') {
|
||||
// Get User CO & WH from Table ICM428M
|
||||
$ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
|
||||
|
||||
@@ -19,12 +19,10 @@ class execSummaryLineController extends Controller
|
||||
try {
|
||||
// Ajax Call
|
||||
if ($request->ajax()) {
|
||||
// dump($request->all());
|
||||
$WHDDA = isset($request->WHDDA) ? $request->WHDDA : [];
|
||||
$WHArr = [];
|
||||
foreach ($WHDDA as $key => $WHDDAV) {
|
||||
$CO = substr($WHDDAV, 0, 3);
|
||||
// $R428PL = substr($WHDDAV, 3, 3);
|
||||
$WHArr[] = substr($WHDDAV, 6, 3);
|
||||
}
|
||||
|
||||
@@ -178,7 +176,6 @@ class execSummaryLineController extends Controller
|
||||
|
||||
// Init Page
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// dd($SHUSER);
|
||||
if ($SHUSER != '') {
|
||||
// Get User CO & WH from Table ICM428M
|
||||
$ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
|
||||
|
||||
@@ -6,7 +6,6 @@ use Illuminate\Http\Request;
|
||||
use mikehaertl\pdftk\Pdf;
|
||||
use Storage;
|
||||
|
||||
// use mikehaertl\tmp\File;
|
||||
|
||||
class fillBOLController extends Controller
|
||||
{
|
||||
@@ -33,7 +32,6 @@ class fillBOLController extends Controller
|
||||
dd($error);
|
||||
}
|
||||
|
||||
// $test = Storage::disk('public')->exists('ETN-BOL.pdf');
|
||||
// dd($test);
|
||||
|
||||
$newfile = "BOL-{$BOL['BOL_number']}.pdf";
|
||||
@@ -46,7 +44,6 @@ class fillBOLController extends Controller
|
||||
dd($error);
|
||||
}
|
||||
|
||||
// $test=$pdf->addFile(Storage::disk('public')->path($newfile), 'A');
|
||||
// dd($test);
|
||||
|
||||
$result = $pdf->fillForm([
|
||||
|
||||
@@ -86,10 +86,8 @@ class palletQtyController extends Controller
|
||||
public static function saveQtyEdit(Request $request)
|
||||
{
|
||||
|
||||
// dump($request);
|
||||
// console.log($request);
|
||||
|
||||
// $icm709m=DB::connection(config('m3.connection', 'pgsql'))->select("select count(*) as COUNT1 from ICM709M
|
||||
// where AT9CO='$request->AT9CO' and AT9PLT='$request->AT9PLT' and AT9WHS='$request->AT9WHS' and AT9PART='$request->AT9PART'");
|
||||
// var_dump($icm709m);
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ class pendingClosureController extends Controller
|
||||
$ICM699Ma[$val2->SHMACPKR]['SHTIME'] = $val2->SHTIME;
|
||||
}
|
||||
}
|
||||
// dump($ICM699Ma);
|
||||
|
||||
$sqlstmt = "select count(*) as COUNT1 from ICM699M
|
||||
where SHCO='$co' and SHWHS='$whs' and SHTYPE like '%M3%' and SHERROR='X'
|
||||
@@ -75,11 +74,9 @@ class pendingClosureController extends Controller
|
||||
// dump($sqlstmt3);
|
||||
$UproccessedOrders = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt3);
|
||||
foreach ($UproccessedOrders as $key => $UproccessedOrder) {
|
||||
// $unprocessedArr[] = $UproccessedOrder->APMANIFEST;
|
||||
$unprocessedArr[] = '<a class="btn btn-link mb-1" target="_blank" href="' . url('MFOrders', ['id' => trim($UproccessedOrder->APMANIFEST)]) . '"> ' .
|
||||
trim($UproccessedOrder->APMANIFEST) . '</a>';
|
||||
}
|
||||
// dump($unprocessedArr);
|
||||
|
||||
return view(
|
||||
'm3::liberty-theme.pages.pendingClosure',
|
||||
@@ -92,7 +89,6 @@ class pendingClosureController extends Controller
|
||||
{
|
||||
// Get URL PARAMS
|
||||
$urlParams = count($request->all()) > 0 ? $request->all() : '';
|
||||
// dd($urlParams);
|
||||
// $SHUSER = isset($urlParams["SHUSER"]) ? $urlParams["SHUSER"] : '';
|
||||
$MANIFEST = isset($urlParams['MANIFEST']) ? $urlParams['MANIFEST'] : '';
|
||||
$APCO = isset($urlParams['APCO']) ? $urlParams['APCO'] : '';
|
||||
@@ -112,7 +108,6 @@ class pendingClosureController extends Controller
|
||||
'message' => 'Manifest Closing submitted',
|
||||
]);
|
||||
} catch (\Throwable $th) {
|
||||
// throw $th;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,6 @@ class userControlController extends Controller
|
||||
|
||||
return 'success';
|
||||
} else {
|
||||
// echo "<script>alert('User profile entered does not exist, please try again');</script>";
|
||||
|
||||
// CL program call here (ewobjtst.)ICMUSRPRF parms(R428US, R428FIRST, R428FAMILY)
|
||||
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
|
||||
@@ -100,7 +99,6 @@ class userControlController extends Controller
|
||||
if (! $result) {
|
||||
$PGMERRORS = self::PROGRAM_ERROR_PREFIX . $conn->getErrorCode() . self::MESSAGE_SEPARATOR . $conn->getErrorMsg();
|
||||
|
||||
// echo "<script>alert($PGMERRORS);</script>";
|
||||
return 'error profile2';
|
||||
} else {
|
||||
// Successful Call : User profile created with default password
|
||||
@@ -128,7 +126,6 @@ class userControlController extends Controller
|
||||
public static function saveUserEdit(Request $request)
|
||||
{
|
||||
|
||||
// dump($request);
|
||||
if ($request->R428EMPCDE == '') {
|
||||
$request->R428EMPCDE = 0;
|
||||
}
|
||||
@@ -149,7 +146,6 @@ class userControlController extends Controller
|
||||
// Update record to ICM428M
|
||||
|
||||
$ICM428M = DB::connection(config('m3.connection', 'pgsql'))->select("select * from ICM428M where R428US='$request->R428US'");
|
||||
// var_dump($ICM428M);
|
||||
|
||||
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',
|
||||
@@ -197,7 +193,6 @@ class userControlController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// $conn->setOptions(array('persistent' => false, 'stateless' => true, 'debug' => true,'debugLogFile' => '/www/sentm3test/htdocs/M3/storage/logs/toolkit_debug.log'));
|
||||
|
||||
// Add LIB
|
||||
// $result = $conn->CLCommand('ADDLIBLE LIB(MPDAT10)');
|
||||
@@ -214,12 +209,10 @@ class userControlController extends Controller
|
||||
// Add Delivery Note Param
|
||||
// $params[] = $conn->AddParameterPackDec('in', 11, 0, 'ParamIn','','00000087125');
|
||||
|
||||
// $params[] = $conn->AddParameterZoned('in', 11, 0, 'ParamIn');
|
||||
|
||||
// Start Time Tracking
|
||||
// $start = microtime(true);
|
||||
|
||||
// dump('Calling: EWOBJ/ICMCHGPRF action='.$request->ACTION.' user='.$request->USERID);
|
||||
|
||||
// Config::get('eproconf.misc.PGM1'), Config::get('eproconf.misc.libname4')
|
||||
// ICM700C EWOBJTST ICM700C ICM700CSBM
|
||||
@@ -227,7 +220,6 @@ class userControlController extends Controller
|
||||
|
||||
if (! $result) {
|
||||
$PGMERRORS = self::PROGRAM_ERROR_PREFIX . $conn->getErrorCode() . self::MESSAGE_SEPARATOR . $conn->getErrorMsg();
|
||||
// dump($PGMERRORS);
|
||||
echo "<script>alert($PGMERRORS);</script>";
|
||||
|
||||
return 'error';
|
||||
@@ -235,7 +227,6 @@ class userControlController extends Controller
|
||||
}
|
||||
// Successful Call
|
||||
else {
|
||||
// dump($result);
|
||||
// $AWREQN = $result['io_param']["var0"];
|
||||
// return "success";
|
||||
if ($request->ACTION == 'P') {
|
||||
@@ -260,21 +251,18 @@ class userControlController extends Controller
|
||||
public static function savePassword(Request $request)
|
||||
{
|
||||
|
||||
// dd('B4');
|
||||
ini_set('max_execution_time', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('max_input_time', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
|
||||
|
||||
$PGMERRORS = '';
|
||||
|
||||
// console_log("request> ");
|
||||
// echo "request="; var_dump($request);
|
||||
|
||||
// echo "B3<br>";
|
||||
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
|
||||
try {
|
||||
$conn = app(PostgresProgramBridge::class);
|
||||
// dump($conn);
|
||||
// echo "B4<br>";
|
||||
} catch (\Throwable $e) {
|
||||
// echo "B5<br>";
|
||||
@@ -299,15 +287,12 @@ class userControlController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// $params = [];
|
||||
// $params[] = $conn->AddParameterChar('in', 10, 'userid','USRPRF',$request->USERID);
|
||||
// $params[] = $conn->AddParameterChar('in', 10, 'pwd','PASSWORD',$request->PASSWORD);
|
||||
// $params[] = $conn->AddParameterChar('in', 9, 'sts','STATUS','*ENABLED');
|
||||
// $params[] = $conn->AddParameterChar('in', 4, 'pwdexp','PWDEXP','*NO');
|
||||
|
||||
// dump('Before CHGUSRPRF');
|
||||
$result = $conn->CLCommand('QSYS/CHGUSRPRF USRPRF(' . $request->R428US_PWD . ') PASSWORD(' . $request->NEW_PASSWORD . ') STATUS(*ENABLED) PWDEXP(*NO)');
|
||||
// $result = $conn->PgmCall('CHGUSRPRF', 'QSYS', $params, array(), array());
|
||||
// echo "<script>alert('After CHGUSRPRF');</script>";
|
||||
|
||||
if (! $result) {
|
||||
|
||||
@@ -54,9 +54,7 @@ class userPickingStats4 extends Controller
|
||||
// while($row = odbc_fetch_object($result)) {
|
||||
$x = 0;
|
||||
foreach ($ICM428M as $key => $row) {
|
||||
// print_r($row);
|
||||
$user_array[$x]['userprf'] = trim($row->USERPRF);
|
||||
// $user_array[$x]['name']=trim($row->R428FIRST)+' '+trim($row->R428FAMILY);
|
||||
$user_array[$x]['name'] = trim($row->NAME);
|
||||
$user_array[$x]['empno'] = $row->EMPNO;
|
||||
$x++;
|
||||
@@ -65,7 +63,6 @@ class userPickingStats4 extends Controller
|
||||
|
||||
// fill array of Lines per Hour per Monitor
|
||||
$lph_per_monitor_array = Config::get('arrays_custom.lph_per_code_array');
|
||||
// echo "<pre>"; print_r($user_array); echo "</pre>";
|
||||
if (isset($request->user)) {
|
||||
$user = $request->user;
|
||||
$empno = 0;
|
||||
@@ -95,7 +92,6 @@ class userPickingStats4 extends Controller
|
||||
and oppno in ($payrollCodes)
|
||||
group by oppno";
|
||||
|
||||
// echo "$sqlstmt<br>";
|
||||
|
||||
$lbpf1 = $schema->hasTable('lbpf')
|
||||
? DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt)
|
||||
@@ -107,7 +103,6 @@ class userPickingStats4 extends Controller
|
||||
}
|
||||
|
||||
$sql = "select * from perfstat where dt='$starting' and a5pickcomu='$user' ";
|
||||
// @dd($sql);
|
||||
|
||||
if ((isset($request->dates) || isset($request->user)) && $schema->hasTable('perfstat')) {
|
||||
$statistic4 = DB::connection(config('m3.connection', 'pgsql'))->select($sql);
|
||||
@@ -115,9 +110,7 @@ class userPickingStats4 extends Controller
|
||||
$statistic4 = [];
|
||||
}
|
||||
|
||||
// echo "<pre>"; print_r($statistic4); echo "</pre>";
|
||||
|
||||
// $duration = microtime(true) - $start;
|
||||
|
||||
// initialize arrays
|
||||
$monitor_array = $totals_array = $perf_array = [];
|
||||
@@ -128,7 +121,6 @@ class userPickingStats4 extends Controller
|
||||
$totals_array['entries'] = 0;
|
||||
$diff = 0;
|
||||
|
||||
// echo "<pre>"; print_r($lbpf1); echo "</pre>";
|
||||
|
||||
foreach ($lbpf1 as $key => $val) {
|
||||
$monitor_array[$val->OPPNO]['tot_hours'] = $val->HRS;
|
||||
@@ -158,7 +150,6 @@ class userPickingStats4 extends Controller
|
||||
$monitor_array[$val->CODE]['weight'] = 0;
|
||||
$monitor_array[$val->CODE]['lines'] = 0;
|
||||
}
|
||||
// echo "after 1st init<br>";
|
||||
|
||||
// add another element (0) in monitor_array to capture the total blended lph value expected
|
||||
$monitor_array[0]['lph_blended_per_activity'] = 0;
|
||||
@@ -258,7 +249,6 @@ class userPickingStats4 extends Controller
|
||||
|
||||
}
|
||||
|
||||
// echo "<pre>";
|
||||
// print_r($request);
|
||||
// print_r($perf_array); print_r($monitor_array);
|
||||
|
||||
@@ -294,7 +284,6 @@ class userPickingStats4 extends Controller
|
||||
'grossHours' => $grossHours,
|
||||
];
|
||||
|
||||
// echo "<pre>"; print_r($json_data);
|
||||
return json_encode($json_data);
|
||||
|
||||
} else {
|
||||
@@ -305,7 +294,6 @@ class userPickingStats4 extends Controller
|
||||
$no_data = 'Y';
|
||||
}
|
||||
|
||||
// error_log("Time required to xyz: " . $duration . "\n", 3, "/temp/v4.log");
|
||||
|
||||
return view(
|
||||
'm3::liberty-theme.pages.userPickingStats4',
|
||||
|
||||
@@ -33,7 +33,6 @@ class userProfileController extends Controller
|
||||
|
||||
public static function updateUserProfile(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
|
||||
$R428US = isset($request->R428US) ? trim($request->R428US) : '';
|
||||
$R428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
|
||||
@@ -41,7 +40,6 @@ class userProfileController extends Controller
|
||||
$R428CO = substr($R428DPW, 0, 3);
|
||||
$R428PL = substr($R428DPW, 3, 3);
|
||||
$R428WH = substr($R428DPW, 6, 3);
|
||||
// dd($R428US.'-'.$R428CO.'-'.$R428PL.'-'.$R428WH );
|
||||
|
||||
if ($R428US != '') {
|
||||
// Update record to ICM428M
|
||||
@@ -49,7 +47,6 @@ class userProfileController extends Controller
|
||||
set R428CO='$R428CO', R428PL='$R428PL', R428WH='$R428WH'
|
||||
where R428US='$R428US'");
|
||||
|
||||
// return "success";
|
||||
return redirect('/userprofile')->with('success', 'Profile updated successfully!');
|
||||
} else {
|
||||
return redirect('/userprofile')->with('success', 'Profile updated successfully!');
|
||||
@@ -59,7 +56,6 @@ class userProfileController extends Controller
|
||||
|
||||
public static function updateUserProfileAjax(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
|
||||
$R428US = isset($request->R428US) ? trim($request->R428US) : '';
|
||||
$R428DPW = isset($request->R428DPW) ? trim($request->R428DPW) : '';
|
||||
@@ -67,7 +63,6 @@ class userProfileController extends Controller
|
||||
$R428CO = substr($R428DPW, 0, 3);
|
||||
$R428PL = substr($R428DPW, 3, 3);
|
||||
$R428WH = substr($R428DPW, 6, 3);
|
||||
// dd($R428US.'-'.$R428CO.'-'.$R428PL.'-'.$R428WH );
|
||||
|
||||
if ($R428US != '') {
|
||||
// Update record to ICM428M
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace Modules\M3\Http\Controllers;
|
||||
|
||||
use Ayeo\Barcode;
|
||||
// use Symfony\Component\HttpFoundation\Request;
|
||||
use Cache;
|
||||
use Config;
|
||||
use DB;
|
||||
@@ -58,7 +57,6 @@ class utilitiesContoller extends Controller
|
||||
|
||||
// define several input/output params
|
||||
$params = [];
|
||||
// $params[] = $conn->AddParameterChar('out',7,'eqNumber');
|
||||
|
||||
// AddParameterChar($io, $size, $comment, $varName, $value, $varying, $dimension)
|
||||
// Add Warehouse Param
|
||||
@@ -68,7 +66,6 @@ class utilitiesContoller extends Controller
|
||||
// Add Delivery Note Param
|
||||
$params[] = $conn->AddParameterPackDec('in', 11, 0, 'ParamIn', '', '00000087125');
|
||||
|
||||
// $params[] = $conn->AddParameterZoned('in', 11, 0, 'ParamIn');
|
||||
|
||||
// Start Time Tracking
|
||||
$start = microtime(true);
|
||||
@@ -85,14 +82,11 @@ class utilitiesContoller extends Controller
|
||||
// Successful Call
|
||||
else {
|
||||
dump($result);
|
||||
// $AWREQN = $result['io_param']["var0"];
|
||||
}
|
||||
|
||||
if ($PGMERRORS != '') {
|
||||
// return back()->withMessage('Can not Create PR: '.$PGMERRORS);
|
||||
dump($PGMERRORS);
|
||||
} else {
|
||||
// return $AWREQN;
|
||||
}
|
||||
// Get Execution Time
|
||||
$time = microtime(true) - $start;
|
||||
@@ -108,13 +102,11 @@ class utilitiesContoller extends Controller
|
||||
// Parse PDF file and build necessary objects.
|
||||
$parser = new Parser;
|
||||
|
||||
// $pdf = $parser->parseFile('/www/sentm3test/htdocs/labels/E1232824-10826596.pdf');
|
||||
// dump($pdf);
|
||||
// $text = $pdf->getText();
|
||||
// dump("Text Only");
|
||||
// dump($text);
|
||||
|
||||
// $pdfFile = file_get_contents('/www/sentm3test/htdocs/labels/E1232824-10826596.pdf');
|
||||
$pdfFile = File::get('/www/sentm3test/htdocs/labels/' . $pdfFileName . '.pdf');
|
||||
|
||||
// Transform content to base64
|
||||
@@ -172,9 +164,7 @@ class utilitiesContoller extends Controller
|
||||
->orderBy('A5PICKSTRD', 'ASC')
|
||||
->get();
|
||||
|
||||
// $counter=0;
|
||||
foreach ($ICM688M2SLTMP as $key => $ICM688M2SL) {
|
||||
// $counter++;
|
||||
// $counter == 10 ? exit : '';
|
||||
|
||||
$A5MACPKR = isset($ICM688M2SL->A5MACPKR) ? $ICM688M2SL->A5MACPKR : '';
|
||||
@@ -206,7 +196,6 @@ class utilitiesContoller extends Controller
|
||||
|
||||
// Get Manifest Array
|
||||
$GSArray = $request->query();
|
||||
// dump($GSArray);
|
||||
|
||||
$SHUSER = isset($GSArray['User']) ? trim($GSArray['User']) : '';
|
||||
|
||||
@@ -374,7 +363,6 @@ class utilitiesContoller extends Controller
|
||||
}
|
||||
|
||||
$html .= '</body> </html>';
|
||||
// dump($html);
|
||||
|
||||
ob_start();
|
||||
|
||||
@@ -389,7 +377,6 @@ class utilitiesContoller extends Controller
|
||||
// $dompdf->stream();
|
||||
|
||||
$pdfContent = $dompdf->output();
|
||||
// dump($pdfContent);
|
||||
|
||||
$labelsPath = Config::get('arrays.PdfPath'); // '/www/sentm3live/htdocs/labels/';
|
||||
// Put the PDF in labels/CarrierLabel
|
||||
@@ -415,12 +402,10 @@ class utilitiesContoller extends Controller
|
||||
// $ICM695M3SQLInsert = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m3')
|
||||
// ->insert(['A2CO'=> $COMPANY,'A2WHS'=> $WHS,'A2MACPKR'=> $Macpkr,'A2GS1LABEL'=> $gs1_128_bc]);
|
||||
|
||||
// Log::channel('LabelCron')->info("<<< GS1-128...End of Label Creation for Mackpkr: ".$Macpkr);
|
||||
|
||||
return json_encode(['result' => 'success', 'GS1File' => $GS1FileNameNoRoot]);
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
// Log::error($th);
|
||||
Log::channel('LabelCron')->error($th);
|
||||
|
||||
return json_encode(['result' => 'error', 'GS1File' => $th]);
|
||||
@@ -432,10 +417,8 @@ class utilitiesContoller extends Controller
|
||||
{
|
||||
print_r('>>> Generate PDF');
|
||||
|
||||
// $builder = new Barcode\Builder();
|
||||
// $image = $builder->output('(10)123456(400)11(3906)333333');
|
||||
|
||||
// $builder = new Barcode\Builder();
|
||||
// $builder->setBarcodeType('gs1-128');
|
||||
// $builder->setFilename('barcode.png');
|
||||
// $builder->setImageFormat('png');
|
||||
@@ -536,7 +519,6 @@ class utilitiesContoller extends Controller
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
// return ($html);
|
||||
|
||||
// Initialize Dompdf
|
||||
$dompdf = new Dompdf;
|
||||
@@ -615,7 +597,6 @@ class utilitiesContoller extends Controller
|
||||
$response = $controller->processShipment($myRequest);
|
||||
|
||||
$responseData = $response->getData();
|
||||
// dd($responseData);
|
||||
// $responseJSON = json_encode($responseData);
|
||||
// dump($responseJSON);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Modules\M3\Http\Controllers;
|
||||
use Config;
|
||||
use DB;
|
||||
use Illuminate\Http\Request;
|
||||
// use Modules\M3\Models\ICM711M;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
@@ -27,7 +26,6 @@ class whsePerfController extends Controller
|
||||
// **********************************************************************************
|
||||
$date_in_yr = isset($request->date_in_yr) ? $request->date_in_yr : date('Y');
|
||||
$date_in_mth = isset($request->date_in_mth) ? $request->date_in_mth : date('m');
|
||||
// $date_in = isset($request->date_in)?$request->date_in:date('Ymd');
|
||||
$date_in = $date_in_yr . $date_in_mth . '01';
|
||||
$sqlstmt = 'select AVDATE, AVANOTESCL,AVADLRCL,AVAWGTCL,AVANOTESCH,AVADLRCH,AVAWGTCH,AVANOTESOP,AVADLROP,AVAWGTOP,
|
||||
AVLNOTESCL,AVLDLRCL,AVLWGTCL,AVLNOTESCH,AVLDLRCH,AVLWGTCH,AVLNOTESOP,AVLDLROP,AVLWGTOP,
|
||||
@@ -51,7 +49,6 @@ class whsePerfController extends Controller
|
||||
|
||||
$date_in_yr = isset($request->date_in_yr) ? $request->date_in_yr : date('Y');
|
||||
$date_in_mth = isset($request->date_in_mth) ? $request->date_in_mth : date('m');
|
||||
// $date_in = isset($request->date_in)?$request->date_in:date('Ymd');
|
||||
$date_in = $date_in_yr . $date_in_mth . '01';
|
||||
$sqlstmt = 'select AVDATE, AVANOTESCL,AVADLRCL,AVAWGTCL,AVANOTESCH,AVADLRCH,AVAWGTCH,AVANOTESOP,AVADLROP,AVAWGTOP,
|
||||
AVLNOTESCL,AVLDLRCL,AVLWGTCL,AVLNOTESCH,AVLDLRCH,AVLWGTCH,AVLNOTESOP,AVLDLROP,AVLWGTOP,
|
||||
|
||||
@@ -11,7 +11,6 @@ class whsePerfDetailsController extends Controller
|
||||
public static function index(Request $request)
|
||||
{
|
||||
|
||||
// $date_in = date('Y-m-d', strtotime($request->date_in));
|
||||
$date_in = isset($request->date) ? date('Y-m-d', strtotime($request->date)) : date('Y-m-d');
|
||||
$date_in_minus_4_months = date('Y-m-d', strtotime($date_in . ' -4 months'));
|
||||
$for = isset($request->for) ? $request->for : 'a';
|
||||
@@ -76,11 +75,8 @@ class whsePerfDetailsController extends Controller
|
||||
$stmt2 = $all;
|
||||
break;
|
||||
}
|
||||
// phpinfo();
|
||||
include $_SERVER['DOCUMENT_ROOT'] . '/../../KPI2_update711M_SQL_main.inc.php';
|
||||
// var_dump($sqlstmt1.$stmt2);
|
||||
$perfDetails = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt1 . $stmt2);
|
||||
// var_dump($perfDetails);
|
||||
|
||||
return view('m3::liberty-theme.pages.whsePerfDetails', compact('perfDetails', 'date_in', 'for'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user