Issue on MANY lines in here, here is a typical modification I made, in bold below:
(Adding "Left(" and a ",30)" on the end of description. For a 30 character field (Which Descr is), can't append on safely to a 30 character field (InvtID is also 30 characters)
"
INSERT #Wrk11400_GLTran (Acct, AvgCostTot,
BOMDirLbrAmt, BOMDirOthAmt, BOMEffLbrOvhVarAmt, BOMEffLbrVarAmt, BOMEffMachOvhVarAmt,
BOMEffOthVarAmt, BOMOvhLbrAmt, BOMOvhMachAmt, BOMTotTranAmt, BOMTotVarAmt,
CrAmt, DrAmt, InvtId,RtgLineNbr, RefNbr, Sub, TranDate, TranDesc, TranType)
SELECT I.InvtAcct,0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, ROUND(R.DirLbrAmt, @BaseDecPl), I.InvtID, R.RtgLineNbr, R.RefNbr, I.InvtSub, B.TranDate, Left(rtrim(R.KitID) + ' - Dir Labor',30), 'AS'
FROM RtgTran R Join BOMDoc B
on B.RefNbr = R.RefNbr
Join Inventory I
on I.InvtID = R.KitID
Join WorkCenter W
on W.WorkCenterID = R.WorkCenterID
WHERE R.RefNbr = @RefNbr and R.DirLbrAmt <> 0 and I.Valmthd <> 'T'
"