Error Number = 799 Stored Procedure= taSopHdrIvcInsert Error Description = Tax table detail does not equal the tax amount
For this error, we are taking the total of all the tax columns in the SOP10105 table STAXAMNT + FRTTXAMT + MSCTXAMT and comparing it to the sum of the 3 tax variables that you are passing into your header: @I_vTAXAMNT + @I_vFRTTXAMT + @I_vMSCTXAMT. If they don’t match then we get the error that you are seeing.
select @TAXAMNTL = isnull(sum(STAXAMNT + FRTTXAMT + MSCTXAMT),0.00) from SOP10105 (nolock) where SOPTYPE = @I_vSOPTYPE and SOPNUMBE = @I_vSOPNUMBE and LNITMSEQ = 0 and BKOUTTAX = 0
if (@TAXAMNTL <> (@I_vTAXAMNT + @I_vFRTTXAMT + @I_vMSCTXAMT))
begin
select @O_iErrorState = 799 /* Tax table detail does not equal the tax amount */
We'd more need a support case for this type of question, but let's see what we can do.....
Below is a example I've seen used for this type of eConnect error message. This was added to an existing customer script.
On the sales tax line, it zeroes out the freight tax. Then a second tax line call is added specifically for the freight tax with a tax type of 1 for Freight.
In this case, the sales order imported into the system without issue and it was able to be transfered into a sales invoice and posted without errors as well in the user interface.
Again, this is just a piece of a example script that was used in a case with this same taSopHdrIvcInsert procedure / 799 error message.
Hopefully it helps resolve the error in your case as well.
EXEC @return_value = [dbo].[taSopLineIvcTaxInsert]
@I_vSOPTYPE = 2,
@I_vSOPNUMBE = N'CUSTOMER123',
@I_vCUSTNMBR = N'12345',
@I_vSALESAMT = 8.40,
@I_vFRTTXAMT = 0, --0 as we need a separate Freight Tax Line
@I_vFREIGHT = 0, --0 as we need a separate Freight Tax Line
@I_vTAXDTLID = N'VAT-19%-SALES',
@I_vSTAXAMNT = 1.60,
@O_iErrorState = @O_iErrorState OUTPUT,
@oErrString = @oErrString OUTPUT
SELECT @oRptString = 'SELECT ErrorCode, SourceProc, ErrorDesc FROM DYNAMICS..taErrorCode WHERE ErrorCode IN (' + REPLACE(RTRIM('0'+@oErrString),CHAR(32), ',') + ')'
EXEC(@oRptString)
--ADDED SEPARATE FREIGHT TAX LINE
EXEC @return_value = [dbo].[taSopLineIvcTaxInsert]
@I_vSOPTYPE = 2,
@I_vSOPNUMBE = N'CUSTOMER123',
@I_vCUSTNMBR = N'12345',
@I_vTAXTYPE = 1, --Added Tax Type of 1 for Freight
@I_vSALESAMT = 0,
@I_vFRTTXAMT = 1.12, --Moved Freight Tax Amounts here
@I_vFREIGHT = 5.87, --Moved Freight Tax Amounts here
@I_vTAXDTLID = N'VAT-19%-SALES',
@I_vSTAXAMNT = 0,
@O_iErrorState = @O_iErrorState OUTPUT,
@oErrString = @oErrString OUTPUT
SELECT @oRptString = 'SELECT ErrorCode, SourceProc, ErrorDesc FROM DYNAMICS..taErrorCode WHERE ErrorCode IN (' + REPLACE(RTRIM('0'+@oErrString),CHAR(32), ',') + ')'
EXEC(@oRptString)
Thanks