US(CA) Sales Tax in General Journal

Hello Experts !!! I’m trying to help our distributor to integrate our Retail AddOn into the NA version of Navision 4.0 SP1. We discovered that it seems to be not possible to generate all necessary entries in the G/L and Tax Entries tables by just filling in all fields in the General Journal lines and do a “Automatic Tax posting”. What we know: Account No. (Income) Amount Tax Group Code Tax Area Code Tax Liable Gen. Bus. Posting Group Balancing Account (Balance) Shouldn’t that be enough information for the CU12 to automatically generate the following entries: Sales Acount posting with the Net Amount GST Entry + Tax Entry PST Entry + Tax Entry Balancing Entry It works for VAT, but it does not seem to work for Sales Tax. When I try to post the Journal I receive the message “Entry No. XXX already exists.” while the system tries to save a record in a temp table (InsertGLEntry function in CU12: … GLEntryTmp := GLEntry; GLEntryTmp.INSERT; … ) What we found so far is that the tax is getting calculated in with all details (SalesTaxCalculate.GetSalesTaxLine() returns all details but the InsertVAT() function then does nothing useful with the Tax Amounts from the tax details) Is that a bug in NA4.00.01?

Hello, First you need to check if Sales tax has been setup correctly? Hopefully it was. Have you entered a journal line manually then posted it? Hopefully it happened with sales tax. If so, then have your coding populate the fields just like a user enters the value, then after each entry do a CAL Validate. The system will generate all additional values requires including sales tax and calculations with the rest of the detail line. Ex: GenJrl.Template Name := ‘GENERAL’; GenJrl.Batch Name := ‘DEFAULT’; GenJrl.Line No. := 10000; GenJrl.VALIDATE(Line No.); GenJrl.Posting Date := WORKDATE; GenJrl.VALIDATE(Posting Date); etc… GenJrl.INSERT; Good Luck. Remember after ever time you create a detail line. Manually create another one F8 with the same values. Then run the table and make sure all fields are duplicated from your coding to the Navision user manual entring it. Good luck.

I just found out something interesting !!! When I replace the CU12 in the NA version with the one from W1, it works perfectly !!! And another one: It does NOT post when I fill in the Journal lines manually with the NA version of CU12. It posts properly with the W1 version. All 4 G/L entries have been created properly as expected. 1 Sale account posting, 2 Sales Tax postings and a balancing posting. That is weird !!!

OK, here we go with the solution of the problem: After some time investigating (mainly comparing code) I have found the code snippet the localization team for the NA version has killed ( I hope this was not on purpose). Almost at the end of the InsertVATEntry function you will find a case construct. The last option in that case construct is VATPostingSetup.“VAT Calculation Type”::“Sales Tax”: In there the localization team has added a new IF condition for determining Automatic/Manual VAT Entry The problem follows directly after that You find another IF condition for “UnrealizedVAT” where normally the “else” contains the code for initializing the GLEntry with the “Tax Account (Sales)” from the TaxJurisdiction table. This else codition has been removed !!!

And now the oficial answer from Microsoft for tis issue: This is a known issue for NAVNA4.00.01 ! Will be fixed with SP2.


… When I replace the CU12 in the NA version with the one from W1, it works perfectly !!! … NOOOOOOOOOOO!!! [:D] [:D] [:D]
Originally posted by - 2006 Apr 03 : 05:42:15

Thomas, Firstly is this US or CA, your posting does not make this too clear. US sales tax is extrodinairly complex compared to VAT, and Canadian GST/Sales tax is even worse. VAT is a picnic in comparison. The original team (Back in the DOS days) that developed the US Sales Tax functionality, did (under the circumstances) a brilliant job of integrating it with VAT. Unfortunately ovr the years, it has just gotten so complex, that it does get buggy from time to time. You should definitely work work with a US/ CA developer, and base you fixes on the NA CU12. Don’t try to integrate the W1 CU12 into the NA GL code, because some where down the line it will come back and bite you. 3.10 has a lot of rounding problems with sales tax on sales orders, and many of these odd things that don’t seem importatn, relate to those fixes. And these can not be tested, since they are not easy to reproduce. You could hae the client working fine, and then 3 months down the line, they can’t post sales invoices.

No, don’t misunderstand me. This was just for testing the stuff. In fact the US developers just by accident deleted en “ELSE” statement from the CU12 which was VEEERY important. That they have done it was already known by Microsoft. They will provide a fix for that with SP2. Sales and purchases using CU80 and 90 where doing fine because there they are doing the posting of the GL Entries on the tax accounts manually. The problem just occured when you tried to post a sale through the General Journal directly. Of course I just have added the missing lines to the CU12 in the NA version, not in the W1 version. Before I call to Microsoft Support, I need to know WHY it does not work and come up with a proposed solution. If you have the chance, just search in the CU12 for “Tax Account (Purchase)” you will find it. If you search for “Tax Account (Sale)” you will definitely NOT find it. I just have tested with NAVW14.00.01,NAVNA4.00.01. In the end it took me a whole sunday to discover what’s going on and why I get such confusing errors. I was the whole time searching an error in my own code. In the end it was just a bug in the original Navision code. But thanks for your warnings anyway. I’m currently in Canada and working on integration issues and training together with our distributor. I would never try to understand how sales taxes work on my own [:D] Especially when it comes to a place where it depends on how old you are when to decide if you have to pay sales taxes or not.