Added credit card fee to a sales order

I'm trying to calculate the extension amount of a miscellaneous charge code.  When "/CCFEE" is entered as the charge code, I want the extension amount to be the total amount multiplied by .025.

Here is my script.  I'm getting the following error when clicking on the Totals tab.

OrderAmt = 0
FeeAmt = 0
NonTaxAmt = 0
SalesTaxAmt = 0
TaxAmt = 0
FreightAmt = 0
TaxAmt = 0


ItemNumber = ""

retVal = oHeaderObj.GetValue("NonTaxableAmt", NonTaxAmt)
retVal = oHeaderObj.GetValue("TaxableAmt", TaxAmt)
retVal = oHeaderObj.GetValue("SalesTaxAmt", SalesTaxAmt)
retVal = oHeaderObj.GetValue("FrieghtAmt", FreightAmt)

retVAL = OBusobj.GetValue("ItemCode$",ItemNumber)

OrderAmt = NonTaxAmt + TaxAmt + SalesTaxAmt + FreightAmt

FeeAmt = OrderAmt * .025

if ItemNumber = "/CCFEE" then retVAL = oBusobj.setValue("ExtensionAmt", FeeAmt) end if

Parents Reply Children
No Data