I have a client in need of a PR script. Objective is to change the tax profile code when a specific earnings code is used.

Unfortunately, our script writing skills are not where they should be. The code below is not producing the necessary results.
Could someone please point out the errors of our logic?
Alnoor's NOLA script class is a faint memory.
Thanks in advance.
' Initialize VARs
sEarningsCode = "": sLineType= "": sTaxProfileCode = "Z SD": sCompany = ""
'in test mode only run if "TST" company
'retVal = oBusObj.GetValue("%C$",sCompany)
'if sCompany = "TST" then
retVal = oBusObj.GetValue("EarningsCode$", sEarningsCode)
retVal = oBusObj.GetValue("LineType", sLineType)
'Only check earnings LineType = "E"
if sLineType = "E" then
if sEarningsCode = "000009" then
retVal = oBusObj.SetValue("TaxProfileCode", sTaxProfileCode)
end if
end if 'Line Type = "1"
'end if 'Company = "TST"
------------------------------
Jeff Schwenk
Bottomline Software, Inc.
(540) 221-4444
------------------------------