m3 Security Fixes
This commit is contained in:
@@ -50,11 +50,11 @@ class CloseShipment extends Controller
|
||||
# PDF File PATH
|
||||
$pdfFilePath = Config::get('arrays.PdfPath');
|
||||
$DELIVERYNO = $MANIFEST != '' ? $MANIFEST : '000000';
|
||||
|
||||
|
||||
// Log::channel('dailyCron')->info("Close Manifest:".$MANIFEST.'-WHS: '.$WHS."-CO:".$COMPANY);
|
||||
|
||||
if ($urlParams != '') {
|
||||
# Write to Logs : JSON
|
||||
# Write to Logs : JSON
|
||||
$JSONIN = json_encode([
|
||||
"WHS" => $WHS,
|
||||
"COMPANY" => $COMPANY,
|
||||
@@ -87,7 +87,7 @@ class CloseShipment extends Controller
|
||||
|
||||
if ($tokenData->code == '200') {
|
||||
$IonToken = isset($tokenData->token) ? $tokenData->token : '';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$SHDATA = isset($tokenData->message) ? $tokenData->message : '';
|
||||
$DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : '000000';
|
||||
@@ -107,7 +107,7 @@ class CloseShipment extends Controller
|
||||
'SHWHS' => $WHS
|
||||
];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
return $tokenResponse;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ class CloseShipment extends Controller
|
||||
->where('AYMACPKR',$MANIFEST)
|
||||
->where('AYWHS',$WHS)
|
||||
->orderBy('AYMACPKR');
|
||||
|
||||
|
||||
# Check Date & Time Before Updating ICM699M
|
||||
if ($SHDT!='' && $SHTIME!='' && $SHTYPE!='' && $NODEBUG) {
|
||||
$ICM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
@@ -141,7 +141,7 @@ class CloseShipment extends Controller
|
||||
->where('SHDT',$SHDT)
|
||||
->where('SHTIME',$SHTIME)
|
||||
->where('SHCO',$COMPANY)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHSOURCE',$SHSOURCE)
|
||||
->where('SHERROR','X')
|
||||
->where('SHTYPE',$SHTYPE)
|
||||
@@ -153,7 +153,7 @@ class CloseShipment extends Controller
|
||||
->select()
|
||||
->where('SHMACPKR',$MANIFEST)
|
||||
->where('SHCO',$COMPANY)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHSOURCE','PackSyst4tray')
|
||||
->where('SHERROR','Z')
|
||||
->where('SHTYPE','M3-QtyChg')
|
||||
@@ -176,7 +176,7 @@ class CloseShipment extends Controller
|
||||
->where('A4MACPKR',$MANIFEST)
|
||||
->orderBy('A4MACPKR');
|
||||
}
|
||||
|
||||
|
||||
$ICM695M1TMP = $ICM695M1PREP->get();
|
||||
// dump($ICM695M1TMP);
|
||||
// Log::channel('dailyCron')->info($ICM695M1TMP);
|
||||
@@ -194,7 +194,7 @@ class CloseShipment extends Controller
|
||||
});
|
||||
}
|
||||
// dump($ICM695M1TMPCOLF);
|
||||
|
||||
|
||||
$ICM695M1TMPCOLFA = $ICM695M1TMPCOLF->toArray();
|
||||
// dump($ICM695M1TMPCOLFA);
|
||||
|
||||
@@ -239,7 +239,7 @@ class CloseShipment extends Controller
|
||||
|
||||
# Close Shipment for Manifest or Single MacPKR
|
||||
if (count($ICM695M1TMP)>0 && ($TRANSTYPE=='M' || $TRANSTYPE=='P')) {
|
||||
# Loop the Results from $ICM595M1TMP
|
||||
# Loop the Results from $ICM595M1TMP
|
||||
foreach ($ICM695M1TMP as $key => $ICM695M1R) {
|
||||
$PACKAGES = [];
|
||||
$AYWHS = trim($ICM695M1R->AYWHS);
|
||||
@@ -272,7 +272,7 @@ class CloseShipment extends Controller
|
||||
// ->where('IMWHS',$AYWHS)
|
||||
// ->where('IMDELNO',$AYMACPKR)
|
||||
// ->where('IMLINE',$AYRLNO)
|
||||
// ->whereIn('IMTOLOC',['DOCK','PACK'])
|
||||
// ->whereIn('IMTOLOC',['DOCK','PACK'])
|
||||
// ->get();
|
||||
|
||||
# PFC : Check that Picked / Packed are all Equal
|
||||
@@ -283,13 +283,13 @@ class CloseShipment extends Controller
|
||||
$A5RSVQTY = isset($ICM688M2SLR->A5RSVQTY) ? $ICM688M2SLR->A5RSVQTY : 0;
|
||||
$A5ShortShipQty = (int) $A5RSVQTY - (int) $A5PICKED;
|
||||
|
||||
# Set EndFLag=1 for short picks
|
||||
# Set EndFLag=1 for short picks
|
||||
if ($A5ShortShipQty > 0) {
|
||||
$EndFlag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
# Get TRAILERNUMBER SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
|
||||
# Get TRAILERNUMBER SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
|
||||
$TRAILERNUMBERS = DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
|
||||
->select('APTRUCKID','APTRACKNO','APMANIFEST')
|
||||
->where('APCO',$COMPANY)
|
||||
@@ -313,7 +313,7 @@ class CloseShipment extends Controller
|
||||
->orderBy('AYINTBOX')
|
||||
->get();
|
||||
// dd($ICM695M1JOINTMP);
|
||||
|
||||
|
||||
foreach ($ICM695M1JOINTMP as $key => $ICM695M1JOINR) {
|
||||
$A4SHIPVIA = isset($ICM695M1JOINR->A4SHIPVIA) ? trim(str_replace("&", "_",$ICM695M1JOINR->A4SHIPVIA)) : '';
|
||||
|
||||
@@ -375,18 +375,18 @@ class CloseShipment extends Controller
|
||||
->where('A1DELNO',$AYMACPKR)
|
||||
->first();
|
||||
$GS1LabelExist = isset($ICM666MSQLSel->A1SPR1A01) ? trim($ICM666MSQLSel->A1SPR1A01) : 0;
|
||||
|
||||
|
||||
# Case #566: BOL = PRONUMBER For SCAC=='RETR'
|
||||
if ($SCAC=='RETR') {
|
||||
$BILLOFLADING = $PRONUMBER;
|
||||
}
|
||||
|
||||
# Get Commodities
|
||||
# Get Commodities
|
||||
$myRequest = new Request();
|
||||
$myRequest->setMethod('POST');
|
||||
|
||||
|
||||
$myRequest->request->add([
|
||||
'MACPKR' => $AYMACPKR
|
||||
'MACPKR' => $AYMACPKR
|
||||
]);
|
||||
# Call processShipment
|
||||
$controller = new GetContentsController();
|
||||
@@ -411,7 +411,7 @@ class CloseShipment extends Controller
|
||||
$commodities = '';
|
||||
$ErrorMsgs = $ErrorMsgs ." Could not find Commodities; ";
|
||||
}
|
||||
# End Commodities
|
||||
# End Commodities
|
||||
|
||||
# Check ICM699M for SHERROR=X
|
||||
$ICM699MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
@@ -433,7 +433,7 @@ class CloseShipment extends Controller
|
||||
}
|
||||
|
||||
if($AYTYPE==""){
|
||||
# Get AETYPE SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
|
||||
# Get AETYPE SELECT APTRUCKID FROM ICM705M1 WHERE APCO=110 AND APWHS=321 AND APMANIFEST=22
|
||||
$ICM693MS = DB::connection(config('m3.connection', 'pgsql'))->table('icm693m')
|
||||
->select('AEID')
|
||||
->where('AESPR1A01','D')
|
||||
@@ -448,11 +448,11 @@ class CloseShipment extends Controller
|
||||
# If billable=Y and a4ratetcp(FREIGHT)>0 and a4ratem3=blank, then call the freight API CoCharge
|
||||
if ($BILLABLE=='Y' && $FREIGHT>0 && $A4RATEM3=='') {
|
||||
$DELIVERYNO = isset($AYMACPKR) ? $AYMACPKR : '000000';
|
||||
|
||||
|
||||
if($SHIPTYPE=='LTL') {
|
||||
$shippingToBill = $FREIGHT*(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceLTL'))/100;
|
||||
$shippingToBill = $FREIGHT*(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceLTL'))/100;
|
||||
} else {
|
||||
$shippingToBill = $FREIGHT*(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel') )/100;
|
||||
$shippingToBill = $FREIGHT*(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel') )/100;
|
||||
}
|
||||
# Construct Json for COCharge
|
||||
$JSONCoCharge = [
|
||||
@@ -478,7 +478,7 @@ class CloseShipment extends Controller
|
||||
# Set PDF URLs for Labels
|
||||
$CarrierLabel = '';
|
||||
$ContentLabel = '';
|
||||
|
||||
|
||||
$docTypes = ['ContentLabel','CarrierLabel'];
|
||||
foreach ($docTypes as $key => $value) {
|
||||
switch ($value) {
|
||||
@@ -489,7 +489,7 @@ class CloseShipment extends Controller
|
||||
$pdfFileName = $pdfFilePath.$PDFKey.'.pdf';
|
||||
// dd($pdfFileName);
|
||||
|
||||
if(File::exists($pdfFileName)){
|
||||
if(File::exists($pdfFileName)){
|
||||
$CarrierLabel = route('m3.M3GetPDFFromCache.index',['MACPKR'=>$AYMACPKR, 'DOCTYPE'=>$DOCTYPE ]);
|
||||
}
|
||||
break;
|
||||
@@ -524,7 +524,7 @@ class CloseShipment extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
# Get Packages Array
|
||||
# Get Packages Array
|
||||
$PACKAGES[]=[
|
||||
"TRACKINGID" => $TRACKING,
|
||||
"BUNDLES" => $AYTYPE,
|
||||
@@ -617,7 +617,7 @@ class CloseShipment extends Controller
|
||||
# MAK : Log JSON Manifest # and MACKPKR #
|
||||
// Log::channel('dailyCron')->info('1 >>> JSON Sent for Manifest: '.$MANIFEST.' ,Macpicker: '.$AYMACPKR);
|
||||
Log::channel('dailyCron')->info('1 >>> JSON Sent for Manifest: '.(string)(int)$MANIFEST.' ,Macpicker: '.$AYMACPKR);
|
||||
|
||||
|
||||
$data = [
|
||||
'SHMACPKR' => $DELIVERYNO,
|
||||
'SHDT' => date('Y-m-d'),
|
||||
@@ -670,13 +670,13 @@ class CloseShipment extends Controller
|
||||
$responseMsg = $responseContents->result->CloseShipment;
|
||||
$M3APIRESULT = $responseMsg->PickingListClose->Result;
|
||||
$M3APIRESULTMsg = isset($responseMsg->PickingListClose->ErrorMessage) ? $responseMsg->PickingListClose->ErrorMessage: '';
|
||||
|
||||
|
||||
# Check M3 Response for Errors
|
||||
$responseResult = $responseContents->result;
|
||||
$M3Errors = Helper::checkM3Errors($responseResult);
|
||||
// dd($M3Errors);
|
||||
|
||||
# If you get a successful response, update database file ICM688M1/A4RATEm3=X
|
||||
# If you get a successful response, update database file ICM688M1/A4RATEm3=X
|
||||
# Update ICM688M1 : Change A4RATEM3
|
||||
if (count($JSONCoCharge)>0 && $M3APIRESULT != 'Error') {
|
||||
DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
|
||||
@@ -781,7 +781,7 @@ class CloseShipment extends Controller
|
||||
$ICM699MUZ = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
->where('SHMACPKR',$AYMACPKR)
|
||||
->where('SHCO',$COMPANY)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHSOURCE',$SHSOURCE)
|
||||
->where('SHERROR','X')
|
||||
->where('SHTYPE','M3-General')
|
||||
@@ -793,17 +793,17 @@ class CloseShipment extends Controller
|
||||
$ICM705M1U = DB::connection(config('m3.connection', 'pgsql'))->table('icm705m1')
|
||||
->where('APMANIFEST',$MANIFEST)
|
||||
->where('APCO',$COMPANY)
|
||||
->where('APWHS',$WHS)
|
||||
->where('APWHS',$WHS)
|
||||
->update(["APSPARE2"=>"X"]);
|
||||
}
|
||||
|
||||
# Send Response
|
||||
|
||||
# Send Response
|
||||
if ($allErrMsgs=='') {
|
||||
return response()->json([
|
||||
'code' => '200',
|
||||
'status' => 'Success',
|
||||
'message'=> 'All Operations Successful'
|
||||
]);
|
||||
]);
|
||||
}
|
||||
else{
|
||||
$allErrMsgsC = Helper::removeDuplicateSubstrings($allErrMsgs);
|
||||
@@ -812,9 +812,9 @@ class CloseShipment extends Controller
|
||||
'code' => '206',
|
||||
'status' => 'Success With Warnings',
|
||||
'message'=> $allErrMsgsC ."; Check Transaction Logs for Errors or Warnings."
|
||||
]);
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
# Close Shipment for Zero Picks
|
||||
else if (count($ICM695M1TMP)>0 && $TRANSTYPE=='Z') {
|
||||
@@ -876,12 +876,12 @@ class CloseShipment extends Controller
|
||||
$responseContents = json_decode($response->getBody()->getContents());
|
||||
$M3SessionId = $response->hasHeader('x-transaction-id') ? "-sessionID:". $response->header('x-transaction-id') : '-sessionID';
|
||||
$M3Errors = '';
|
||||
|
||||
|
||||
if ($responseContents!=null) {
|
||||
$responseMsg = $responseContents->result->CloseShipment;
|
||||
$M3APIRESULT = $responseMsg->PickingListClose->Result;
|
||||
$M3APIRESULTMsg = isset($responseMsg->PickingListClose->ErrorMessage) ? $responseMsg->PickingListClose->ErrorMessage: '';
|
||||
|
||||
|
||||
# Check M3 Response for Errors
|
||||
$responseResult = $responseContents->result;
|
||||
$M3Errors = Helper::checkM3Errors($responseResult);
|
||||
@@ -959,21 +959,21 @@ class CloseShipment extends Controller
|
||||
$ICM699MUZ = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
->where('SHMACPKR',$AYMACPKR)
|
||||
->where('SHCO',$COMPANY)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHWHS',$WHS)
|
||||
->where('SHSOURCE',$SHSOURCE)
|
||||
->where('SHERROR','X')
|
||||
->where('SHTYPE','M3-General')
|
||||
->where('SHDATA','like','%CommTCP_read%')
|
||||
->update(["SHERROR"=>"Z","SHACKUSER"=>$SHUSER,"SHACKDATE"=>date('Y-m-d'),"SHACKTIME"=>date('H:i:s'),"SHACKNOTE"=> $SHACKNOTE]);
|
||||
}
|
||||
|
||||
# Send Response
|
||||
|
||||
# Send Response
|
||||
if ($ErrorMsgs=='') {
|
||||
return response()->json([
|
||||
'code' => '200',
|
||||
'status' => 'Success',
|
||||
'message'=> 'All Operations Successful'
|
||||
]);
|
||||
]);
|
||||
}
|
||||
else{
|
||||
return response()->json([
|
||||
@@ -988,9 +988,9 @@ class CloseShipment extends Controller
|
||||
$DELIVERYNO = isset($MANIFEST) ? $MANIFEST : '000000';
|
||||
// # Set SHDATA Message
|
||||
$SHDATAMSG = 'No records found in ICM695M1,or URL parameters incomplete';
|
||||
# count($ICM695M1TMP)==0 ? 'MacPkr already closed' :
|
||||
# count($ICM695M1TMP)==0 ? 'MacPkr already closed' :
|
||||
$SHERROR = 'X';
|
||||
# count($ICM695M1TMP)==0 ? 'Z' :
|
||||
# count($ICM695M1TMP)==0 ? 'Z' :
|
||||
|
||||
# Write to Logs Out : Error
|
||||
$data = [
|
||||
|
||||
@@ -128,7 +128,7 @@ class M3Controller extends Controller
|
||||
try {
|
||||
$jsonFile = count($request->json()->all()) > 0 ? $request->json()->all() : '';
|
||||
|
||||
# Root
|
||||
# Root
|
||||
$Company = isset($jsonFile["Company"]) ? $jsonFile["Company"] : '';
|
||||
$Plant = isset($jsonFile["Plant"]) ? $jsonFile["Plant"] : '';
|
||||
$Warehouse = isset($jsonFile["Warehouse"]) ? $jsonFile["Warehouse"] : '';
|
||||
@@ -148,7 +148,7 @@ class M3Controller extends Controller
|
||||
$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
|
||||
# Set Carrier BWAY if it's empty for Tilburg only
|
||||
if (($CarrierCode=='' || $CarrierCode==null) && $Warehouse=='111' && $Company=='410' && $Plant=='410' ) {
|
||||
$CarrierCode = 'BWAY';
|
||||
}
|
||||
@@ -188,7 +188,7 @@ class M3Controller extends Controller
|
||||
|
||||
# MycarrierDetails
|
||||
$ShipVia = isset($jsonFile["ShipVia"]) ? $jsonFile["ShipVia"]: '';
|
||||
|
||||
|
||||
# Comments
|
||||
$Picker = $Packer = $Carrier = $Other ='';
|
||||
$AXCO = $Company;
|
||||
@@ -200,11 +200,11 @@ class M3Controller extends Controller
|
||||
$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];
|
||||
@@ -285,17 +285,87 @@ class M3Controller extends Controller
|
||||
$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,
|
||||
'ExchangeRate' => $ExchangeRate,
|
||||
'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,
|
||||
];
|
||||
|
||||
# Check JSON fields if empty or > DB Fields
|
||||
foreach ($ICM666MFields as $key => $value) {
|
||||
$keyVar = $key;
|
||||
# Sanitize String
|
||||
$$keyVar = Helper::sanityzeString($$keyVar);
|
||||
$fieldValue = Helper::sanityzeString($fieldValues[$key] ?? '');
|
||||
# Check Var Types & Length
|
||||
$LengthTest = Helper::checkLength($$keyVar, $value[1], $value[2]);
|
||||
$LengthTest = Helper::checkLength($fieldValue, $value[1], $value[2]);
|
||||
|
||||
if (!$LengthTest[413] || !$LengthTest[411] || !$LengthTest[417]) {
|
||||
// Log::error($key .' :: '. $value[0].' :: '. $value[1] .' JSONF: '.$$keyVar .' Type: '.$value[2] );
|
||||
@@ -315,12 +385,12 @@ class M3Controller extends Controller
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
return response()->json($message);
|
||||
} else if ($$keyVar != '') {
|
||||
$InsertArray[$value[0]] = $$keyVar;
|
||||
} else if ($fieldValue != '') {
|
||||
$InsertArray[$value[0]] = $fieldValue;
|
||||
}
|
||||
}
|
||||
// Log::info($InsertArray);
|
||||
|
||||
|
||||
# Check ICM709M
|
||||
$ICM709MSEL = DB::connection(config('m3.connection', 'pgsql'))->table('icm709m')
|
||||
->select()
|
||||
@@ -339,7 +409,7 @@ class M3Controller extends Controller
|
||||
$InsertArray['A1MATWRN'] = $HazMat;
|
||||
|
||||
// if ($PalletQty!='') {
|
||||
// $InsertArray['A1USRN01']=$palletQty;
|
||||
// $InsertArray['A1USRN01']=$palletQty;
|
||||
// }
|
||||
|
||||
# SQL Insert to ICM666M
|
||||
@@ -350,16 +420,16 @@ class M3Controller extends Controller
|
||||
if ($Warehouse!='' && $PickerNumber!='' && $Company!='') {
|
||||
$PGMERRORS = '';
|
||||
$AWREQN = '';
|
||||
|
||||
|
||||
# connect to toolkit using DB2 credentials (can also leave blank for default authority)
|
||||
try {
|
||||
$conn = app(\Modules\M3\Services\PostgresProgramBridge::class);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
# Determine reason for failure.
|
||||
# Probably database authentication error or invalid or unreachable database.
|
||||
$code = $e->getCode();
|
||||
$msg = $e->getMessage();
|
||||
|
||||
|
||||
switch ($code) {
|
||||
case 8001:
|
||||
# "Authorization failure on distributed database connection attempt"
|
||||
@@ -375,10 +445,10 @@ class M3Controller extends Controller
|
||||
}
|
||||
}
|
||||
$conn->setOptions(array('persistent' => false, 'stateless' => true, 'debug' => true,'debugLogFile' => env('TOOLKIT_DEBUG_LOG')));
|
||||
|
||||
|
||||
# Add LIB
|
||||
# $result = $conn->CLCommand('ADDLIBLE LIB(MPDAT10)');
|
||||
|
||||
|
||||
# define several input/output params
|
||||
$params = [];
|
||||
# $params[] = $conn->AddParameterChar('out',7,'eqNumber');
|
||||
@@ -391,7 +461,7 @@ class M3Controller extends Controller
|
||||
|
||||
# AddParameterPackDec($io, $length, $scale, $comment, $varName, $value,$dimension)
|
||||
# Add Delivery Note Param
|
||||
$PickerNumberNoZero = ltrim(strval($PickerNumber), '0');
|
||||
$PickerNumberNoZero = ltrim(strval($PickerNumber), '0');
|
||||
$params[] = $conn->AddParameterChar('in', 11, 'PickerNumber','',$PickerNumberNoZero);
|
||||
// $params[] = $conn->AddParameterZoned('in', 11, 0, 'ParamIn');
|
||||
|
||||
@@ -427,11 +497,11 @@ 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';
|
||||
|
||||
|
||||
$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([
|
||||
'code'=>'415',
|
||||
'status'=>'error',
|
||||
|
||||
@@ -96,7 +96,7 @@ class M3InventoryReport extends Controller
|
||||
$data = ['SHMACPKR'=>$DELIVERYNO,'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'=>'','SHWHS'=>$WHS ];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
# Send Response
|
||||
return response()->json([
|
||||
'code'=>'405',
|
||||
@@ -126,7 +126,7 @@ class M3InventoryReport extends Controller
|
||||
$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'=>'','SHWHS'=>$WHS];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
return response()->json([
|
||||
'code'=>'405',
|
||||
'status'=>'error',
|
||||
@@ -172,7 +172,7 @@ class M3InventoryReport extends Controller
|
||||
$WHS = isset($urlParams["WHS"]) ? $urlParams["WHS"] : '';
|
||||
$MACPKR = isset($urlParams["MACPKR"]) ? $urlParams["MACPKR"] : '000000'; # Delivery Number
|
||||
$PKLN = isset($urlParams["PKLN"]) ? $urlParams["PKLN"] : '';
|
||||
|
||||
|
||||
if($urlParams!=''){
|
||||
$IncomingParams = ['CO'=> $CO,'WHS'=> $WHS,'MACPKR'=> $MACPKR,'PKLN'=> $PKLN,'REQPKWS'=> $REQPKWS,'REQKPKUS'=> $REQKPKUS];
|
||||
$IncomingParams = json_encode($IncomingParams);
|
||||
@@ -211,11 +211,11 @@ class M3InventoryReport extends Controller
|
||||
$PARTS[] = ["PART"=> $PART , "LOT"=>$LOT];
|
||||
$PICKERARR[$PART] = $ICM688M2->A5SENTPKR;
|
||||
}
|
||||
// Log::info($PARTS);
|
||||
// Log::info($PARTS);
|
||||
// dump($PARTS);
|
||||
$JSON = json_encode( ["WHS" => $WHS,"PARTS"=> $PARTS ] );
|
||||
// Log::info($JSON);
|
||||
|
||||
// Log::info($JSON);
|
||||
|
||||
# Get Token
|
||||
$tokenResponse = Helper::checkReceiveTokenV2();
|
||||
$tokenData = $tokenResponse->getData();
|
||||
@@ -234,7 +234,7 @@ class M3InventoryReport extends Controller
|
||||
# Call ionapi with Params
|
||||
$endPointURL = env('ENDPOINTURL').'APIFLOWS/Sentinel/M3InventoryReportList?ionapiRespStyle=sync';
|
||||
$token = $IonToken;
|
||||
|
||||
|
||||
$response = Http::withHeaders([
|
||||
'accept' => 'application/json',
|
||||
'Content-Type' => 'application/json'
|
||||
@@ -260,13 +260,13 @@ class M3InventoryReport extends Controller
|
||||
$M3Errors = 'Error: No Response from M3';
|
||||
}
|
||||
|
||||
# Validate response From M3
|
||||
# Validate response From M3
|
||||
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 ];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
# Send Response
|
||||
return response()->json([
|
||||
'code'=>'405',
|
||||
@@ -285,7 +285,7 @@ class M3InventoryReport extends Controller
|
||||
foreach ($responseTMP as $key => $value) {
|
||||
// dump($value);
|
||||
$dataToWrite = [];
|
||||
|
||||
|
||||
foreach ($value as $key2 => $content) {
|
||||
if($key2!='Locations'){
|
||||
$dataToWrite[$key2] = $content;
|
||||
@@ -317,12 +317,12 @@ class M3InventoryReport extends Controller
|
||||
->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=='' ) {
|
||||
$SQLInsertPrep640M['LVCO'] = $CO; # Company
|
||||
@@ -364,7 +364,7 @@ class M3InventoryReport extends Controller
|
||||
$SQLInsertPrep630M['LLIZLCF'] = trim($value['LotNumber'])!='' ? '1' : ''; # Lot control flag
|
||||
$SQLInsertPrep630M['LLCMDESC'] = $value['Description']; # Description
|
||||
$SQLInsertPrep630M['LLSPR10A01'] = isset($value['Allocation']) ? $value['Allocation'] : ''; # Allocation
|
||||
$SQLInsertPrep630M['LLSPR15A01'] = isset($value['AllocatedTo']) ? $value['AllocatedTo'] : ''; # AllocatedTo
|
||||
$SQLInsertPrep630M['LLSPR15A01'] = isset($value['AllocatedTo']) ? $value['AllocatedTo'] : ''; # AllocatedTo
|
||||
|
||||
DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')->insert($SQLInsertPrep630M);
|
||||
}
|
||||
@@ -431,7 +431,7 @@ class M3InventoryReport extends Controller
|
||||
$SHERROR = 'X';
|
||||
$word = 'Duplicate key value specified';
|
||||
$position = strpos($th, $word);
|
||||
|
||||
|
||||
if ($position !== false) {
|
||||
$SHERROR = 'Z';
|
||||
}
|
||||
@@ -439,7 +439,7 @@ class M3InventoryReport extends Controller
|
||||
$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'=> $REQKPKUS,'SHSOURCE'=> $SHSOURCE,'SHCO'=>$CO,'SHWHS'=>$WHS];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
Log::error($th);
|
||||
return response()->json([
|
||||
'code'=>'405',
|
||||
|
||||
@@ -33,11 +33,11 @@ class PdfStorage extends Controller
|
||||
# Get URL PARAMS
|
||||
$urlParams = count($request->all())>0 ? $request->all() : '';
|
||||
// dd($urlParams);
|
||||
|
||||
|
||||
$COMPANY = isset($urlParams["COMPANY"]) ? trim($urlParams["COMPANY"]) : ''; # Company
|
||||
$WHS = isset($urlParams["WHS"]) ? trim($urlParams["WHS"]) : ''; # WareHouse
|
||||
$DOCTYPE = isset($urlParams["DOCTYPE"]) ? trim($urlParams["DOCTYPE"]) : ''; # document type (PackingList, CarrierLabel, ContentLabel)
|
||||
$FILENAME = isset($urlParams["FILENAME"]) ? trim($urlParams["FILENAME"]) : ''; # PDF File name
|
||||
$FILENAME = isset($urlParams["FILENAME"]) ? trim($urlParams["FILENAME"]) : ''; # PDF File name
|
||||
$DOCNUM = isset($urlParams["DOCNUM"]) ? trim($urlParams["DOCNUM"]) : ''; # document number (ie the internal box number, the pick list number)
|
||||
$A4MACPKR = isset($urlParams["A4MACPKR"]) ? trim($urlParams["A4MACPKR"]) : ''; # Delivery note number
|
||||
|
||||
@@ -52,7 +52,7 @@ class PdfStorage extends Controller
|
||||
'SHDATA'=>json_encode($IncomingParams) ,'SHUSER'=> $SHUSER,'SHSOURCE'=> $SHSOURCE,'SHCO'=>$COMPANY,'SHWHS'=>$WHS ];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
# Make Key and Test Validity
|
||||
# Make Key and Test Validity
|
||||
if ($A4MACPKR!='' && $DOCTYPE!='' && $DOCNUM!='' && $COMPANY!='' && $WHS!=''){
|
||||
$cacheKey = $A4MACPKR.$DOCTYPE.$DOCNUM.$COMPANY.$WHS;
|
||||
}
|
||||
@@ -69,24 +69,24 @@ class PdfStorage extends Controller
|
||||
|
||||
// Parse PDF file and build necessary objects.
|
||||
$parser = new \Smalot\PdfParser\Parser();
|
||||
|
||||
|
||||
// $pdf = $parser->parseFile('/www/sentm3test/htdocs/labels/E1232824-10826596.pdf');
|
||||
// dump($pdf);
|
||||
// $text = $pdf->getText();
|
||||
// dump("Text Only");
|
||||
// dump($text);
|
||||
|
||||
|
||||
$pdfFile = File::get($pdfFileName);
|
||||
|
||||
|
||||
// Transform content to base64
|
||||
$base64PDF = base64_encode($pdfFile);
|
||||
// Output base64 string
|
||||
// dump($base64PDF);
|
||||
|
||||
|
||||
# Save Cache
|
||||
Cache::forever($cacheKey, $base64PDF);
|
||||
// Cache::put($cacheKey, $base64PDF, now()->addMinutes(60));
|
||||
|
||||
|
||||
# Retrieve Cache
|
||||
// $cachedPdfFile = Cache::get($cacheKey);
|
||||
// dump("Retrieve Base64 Encoded PDF saved in Cache:");
|
||||
@@ -95,7 +95,7 @@ class PdfStorage extends Controller
|
||||
# remove File from Cache
|
||||
// Cache::put(pdfFileName, 'value', -5);
|
||||
// Cache::forget($pdfFileName);
|
||||
|
||||
|
||||
# Base64 Decode and Display
|
||||
// $pdf = $parser->parseContent(base64_decode($base64PDF));
|
||||
// $text = $pdf->getText();
|
||||
@@ -117,7 +117,7 @@ class PdfStorage extends Controller
|
||||
else {
|
||||
$SHDATA = File::exists($pdfFileName) ? '' : 'PDF File Not Found-';
|
||||
$SHDATA = $cacheKey!='' ? $SHDATA.'' : $SHDATA.'Cache Key is missing Params';
|
||||
|
||||
|
||||
# Write to Logs Out : Error
|
||||
$data = ['SHMACPKR'=>$DELIVERYNO,'SHDT'=> date('Y-m-d'),'SHTIME'=> date('H:i:s') ,'SHERROR'=> 'X','SHINTBOX'=> $DOCNUM,'SHTYPE'=> 'M3-Res-out' ,
|
||||
'SHDATA'=>'An Error Occured -'.$SHDATA,'SHUSER'=> $SHUSER,'SHSOURCE'=> $SHSOURCE,'SHCO'=>$COMPANY,'SHWHS'=>$WHS];
|
||||
|
||||
@@ -24,7 +24,7 @@ class ReplenAPI extends Controller
|
||||
ini_set('max_input_time', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
|
||||
|
||||
// dd($request->all());
|
||||
// dd($request->all());
|
||||
// Log::info( $request->all() );
|
||||
# Get The Calling User
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(m3_user()) : 'WebUser';
|
||||
@@ -35,7 +35,7 @@ class ReplenAPI extends Controller
|
||||
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"] : '';
|
||||
@@ -59,7 +59,7 @@ class ReplenAPI extends Controller
|
||||
// dump($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 ];
|
||||
@@ -116,13 +116,13 @@ class ReplenAPI extends Controller
|
||||
$M3Errors = 'Error: No Response from M3';
|
||||
}
|
||||
|
||||
# Validate response From M3
|
||||
# Validate response From M3
|
||||
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 ];
|
||||
Helper::logToICM699M($data);
|
||||
|
||||
|
||||
# Send Response
|
||||
return response()->json([
|
||||
'code'=>'405',
|
||||
@@ -141,7 +141,7 @@ class ReplenAPI extends Controller
|
||||
foreach ($responseTMP as $key => $value) {
|
||||
// dump($value);
|
||||
$dataToWrite = [];
|
||||
|
||||
|
||||
foreach ($value as $key2 => $content) {
|
||||
if($key2!='Locations'){
|
||||
$dataToWrite[$key2] = $content;
|
||||
@@ -173,12 +173,12 @@ class ReplenAPI extends Controller
|
||||
->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=='' ) {
|
||||
$SQLInsertPrep640M['LVCO'] = $CO; // Company
|
||||
@@ -189,15 +189,15 @@ class ReplenAPI extends Controller
|
||||
$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);
|
||||
}
|
||||
# Update
|
||||
else {
|
||||
$SQLUpdatePrep640M['LVSEQN'] = $value['LocationSeq'];
|
||||
$SQLUpdatePrep640M['LVUSD2'] = $value['LocationType'];
|
||||
$SQLUpdatePrep640M['LVZONE'] = $value['Zone'];
|
||||
$SQLUpdatePrep640M['LVMAINTTS'] = now();
|
||||
$SQLUpdatePrep640M['LVZONE'] = $value['Zone'];
|
||||
$SQLUpdatePrep640M['LVMAINTTS'] = now();
|
||||
|
||||
DB::connection(config('m3.connection', 'pgsql'))->table('de640m')
|
||||
->where('LVCO',$CO)
|
||||
@@ -218,15 +218,15 @@ class ReplenAPI extends Controller
|
||||
$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
|
||||
|
||||
|
||||
DB::connection(config('m3.connection', 'pgsql'))->table('ic630m')->insert($SQLInsertPrep630M);
|
||||
}
|
||||
// dump($SQLInsertPrep);
|
||||
|
||||
|
||||
#Send Response
|
||||
return response()->json([
|
||||
'code' => '200',
|
||||
@@ -259,7 +259,7 @@ class ReplenAPI extends Controller
|
||||
$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([
|
||||
'code'=>'405',
|
||||
'status'=>'error',
|
||||
@@ -272,7 +272,7 @@ class ReplenAPI extends Controller
|
||||
$SHERROR = 'X';
|
||||
$word = 'Duplicate key value specified';
|
||||
$position = strpos($th, $word);
|
||||
|
||||
|
||||
if ($position !== false) {
|
||||
$SHERROR = 'Z';
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class TransferAPI extends Controller
|
||||
->where('SHMACPKR', $DELIVERYNO)
|
||||
->where('SHDT', $SHDT)
|
||||
->where('SHTIME', $SHTIME)
|
||||
# ->whereRaw("VARCHAR_FORMAT (TIMESTAMP (CURRENT DATE) + MIDNIGHT_SECONDS (SHTIME) SECONDS, 'HH24:MI') = ?", [$SHTIMEHM])
|
||||
# ->whereRaw("VARCHAR_FORMAT (TIMESTAMP (CURRENT DATE) + MIDNIGHT_SECONDS (SHTIME) SECONDS, 'HH24:MI') = ?", [$SHTIMEHM])
|
||||
->where('SHCO', $DIVI)
|
||||
->where('SHWHS', $WHS)
|
||||
->where('SHSOURCE', $SHSOURCE)
|
||||
@@ -101,7 +101,7 @@ class TransferAPI extends Controller
|
||||
$SHDATA = isset($ICM699MS->SHDATA) ? $ICM699MS->SHDATA : '';
|
||||
$SHDATAJSON = "";
|
||||
$position = strpos($SHDATA, $word);
|
||||
# Also Read CommTCP_read
|
||||
# Also Read CommTCP_read
|
||||
$word2 = 'url:http://127.0.0.1:10005/api/TransferAPIURL?';
|
||||
$SHDATA2 = isset($ICM699MS->SHDATA) ? $ICM699MS->SHDATA : '';
|
||||
$position2 = strpos($SHDATA2, $word2);
|
||||
@@ -141,7 +141,7 @@ class TransferAPI extends Controller
|
||||
}
|
||||
// dd($JSONTR);
|
||||
|
||||
# Set SHERROR to Z in ICM699M
|
||||
# Set SHERROR to Z in ICM699M
|
||||
$ICM699MU = DB::connection(config('m3.connection', 'pgsql'))->table('icm699m')
|
||||
->where('SHMACPKR', $DELIVERYNO)
|
||||
->where('SHDT', $SHDT)
|
||||
@@ -154,9 +154,9 @@ class TransferAPI extends Controller
|
||||
->update(["SHERROR" => "Z", "SHACKUSER" => $SHUSER, "SHACKDATE" => date('Y-m-d'), "SHACKTIME" => date('H:i:s')]);
|
||||
}
|
||||
|
||||
# Part Exists : proceed
|
||||
# Part Exists : proceed
|
||||
if ($PART != '') {
|
||||
# Read from ICM688M2
|
||||
# Read from ICM688M2
|
||||
# Get Parts And Lots from ICM688M2
|
||||
$ICM688M2SLTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m2')
|
||||
->select('A5BRADLN', 'A5PKSFX', 'A5PLANT', 'A5SENTPKR')
|
||||
@@ -470,7 +470,7 @@ class TransferAPI extends Controller
|
||||
// dd($A4SPR15A01);
|
||||
|
||||
if ($A4SPR15A01 != '') {
|
||||
# Read from ICM688M1
|
||||
# Read from ICM688M1
|
||||
$ICM688M1SLTMP = DB::connection(config('m3.connection', 'pgsql'))->table('icm688m1')
|
||||
->select('A4MACPKR')
|
||||
->where('A4CO', $DIVI)
|
||||
@@ -490,7 +490,7 @@ class TransferAPI extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
# A4SPR15A01 Exists : proceed
|
||||
# A4SPR15A01 Exists : proceed
|
||||
if ($A4SPR15A01 != '' && count($allMacpkrs)>0) {
|
||||
$JSON = json_encode([
|
||||
"DIVI" => $DIVI,
|
||||
@@ -631,7 +631,7 @@ class TransferAPI extends Controller
|
||||
'message' => 'Json Payload Not Valid, missing Parameter or no Macpicker # found.'
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Write to Logs Out : Error
|
||||
$DELIVERYNO = isset($DELIVERYNO) ? $DELIVERYNO : '000000';
|
||||
|
||||
@@ -25,7 +25,7 @@ class TwoShipAPIs extends Controller
|
||||
ini_set('max_input_time', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
|
||||
|
||||
// dd($request->all());
|
||||
// dd($request->all());
|
||||
|
||||
// Log::info( $request->all() );
|
||||
# Get The Calling User
|
||||
@@ -115,12 +115,12 @@ class TwoShipAPIs extends Controller
|
||||
curl_setopt($ch, CURLOPT_VERBOSE, false);
|
||||
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
#When CURLOPT_SSL_VERIFYPEER is enabled (value=1), and the verification fails to prove that the certificate is authentic, the connection fails.
|
||||
#When CURLOPT_SSL_VERIFYPEER is enabled (value=1), and the verification fails to prove that the certificate is authentic, the connection fails.
|
||||
#When the option is zero, the peer certificate verification succeeds regardless.
|
||||
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||
#When CURLOPT_SSL_VERIFYHOST is 2, that certificate must indicate that the server is the server to which you meant to connect,
|
||||
#or the connection fails. Simply put, it means it has to have the same name in the certificate as is in the URL you operate against.
|
||||
#When CURLOPT_SSL_VERIFYHOST is 2, that certificate must indicate that the server is the server to which you meant to connect,
|
||||
#or the connection fails. Simply put, it means it has to have the same name in the certificate as is in the URL you operate against.
|
||||
|
||||
# Set data content type
|
||||
curl_setopt(
|
||||
@@ -157,7 +157,7 @@ class TwoShipAPIs extends Controller
|
||||
|
||||
# Close the session
|
||||
unset($ch);
|
||||
|
||||
|
||||
// dump($response);
|
||||
// dump($status);
|
||||
// dump($CurlError);
|
||||
@@ -173,7 +173,7 @@ class TwoShipAPIs extends Controller
|
||||
$TwoShipErrors .= ' -Curl Error: '.$CurlError;
|
||||
}
|
||||
|
||||
# Validate response From 2Ship
|
||||
# Validate response From 2Ship
|
||||
# Error
|
||||
if ($TwoShipErrors != '') {
|
||||
// dump($TwoShipErrors);
|
||||
|
||||
@@ -8,7 +8,7 @@ use Config;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
// use Modules\M3\Models\ICM709M;
|
||||
//
|
||||
//
|
||||
|
||||
class GetContentsController extends Controller
|
||||
{
|
||||
@@ -17,8 +17,8 @@ class GetContentsController extends Controller
|
||||
{
|
||||
# Get Mackpkr from Request
|
||||
$macpacPicker = isset($request->MACPKR) ? trim($request->MACPKR) : '';
|
||||
|
||||
# ESN1
|
||||
|
||||
# ESN1
|
||||
# $macpacPicker='888568'; // LTL example
|
||||
# $macpacPicker='894337'; // another LTL example with smaller orders, therefore pallets are more mixed
|
||||
# $macpacPicker='1225311'; // parcel example
|
||||
@@ -27,7 +27,7 @@ class GetContentsController extends Controller
|
||||
|
||||
try {
|
||||
$icm704mArray = $this->buildNMFCCodesArray();
|
||||
|
||||
|
||||
$shipmentData = $this->getShipmentData($macpacPicker);
|
||||
if (empty($shipmentData['orderNumber'])) {
|
||||
return response()->json(['error' => "Picker {$macpacPicker} was not found in ICM688M1"]);
|
||||
@@ -80,19 +80,19 @@ class GetContentsController extends Controller
|
||||
protected function getShipmentData($macpacPicker)
|
||||
{
|
||||
$result = DB::select("
|
||||
SELECT
|
||||
SELECT
|
||||
SUM(A4TPCKWGHT) as total_weight,
|
||||
A4MACPKR, A4SHSHA1, A4SHSHA2, A4SHSHCI, A4SHSHNM,
|
||||
A4SHSHCT, A4SHSHZP, A4SHSHST, A4ONO, A4STCN, A4CO,
|
||||
A4MACPKR, A4SHSHA1, A4SHSHA2, A4SHSHCI, A4SHSHNM,
|
||||
A4SHSHCT, A4SHSHZP, A4SHSHST, A4ONO, A4STCN, A4CO,
|
||||
A4WHS, A4SHIPVIA, A4SLCO, A4SLWHS, A4CATPID, A42SSVCCOD,
|
||||
A4CARRIER, A4SHPAGGCD, A4SALESLOC, A4SHCSPO, A4OFSTRM,
|
||||
A4CARRIER, A4SHPAGGCD, A4SALESLOC, A4SHCSPO, A4OFSTRM,
|
||||
A4SCAC, A4PLANT
|
||||
FROM ICM688M1
|
||||
FROM ICM688M1
|
||||
WHERE A4MACPKR = ?
|
||||
GROUP BY A4MACPKR, A4SHSHA1, A4SHSHA2, A4SHSHCI, A4SHSHNM,
|
||||
A4SHSHCT, A4SHSHZP, A4SHSHST, A4ONO, A4RLNO, A4SHNO,
|
||||
A4STCN, A4CO, A4WHS, A4SHIPVIA, A4SLCO, A4SLWHS,
|
||||
A4CATPID, A42SSVCCOD, A4CARRIER, A4SHPAGGCD,
|
||||
GROUP BY A4MACPKR, A4SHSHA1, A4SHSHA2, A4SHSHCI, A4SHSHNM,
|
||||
A4SHSHCT, A4SHSHZP, A4SHSHST, A4ONO, A4RLNO, A4SHNO,
|
||||
A4STCN, A4CO, A4WHS, A4SHIPVIA, A4SLCO, A4SLWHS,
|
||||
A4CATPID, A42SSVCCOD, A4CARRIER, A4SHPAGGCD,
|
||||
A4SALESLOC, A4SHCSPO, A4OFSTRM, A4SCAC, A4PLANT",
|
||||
[$macpacPicker]
|
||||
);
|
||||
@@ -128,13 +128,13 @@ class GetContentsController extends Controller
|
||||
protected function getPackagesData($macpkrList)
|
||||
{
|
||||
$results = DB::select("
|
||||
SELECT
|
||||
AYINTBOX,
|
||||
MAX(AYHEIGHT) as height,
|
||||
MAX(AYWIDTH) as width,
|
||||
MAX(AYDEPTH) as depth,
|
||||
SELECT
|
||||
AYINTBOX,
|
||||
MAX(AYHEIGHT) as height,
|
||||
MAX(AYWIDTH) as width,
|
||||
MAX(AYDEPTH) as depth,
|
||||
SUM(AYLNWGHT) as weight
|
||||
FROM ICM695M1
|
||||
FROM ICM695M1
|
||||
WHERE AYMACPKR IN (?)
|
||||
GROUP BY AYINTBOX
|
||||
ORDER BY AYINTBOX",
|
||||
@@ -183,16 +183,16 @@ class GetContentsController extends Controller
|
||||
$nmfcResults = DB::select("
|
||||
WITH tempfile AS (
|
||||
SELECT
|
||||
(SELECT A5WBFRCT FROM ICM688M2
|
||||
WHERE A5MACPKR IN (?) AND A5PART=AZPART
|
||||
(SELECT A5WBFRCT FROM ICM688M2
|
||||
WHERE A5MACPKR IN (?) AND A5PART=AZPART
|
||||
FETCH FIRST 1 ROWS ONLY) as WBFRCT,
|
||||
az.*
|
||||
FROM ICM695M2 az
|
||||
az.*
|
||||
FROM ICM695M2 az
|
||||
WHERE AZMACPKR IN (?)
|
||||
)
|
||||
SELECT azintbox, MIN(WBFRCT) as MIN_WBFRCT
|
||||
FROM tempfile
|
||||
GROUP BY azintbox
|
||||
SELECT azintbox, MIN(WBFRCT) as MIN_WBFRCT
|
||||
FROM tempfile
|
||||
GROUP BY azintbox
|
||||
ORDER BY 1",
|
||||
[$macpkrList, $macpkrList]
|
||||
);
|
||||
@@ -210,34 +210,34 @@ class GetContentsController extends Controller
|
||||
{
|
||||
$results = DB::select("
|
||||
WITH tempfile1 AS (
|
||||
SELECT
|
||||
A5PART,
|
||||
MAX(A5CMDESC) as A5CMDESC,
|
||||
MAX(A5MUTMS) as A5MUTMS,
|
||||
SELECT
|
||||
A5PART,
|
||||
MAX(A5CMDESC) as A5CMDESC,
|
||||
MAX(A5MUTMS) as A5MUTMS,
|
||||
MAX(A5PMPWHT) as A5PMPWHT,
|
||||
MAX(A5SLUNPR) as A5SLUNPR,
|
||||
MAX(A5SLUNPR) as A5SLUNPR,
|
||||
TRIM(MIN(A5WBFRCT)) as A5WBFRCT
|
||||
FROM ICM688M2
|
||||
WHERE A5CO = ? AND A5WHS = ? AND A5MACPKR IN (?) AND A5PACKED > 0
|
||||
GROUP BY A5PART
|
||||
),
|
||||
tempfile2 AS (
|
||||
SELECT
|
||||
AZINTBOX,
|
||||
AZPART,
|
||||
SELECT
|
||||
AZINTBOX,
|
||||
AZPART,
|
||||
SUM(AZPACKED) as AZPACKED,
|
||||
MAX(SUBSTR(AZSPR15A01,1,4)) as HAZARDOUS
|
||||
FROM ICM695M2
|
||||
WHERE AZCO = ? AND AZWHS = ? AND AZMACPKR IN (?) AND AZPACKED <> 0
|
||||
FROM ICM695M2
|
||||
WHERE AZCO = ? AND AZWHS = ? AND AZMACPKR IN (?) AND AZPACKED <> 0
|
||||
GROUP BY AZINTBOX, AZPART
|
||||
)
|
||||
SELECT
|
||||
A5PART, A5CMDESC, A5MUTMS,
|
||||
A5PMPWHT * AZPACKED as WEIGHt,
|
||||
SELECT
|
||||
A5PART, A5CMDESC, A5MUTMS,
|
||||
A5PMPWHT * AZPACKED as WEIGHt,
|
||||
AZPACKED, AZINTBOX,
|
||||
A5WBFRCT, HAZARDOUS, A5SLUNPR
|
||||
FROM tempfile1
|
||||
LEFT JOIN tempfile2 ON AZPART = A5PART
|
||||
FROM tempfile1
|
||||
LEFT JOIN tempfile2 ON AZPART = A5PART
|
||||
ORDER BY A5PART",
|
||||
[$company, $warehouse, $macpkrList, $company, $warehouse, $macpkrList]
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@ class M3CallCloseAPIController extends Controller
|
||||
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
|
||||
|
||||
try {
|
||||
|
||||
|
||||
# Get the Calling User
|
||||
# Get URL PARAMS
|
||||
$urlParams = count($request->all())>0 ? $request->all() : '';
|
||||
@@ -31,7 +31,7 @@ class M3CallCloseAPIController extends Controller
|
||||
$APCO = isset($urlParams["APCO"]) ? $urlParams["APCO"] : '';
|
||||
$APWHS = isset($urlParams["APWHS"]) ? $urlParams["APWHS"] : '';
|
||||
|
||||
if ($MANIFEST!='' && $APCO!='' && $APWHS!='') { // $SHUSER!='' &&
|
||||
if ($MANIFEST!='' && $APCO!='' && $APWHS!='') { // $SHUSER!='' &&
|
||||
// Log::channel('dailyCron')->info("Cron...Start CallCloseAPI...For user:".$SHUSER." Manifest#: ".$MANIFEST);
|
||||
|
||||
# Get Logged User CO & WH
|
||||
@@ -62,10 +62,10 @@ class M3CallCloseAPIController extends Controller
|
||||
if (count($ICM705M1)>0) {
|
||||
# Loop the Results from $ICM705M1
|
||||
foreach ($ICM705M1 as $key => $ICM705M1R) {
|
||||
# Send CO and WHS to CallCloseAPI
|
||||
# Send CO and WHS to CallCloseAPI
|
||||
$USERCO = isset($ICM705M1R->APCO) ? $ICM705M1R->APCO : '';
|
||||
$USERWH = isset($ICM705M1R->APWHS) ? $ICM705M1R->APWHS : '';
|
||||
|
||||
|
||||
$callCloseShipment = Artisan::call('command:CallCloseAPI', ['user'=> $SHUSER ,'manifest' => $ICM705M1R->APMANIFEST ,
|
||||
'co' => $USERCO ,'whs' => $USERWH]);
|
||||
// dump($callCloseShipment);
|
||||
@@ -75,14 +75,14 @@ class M3CallCloseAPIController extends Controller
|
||||
'code' => '200',
|
||||
'status' => 'Success',
|
||||
'message'=> 'Manifest Closing submitted'
|
||||
]);
|
||||
]);
|
||||
}
|
||||
else{
|
||||
return response()->json([
|
||||
'code' => '206',
|
||||
'status' => 'Failure',
|
||||
'message'=> 'Manifest Closing Failed'
|
||||
]);
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ class M3CallCloseAPIController extends Controller
|
||||
'code' => '206',
|
||||
'status' => 'Error',
|
||||
'message'=> "Manifest CloseAPI: No records found in ICM705M1..."
|
||||
]);
|
||||
]);
|
||||
}
|
||||
}
|
||||
else{
|
||||
@@ -109,5 +109,5 @@ class M3CallCloseAPIController extends Controller
|
||||
Log::error($th);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -35,15 +35,15 @@ class M3DeliveryController extends Controller
|
||||
//
|
||||
public static function saveM3DeliveryAdd(Request $request) {
|
||||
|
||||
$icm664m=DB::connection(config('m3.connection', 'pgsql'))->select("select count(*) as COUNT1 from ICM664M
|
||||
$icm664m=DB::connection(config('m3.connection', 'pgsql'))->select("select count(*) as COUNT1 from ICM664M
|
||||
where AVCO='$request->AVCO' and AVWHS='$request->AVWHS' and AVPLANT='$request->AVPLANT' and AVDELMETH='$request->AVDELMETH'");
|
||||
if($icm664m[0]->COUNT1=="1") {
|
||||
return "exists";
|
||||
} else {
|
||||
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM664M
|
||||
(AVCO, AVPLANT, AVWHS, AVDELMETH, AVSHPVIA, AVSHSRT, AVSHORCL)
|
||||
values ('$request->AVCO', '$request->AVPLANT', '$request->AVWHS', '$request->AVDELMETH',
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM664M
|
||||
(AVCO, AVPLANT, AVWHS, AVDELMETH, AVSHPVIA, AVSHSRT, AVSHORCL)
|
||||
values ('$request->AVCO', '$request->AVPLANT', '$request->AVWHS', '$request->AVDELMETH',
|
||||
'$request->AVSHPVIA', '$request->AVSHSRT', '$request->AVSHORCL')");
|
||||
return "success";
|
||||
|
||||
@@ -56,11 +56,11 @@ class M3DeliveryController extends Controller
|
||||
public static function saveM3DeliveryEdit(Request $request) {
|
||||
#dd($request);
|
||||
// Update record to ICM664M
|
||||
|
||||
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM664M
|
||||
|
||||
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM664M
|
||||
set AVSHPVIA='$request->AVSHPVIA', AVSHSRT='$request->AVSHSRT', AVSHORCL='$request->AVSHORCL'
|
||||
where AVCO='$request->AVCO' and AVPLANT='$request->AVPLANT' and AVWHS='$request->AVWHS' and AVDELMETH='$request->AVDELMETH'");
|
||||
|
||||
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ class M3ErrorsDispController extends Controller
|
||||
# Count records before exporting to excel : Max 20K records are allowed
|
||||
$ICM699MCount = $ICM699MC->count();
|
||||
// dd($ICM699MCount);
|
||||
# Set Max allowed records
|
||||
# Set Max allowed records
|
||||
$maxRecords = Config::get('arrays.maxRecDL');
|
||||
if ($ICM699MCount > $maxRecords) {
|
||||
return redirect()->back()->withInput()->with('message', 'Maximum allowed records for Excel Download is: ' . number_format($maxRecords) .
|
||||
@@ -318,7 +318,7 @@ class M3ErrorsDispController extends Controller
|
||||
return $value->SHACKUSER = $SHACKUSER;
|
||||
});
|
||||
|
||||
# Prepend Header To Excel
|
||||
# Prepend Header To Excel
|
||||
$newItem = ["SHMACPKR" => 'Delivery Note',
|
||||
"DELIVERY_NUM" => 'Order #',
|
||||
"CUSTOMER" => 'Customer',
|
||||
|
||||
@@ -28,7 +28,7 @@ class M3GetPDFFromCacheController extends Controller
|
||||
$pdfFilePath = Config::get('arrays.PdfPath');
|
||||
try {
|
||||
# Initialise Vars
|
||||
$PDFArray = $trackingno = $carrier = $ICM688M1 = [];
|
||||
$PDFArray = $trackingno = $carrier = $ICM688M1 = [];
|
||||
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// dd($SHUSER);
|
||||
@@ -40,7 +40,7 @@ class M3GetPDFFromCacheController extends Controller
|
||||
->select('R428US','R428CO', 'R428WH','R428PL')
|
||||
->where('R428US','=',$SHUSER)
|
||||
->first();
|
||||
|
||||
|
||||
$R428US = isset($ICM428M->R428US) ? $ICM428M->R428US : '';
|
||||
$COMPANY = isset($ICM428M->R428CO) ? $ICM428M->R428CO : ''; # Company
|
||||
$PLANT = isset($ICM428M->R428PL) ? $ICM428M->R428PL : ''; # Plant
|
||||
@@ -50,7 +50,7 @@ class M3GetPDFFromCacheController extends Controller
|
||||
# Warehouse Table
|
||||
$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);
|
||||
@@ -78,7 +78,7 @@ class M3GetPDFFromCacheController extends Controller
|
||||
// dump($ICM695M1Agg);
|
||||
$aggno = isset($ICM695M1Agg->AYTRUCK) ? trim($ICM695M1Agg->AYTRUCK) : '';
|
||||
|
||||
if($aggno!="" && $aggno!="0") {
|
||||
if($aggno!="" && $aggno!="0") {
|
||||
// dump($aggno);
|
||||
|
||||
$aggmsg="This delivery note is part of aggregation $aggno ";
|
||||
@@ -117,7 +117,7 @@ class M3GetPDFFromCacheController extends Controller
|
||||
|
||||
if (count($ICM695M1)>0) {
|
||||
$tmpCacheArr = $carrier = $trackingno = [];
|
||||
# Loop the Results from $ICM595M1TMP
|
||||
# Loop the Results from $ICM595M1TMP
|
||||
foreach ($ICM695M1 as $key => $ICM695M1R) {
|
||||
$WHS = trim($ICM695M1R->AYWHS);
|
||||
$COMPANY = trim($ICM695M1R->AYCO);
|
||||
@@ -177,7 +177,7 @@ class M3GetPDFFromCacheController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
// dump($tmpCacheArr);
|
||||
// dump($tmpCacheArr);
|
||||
|
||||
# Get unique values from array $PDFArray
|
||||
$tmpCacheArr = collect($tmpCacheArr)->unique();
|
||||
@@ -194,7 +194,7 @@ class M3GetPDFFromCacheController extends Controller
|
||||
// $base64PDF = $pdfFile;
|
||||
$base64PDF = base64_encode($pdfFile);
|
||||
// dd($base64PDF);
|
||||
$PDFArray[] = $base64PDF;
|
||||
$PDFArray[] = $base64PDF;
|
||||
}
|
||||
}
|
||||
// dump($PDFArray);
|
||||
@@ -206,7 +206,7 @@ class M3GetPDFFromCacheController extends Controller
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
// Log::error($th);
|
||||
}
|
||||
}
|
||||
# dump($PDFArray);
|
||||
# dump($AYMACPKR);
|
||||
# dump($IC670M);
|
||||
|
||||
@@ -11,7 +11,7 @@ class MFOrdersController extends Controller
|
||||
public static function index(Request $request)
|
||||
{
|
||||
$MF = isset($request->id) ? trim($request->id) : "";
|
||||
|
||||
|
||||
// dd("MFOrders ".$MF);
|
||||
# Get Users from ICM428M
|
||||
$ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
|
||||
@@ -26,7 +26,7 @@ class MFOrdersController extends Controller
|
||||
# ICM705M1 Statement
|
||||
$sqlstmt = "select APMANIFEST,APDOCKDOOR,APCARRIER,APTRUCKIDT,APSPARE1,APLDSTRU,APLDSTRD,APLDSTRT,
|
||||
APLDCLOU,APLDCLOD,APLDCLOT,APCO,APWHS,APPLT,APSPARE2,APLDCLOZ
|
||||
from ICM705M1
|
||||
from ICM705M1
|
||||
where APMANIFEST = $MF and APCO='$co' and APWHS='$whs' and APPLT='$plant' limit 1";
|
||||
|
||||
$ICM705M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
|
||||
@@ -35,8 +35,8 @@ class MFOrdersController extends Controller
|
||||
|
||||
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
|
||||
|
||||
$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'
|
||||
GROUP BY AYCO,AYPLANT,AYMACPKR,AYONO,A4SHSHNM,A4PICKSTS,AYSPR15A01";
|
||||
|
||||
@@ -29,7 +29,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
->select('R428US','R428CO', 'R428WH','R428PL')
|
||||
->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
|
||||
@@ -38,7 +38,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
# Warehouse Table
|
||||
$IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
|
||||
|
||||
|
||||
# Get URL PARAMS
|
||||
$urlParams = count($request->all())>0 ? $request->all() : '';
|
||||
// dump($urlParams);
|
||||
@@ -58,10 +58,10 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
SHDT, SHTIME,
|
||||
CASE WHEN SHDT IS NULL THEN (SELECT SHDATA FROM ICM699M WHERE SHMACPKR=A5MACPKR AND SHTYPE='M3-Res-out' AND SHSOURCE='CloseShipmentCoChargeAPI' ORDER BY SHDT DESC, SHTIME DESC FETCH FIRST 1 ROWS ONLY) ELSE '' END AS REASON,
|
||||
A1SHCURR,
|
||||
CASE
|
||||
WHEN (SELECT A4SHIPTYPE FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) = 'LTL'
|
||||
CASE
|
||||
WHEN (SELECT A4SHIPTYPE FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) = 'LTL'
|
||||
THEN (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceLTL'))/100 ."
|
||||
ELSE (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel') )/100 ."
|
||||
ELSE (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel') )/100 ."
|
||||
END AS FREIGHT,
|
||||
A4SHIPTYPE,
|
||||
A4SHIPVIA1,
|
||||
@@ -69,7 +69,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
A4OFSTRM
|
||||
FROM ICM688M2
|
||||
LEFT JOIN ICM699M ON SHMACPKR=A5MACPKR AND SHTYPE='M3-Res-out' AND SHDATA LIKE 'Success%' AND SHSOURCE='CloseShipmentCoChargeAPI'
|
||||
LEFT JOIN ICM666M ON A1DELNO=A5MACPKR AND A1ONO=A5ONO AND A1PKLN=A5BRADLN
|
||||
LEFT JOIN ICM666M ON A1DELNO=A5MACPKR AND A1ONO=A5ONO AND A1PKLN=A5BRADLN
|
||||
LEFT JOIN ICM688M1 ON A4MACPKR=A5MACPKR
|
||||
WHERE A5MACPKR IN (
|
||||
SELECT DISTINCT AYMACPKR
|
||||
@@ -99,13 +99,13 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
foreach ($files as $file) {
|
||||
# Get the file URL (if URL is configured in filesystems.php)
|
||||
$url = Storage::disk('publicCL')->url($file);
|
||||
$allReportsUrls[$file] = $url;
|
||||
$allReportsUrls[$file] = $url;
|
||||
}
|
||||
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
Log::error($th);
|
||||
}
|
||||
}
|
||||
|
||||
return view('m3::liberty-theme.pages.OrderLinesOfClosed',compact('IC670M','ICM688M2','WHDDA','COMPANY','PLANT','WHS','REPORTDATEDisp','allReportsUrls'));
|
||||
}
|
||||
@@ -115,7 +115,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
ini_set('max_input_time', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOut'));
|
||||
ini_set('memory_limit', '1024M');
|
||||
|
||||
|
||||
try {
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// dd($SHUSER);
|
||||
@@ -126,7 +126,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
->select('R428US','R428CO', 'R428WH','R428PL')
|
||||
->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
|
||||
@@ -135,7 +135,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
# Warehouse Table
|
||||
$IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
|
||||
|
||||
|
||||
# Get URL PARAMS
|
||||
$urlParams = count($request->all())>0 ? $request->all() : '';
|
||||
// dd($urlParams);
|
||||
@@ -161,10 +161,10 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
(SELECT A4SHSHNM FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) AS A4SHSHNM ,
|
||||
CASE WHEN SHDT IS NULL THEN (SELECT SHDATA FROM ICM699M WHERE SHMACPKR=A5MACPKR AND SHTYPE='M3-Res-out' AND SHSOURCE='CloseShipmentCoChargeAPI' ORDER BY SHDT DESC, SHTIME DESC FETCH FIRST 1 ROWS ONLY) ELSE '' END AS REASON,
|
||||
A1SHCURR,
|
||||
CASE
|
||||
WHEN (SELECT A4SHIPTYPE FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) = 'LTL'
|
||||
CASE
|
||||
WHEN (SELECT A4SHIPTYPE FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) = 'LTL'
|
||||
THEN (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceLTL'))/100 ."
|
||||
ELSE (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel'))/100 ."
|
||||
ELSE (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel'))/100 ."
|
||||
END AS FREIGHT
|
||||
FROM ICM688M2
|
||||
LEFT JOIN ICM699M ON SHMACPKR=A5MACPKR AND SHTYPE='M3-Res-out' AND SHDATA LIKE 'Success%' AND SHSOURCE='CloseShipmentCoChargeAPI'
|
||||
@@ -173,7 +173,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
WHERE A5MACPKR IN (
|
||||
SELECT DISTINCT AYMACPKR
|
||||
FROM ICM695M1
|
||||
WHERE AYSTATUS IN ('Z','z') AND AYAPR8N002 BETWEEN $reportDate AND $toreportDate
|
||||
WHERE AYSTATUS IN ('Z','z') AND AYAPR8N002 BETWEEN $reportDate AND $toreportDate
|
||||
)
|
||||
AND A5CO=$COMPANY AND A5WHS=$WHS AND A5PLANT=$PLANT";
|
||||
|
||||
@@ -191,7 +191,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
# Count records before exporting to excel : Max 20K records are allowed
|
||||
$ICM688M2Count = $ICM688M2Col->count();
|
||||
# Set Max allowed records
|
||||
# Set Max allowed records
|
||||
$maxRecords = Config::get('arrays.maxRecCL');
|
||||
if ($ICM688M2Count>$maxRecords) {
|
||||
return redirect()->back()->withInput()->with('message', 'Maximum allowed records for Excel Download is: '.number_format($maxRecords).
|
||||
@@ -209,7 +209,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
Log::error($th);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function StoreExcelToDisk(Request $request){
|
||||
@@ -217,7 +217,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
ini_set('max_input_time', Config::get('arrays.PHPTimeOutCL'));
|
||||
ini_set('default_socket_timeout', Config::get('arrays.PHPTimeOutCL'));
|
||||
ini_set('memory_limit', '1024M');
|
||||
|
||||
|
||||
try {
|
||||
$SHUSER = m3_user() !== '' ? Str::upper(trim(m3_user())) : '';
|
||||
// dd($SHUSER);
|
||||
@@ -228,7 +228,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
->select('R428US','R428CO', 'R428WH','R428PL')
|
||||
->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
|
||||
@@ -237,7 +237,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
# Warehouse Table
|
||||
$IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
|
||||
|
||||
|
||||
# Get URL PARAMS
|
||||
$urlParams = count($request->all())>0 ? $request->all() : '';
|
||||
// dd($urlParams);
|
||||
@@ -265,10 +265,10 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
(SELECT A4SHSHNM FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) AS A4SHSHNM ,
|
||||
CASE WHEN SHDT IS NULL THEN (SELECT SHDATA FROM ICM699M WHERE SHMACPKR=A5MACPKR AND SHTYPE='M3-Res-out' AND SHSOURCE='CloseShipmentCoChargeAPI' ORDER BY SHDT DESC, SHTIME DESC FETCH FIRST 1 ROWS ONLY) ELSE '' END AS REASON,
|
||||
A1SHCURR,
|
||||
CASE
|
||||
WHEN (SELECT A4SHIPTYPE FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) = 'LTL'
|
||||
CASE
|
||||
WHEN (SELECT A4SHIPTYPE FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) = 'LTL'
|
||||
THEN (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceLTL'))/100 ."
|
||||
ELSE (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel'))/100 ."
|
||||
ELSE (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel'))/100 ."
|
||||
END AS FREIGHT
|
||||
FROM ICM688M2
|
||||
LEFT JOIN ICM699M ON SHMACPKR=A5MACPKR AND SHTYPE='M3-Res-out' AND SHDATA LIKE 'Success%' AND SHSOURCE='CloseShipmentCoChargeAPI'
|
||||
@@ -277,7 +277,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
WHERE A5MACPKR IN (
|
||||
SELECT DISTINCT AYMACPKR
|
||||
FROM ICM695M1
|
||||
WHERE AYSTATUS IN ('Z','z') AND AYAPR8N002 BETWEEN $reportDate AND $toreportDate
|
||||
WHERE AYSTATUS IN ('Z','z') AND AYAPR8N002 BETWEEN $reportDate AND $toreportDate
|
||||
)
|
||||
AND A5CO=$COMPANY AND A5WHS=$WHS AND A5PLANT=$PLANT
|
||||
");
|
||||
@@ -293,7 +293,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
# Count records before exporting to excel : Max 20K records are allowed
|
||||
$ICM688M2Count = $ICM688M2Col->count();
|
||||
# Set Max allowed records
|
||||
# Set Max allowed records
|
||||
$maxRecords = Config::get('arrays.maxRecCL');
|
||||
if ($ICM688M2Count>$maxRecords) {
|
||||
return redirect()->back()->withInput()->with('message', 'Maximum allowed records for Excel Download is: '.number_format($maxRecords).
|
||||
@@ -315,7 +315,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
app(\Modules\M3\Services\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...');
|
||||
@@ -323,7 +323,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
Log::error($th);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Download File
|
||||
|
||||
@@ -19,15 +19,15 @@ class ReplenishSettingsController extends Controller
|
||||
// $REFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')->get();
|
||||
# Warehouse Table
|
||||
// $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
|
||||
|
||||
# Get Logged user Id
|
||||
|
||||
# Get Logged user Id
|
||||
$userId = m3_user() !== '' ? strtoupper(m3_user()) : '' ;
|
||||
// $userId = 'E1135818'; // Brad : E1135818 Malak : E2011812 ACOM_PDF
|
||||
$connection = config('m3.connection', 'pgsql');
|
||||
$ICM428M = \Illuminate\Support\Facades\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 : '' ;
|
||||
@@ -68,7 +68,7 @@ class ReplenishSettingsController extends Controller
|
||||
|
||||
$formInputs['R658IZLCF'] = isset($formInputs['R658IZLCF']) ? $formInputs['R658IZLCF'] : '0';
|
||||
// dd($formInputs);
|
||||
|
||||
|
||||
$ICM658MINS = ICM658M::insert($formInputs);
|
||||
// dd($ICM658MINS);
|
||||
return redirect()->route('m3.replenishmentSettings.index');
|
||||
@@ -77,9 +77,9 @@ class ReplenishSettingsController extends Controller
|
||||
public function update(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
$R658PN = (trim($request->R658PN) ?? trim($request->R658PN)) != null ? trim($request->R658PN) : "";
|
||||
$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) : "";
|
||||
$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);
|
||||
@@ -93,7 +93,7 @@ class ReplenishSettingsController extends Controller
|
||||
->where('R658PL', $R658PL)
|
||||
->where('R658WH', $R658WH)
|
||||
->update([ 'R658MQ'=>$R658MQ,'R658RQ'=>$R658RQ,'R658RMQ'=>$R658RMQ,'R658TL'=>$R658TL,'R658IZLCF'=>$R658IZLCF ]);
|
||||
|
||||
|
||||
return redirect()->route('m3.replenishmentSettings.index');
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ class ReplenishSettingsController extends Controller
|
||||
$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)
|
||||
@@ -140,7 +140,7 @@ class ReplenishSettingsController extends Controller
|
||||
->first();
|
||||
// dd($recordExists);
|
||||
$recordExists = $recordExistSQL == null ? true : false;
|
||||
|
||||
|
||||
return response()->json(['recordExists'=>$recordExists]);
|
||||
}
|
||||
|
||||
@@ -149,15 +149,15 @@ class ReplenishSettingsController extends Controller
|
||||
// $REFCAT658 = DB::connection(config('m3.connection', 'pgsql'))->table('icm658m')->get();
|
||||
# Warehouse Table
|
||||
// $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
|
||||
|
||||
# Get Logged user Id
|
||||
|
||||
# Get Logged user Id
|
||||
$userId = m3_user() !== '' ? strtoupper(m3_user()) : '' ;
|
||||
// $userId = 'E1135818'; // Brad : E1135818 Malak : E2011812 ACOM_PDF
|
||||
$connection = config('m3.connection', 'pgsql');
|
||||
$ICM428M = \Illuminate\Support\Facades\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 : '' ;
|
||||
@@ -170,7 +170,7 @@ class ReplenishSettingsController extends Controller
|
||||
->where('R658PL',$userPL)
|
||||
->where('R658WH',$userWH)
|
||||
->orderBy('R658CO','asc');
|
||||
|
||||
|
||||
# Warehouse Table
|
||||
// $IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')
|
||||
// ->where('WDCO',$userCO)
|
||||
|
||||
@@ -25,7 +25,7 @@ class WhsPerfMetrics extends Controller
|
||||
->select('R428US','R428CO', 'R428WH','R428PL')
|
||||
->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
|
||||
@@ -34,7 +34,7 @@ class WhsPerfMetrics extends Controller
|
||||
|
||||
# Warehouse Table
|
||||
$IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')->get();
|
||||
|
||||
|
||||
# Get URL PARAMS
|
||||
$urlParams = count($request->all())>0 ? $request->all() : '';
|
||||
// dump($urlParams);
|
||||
@@ -53,14 +53,14 @@ class WhsPerfMetrics extends Controller
|
||||
SHDT, SHTIME,
|
||||
CASE WHEN SHDT IS NULL THEN (SELECT SHDATA FROM ICM699M WHERE SHMACPKR=A5MACPKR AND SHTYPE='M3-Res-out' AND SHSOURCE='CloseShipmentCoChargeAPI' ORDER BY SHDT DESC, SHTIME DESC FETCH FIRST 1 ROWS ONLY) ELSE '' END AS REASON,
|
||||
A1SHCURR,
|
||||
CASE
|
||||
WHEN (SELECT A4SHIPTYPE FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) = 'LTL'
|
||||
CASE
|
||||
WHEN (SELECT A4SHIPTYPE FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) = 'LTL'
|
||||
THEN (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceLTL'))/100 ."
|
||||
ELSE (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel') )/100 ."
|
||||
ELSE (SELECT A4RATETCP FROM ICM688M1 WHERE A4MACPKR=A5MACPKR) * ".(100.00 - Config::get('arrays.misc.discountCarrierRateForCustomerPriceParcel') )/100 ."
|
||||
END AS FREIGHT
|
||||
FROM ICM688M2
|
||||
LEFT JOIN ICM699M ON SHMACPKR=A5MACPKR AND SHTYPE='M3-Res-out' AND SHDATA LIKE 'Success%' AND SHSOURCE='CloseShipmentCoChargeAPI'
|
||||
LEFT JOIN ICM666M ON A1DELNO=A5MACPKR AND A1ONO=A5ONO AND A1PKLN=A5BRADLN
|
||||
LEFT JOIN ICM666M ON A1DELNO=A5MACPKR AND A1ONO=A5ONO AND A1PKLN=A5BRADLN
|
||||
WHERE A5MACPKR IN (
|
||||
SELECT DISTINCT AYMACPKR
|
||||
FROM ICM695M1
|
||||
@@ -80,18 +80,18 @@ class WhsPerfMetrics extends Controller
|
||||
# Get List of Files
|
||||
$allReportsUrls = [];
|
||||
$files = Storage::disk('publicLabels')->allFiles('WhsPerf/'.$WHS);
|
||||
// $whsPerfFile = 'WhsPerf/'.$WHS.'/WhsPerfMetrics_'.$DateToday.'-'.$WHS.'.xlsx';
|
||||
// $whsPerfFile = 'WhsPerf/'.$WHS.'/WhsPerfMetrics_'.$DateToday.'-'.$WHS.'.xlsx';
|
||||
|
||||
foreach ($files as $file) {
|
||||
# Get the file URL (if URL is configured in filesystems.php)
|
||||
$url = Storage::disk('publicLabels')->url($file);
|
||||
$allReportsUrls[$file] = $url;
|
||||
$allReportsUrls[$file] = $url;
|
||||
}
|
||||
// dd($allReportsUrls);
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
Log::error($th);
|
||||
}
|
||||
}
|
||||
|
||||
return view('m3::liberty-theme.pages.WhsPerfMetrics',compact('IC670M','WHDDA','COMPANY','PLANT','WHS','allReportsUrls'));
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class carrierMaintController extends Controller
|
||||
$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,
|
||||
$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
|
||||
$insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm160m')->insert($data);
|
||||
@@ -75,7 +75,7 @@ class carrierMaintController extends Controller
|
||||
|
||||
$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
|
||||
$insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm160m')->insert($data);
|
||||
@@ -93,11 +93,11 @@ class carrierMaintController extends Controller
|
||||
if($request->CANUM == NULL) {
|
||||
return "null";
|
||||
}
|
||||
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM160M
|
||||
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'");
|
||||
|
||||
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class execSummaryController extends Controller
|
||||
}
|
||||
|
||||
$reportPeriod = isset($request->reportPeriod) ? $request->reportPeriod : ''; # monthly , quarter , year , daily
|
||||
# Current
|
||||
# Current
|
||||
$checkSales = isset($request->checkSales) ? $request->checkSales : ''; # on
|
||||
$checkWeight = isset($request->checkWeight) ? $request->checkWeight : ''; # on
|
||||
$checkLines = isset($request->checkLines) ? $request->checkLines : ''; # on
|
||||
@@ -49,14 +49,14 @@ class execSummaryController extends Controller
|
||||
$toreportDate = $lastDay->modify('last day of December')->format('Ymd');
|
||||
|
||||
# Build SQL
|
||||
$selectContent = "with tempfile as (
|
||||
$selectContent = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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).")
|
||||
)
|
||||
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
|
||||
(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).")
|
||||
)
|
||||
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 ";
|
||||
break;
|
||||
|
||||
@@ -69,16 +69,16 @@ class execSummaryController extends Controller
|
||||
$toreportDate = $lastDay->modify('last day of December')->format('Ymd');
|
||||
|
||||
# Build SQL
|
||||
$selectContent = "with tempfile as (
|
||||
$selectContent = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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 )
|
||||
(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).")
|
||||
)
|
||||
)
|
||||
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
|
||||
from tempfile
|
||||
from tempfile
|
||||
group by substr(ayapr8N002,3,2) ||'-' || 'Q' || EXTRACT(QUARTER FROM TO_DATE(CAST(ayapr8n002 AS TEXT),'YYYYMMDD')),a5whs order by 1 ";
|
||||
break;
|
||||
|
||||
@@ -91,16 +91,16 @@ class execSummaryController extends Controller
|
||||
$toreportDate =$lastDay->modify('last day of this month')->format('Ymd');
|
||||
|
||||
# Build SQL
|
||||
$selectContent = "with tempfile as (
|
||||
$selectContent = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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 )
|
||||
(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).")
|
||||
)
|
||||
)
|
||||
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
|
||||
from tempfile
|
||||
from tempfile
|
||||
group by substr(ayapr8N002,1,4) || '-' || substr(ayapr8N002,5,2),a5whs order by 1 ";
|
||||
break;
|
||||
|
||||
@@ -114,16 +114,16 @@ class execSummaryController extends Controller
|
||||
// $toreportDate =$lastDay->modify('last day of this month')->format('Ymd');
|
||||
|
||||
# Build SQL
|
||||
$selectContent = "with tempfile as (
|
||||
$selectContent = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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 )
|
||||
(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).")
|
||||
)
|
||||
)
|
||||
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
|
||||
from tempfile
|
||||
from tempfile
|
||||
group by substr(ayapr8N002,7,2),a5whs order by 1 ";
|
||||
break;
|
||||
|
||||
@@ -155,7 +155,7 @@ class execSummaryController extends Controller
|
||||
->select('R428US','R428CO', 'R428WH','R428PL')
|
||||
->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
|
||||
@@ -168,7 +168,7 @@ class execSummaryController extends Controller
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
Log::error($th);
|
||||
}
|
||||
}
|
||||
|
||||
return view('m3::liberty-theme.pages.execSummary',compact('IC670M','WHDDA'));
|
||||
// ,'ICM688M2',,'COMPANY','PLANT','WHS','reportDate'
|
||||
|
||||
@@ -27,7 +27,7 @@ class execSummaryLineController extends Controller
|
||||
}
|
||||
|
||||
$reportPeriod = isset($request->reportPeriod) ? $request->reportPeriod : ''; # monthly , quarter , year , daily
|
||||
# Current
|
||||
# Current
|
||||
$checkSales = isset($request->checkSales) ? $request->checkSales : ''; # on
|
||||
$checkWeight = isset($request->checkWeight) ? $request->checkWeight : ''; # on
|
||||
$checkLines = isset($request->checkLines) ? $request->checkLines : ''; # on
|
||||
@@ -43,14 +43,14 @@ class execSummaryLineController extends Controller
|
||||
$toreportDate = $lastDay->modify('last day of December')->format('Ymd');
|
||||
|
||||
# Build SQL
|
||||
$selectContent = "with tempfile as (
|
||||
$selectContent = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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).")
|
||||
)
|
||||
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
|
||||
(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).")
|
||||
)
|
||||
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 ";
|
||||
|
||||
$execSummaryResLY = [];
|
||||
@@ -64,28 +64,28 @@ class execSummaryLineController extends Controller
|
||||
$lastDay = isset($request->TOREPORTDATE) ? \DateTime::createFromFormat('Y-m', trim($request->TOREPORTDATE)) : '';
|
||||
$toreportDate = $lastDay->modify('last day of December')->format('Ymd');
|
||||
# Build SQL
|
||||
$selectContent = "with tempfile as (
|
||||
$selectContent = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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 )
|
||||
(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).")
|
||||
)
|
||||
)
|
||||
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
|
||||
from tempfile
|
||||
from tempfile
|
||||
group by 'Q' || EXTRACT(QUARTER FROM TO_DATE(CAST(ayapr8n002 AS TEXT),'YYYYMMDD')) ||'-' || substr(ayapr8N002,3,2),a5whs order by 1 ";
|
||||
|
||||
$execSummaryResLY = [];
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'monthly':
|
||||
# Set Dates based on reportPeriod type
|
||||
$firstDay = isset($request->REPORTDATE) ? \DateTime::createFromFormat('Y-m', $request->REPORTDATE) : null;
|
||||
|
||||
|
||||
$lastDay = (clone $firstDay);
|
||||
$reportDate = $firstDay->modify('-11 months')->modify('first day of this month')->format('Ymd'); //
|
||||
$reportDate = $firstDay->modify('-11 months')->modify('first day of this month')->format('Ymd'); //
|
||||
$toreportDate = $lastDay ? $lastDay->modify('last day of this month')->format('Ymd') : '';
|
||||
# Last Year Dates
|
||||
// Same period, but for Last Year (LY)
|
||||
@@ -93,32 +93,32 @@ class execSummaryLineController extends Controller
|
||||
$toreportDateLY = (clone $lastDay)->modify('-1 year')->modify('last day of this month')->format('Ymd');
|
||||
|
||||
# Build SQL
|
||||
$selectContent = "with tempfile as (
|
||||
$selectContent = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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 )
|
||||
(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).")
|
||||
)
|
||||
)
|
||||
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
|
||||
from tempfile
|
||||
from tempfile
|
||||
group by substr(ayapr8N002,1,4) || '-' || substr(ayapr8N002,5,2),a5whs order by 1 ";
|
||||
|
||||
$selectContentLY = "with tempfile as (
|
||||
$selectContentLY = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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 )
|
||||
(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."' and a5whs in (".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
|
||||
from tempfile
|
||||
from tempfile
|
||||
group by substr(ayapr8N002,1,4) || '-' || substr(ayapr8N002,5,2),a5whs order by 1 ";
|
||||
|
||||
$execSummaryResLY = DB::connection(config('m3.connection', 'pgsql'))->select($selectContentLY);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 'custom':
|
||||
@@ -132,28 +132,28 @@ class execSummaryLineController extends Controller
|
||||
$toreportDateLY = (clone $firstDay)->modify('-1 year')->modify('last day of this month')->format('Ymd');
|
||||
|
||||
# Build SQL
|
||||
$selectContent = "with tempfile as (
|
||||
$selectContent = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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 )
|
||||
(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).")
|
||||
)
|
||||
)
|
||||
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
|
||||
from tempfile
|
||||
from tempfile
|
||||
group by substr(ayapr8N002,7,2),a5whs order by 1 ";
|
||||
|
||||
$selectContentLY = "with tempfile as (
|
||||
$selectContentLY = "with tempfile as (
|
||||
select a5rsvqty,a5packed,a5slunpr*a5packed as dollars,a5lnwght,a5whs,
|
||||
(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 )
|
||||
(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."' and a5whs in (".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
|
||||
from tempfile
|
||||
from tempfile
|
||||
group by substr(ayapr8N002,7,2),a5whs order by 1 ";
|
||||
|
||||
$execSummaryResLY = DB::connection(config('m3.connection', 'pgsql'))->select($selectContentLY);
|
||||
@@ -184,7 +184,7 @@ class execSummaryLineController extends Controller
|
||||
->select('R428US','R428CO', 'R428WH','R428PL')
|
||||
->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
|
||||
@@ -197,7 +197,7 @@ class execSummaryLineController extends Controller
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
Log::error($th);
|
||||
}
|
||||
}
|
||||
|
||||
return view('m3::liberty-theme.pages.execSummaryLine',compact('IC670M','WHDDA'));
|
||||
// ,'ICM688M2',,'COMPANY','PLANT','WHS','reportDate'
|
||||
|
||||
@@ -90,139 +90,139 @@ Line 5',
|
||||
'ckFREIGHTCOLECT' => 'Yes',
|
||||
'ckPREPAY' => 'Off',
|
||||
|
||||
'DTESHIPED.2' => '',
|
||||
'LNITEMWT24' => '',
|
||||
'CLASSORATE24' => '',
|
||||
'LNITEMCLAS24' => '',
|
||||
'TYPEANDESCPTN.24' => '',
|
||||
'PKGTYPECOUNT24' => '',
|
||||
'LNITEMWT23' => '',
|
||||
'CLASSORATE23' => '',
|
||||
'LNITEMCLAS23' => '',
|
||||
'TYPEANDESCPTN.23' => '',
|
||||
'PKGTYPECOUNT23' => '',
|
||||
'LNITEMWT22' => '',
|
||||
'CLASSORATE22' => '',
|
||||
'LNITEMCLAS22' => '',
|
||||
'TYPEANDESCPTN.22' => '',
|
||||
'PKGTYPECOUNT22' => '',
|
||||
'LNITEMWT21' => '',
|
||||
'CLASSORATE21' => '',
|
||||
'LNITEMCLAS21' => '',
|
||||
'TYPEANDESCPTN.21' => '',
|
||||
'PKGTYPECOUNT21' => '',
|
||||
'LNITEMWT20' => '',
|
||||
'CLASSORATE20' => '',
|
||||
'LNITEMCLAS20' => '',
|
||||
'TYPEANDESCPTN.20' => '',
|
||||
'PKGTYPECOUNT20' => '',
|
||||
'LNITEMWT19' => '',
|
||||
'CLASSORATE19' => '',
|
||||
'LNITEMCLAS19' => '',
|
||||
'TYPEANDESCPTN.19' => '',
|
||||
'PKGTYPECOUNT19' => '',
|
||||
'LNITEMWT18' => '',
|
||||
'CLASSORATE18' => '',
|
||||
'LNITEMCLAS18' => '',
|
||||
'TYPEANDESCPTN.18' => '',
|
||||
'PKGTYPECOUNT18' => '',
|
||||
'LNITEMWT17' => '',
|
||||
'CLASSORATE17' => '',
|
||||
'LNITEMCLAS17' => '',
|
||||
'TYPEANDESCPTN.17' => '',
|
||||
'PKGTYPECOUNT17' => '',
|
||||
'LNITEMWT16' => '',
|
||||
'CLASSORATE16' => '',
|
||||
'LNITEMCLAS16' => '',
|
||||
'TYPEANDESCPTN.16' => '',
|
||||
'PKGTYPECOUNT16' => '',
|
||||
'LNITEMWT15' => '',
|
||||
'CLASSORATE15' => '',
|
||||
'LNITEMCLAS15' => '',
|
||||
'TYPEANDESCPTN.15' => '',
|
||||
'PKGTYPECOUNT15' => '',
|
||||
'LNITEMWT14' => '',
|
||||
'CLASSORAT14' => '',
|
||||
'LNITEMCLAS14' => '',
|
||||
'TYPEANDESCPTN.14' => '',
|
||||
'PKGTYPECOUNT14' => '',
|
||||
'LNITEMWT13' => '',
|
||||
'CLASSORATE13' => '',
|
||||
'LNITEMCLAS13' => '',
|
||||
'PKGTYPECOUNT13' => '',
|
||||
'LNITEMWT12' => '',
|
||||
'CLASSORATE12' => '',
|
||||
'LNITEMCLAS12' => '',
|
||||
'TYPEANDESCPTN.12' => '',
|
||||
'PKGTYPECOUNT12' => '',
|
||||
'LNITEMWT11' => '',
|
||||
'CLASSORATE11' => '',
|
||||
'LNITEMCLAS11' => '',
|
||||
'TYPEANDESCPTN.11' => '',
|
||||
'PKGTYPECOUNT11' => '',
|
||||
'LNITEMWT10' => '',
|
||||
'CLASSORATE10' => '',
|
||||
'LNITEMCLAS10' => '',
|
||||
'PKGTYPECOUNT10' => '',
|
||||
'LNITEMWT9' => '',
|
||||
'CLASSORATE9' => '',
|
||||
'LNITEMCLAS8' => '',
|
||||
'PKGTYPECOUNT9' => '',
|
||||
'LNITEMWT8' => '',
|
||||
'CLASSORATE8' => '',
|
||||
'TYPEANDESCPTN.8' => '',
|
||||
'PKGTYPECOUNT8' => '',
|
||||
'LNITEMWT7' => '',
|
||||
'CLASSORATE7' => '',
|
||||
'LNITEMCLAS7' => '',
|
||||
'PKGTYPECOUNT7' => '',
|
||||
'LNITEMWT6' => '',
|
||||
'CLASSORATE6' => '',
|
||||
'LNITEMCLAS6' => '',
|
||||
'PKGTYPECOUNT6' => '',
|
||||
'LNITEMWT5' => '',
|
||||
'CLASSORATE5' => '',
|
||||
'LNITEMCLAS5' => '',
|
||||
'PKGTYPECOUNT5' => '',
|
||||
'LNITEMWT4' => '',
|
||||
'CLASSORATE4' => '',
|
||||
'LNITEMCLAS4' => '',
|
||||
'PKGTYPECOUNT4' => '',
|
||||
'LNITEMWT3' => '',
|
||||
'CLASSORATE3' => '',
|
||||
'LNITEMCLAS3' => '',
|
||||
'TYPEANDESCPTN.3' => '',
|
||||
'PKGTYPECOUNT3' => '',
|
||||
'LNITEMWT2' => '',
|
||||
'CLASSORATE2' => '',
|
||||
'DTESHIPED.2' => '',
|
||||
'LNITEMWT24' => '',
|
||||
'CLASSORATE24' => '',
|
||||
'LNITEMCLAS24' => '',
|
||||
'TYPEANDESCPTN.24' => '',
|
||||
'PKGTYPECOUNT24' => '',
|
||||
'LNITEMWT23' => '',
|
||||
'CLASSORATE23' => '',
|
||||
'LNITEMCLAS23' => '',
|
||||
'TYPEANDESCPTN.23' => '',
|
||||
'PKGTYPECOUNT23' => '',
|
||||
'LNITEMWT22' => '',
|
||||
'CLASSORATE22' => '',
|
||||
'LNITEMCLAS22' => '',
|
||||
'TYPEANDESCPTN.22' => '',
|
||||
'PKGTYPECOUNT22' => '',
|
||||
'LNITEMWT21' => '',
|
||||
'CLASSORATE21' => '',
|
||||
'LNITEMCLAS21' => '',
|
||||
'TYPEANDESCPTN.21' => '',
|
||||
'PKGTYPECOUNT21' => '',
|
||||
'LNITEMWT20' => '',
|
||||
'CLASSORATE20' => '',
|
||||
'LNITEMCLAS20' => '',
|
||||
'TYPEANDESCPTN.20' => '',
|
||||
'PKGTYPECOUNT20' => '',
|
||||
'LNITEMWT19' => '',
|
||||
'CLASSORATE19' => '',
|
||||
'LNITEMCLAS19' => '',
|
||||
'TYPEANDESCPTN.19' => '',
|
||||
'PKGTYPECOUNT19' => '',
|
||||
'LNITEMWT18' => '',
|
||||
'CLASSORATE18' => '',
|
||||
'LNITEMCLAS18' => '',
|
||||
'TYPEANDESCPTN.18' => '',
|
||||
'PKGTYPECOUNT18' => '',
|
||||
'LNITEMWT17' => '',
|
||||
'CLASSORATE17' => '',
|
||||
'LNITEMCLAS17' => '',
|
||||
'TYPEANDESCPTN.17' => '',
|
||||
'PKGTYPECOUNT17' => '',
|
||||
'LNITEMWT16' => '',
|
||||
'CLASSORATE16' => '',
|
||||
'LNITEMCLAS16' => '',
|
||||
'TYPEANDESCPTN.16' => '',
|
||||
'PKGTYPECOUNT16' => '',
|
||||
'LNITEMWT15' => '',
|
||||
'CLASSORATE15' => '',
|
||||
'LNITEMCLAS15' => '',
|
||||
'TYPEANDESCPTN.15' => '',
|
||||
'PKGTYPECOUNT15' => '',
|
||||
'LNITEMWT14' => '',
|
||||
'CLASSORAT14' => '',
|
||||
'LNITEMCLAS14' => '',
|
||||
'TYPEANDESCPTN.14' => '',
|
||||
'PKGTYPECOUNT14' => '',
|
||||
'LNITEMWT13' => '',
|
||||
'CLASSORATE13' => '',
|
||||
'LNITEMCLAS13' => '',
|
||||
'PKGTYPECOUNT13' => '',
|
||||
'LNITEMWT12' => '',
|
||||
'CLASSORATE12' => '',
|
||||
'LNITEMCLAS12' => '',
|
||||
'TYPEANDESCPTN.12' => '',
|
||||
'PKGTYPECOUNT12' => '',
|
||||
'LNITEMWT11' => '',
|
||||
'CLASSORATE11' => '',
|
||||
'LNITEMCLAS11' => '',
|
||||
'TYPEANDESCPTN.11' => '',
|
||||
'PKGTYPECOUNT11' => '',
|
||||
'LNITEMWT10' => '',
|
||||
'CLASSORATE10' => '',
|
||||
'LNITEMCLAS10' => '',
|
||||
'PKGTYPECOUNT10' => '',
|
||||
'LNITEMWT9' => '',
|
||||
'CLASSORATE9' => '',
|
||||
'LNITEMCLAS8' => '',
|
||||
'PKGTYPECOUNT9' => '',
|
||||
'LNITEMWT8' => '',
|
||||
'CLASSORATE8' => '',
|
||||
'TYPEANDESCPTN.8' => '',
|
||||
'PKGTYPECOUNT8' => '',
|
||||
'LNITEMWT7' => '',
|
||||
'CLASSORATE7' => '',
|
||||
'LNITEMCLAS7' => '',
|
||||
'PKGTYPECOUNT7' => '',
|
||||
'LNITEMWT6' => '',
|
||||
'CLASSORATE6' => '',
|
||||
'LNITEMCLAS6' => '',
|
||||
'PKGTYPECOUNT6' => '',
|
||||
'LNITEMWT5' => '',
|
||||
'CLASSORATE5' => '',
|
||||
'LNITEMCLAS5' => '',
|
||||
'PKGTYPECOUNT5' => '',
|
||||
'LNITEMWT4' => '',
|
||||
'CLASSORATE4' => '',
|
||||
'LNITEMCLAS4' => '',
|
||||
'PKGTYPECOUNT4' => '',
|
||||
'LNITEMWT3' => '',
|
||||
'CLASSORATE3' => '',
|
||||
'LNITEMCLAS3' => '',
|
||||
'TYPEANDESCPTN.3' => '',
|
||||
'PKGTYPECOUNT3' => '',
|
||||
'LNITEMWT2' => '',
|
||||
'CLASSORATE2' => '',
|
||||
'LNITEMCLAS2' => '',
|
||||
'PKGTYPECOUNT2' => '',
|
||||
'LNITEMCLAS1' => '',
|
||||
'HAZLNITEMWT3' => '',
|
||||
'HAZCLASSORATE3' => '',
|
||||
'HAZLNITEMCLAS3' => '',
|
||||
'HAZMATERDESL3' => '',
|
||||
'HAZMATERL3' => '',
|
||||
'HAZLNITEMWT2' => '',
|
||||
'HAZCLASSORATE2' => '',
|
||||
'HAZLNITEMCLAS2' => '',
|
||||
'HAZMATERDESL2' => '',
|
||||
'HAZMATERL2' => '',
|
||||
'HAZLNITEMWT1' => '',
|
||||
'HAZCLASSORATE1' => '',
|
||||
'HAZLNITEMCLAS1' => '',
|
||||
'HAZMATERDESL1' => '',
|
||||
'HAZMATERL1' => '',
|
||||
'24HREMGCYRSPNS' => '',
|
||||
'CARIERFEDEMPID' => '',
|
||||
'BILLTOADDR' => '',
|
||||
'NUMDROPS' => '',
|
||||
'PKGTYPECOUNT2' => '',
|
||||
'LNITEMCLAS1' => '',
|
||||
'HAZLNITEMWT3' => '',
|
||||
'HAZCLASSORATE3' => '',
|
||||
'HAZLNITEMCLAS3' => '',
|
||||
'HAZMATERDESL3' => '',
|
||||
'HAZMATERL3' => '',
|
||||
'HAZLNITEMWT2' => '',
|
||||
'HAZCLASSORATE2' => '',
|
||||
'HAZLNITEMCLAS2' => '',
|
||||
'HAZMATERDESL2' => '',
|
||||
'HAZMATERL2' => '',
|
||||
'HAZLNITEMWT1' => '',
|
||||
'HAZCLASSORATE1' => '',
|
||||
'HAZLNITEMCLAS1' => '',
|
||||
'HAZMATERDESL1' => '',
|
||||
'HAZMATERL1' => '',
|
||||
'24HREMGCYRSPNS' => '',
|
||||
'CARIERFEDEMPID' => '',
|
||||
'BILLTOADDR' => '',
|
||||
'NUMDROPS' => '',
|
||||
|
||||
];
|
||||
|
||||
try {
|
||||
$filledPdf = $this->bolService->fillBillOfLading($data);
|
||||
|
||||
|
||||
return response()->download($filledPdf)->deleteFileAfterSend(true);
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['error' => $e->getMessage()], 500);
|
||||
|
||||
@@ -79,133 +79,133 @@ class fillBOLController extends Controller
|
||||
'ckFREIGHTCOLECT' => 'Yes',
|
||||
'ckPREPAY' => 'Off',
|
||||
|
||||
'DTESHIPED.2' => '',
|
||||
'LNITEMWT24' => '',
|
||||
'CLASSORATE24' => '',
|
||||
'LNITEMCLAS24' => '',
|
||||
'TYPEANDESCPTN.24' => '',
|
||||
'PKGTYPECOUNT24' => '',
|
||||
'LNITEMWT23' => '',
|
||||
'CLASSORATE23' => '',
|
||||
'LNITEMCLAS23' => '',
|
||||
'TYPEANDESCPTN.23' => '',
|
||||
'PKGTYPECOUNT23' => '',
|
||||
'LNITEMWT22' => '',
|
||||
'CLASSORATE22' => '',
|
||||
'LNITEMCLAS22' => '',
|
||||
'TYPEANDESCPTN.22' => '',
|
||||
'PKGTYPECOUNT22' => '',
|
||||
'LNITEMWT21' => '',
|
||||
'CLASSORATE21' => '',
|
||||
'LNITEMCLAS21' => '',
|
||||
'TYPEANDESCPTN.21' => '',
|
||||
'PKGTYPECOUNT21' => '',
|
||||
'LNITEMWT20' => '',
|
||||
'CLASSORATE20' => '',
|
||||
'LNITEMCLAS20' => '',
|
||||
'TYPEANDESCPTN.20' => '',
|
||||
'PKGTYPECOUNT20' => '',
|
||||
'LNITEMWT19' => '',
|
||||
'CLASSORATE19' => '',
|
||||
'LNITEMCLAS19' => '',
|
||||
'TYPEANDESCPTN.19' => '',
|
||||
'PKGTYPECOUNT19' => '',
|
||||
'LNITEMWT18' => '',
|
||||
'CLASSORATE18' => '',
|
||||
'LNITEMCLAS18' => '',
|
||||
'TYPEANDESCPTN.18' => '',
|
||||
'PKGTYPECOUNT18' => '',
|
||||
'LNITEMWT17' => '',
|
||||
'CLASSORATE17' => '',
|
||||
'LNITEMCLAS17' => '',
|
||||
'TYPEANDESCPTN.17' => '',
|
||||
'PKGTYPECOUNT17' => '',
|
||||
'LNITEMWT16' => '',
|
||||
'CLASSORATE16' => '',
|
||||
'LNITEMCLAS16' => '',
|
||||
'TYPEANDESCPTN.16' => '',
|
||||
'PKGTYPECOUNT16' => '',
|
||||
'LNITEMWT15' => '',
|
||||
'CLASSORATE15' => '',
|
||||
'LNITEMCLAS15' => '',
|
||||
'TYPEANDESCPTN.15' => '',
|
||||
'PKGTYPECOUNT15' => '',
|
||||
'LNITEMWT14' => '',
|
||||
'CLASSORAT14' => '',
|
||||
'LNITEMCLAS14' => '',
|
||||
'TYPEANDESCPTN.14' => '',
|
||||
'PKGTYPECOUNT14' => '',
|
||||
'LNITEMWT13' => '',
|
||||
'CLASSORATE13' => '',
|
||||
'LNITEMCLAS13' => '',
|
||||
'PKGTYPECOUNT13' => '',
|
||||
'LNITEMWT12' => '',
|
||||
'CLASSORATE12' => '',
|
||||
'LNITEMCLAS12' => '',
|
||||
'TYPEANDESCPTN.12' => '',
|
||||
'PKGTYPECOUNT12' => '',
|
||||
'LNITEMWT11' => '',
|
||||
'CLASSORATE11' => '',
|
||||
'LNITEMCLAS11' => '',
|
||||
'TYPEANDESCPTN.11' => '',
|
||||
'PKGTYPECOUNT11' => '',
|
||||
'LNITEMWT10' => '',
|
||||
'CLASSORATE10' => '',
|
||||
'LNITEMCLAS10' => '',
|
||||
'PKGTYPECOUNT10' => '',
|
||||
'LNITEMWT9' => '',
|
||||
'CLASSORATE9' => '',
|
||||
'LNITEMCLAS8' => '',
|
||||
'PKGTYPECOUNT9' => '',
|
||||
'LNITEMWT8' => '',
|
||||
'CLASSORATE8' => '',
|
||||
'TYPEANDESCPTN.8' => '',
|
||||
'PKGTYPECOUNT8' => '',
|
||||
'LNITEMWT7' => '',
|
||||
'CLASSORATE7' => '',
|
||||
'LNITEMCLAS7' => '',
|
||||
'PKGTYPECOUNT7' => '',
|
||||
'LNITEMWT6' => '',
|
||||
'CLASSORATE6' => '',
|
||||
'LNITEMCLAS6' => '',
|
||||
'PKGTYPECOUNT6' => '',
|
||||
'LNITEMWT5' => '',
|
||||
'CLASSORATE5' => '',
|
||||
'LNITEMCLAS5' => '',
|
||||
'PKGTYPECOUNT5' => '',
|
||||
'LNITEMWT4' => '',
|
||||
'CLASSORATE4' => '',
|
||||
'LNITEMCLAS4' => '',
|
||||
'PKGTYPECOUNT4' => '',
|
||||
'LNITEMWT3' => '',
|
||||
'CLASSORATE3' => '',
|
||||
'LNITEMCLAS3' => '',
|
||||
'TYPEANDESCPTN.3' => '',
|
||||
'PKGTYPECOUNT3' => '',
|
||||
'LNITEMWT2' => '',
|
||||
'CLASSORATE2' => '',
|
||||
'DTESHIPED.2' => '',
|
||||
'LNITEMWT24' => '',
|
||||
'CLASSORATE24' => '',
|
||||
'LNITEMCLAS24' => '',
|
||||
'TYPEANDESCPTN.24' => '',
|
||||
'PKGTYPECOUNT24' => '',
|
||||
'LNITEMWT23' => '',
|
||||
'CLASSORATE23' => '',
|
||||
'LNITEMCLAS23' => '',
|
||||
'TYPEANDESCPTN.23' => '',
|
||||
'PKGTYPECOUNT23' => '',
|
||||
'LNITEMWT22' => '',
|
||||
'CLASSORATE22' => '',
|
||||
'LNITEMCLAS22' => '',
|
||||
'TYPEANDESCPTN.22' => '',
|
||||
'PKGTYPECOUNT22' => '',
|
||||
'LNITEMWT21' => '',
|
||||
'CLASSORATE21' => '',
|
||||
'LNITEMCLAS21' => '',
|
||||
'TYPEANDESCPTN.21' => '',
|
||||
'PKGTYPECOUNT21' => '',
|
||||
'LNITEMWT20' => '',
|
||||
'CLASSORATE20' => '',
|
||||
'LNITEMCLAS20' => '',
|
||||
'TYPEANDESCPTN.20' => '',
|
||||
'PKGTYPECOUNT20' => '',
|
||||
'LNITEMWT19' => '',
|
||||
'CLASSORATE19' => '',
|
||||
'LNITEMCLAS19' => '',
|
||||
'TYPEANDESCPTN.19' => '',
|
||||
'PKGTYPECOUNT19' => '',
|
||||
'LNITEMWT18' => '',
|
||||
'CLASSORATE18' => '',
|
||||
'LNITEMCLAS18' => '',
|
||||
'TYPEANDESCPTN.18' => '',
|
||||
'PKGTYPECOUNT18' => '',
|
||||
'LNITEMWT17' => '',
|
||||
'CLASSORATE17' => '',
|
||||
'LNITEMCLAS17' => '',
|
||||
'TYPEANDESCPTN.17' => '',
|
||||
'PKGTYPECOUNT17' => '',
|
||||
'LNITEMWT16' => '',
|
||||
'CLASSORATE16' => '',
|
||||
'LNITEMCLAS16' => '',
|
||||
'TYPEANDESCPTN.16' => '',
|
||||
'PKGTYPECOUNT16' => '',
|
||||
'LNITEMWT15' => '',
|
||||
'CLASSORATE15' => '',
|
||||
'LNITEMCLAS15' => '',
|
||||
'TYPEANDESCPTN.15' => '',
|
||||
'PKGTYPECOUNT15' => '',
|
||||
'LNITEMWT14' => '',
|
||||
'CLASSORAT14' => '',
|
||||
'LNITEMCLAS14' => '',
|
||||
'TYPEANDESCPTN.14' => '',
|
||||
'PKGTYPECOUNT14' => '',
|
||||
'LNITEMWT13' => '',
|
||||
'CLASSORATE13' => '',
|
||||
'LNITEMCLAS13' => '',
|
||||
'PKGTYPECOUNT13' => '',
|
||||
'LNITEMWT12' => '',
|
||||
'CLASSORATE12' => '',
|
||||
'LNITEMCLAS12' => '',
|
||||
'TYPEANDESCPTN.12' => '',
|
||||
'PKGTYPECOUNT12' => '',
|
||||
'LNITEMWT11' => '',
|
||||
'CLASSORATE11' => '',
|
||||
'LNITEMCLAS11' => '',
|
||||
'TYPEANDESCPTN.11' => '',
|
||||
'PKGTYPECOUNT11' => '',
|
||||
'LNITEMWT10' => '',
|
||||
'CLASSORATE10' => '',
|
||||
'LNITEMCLAS10' => '',
|
||||
'PKGTYPECOUNT10' => '',
|
||||
'LNITEMWT9' => '',
|
||||
'CLASSORATE9' => '',
|
||||
'LNITEMCLAS8' => '',
|
||||
'PKGTYPECOUNT9' => '',
|
||||
'LNITEMWT8' => '',
|
||||
'CLASSORATE8' => '',
|
||||
'TYPEANDESCPTN.8' => '',
|
||||
'PKGTYPECOUNT8' => '',
|
||||
'LNITEMWT7' => '',
|
||||
'CLASSORATE7' => '',
|
||||
'LNITEMCLAS7' => '',
|
||||
'PKGTYPECOUNT7' => '',
|
||||
'LNITEMWT6' => '',
|
||||
'CLASSORATE6' => '',
|
||||
'LNITEMCLAS6' => '',
|
||||
'PKGTYPECOUNT6' => '',
|
||||
'LNITEMWT5' => '',
|
||||
'CLASSORATE5' => '',
|
||||
'LNITEMCLAS5' => '',
|
||||
'PKGTYPECOUNT5' => '',
|
||||
'LNITEMWT4' => '',
|
||||
'CLASSORATE4' => '',
|
||||
'LNITEMCLAS4' => '',
|
||||
'PKGTYPECOUNT4' => '',
|
||||
'LNITEMWT3' => '',
|
||||
'CLASSORATE3' => '',
|
||||
'LNITEMCLAS3' => '',
|
||||
'TYPEANDESCPTN.3' => '',
|
||||
'PKGTYPECOUNT3' => '',
|
||||
'LNITEMWT2' => '',
|
||||
'CLASSORATE2' => '',
|
||||
'LNITEMCLAS2' => '',
|
||||
'PKGTYPECOUNT2' => '',
|
||||
'LNITEMCLAS1' => '',
|
||||
'HAZLNITEMWT3' => '',
|
||||
'HAZCLASSORATE3' => '',
|
||||
'HAZLNITEMCLAS3' => '',
|
||||
'HAZMATERDESL3' => '',
|
||||
'HAZMATERL3' => '',
|
||||
'HAZLNITEMWT2' => '',
|
||||
'HAZCLASSORATE2' => '',
|
||||
'HAZLNITEMCLAS2' => '',
|
||||
'HAZMATERDESL2' => '',
|
||||
'HAZMATERL2' => '',
|
||||
'HAZLNITEMWT1' => '',
|
||||
'HAZCLASSORATE1' => '',
|
||||
'HAZLNITEMCLAS1' => '',
|
||||
'HAZMATERDESL1' => '',
|
||||
'HAZMATERL1' => '',
|
||||
'24HREMGCYRSPNS' => '',
|
||||
'CARIERFEDEMPID' => '',
|
||||
'BILLTOADDR' => '',
|
||||
'NUMDROPS' => '',
|
||||
'PKGTYPECOUNT2' => '',
|
||||
'LNITEMCLAS1' => '',
|
||||
'HAZLNITEMWT3' => '',
|
||||
'HAZCLASSORATE3' => '',
|
||||
'HAZLNITEMCLAS3' => '',
|
||||
'HAZMATERDESL3' => '',
|
||||
'HAZMATERL3' => '',
|
||||
'HAZLNITEMWT2' => '',
|
||||
'HAZCLASSORATE2' => '',
|
||||
'HAZLNITEMCLAS2' => '',
|
||||
'HAZMATERDESL2' => '',
|
||||
'HAZMATERL2' => '',
|
||||
'HAZLNITEMWT1' => '',
|
||||
'HAZCLASSORATE1' => '',
|
||||
'HAZLNITEMCLAS1' => '',
|
||||
'HAZMATERDESL1' => '',
|
||||
'HAZMATERL1' => '',
|
||||
'24HREMGCYRSPNS' => '',
|
||||
'CARIERFEDEMPID' => '',
|
||||
'BILLTOADDR' => '',
|
||||
'NUMDROPS' => '',
|
||||
|
||||
])
|
||||
->needAppearances() // ensures values are visible in viewer
|
||||
|
||||
@@ -38,18 +38,18 @@ class palletQtyController extends Controller
|
||||
#var_dump($request);
|
||||
#console.log($request);
|
||||
// Verify record does not already exist in ICM709M
|
||||
$icm709m=DB::connection(config('m3.connection', 'pgsql'))->select("select count(*) as COUNT1 from ICM709M
|
||||
$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'");
|
||||
if($icm709m[0]->COUNT1>="1") {
|
||||
return "exists";
|
||||
} else {
|
||||
// Verify Part# already exists in ICM630M
|
||||
$ic630m= DB::connection(config('m3.connection', 'pgsql'))->select("select count(*) as COUNT1 from IC630M
|
||||
$ic630m= DB::connection(config('m3.connection', 'pgsql'))->select("select count(*) as COUNT1 from IC630M
|
||||
where LLCO='$request->AT9CO' and LLWHNO='$request->AT9WHS' and LLPPN='$request->AT9PART'");
|
||||
if($ic630m[0]->COUNT1=="0") {
|
||||
return "not exist";
|
||||
} else {
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM709M (AT9CO, AT9PLT, AT9WHS, AT9PART, AT9QTY, AT9WRN)
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM709M (AT9CO, AT9PLT, AT9WHS, AT9PART, AT9QTY, AT9WRN)
|
||||
values ('$request->AT9CO', '$request->AT9PLT', '$request->AT9WHS', '$request->AT9PART', '$request->AT9QTY', '$request->AT9WRN')");
|
||||
return "success";
|
||||
}
|
||||
@@ -61,12 +61,12 @@ class palletQtyController extends Controller
|
||||
#var_dump($request);
|
||||
#console.log($request);
|
||||
// Verify record does not already exist in ICM709M
|
||||
//DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM709M (AT9CO, AT9PLT, AT9WHS, AT9PART, AT9QTY)
|
||||
//DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM709M (AT9CO, AT9PLT, AT9WHS, AT9PART, AT9QTY)
|
||||
// values ('$request->AT9CO', '$request->AT9PLT', '$request->AT9WHS', '$request->AT9PART', '$request->AT9QTY')");
|
||||
// $data=['AT9CO'=>$request->AT9CO, 'AT9PLT'=>$request->AT9PLT, 'AT9WHS'=>$request->AT9WHS, 'AT9PART'=>$request->AT9PART,
|
||||
// $data=['AT9CO'=>$request->AT9CO, 'AT9PLT'=>$request->AT9PLT, 'AT9WHS'=>$request->AT9WHS, 'AT9PART'=>$request->AT9PART,
|
||||
// 'AT9QTY'=>$request->AT9QTY, 'AT9WRN'=>$request->AT9WRN];
|
||||
// $insertSQL = DB::connection(config('m3.connection', 'pgsql'))->table('icm709m')->insert($data);
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM709M (AT9CO, AT9PLT, AT9WHS, AT9PART, AT9QTY, AT9WRN)
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM709M (AT9CO, AT9PLT, AT9WHS, AT9PART, AT9QTY, AT9WRN)
|
||||
values ('$request->AT9CO', '$request->AT9PLT', '$request->AT9WHS', '$request->AT9PART', '$request->AT9QTY', '$request->AT9WRN')");
|
||||
// if($insertSQL) {
|
||||
return "success";
|
||||
@@ -82,14 +82,14 @@ class palletQtyController extends Controller
|
||||
#dump($request);
|
||||
#console.log($request);
|
||||
|
||||
//$icm709m=DB::connection(config('m3.connection', 'pgsql'))->select("select count(*) as COUNT1 from ICM709M
|
||||
//$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);
|
||||
|
||||
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM709M
|
||||
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM709M
|
||||
set AT9QTY='$request->AT9QTY', AT9WRN='$request->AT9WRN'
|
||||
where AT9CO='$request->AT9CO' and AT9PLT='$request->AT9PLT' and AT9WHS='$request->AT9WHS' and AT9PART='$request->AT9PART'");
|
||||
|
||||
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class pendingClosureController extends Controller
|
||||
# ICM705M1 Statement
|
||||
$sqlstmt = "select APMANIFEST,APDOCKDOOR,APCARRIER,APTRUCKIDT,APSPARE1,APLDSTRU,APLDSTRD,APLDSTRT,
|
||||
APLDCLOU,APLDCLOD,APLDCLOT,APCO,APWHS,APPLT,APSPARE2,APLDCLOZ
|
||||
from ICM705M1
|
||||
from ICM705M1
|
||||
where APSPARE2 in ('','P') and APCO='$co' and APWHS='$whs' and APPLT='$plant'";
|
||||
|
||||
$ICM705M1 = DB::connection(config('m3.connection', 'pgsql'))->select($sqlstmt);
|
||||
@@ -33,10 +33,10 @@ class pendingClosureController extends Controller
|
||||
$ICM698Ma=array();
|
||||
$ICM699Ma=array();
|
||||
foreach($ICM705M1 as $key=>$val) {
|
||||
$sqlstmt1="select LGUSER,LGCONFDT,LGCONFTM
|
||||
$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%'
|
||||
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']='';
|
||||
@@ -47,10 +47,10 @@ class pendingClosureController extends Controller
|
||||
$ICM698Ma[$val->APMANIFEST]['TMSDATE']=$val2->LGCONFDT;
|
||||
$ICM698Ma[$val->APMANIFEST]['TMSTIME']=$val2->LGCONFTM;
|
||||
}
|
||||
|
||||
|
||||
$ICM699MSel1 ="select SHMACPKR,SHDT,SHTIME from ICM699M
|
||||
WHERE SHMACPKR='$val->APMANIFEST' AND SHCO='$co' AND SHWHS='$whs'
|
||||
|
||||
$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) {
|
||||
@@ -61,15 +61,15 @@ class pendingClosureController extends Controller
|
||||
// dump($ICM699Ma);
|
||||
|
||||
|
||||
$sqlstmt="select count(*) as COUNT1 from ICM699M
|
||||
where SHCO='$co' and SHWHS='$whs' and SHTYPE like '%M3%' and SHERROR='X'
|
||||
$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);
|
||||
|
||||
# Get Unprocessed Orders
|
||||
$unprocessedArr = array();
|
||||
$sqlstmt3 = "WITH TEMPFILE AS (
|
||||
SELECT A4MACPKR,A4SPKRFUD,(SELECT AYAPRF1551 FROM ICM695M1 WHERE AYMACPKR=A4MACPKR AND AYSLWHS='$whs' FETCH FIRST 1 ROWS ONLY) AS MF FROM ICM688M1
|
||||
SELECT A4MACPKR,A4SPKRFUD,(SELECT AYAPRF1551 FROM ICM695M1 WHERE AYMACPKR=A4MACPKR AND AYSLWHS='$whs' FETCH FIRST 1 ROWS ONLY) AS MF FROM ICM688M1
|
||||
WHERE A4PICKSTS='B' AND A4WHS='$whs' ORDER BY A4SPKRFUD
|
||||
)
|
||||
SELECT APMANIFEST,APSPARE2 FROM ICM705M1 WHERE APMANIFEST IN (SELECT DISTINCT MF FROM TEMPFILE) AND APSPARE2='X' AND APWHS='$whs' ";
|
||||
@@ -110,7 +110,7 @@ class pendingClosureController extends Controller
|
||||
'code' => '200',
|
||||
'status' => 'Success',
|
||||
'message'=> 'Manifest Closing submitted'
|
||||
]);
|
||||
]);
|
||||
} catch (\Throwable $th) {
|
||||
//throw $th;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ 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) : '';
|
||||
@@ -31,33 +31,33 @@ class sentinelController extends Controller
|
||||
->first();
|
||||
|
||||
$allowDeletion = isset($ICM695M1Sel->AYSENTPKR) ? ($ICM695M1Sel->AYSENTPKR !='' ? true : false ) : false;
|
||||
|
||||
|
||||
if ($allowDeletion) {
|
||||
$timestamp = date('Y-m-d H:i:s.u');
|
||||
$date1 = date('Ymd');
|
||||
$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)
|
||||
->delete();
|
||||
|
||||
|
||||
$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'";
|
||||
|
||||
$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)");
|
||||
|
||||
|
||||
return response()->json(['success'=>true , 'message' => 'Line Deleted']);
|
||||
}
|
||||
else{
|
||||
@@ -69,5 +69,5 @@ class sentinelController extends Controller
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -58,9 +58,9 @@ class userControlController extends Controller
|
||||
} else {
|
||||
|
||||
if($usrprf[0]->COUNT=="1") {
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM428M
|
||||
(R428CO, R428PL, R428WH, R428STS, R428US, R428FIRST, R428FAMILY, R428EMAIL, R428EMPCDE, R428ADMUSR, R428PWRUSR, MENU2OPT, MENU3OPT, MENU4OPT, MENU5OPT, MENU6OPT, R42811A)
|
||||
values ('$request->R428CO', '$request->R428PL', '$request->R428WH', '$request->R428STS', '$request->R428US', '$request->R428FIRST',
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM428M
|
||||
(R428CO, R428PL, R428WH, R428STS, R428US, R428FIRST, R428FAMILY, R428EMAIL, R428EMPCDE, R428ADMUSR, R428PWRUSR, MENU2OPT, MENU3OPT, MENU4OPT, MENU5OPT, MENU6OPT, R42811A)
|
||||
values ('$request->R428CO', '$request->R428PL', '$request->R428WH', '$request->R428STS', '$request->R428US', '$request->R428FIRST',
|
||||
'$request->R428FAMILY', '$request->R428EMAIL', $request->R428EMPCDE, '$request->R428ADMUSR', '$request->R428PWRUSR',
|
||||
'NN".$request->MENU2OPT3."NNN".$request->MENU2OPT7.$request->MENU2OPT8."N', '".$request->MENU3OPT1.$request->MENU3OPT2."NNNNNNN',
|
||||
'".$request->MENU4OPT1.$request->MENU4OPT2.$request->MENU4OPT3."NNNNNN',
|
||||
@@ -74,7 +74,7 @@ class userControlController extends Controller
|
||||
try {
|
||||
$conn = app(\Modules\M3\Services\PostgresProgramBridge::class);
|
||||
}
|
||||
catch (Exception $e)
|
||||
catch (\Exception $e)
|
||||
{
|
||||
// Determine reason for failure.
|
||||
// Probably database authentication error or invalid or unreachable database.
|
||||
@@ -115,14 +115,14 @@ class userControlController extends Controller
|
||||
// Successful Call : User profile created with default password
|
||||
//dd($result);
|
||||
//echo "<script>alert('User profile $request->R428US was created on the system with default password.');</script>";
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM428M
|
||||
(R428CO, R428PL, R428WH, R428STS, R428US, R428FIRST, R428FAMILY, R428EMAIL, R428EMPCDE, R428ADMUSR, R428PWRUSR, MENU2OPT, MENU3OPT, MENU4OPT, MENU5OPT, MENU6OPT, R42811A,R42821A)
|
||||
values ('$request->R428CO', '$request->R428PL', '$request->R428WH', '$request->R428STS', '$request->R428US', '$request->R428FIRST',
|
||||
DB::connection(config('m3.connection', 'pgsql'))->insert("insert into ICM428M
|
||||
(R428CO, R428PL, R428WH, R428STS, R428US, R428FIRST, R428FAMILY, R428EMAIL, R428EMPCDE, R428ADMUSR, R428PWRUSR, MENU2OPT, MENU3OPT, MENU4OPT, MENU5OPT, MENU6OPT, R42811A,R42821A)
|
||||
values ('$request->R428CO', '$request->R428PL', '$request->R428WH', '$request->R428STS', '$request->R428US', '$request->R428FIRST',
|
||||
'$request->R428FAMILY', '$request->R428EMAIL', $request->R428EMPCDE, '$request->R428ADMUSR', '$request->R428PWRUSR',
|
||||
'NN".$request->MENU2OPT3."NNN".$request->MENU2OPT7.$request->MENU2OPT8."N', '".$request->MENU3OPT1.$request->MENU3OPT2."NNNNNNN',
|
||||
'".$request->MENU4OPT1.$request->MENU4OPT2.$request->MENU4OPT3."NNNNNN',
|
||||
'".$request->MENU5OPT1.$request->MENU5OPT2.$request->MENU5OPT3."N".$request->MENU5OPT5."NNNN','".$request->MENU6OPT1.$request->MENU6OPT2.$request->MENU6OPT3."','".$request->R42811A."','".$request->R42821A."')");
|
||||
return "success2";
|
||||
return "success2";
|
||||
}
|
||||
##kd return "error profile";
|
||||
}
|
||||
@@ -154,13 +154,13 @@ 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',
|
||||
R428FAMILY='$request->R428FAMILY', R428EMAIL='$request->R428EMAIL', R428EMPCDE=$request->R428EMPCDE, R428ADMUSR='$request->R428ADMUSR',
|
||||
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)."',
|
||||
@@ -169,12 +169,12 @@ class userControlController extends Controller
|
||||
MENU6OPT='".$request->MENU6OPT1.$request->MENU6OPT2.$request->MENU6OPT3.substr($ICM428M[0]->MENU6OPT,3,-1)."',
|
||||
R42811A='".$request->R42811A."',R42821A='".$request->R42821A."'
|
||||
where R428US='$request->R428US'");
|
||||
|
||||
|
||||
return "success";
|
||||
|
||||
}
|
||||
|
||||
#590
|
||||
#590
|
||||
public static function callCL(Request $request) {
|
||||
|
||||
$PGMERRORS = '';
|
||||
@@ -182,8 +182,8 @@ class userControlController extends Controller
|
||||
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
|
||||
try {
|
||||
$conn = app(\Modules\M3\Services\PostgresProgramBridge::class);
|
||||
}
|
||||
catch (Exception $e)
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
// Determine reason for failure.
|
||||
// Probably database authentication error or invalid or unreachable database.
|
||||
@@ -206,7 +206,7 @@ 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)');
|
||||
|
||||
@@ -221,7 +221,7 @@ class userControlController extends Controller
|
||||
// AddParameterPackDec($io, $length, $scale, $comment, $varName, $value,$dimension)
|
||||
// Add Delivery Note Param
|
||||
//$params[] = $conn->AddParameterPackDec('in', 11, 0, 'ParamIn','','00000087125');
|
||||
|
||||
|
||||
// $params[] = $conn->AddParameterZoned('in', 11, 0, 'ParamIn');
|
||||
|
||||
// Start Time Tracking
|
||||
@@ -240,7 +240,7 @@ class userControlController extends Controller
|
||||
return "error";
|
||||
die();
|
||||
}
|
||||
// Successful Call
|
||||
// Successful Call
|
||||
else{
|
||||
//dump($result);
|
||||
// $AWREQN = $result['io_param']["var0"];
|
||||
@@ -260,7 +260,7 @@ class userControlController extends Controller
|
||||
// }
|
||||
// else{
|
||||
// // return $AWREQN;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@ class userControlController 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'));
|
||||
|
||||
|
||||
$PGMERRORS = '';
|
||||
|
||||
#console_log("request> ");
|
||||
@@ -283,8 +283,8 @@ class userControlController extends Controller
|
||||
$conn = app(\Modules\M3\Services\PostgresProgramBridge::class);
|
||||
#dump($conn);
|
||||
#echo "B4<br>";
|
||||
}
|
||||
catch (Exception $e)
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
#echo "B5<br>";
|
||||
// Determine reason for failure.
|
||||
@@ -325,10 +325,10 @@ class userControlController extends Controller
|
||||
echo "<script>alert($PGMERRORS);</script>";
|
||||
return "error pwd";
|
||||
}
|
||||
// Successful Call
|
||||
// Successful Call
|
||||
else{
|
||||
return "success";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class userPickingStats4 extends Controller
|
||||
{
|
||||
|
||||
#$start = microtime(true);
|
||||
#dd($request);
|
||||
#dd($request);
|
||||
// Filter by date
|
||||
if (isset($request->dates)) {
|
||||
$date = $request->dates;
|
||||
@@ -30,7 +30,7 @@ class userPickingStats4 extends Controller
|
||||
|
||||
#$user_array = Config::get('arrays.user_array');
|
||||
#618
|
||||
# Get Logged User CO & WH
|
||||
# Get Logged User CO & WH
|
||||
# Get Users from ICM428M
|
||||
$co = '';
|
||||
$whs = '';
|
||||
@@ -91,7 +91,7 @@ class userPickingStats4 extends Controller
|
||||
$mth = substr($starting, 5, 2);
|
||||
$day = substr($starting, 8, 2);
|
||||
$sqlstmt = "select oppno, sum(cast (hrs as integer)+ (hrs-cast (hrs as integer))/0.6) as hrs from LBPF
|
||||
where empno=$empno and lbyr=$yr and lbmo=$mth and lbdy=$day
|
||||
where empno=$empno and lbyr=$yr and lbmo=$mth and lbdy=$day
|
||||
and oppno in ($payrollCodes)
|
||||
group by oppno";
|
||||
|
||||
@@ -145,7 +145,7 @@ class userPickingStats4 extends Controller
|
||||
}
|
||||
if (!empty($statistic4)) {
|
||||
#echo "in !empty<br>";
|
||||
// Initialize the Monitor array
|
||||
// Initialize the Monitor array
|
||||
foreach ($statistic4 as $key => $val) {
|
||||
|
||||
// Initialize these variables in case not existant in LBPF
|
||||
@@ -259,8 +259,8 @@ class userPickingStats4 extends Controller
|
||||
|
||||
}
|
||||
|
||||
#echo "<pre>";
|
||||
#print_r($request);
|
||||
#echo "<pre>";
|
||||
#print_r($request);
|
||||
#print_r($perf_array); print_r($monitor_array);
|
||||
|
||||
// return encoded json if input field named format is json
|
||||
@@ -294,7 +294,7 @@ class userPickingStats4 extends Controller
|
||||
"actualLPH" => $actualLPH,
|
||||
"grossHours" => $grossHours
|
||||
);
|
||||
#echo "<pre>"; print_r($json_data);
|
||||
#echo "<pre>"; print_r($json_data);
|
||||
return json_encode($json_data);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -94,16 +94,16 @@ class userPickingStats5 extends Controller
|
||||
// loop for the days difference and passing proper date to v4 to get json encoded response
|
||||
if (isset($request->dates)) {
|
||||
for($x=0;$x<=$days;$x++) {
|
||||
|
||||
|
||||
$next_date = date("Y-m-d",strtotime($starting."+$x days"));
|
||||
|
||||
$parameters = ['dates'=>$next_date, 'user'=>$request->user, 'format'=>'json'];
|
||||
#echo "<pre>"; print_r($parameters); echo "$urlStats4</pre>";
|
||||
|
||||
$response = Http::withBasicAuth($username, $pw)->get($urlStats4, $parameters);
|
||||
#echo $response;
|
||||
#echo $response;
|
||||
$statusCode = $response->status();
|
||||
|
||||
|
||||
#echo "$statusCode json return=".$response->getBody()." <br>";
|
||||
|
||||
$statistic5[$x] = json_decode($response->getBody(),true);
|
||||
|
||||
@@ -29,7 +29,7 @@ class userProfileController extends Controller
|
||||
# Check if user is eligible for Profile update
|
||||
if (isset($ICM428M->R428US)) {
|
||||
return view('m3::liberty-theme.pages.userProfile', compact('ICM428M','IC670M'));
|
||||
}
|
||||
}
|
||||
else{
|
||||
abort(404);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ class userProfileController extends Controller
|
||||
|
||||
$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);
|
||||
@@ -49,10 +49,10 @@ class userProfileController extends Controller
|
||||
|
||||
if ($R428US!='') {
|
||||
# Update record to ICM428M
|
||||
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM428M
|
||||
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM428M
|
||||
set R428CO='$R428CO', R428PL='$R428PL', R428WH='$R428WH'
|
||||
where R428US='$R428US'");
|
||||
|
||||
|
||||
// return "success";
|
||||
return redirect('/userprofile')->with('success', 'Profile updated successfully!');
|
||||
}
|
||||
@@ -67,7 +67,7 @@ class userProfileController extends Controller
|
||||
|
||||
$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);
|
||||
@@ -75,10 +75,10 @@ class userProfileController extends Controller
|
||||
|
||||
if ($R428US!='') {
|
||||
# Update record to ICM428M
|
||||
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM428M
|
||||
DB::connection(config('m3.connection', 'pgsql'))->update("update ICM428M
|
||||
set R428CO='$R428CO', R428PL='$R428PL', R428WH='$R428WH'
|
||||
where R428US='$R428US'");
|
||||
|
||||
|
||||
return response()->json(['success'=>true]);
|
||||
}
|
||||
else{
|
||||
@@ -86,5 +86,5 @@ class userProfileController extends Controller
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class utilitiesContoller extends Controller
|
||||
// connect to toolkit using DB2 credentials (can also leave blank for default authority)
|
||||
try {
|
||||
$conn = app(\Modules\M3\Services\PostgresProgramBridge::class);
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
// Determine reason for failure.
|
||||
// Probably database authentication error or invalid or unreachable database.
|
||||
$code = $e->getCode();
|
||||
@@ -89,7 +89,7 @@ class utilitiesContoller extends Controller
|
||||
if (!$result) {
|
||||
$PGMERRORS = 'Error calling program. Code: ' . $conn->getErrorCode() . ' Msg: ' . $conn->getErrorMsg();
|
||||
}
|
||||
// Successful Call
|
||||
// Successful Call
|
||||
else {
|
||||
dump($result);
|
||||
// $AWREQN = $result['io_param']["var0"];
|
||||
@@ -245,29 +245,29 @@ class utilitiesContoller extends Controller
|
||||
.border_rght {
|
||||
border-right: 1px solid;
|
||||
}
|
||||
|
||||
|
||||
.margin_t {
|
||||
padding-top : 10px;
|
||||
}
|
||||
|
||||
|
||||
.align_lft {
|
||||
text-align: left;
|
||||
}
|
||||
.align_center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
@page { margin: 5px; }
|
||||
body { margin: 0px; }
|
||||
</style>
|
||||
</head>
|
||||
<body style="font-family: Arial, sans-serif;">';
|
||||
|
||||
# Get number of Pallets
|
||||
# Get number of Pallets
|
||||
$packageCount = count($GSArray['PackagesArray']);
|
||||
$packageNum = 1;
|
||||
|
||||
# Get GS1 Label MAX ID from ICM695M3 :
|
||||
# Get GS1 Label MAX ID from ICM695M3 :
|
||||
$GS1SEQUENCESel = DB::connection(config('m3.connection', 'pgsql'))->table('icm695m3')->max('ID');
|
||||
$GS1SEQUENCE = isset($GS1SEQUENCESel) ? $GS1SEQUENCESel : 0;
|
||||
|
||||
@@ -601,8 +601,8 @@ class utilitiesContoller extends Controller
|
||||
// $GS1SEQUENCEID = str_pad($GS1SEQUENCE, $total_length, "0", STR_PAD_LEFT);
|
||||
// dump($GS1SEQUENCEID);
|
||||
|
||||
# MAK Get Contents
|
||||
# ESN1
|
||||
# MAK Get Contents
|
||||
# ESN1
|
||||
# $AYMACPKR='888568'; // LTL example
|
||||
# $AYMACPKR='894337'; // another LTL example with smaller orders, therefore pallets are more mixed
|
||||
# $AYMACPKR='1225311'; // parcel example
|
||||
|
||||
@@ -32,10 +32,10 @@ class whsePerfController extends Controller
|
||||
$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,
|
||||
$sqlstmt = "select AVDATE, AVANOTESCL,AVADLRCL,AVAWGTCL,AVANOTESCH,AVADLRCH,AVAWGTCH,AVANOTESOP,AVADLROP,AVAWGTOP,
|
||||
AVLNOTESCL,AVLDLRCL,AVLWGTCL,AVLNOTESCH,AVLDLRCH,AVLWGTCH,AVLNOTESOP,AVLDLROP,AVLWGTOP,
|
||||
AVPNOTESCL,AVPDLRCL,AVPWGTCL,AVPNOTESCH,AVPDLRCH,AVPWGTCH,AVPNOTESOP,AVPDLROP,AVPWGTOP,
|
||||
AVINOTESCL,AVIDLRCL,AVIWGTCL,AVINOTESOP,AVIDLROP,AVIWGTOP
|
||||
AVINOTESCL,AVIDLRCL,AVIWGTCL,AVINOTESOP,AVIDLROP,AVIWGTOP
|
||||
from ICM711M
|
||||
where AVDATE between ".date('Ym', strtotime($date_in))."00 and ".date('Ym', strtotime($date_in))."32";
|
||||
|
||||
@@ -46,7 +46,7 @@ class whsePerfController extends Controller
|
||||
$pct_array = Config::get('arrays.whsePerf_targets');
|
||||
|
||||
return view('m3::liberty-theme.pages.whsePerf', compact('ICM711M','power_user','USER_INFO','date_in','pct_array'));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function exportTable(Request $request) {
|
||||
@@ -55,10 +55,10 @@ class whsePerfController extends Controller
|
||||
$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,
|
||||
$sqlstmt = "select AVDATE, AVANOTESCL,AVADLRCL,AVAWGTCL,AVANOTESCH,AVADLRCH,AVAWGTCH,AVANOTESOP,AVADLROP,AVAWGTOP,
|
||||
AVLNOTESCL,AVLDLRCL,AVLWGTCL,AVLNOTESCH,AVLDLRCH,AVLWGTCH,AVLNOTESOP,AVLDLROP,AVLWGTOP,
|
||||
AVPNOTESCL,AVPDLRCL,AVPWGTCL,AVPNOTESCH,AVPDLRCH,AVPWGTCH,AVPNOTESOP,AVPDLROP,AVPWGTOP,
|
||||
AVINOTESCL,AVIDLRCL,AVIWGTCL,AVINOTESOP,AVIDLROP,AVIWGTOP
|
||||
AVINOTESCL,AVIDLRCL,AVIWGTCL,AVINOTESOP,AVIDLROP,AVIWGTOP
|
||||
from ICM711M
|
||||
where AVDATE between ".date('Ym', strtotime($date_in))."00 and ".date('Ym', strtotime($date_in))."32";
|
||||
|
||||
@@ -70,27 +70,27 @@ class whsePerfController extends Controller
|
||||
|
||||
$html = view('m3::liberty-theme.pages.whsePerf', compact('ICM711M','power_user','USER_INFO','date_in','pct_array'))->render();
|
||||
|
||||
libxml_use_internal_errors(true);
|
||||
$doc = new \DOMDocument();
|
||||
$doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); // Extract only table elements
|
||||
$tables = $doc->getElementsByTagName('table');
|
||||
if ($tables->length === 0) {
|
||||
abort(400, 'No table found in HTML');
|
||||
}
|
||||
// Create new document with only the table
|
||||
$newDoc = new \DOMDocument();
|
||||
$newDoc->appendChild($newDoc->importNode($tables->item(0), true));
|
||||
$cleanHtml = '<!DOCTYPE html><html><body>' . $newDoc->saveHTML() . '</body></html>';
|
||||
libxml_clear_errors();
|
||||
$tempFile = tempnam(sys_get_temp_dir(), 'html') . '.html';
|
||||
file_put_contents($tempFile, $cleanHtml);
|
||||
$reader = IOFactory::createReader('Html');
|
||||
$spreadsheet = $reader->load($tempFile);
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
$fileName = 'export.xlsx';
|
||||
$tempExcel = tempnam(sys_get_temp_dir(), 'excel');
|
||||
$writer->save($tempExcel);
|
||||
unlink($tempFile);
|
||||
libxml_use_internal_errors(true);
|
||||
$doc = new \DOMDocument();
|
||||
$doc->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); // Extract only table elements
|
||||
$tables = $doc->getElementsByTagName('table');
|
||||
if ($tables->length === 0) {
|
||||
abort(400, 'No table found in HTML');
|
||||
}
|
||||
// Create new document with only the table
|
||||
$newDoc = new \DOMDocument();
|
||||
$newDoc->appendChild($newDoc->importNode($tables->item(0), true));
|
||||
$cleanHtml = '<!DOCTYPE html><html><body>' . $newDoc->saveHTML() . '</body></html>';
|
||||
libxml_clear_errors();
|
||||
$tempFile = tempnam(sys_get_temp_dir(), 'html') . '.html';
|
||||
file_put_contents($tempFile, $cleanHtml);
|
||||
$reader = IOFactory::createReader('Html');
|
||||
$spreadsheet = $reader->load($tempFile);
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
$fileName = 'export.xlsx';
|
||||
$tempExcel = tempnam(sys_get_temp_dir(), 'excel');
|
||||
$writer->save($tempExcel);
|
||||
unlink($tempFile);
|
||||
return response()->download($tempExcel, $fileName)->deleteFileAfterSend(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,36 +33,36 @@ class whsePerfDetailsController extends Controller
|
||||
|
||||
$all = "tempfile4 as (
|
||||
select a5macpkr, a4shshnm, a4shipvia1, interco, a4shiptype, sum(dollarvalue) as dollarvalue, sum(weight) as weight, max(source) as source
|
||||
from tempfile3
|
||||
where not (a4shipvia1='OCEAN' or interco='interco') and source<>'A2'
|
||||
from tempfile3
|
||||
where not (a4shipvia1='OCEAN' or interco='interco') and source<>'A2'
|
||||
group by a5macpkr, a4shshnm, a4shipvia1, interco, a4shiptype
|
||||
)
|
||||
select * from tempfile4 order by source";
|
||||
|
||||
|
||||
$ltl = "tempfile4 as (
|
||||
select a5macpkr, a4shshnm, a4shipvia1, interco, a4shiptype, sum(dollarvalue) as dollarvalue, sum(weight) as weight, max(source) as source
|
||||
from tempfile3
|
||||
where not (a4shipvia1='OCEAN' or interco='interco') and source<>'A2' and a4shiptype='LTL'
|
||||
from tempfile3
|
||||
where not (a4shipvia1='OCEAN' or interco='interco') and source<>'A2' and a4shiptype='LTL'
|
||||
group by a5macpkr, a4shshnm, a4shipvia1, interco, a4shiptype
|
||||
)
|
||||
select * from tempfile4 order by source";
|
||||
|
||||
$parcel = "tempfile4 as (
|
||||
select a5macpkr, a4shshnm, a4shipvia1, interco, a4shiptype, sum(dollarvalue) as dollarvalue, sum(weight) as weight, max(source) as source
|
||||
from tempfile3
|
||||
from tempfile3
|
||||
where not (a4shipvia1='OCEAN' or interco='interco') and source<>'A2' and a4shiptype='SmallPack'
|
||||
group by a5macpkr, a4shshnm, a4shipvia1, interco, a4shiptype
|
||||
)
|
||||
select * from tempfile4 order by source";
|
||||
|
||||
|
||||
$io = "tempfile4 as (
|
||||
select a5macpkr, a4shshnm, a4shipvia1, interco, a4shiptype, sum(dollarvalue) as dollarvalue, sum(weight) as weight, max(source) as source
|
||||
from tempfile3
|
||||
where (a4shipvia1='OCEAN' or interco='interco') and source<>'A2'
|
||||
from tempfile3
|
||||
where (a4shipvia1='OCEAN' or interco='interco') and source<>'A2'
|
||||
group by a5macpkr, a4shshnm, a4shipvia1, interco, a4shiptype
|
||||
)
|
||||
select * from tempfile4 order by source";
|
||||
|
||||
|
||||
switch ($for) {
|
||||
case "a":
|
||||
$stmt2=$all;
|
||||
|
||||
Reference in New Issue
Block a user