Never use a JE for QB payroll.
The function is in Edit menu > Preferences, Payroll & Employees, click on the Company Preferences tab. Select Job and Class Tracking Per Earnings item.
Now for the paycheck you reiterate the Salary Pay item = post it in allocated lines, to class track each allocation.
Please see my attachment.