I am in the need of some help on a custom office script regarding Sales Tax amounts in invoice data entry.
My client is manually entering a value in a UDF called UDF_MAN_SLSTAX. However, It is mainly used on imported VI orders
When Sales Order Invoice occurs the invoice clerks, manually overrides the Tax Amount in Sage by this value.
Goal: To have Sage take this UDF value on have it automatically update the standard Sales Tax fields. The Tax Schedule is always the same ECOMM for every order. Also the tax code is setup up with a rate of 0.
Challenge: I think Sage's standard tax program keeps overriding any amounts that I try to script based on the tax schedule setups. The client does not want to setup tax rules in Sage and they have a very strange distaste of Avatax and Vertex. It was tried in the past and was not successfully.
The following is my current script.
Any help or insights would be appreciated.
'Goal: To set Sales Tax Schedule and Sage Tax amount to manual UDF Tax value
UDF_MAN_SLSTAX=0
if oSession.CompanyCode = "TST" then
retVal = oBusObj.GetValue("UDF_MAN_SLSTAX", UDF_MAN_SLSTAX)
'oSession.AsObject(oSession.UI).MessageBox "", "UDF_MAN_SLSTAX is " & UDF_MAN_SLSTAX
if UDF_MAN_SLSTAX <> 0 then
retVal = oBusObj.SetValue("TaxSchedule$", " ECOMM")
'Sales Tax Detail Key
'SalesOrderNo+ScheduleSeqNo+TaxCode+TaxClass
'Sales Tax Header
If oBusObj.SalesTaxCalcObj > 0 Then
'Set oSalesTaxCalcObj = oSession.AsObject(oBusObj.SalesTaxCalcObj)
Set oSalesTaxCalcObj = oSession.AsObject(oSession.GetObject("SO_SalesOrderTaxSummary_bus"))
orderNo = ""
seqNo = ""
taxCode = ""
retVal = oBusObj.GetValue("SalesOrderNo$", orderNo)
retval = oSalesTaxCalcObj.SetKeyValue("SalesOrderNo$", orderNo)
retval = oSalesTaxCalcObj.SetKeyValue("ScheduleSeqNo$", "000001")
retval = oSalesTaxCalcObj.SetKeyValue("TaxCode$", "TX")
retval = oSalesTaxCalcObj.SetKey()
retval = oSalesTaxCalcObj.Write()
retVal = oSalesTaxCalcObj.SetValue("Overridden$", "Y")
retVal = oSalesTaxCalcObj.SetValue("SalesTaxAmt", UDF_MAN_SLSTAX)
retval = oSalesTaxCalcObj.Write()
set oSalesTaxCalcObj = Nothing
End If
'retVal = oScript.InvokeButton("BT_TAXDETAIL")
'oSession.AsObject(oSession.UI).MessageBox "", "UDF_MAN_SLSTAX is " & UDF_MAN_SLSTAX & " " & TaxableSalesAmt & " " & NonTaxableSalesAmt
end if
end if
------------------------------
Michael Davis
Warren Averett Technology Group
Birmingham, AL
------------------------------