M3 Integration fixes
This commit is contained in:
@@ -295,7 +295,7 @@ class CloseShipment extends Controller
|
||||
->orderBy('AYINTBOX')
|
||||
->get();
|
||||
|
||||
foreach ($iCM695M1JOINTMP as $key => $ICM695M1JOINR) {
|
||||
foreach ($iCM695M1JOINTMP as $ICM695M1JOINR) {
|
||||
$a4SHIPVIA = isset($ICM695M1JOINR->A4SHIPVIA) ? trim(str_replace('&', '_', $ICM695M1JOINR->A4SHIPVIA)) : '';
|
||||
|
||||
$sHIPTYPE = trim($ICM695M1JOINR->A4SHIPTYPE);
|
||||
|
||||
@@ -18,6 +18,10 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
public static function index(Request $request)
|
||||
{
|
||||
$iC670M = $iCM688M2 = [];
|
||||
$wHDDA = '';
|
||||
$cOMPANY = '110';
|
||||
$pLANT = '144';
|
||||
$wHS = '322';
|
||||
$rEPORTDATEDisp = today()->format('Ymd');
|
||||
$allReportsUrls = [];
|
||||
try {
|
||||
@@ -237,7 +241,7 @@ class OrderLinesOfClosedOrder extends Controller
|
||||
|
||||
private static function userWarehouseContext(string $defaultCompany = '', string $defaultPlant = '', string $defaultWarehouse = ''): array
|
||||
{
|
||||
$user = trim((string) m3User());
|
||||
$user = trim((string) m3_user());
|
||||
if ($user === '') {
|
||||
return [$defaultCompany, $defaultPlant, $defaultWarehouse];
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class UserControlController extends Controller
|
||||
$connection = config('m3.connection', 'pgsql');
|
||||
$profile = null;
|
||||
if (Schema::connection($connection)->hasTable('icm428m')) {
|
||||
$profile = DB::connection($connection)->table('icm428m')->where('R428US', strtoupper(m3User()))->first();
|
||||
$profile = DB::connection($connection)->table('icm428m')->where('R428US', strtoupper(m3_user()))->first();
|
||||
}
|
||||
$co = $profile->R428CO ?? '';
|
||||
$whs = $profile->R428WH ?? '';
|
||||
@@ -87,14 +87,14 @@ class UserControlController extends Controller
|
||||
}
|
||||
$conn->setOptions(['persistent' => false, 'stateless' => true, 'debug' => true, 'debugLogFile' => '/www/sentm3test/htdocs/M3/storage/logs/toolkit_debug.log']);
|
||||
// Add LIB
|
||||
// $result = $conn->clCommand('ADDLIBLE LIB(MPDAT10)');
|
||||
// $result = $conn->CLCommand('ADDLIBLE LIB(MPDAT10)');
|
||||
// define several input/output params
|
||||
$params = [];
|
||||
$params[] = $conn->addParameterChar('in', 10, 'User profile', 'E#iUsrPrf', $request->R428US);
|
||||
$params[] = $conn->addParameterChar('in', 20, 'First name', 'FIRST', $request->R428FIRST);
|
||||
$params[] = $conn->addParameterChar('in', 30, 'Family name', 'FAMILY', $request->R428FAMILY);
|
||||
// # $result = $conn->pgmCall(Config::get('eproconf.misc.PGM1'), Config::get('eproconf.misc.libname4'), $params, array(), array());
|
||||
$result = $conn->pgmCall('ICMUSRPRF', 'EWOBJ', $params, [], []);
|
||||
$params[] = $conn->AddParameterChar('in', 10, 'User profile', 'E#iUsrPrf', $request->R428US);
|
||||
$params[] = $conn->AddParameterChar('in', 20, 'First name', 'FIRST', $request->R428FIRST);
|
||||
$params[] = $conn->AddParameterChar('in', 30, 'Family name', 'FAMILY', $request->R428FAMILY);
|
||||
// # $result = $conn->PgmCall(Config::get('eproconf.misc.PGM1'), Config::get('eproconf.misc.libname4'), $params, array(), array());
|
||||
$result = $conn->PgmCall('ICMUSRPRF', 'EWOBJ', $params, [], []);
|
||||
if (! $result) {
|
||||
|
||||
return 'error profile2';
|
||||
@@ -175,15 +175,15 @@ class UserControlController extends Controller
|
||||
}
|
||||
|
||||
// Add LIB
|
||||
// $result = $conn->clCommand('ADDLIBLE LIB(MPDAT10)');
|
||||
// $result = $conn->CLCommand('ADDLIBLE LIB(MPDAT10)');
|
||||
|
||||
// define several input/output params
|
||||
$params = [];
|
||||
|
||||
// AddParameterChar($io, $size, $comment, $varName, $value, $varying, $dimension)
|
||||
// Add Warehouse Param
|
||||
$params[] = $conn->addParameterChar('in', 10, 'userid', 'USERID', $request->USERID);
|
||||
$params[] = $conn->addParameterChar('in', 1, 'action', 'ACTION', $request->ACTION);
|
||||
$params[] = $conn->AddParameterChar('in', 10, 'userid', 'USERID', $request->USERID);
|
||||
$params[] = $conn->AddParameterChar('in', 1, 'action', 'ACTION', $request->ACTION);
|
||||
|
||||
// AddParameterPackDec($io, $length, $scale, $comment, $varName, $value,$dimension)
|
||||
// Add Delivery Note Param
|
||||
@@ -193,10 +193,10 @@ class UserControlController extends Controller
|
||||
|
||||
// Config::get('eproconf.misc.PGM1'), Config::get('eproconf.misc.libname4')
|
||||
// ICM700C EWOBJTST ICM700C ICM700CSBM
|
||||
$result = $conn->pgmCall('ICMCHGPRF', 'EWOBJ', $params, [], []);
|
||||
$result = $conn->PgmCall('ICMCHGPRF', 'EWOBJ', $params, [], []);
|
||||
|
||||
if (! $result) {
|
||||
echo "<script>alert($pGMERRORS);</script>";
|
||||
echo "<script>alert(" . json_encode($conn->getErrorMsg()) . ");</script>";
|
||||
|
||||
return 'error';
|
||||
}
|
||||
@@ -236,11 +236,11 @@ class UserControlController extends Controller
|
||||
return self::programBridgeConnectionError($e);
|
||||
}
|
||||
|
||||
$result = $conn->clCommand('QSYS/CHGUSRPRF USRPRF(' . $request->R428US_PWD . ') PASSWORD(' . $request->NEW_PASSWORD . ') STATUS(*ENABLED) PWDEXP(*NO)');
|
||||
$result = $conn->CLCommand('QSYS/CHGUSRPRF USRPRF(' . $request->R428US_PWD . ') PASSWORD(' . $request->NEW_PASSWORD . ') STATUS(*ENABLED) PWDEXP(*NO)');
|
||||
|
||||
if (! $result) {
|
||||
dump($pGMERRORS);
|
||||
echo "<script>alert($pGMERRORS);</script>";
|
||||
dump($conn->getErrorMsg());
|
||||
echo "<script>alert(" . json_encode($conn->getErrorMsg()) . ");</script>";
|
||||
|
||||
return 'error pwd';
|
||||
}
|
||||
|
||||
@@ -29,34 +29,25 @@ class UtilitiesController extends Controller
|
||||
} catch (\Throwable $e) {
|
||||
// Determine reason for failure.
|
||||
// Probably database authentication error or invalid or unreachable database.
|
||||
$code = $e->getCode();
|
||||
Log::error('Unable to connect to the program bridge.', ['exception' => $e]);
|
||||
|
||||
switch ($code) {
|
||||
case 8001:
|
||||
// "Authorization failure on distributed database connection attempt"
|
||||
// Usually means a wrong DB2 user or password
|
||||
break;
|
||||
case 42705:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return response()->json(['error' => 'Program bridge connection failed.'], 503);
|
||||
}
|
||||
$conn->setOptions(['persistent' => false, 'stateless' => true, 'debug' => true, 'debugLogFile' => '/www/sentustesx/htdocs/storage/logs/toolkit_debug.log']);
|
||||
|
||||
// Add LIB
|
||||
// $result = $conn->clCommand('ADDLIBLE LIB(MPDAT10)');
|
||||
// $result = $conn->CLCommand('ADDLIBLE LIB(MPDAT10)');
|
||||
|
||||
// define several input/output params
|
||||
$params = [];
|
||||
|
||||
// AddParameterChar($io, $size, $comment, $varName, $value, $varying, $dimension)
|
||||
// Add Warehouse Param
|
||||
$params[] = $conn->addParameterChar('in', 3, 'eqNumber', '', '111');
|
||||
$params[] = $conn->AddParameterChar('in', 3, 'eqNumber', '', '111');
|
||||
|
||||
// AddParameterPackDec($io, $length, $scale, $comment, $varName, $value,$dimension)
|
||||
// Add Delivery Note Param
|
||||
$params[] = $conn->addParameterPackDec('in', 11, 0, 'ParamIn', '', '00000087125');
|
||||
$params[] = $conn->AddParameterPackDec('in', 11, 0, 'ParamIn', '', '00000087125');
|
||||
|
||||
// Start Time Tracking
|
||||
$start = microtime(true);
|
||||
@@ -65,15 +56,15 @@ class UtilitiesController extends Controller
|
||||
|
||||
// Config::get('eproconf.misc.PGM1'), Config::get('eproconf.misc.libname4')
|
||||
// ICM700C EWOBJTST ICM700C ICM700CSBM
|
||||
$result = $conn->pgmCall('ICM700CSBM', 'EWOBJTST', $params, [], []);
|
||||
$result = $conn->PgmCall('ICM700CSBM', 'EWOBJTST', $params, [], []);
|
||||
|
||||
if ($result) {
|
||||
if (! $result) {
|
||||
}
|
||||
// Successful Call
|
||||
else {
|
||||
dump($result);
|
||||
}
|
||||
|
||||
if ($pGMERRORS != '') {
|
||||
dump($pGMERRORS);
|
||||
}
|
||||
// Get Execution Time
|
||||
$time = microtime(true) - $start;
|
||||
dump($time);
|
||||
@@ -170,7 +161,7 @@ class UtilitiesController extends Controller
|
||||
|
||||
// Get the Calling User
|
||||
// $userId = 'TWOSHIP';
|
||||
// $sHUSER = isset($userId) ? $userId : (m3User() !== '' ? Str::upper(trim(m3User())) : '');
|
||||
// $sHUSER = isset($userId) ? $userId : (m3_user() !== '' ? Str::upper(trim(m3_user())) : '');
|
||||
|
||||
// Get Manifest Array
|
||||
$gSArray = $request->query();
|
||||
|
||||
Reference in New Issue
Block a user