M3 Integration fixes

This commit is contained in:
Mark Gregory
2026-09-21 13:25:44 +01:00
parent 47085e5160
commit 3521e47ef0
62 changed files with 131 additions and 173 deletions
@@ -13,11 +13,11 @@ class PalletQtyController extends Controller
public static function index(Request $request)
{
$connection = config('m3.connection', 'pgsql');
$power_user = (object) ['R428PWRUSR' => 'N', 'R428US' => strtoupper(m3_user()), 'R428CO' => '', 'R428PL' => '', 'R428WH' => ''];
$power_user = (object) ['R428PWRUSR' => 'N', 'R428US' => strtoupper(m3User()), 'R428CO' => '', 'R428PL' => '', 'R428WH' => ''];
if (Schema::connection($connection)->hasTable('icm428m')) {
$power_user = DB::connection($connection)->table('icm428m')
->select('R428PWRUSR', 'R428US', 'R428CO', 'R428PL', 'R428WH')
->where('R428US', '=', strtoupper(m3_user()))->first() ?? $power_user;
->where('R428US', '=', strtoupper(m3User()))->first() ?? $power_user;
}
$co = $power_user->R428CO;
$plant = $power_user->R428PL;