Getting incorrect tax name for given tax code after Sage 50 2019.1 Update

I have Sage 50 Canadian Accountant company file and following setting are configured in it. 

  • HST tax name is setup

  • Tax code H is setup and mapped to HST Tax name 

For Receivable accounts , Tax code H is setup for new customers sales

Now we are sending Sale invoice to Sage 50 Company file and while preparing data to be posted, we are making a call to get tax name by tax code 'H'. Following query is being used which is executed by method RunSelectQuery() which is defined in SDKDatabaseUtility Class in Sage_SA.SDK.dll

SELECT tTaxAuth.sName FROM tTxCdDtl INNER JOIN tTaxAuth ON  tTaxAuth.lId = tTxCdDtl.lTaxAuth INNER JOIN tTaxCode ON tTaxCode.lId = tTxCdDtl.lTaxId WHERE (tTaxCode.sCode = 'H')

But this query is returning tax name 'GST/HST' instead of 'HST'. This tax name is causing issue while saving tax amount by tax name 'GST/HST' using method SetTaxAmountByName() which is defined in TaxSummaryInfo Class in Sage_SA.SDK.dll . I am getting following message in response:-

“The value you are attempting to set for this field is invalid.”

Can you please help me why tax name 'GST/HST' is returning although i have setup tax name 'HST' for tax code 'H'?

Thanks in advance

  • 0

    I am surprised you are only getting one row returned.  I would expect a minimum of two.  I got 7 rows in my sample file using your code.

    Sales tax setup in the program is based on time of edit.  If you create a file with the tax name GST/HST and then post two entries with the H tax code that uses that tax, they will say the tax is called GST/HST.

    Then change the tax name to HST and post three more entries, those last three will think the tax is called HST.

    However, the first three will still think it was GST/HST.  This allows the program to reprint invoices, show details on screen of what was the case at the time of the original entry.  Be aware that these changes are not date sensitive, they are based on the actual time you made the change.

    So the first two could be GST/HST on Jan 4 and entry two could be dated Feb 5.  Entry three could be dated Jan 31 and still be called HST.

    Have a look at the relationship of ttaxdtl.lTaxRev and ttaxauth.lFirstRev and ttaxauth.lLastRev.  These last two are in ttaxcode as well.

    I don't have my code handy for this programming but you just have to make sure ttaxdtl.lTaxRev is between the lFirstRev and lLastRev in the related tables and you should be ok.