updates to M3 module

This commit is contained in:
Mark Gregory
2026-09-16 16:46:15 +01:00
parent 13a7e804af
commit ce06aa9fac
20 changed files with 191 additions and 203 deletions
@@ -23,10 +23,10 @@ class ReplenishSettingsController extends Controller
# Get Logged user Id
$userId = m3_user() !== '' ? strtoupper(m3_user()) : '' ;
// $userId = 'E1135818'; // Brad : E1135818 Malak : E2011812 ACOM_PDF
$ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->where('R428US',$userId)
->where('R428STS','A')
->first();
$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 : '';
@@ -34,11 +34,13 @@ class ReplenishSettingsController extends Controller
if ($userCO!='') {
# Warehouse Table
$IC670M = DB::connection(config('m3.connection', 'pgsql'))->table('ic670m')
$IC670M = \Illuminate\Support\Facades\Schema::connection($connection)->hasTable('ic670m')
? DB::connection($connection)->table('ic670m')
->where('WDCO',$userCO)
->where('WDPL',$userPL)
->where('WDWHS',$userWH)
->get();
->get()
: [];
}
else{
// $REFCAT658 =[];
@@ -151,10 +153,10 @@ class ReplenishSettingsController extends Controller
# Get Logged user Id
$userId = m3_user() !== '' ? strtoupper(m3_user()) : '' ;
// $userId = 'E1135818'; // Brad : E1135818 Malak : E2011812 ACOM_PDF
$ICM428M = DB::connection(config('m3.connection', 'pgsql'))->table('icm428m')
->where('R428US',$userId)
->where('R428STS','A')
->first();
$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 : '';