INCONSISTENT error on the G/L entry table when issuing
Comments
-
I've got this one from MS, use at ease if you have same trouble.
The issue resolved in 5.01.
Code fix:
OBJECT: Codeunit 12 - Gen. Jnl.-Post
Function InitVat
//old code
…
GLEntry.Amount := "VAT Base Amount (LCY)";
GLEntry."VAT Amount" := "Amount (LCY)" - GLEntry.Amount;
GLEntry."Additional-Currency Amount" := "Source Curr. VAT Base Amount";
IF "Source Currency Code" = GLSetup."Additional Reporting Currency" THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr(GLEntry."VAT Amount");
…
//new code
…
GLEntry.Amount := "VAT Base Amount (LCY)";
GLEntry."VAT Amount" := "Amount (LCY)" - GLEntry.Amount;
GLEntry."Additional-Currency Amount" := "Source Curr. VAT Base Amount";
IF ("Source Currency Code" = GLSetup."Additional Reporting Currency") AND
("Currency Factor" = "VAT Currency Factor") THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr(GLEntry."VAT Amount");
…
//old code
…
ROUND(
"Source Currency Amount" / (1 + VATPostingSetup."VAT %" / 100),
AddCurrency."Amount Rounding Precision");
IF "Source Currency Code" = GLSetup."Additional Reporting Currency" THEN
AddCurrGLEntryVATAmt := "Source Currency Amount" - GLEntry."Additional-Currency Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr(GLEntry."VAT Amount");
…
//new code
…
ROUND(
"Source Currency Amount" / (1 + VATPostingSetup."VAT %" / 100),
AddCurrency."Amount Rounding Precision");
IF ("Source Currency Code" = GLSetup."Additional Reporting Currency") AND
("Currency Factor" = "VAT Currency Factor") THEN
AddCurrGLEntryVATAmt := "Source Currency Amount" - GLEntry."Additional-Currency Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr(GLEntry."VAT Amount");
…
//old code
…
BEGIN
IF "VAT Difference" <> 0 THEN BEGIN
GLEntry."VAT Amount" := "VAT Amount (LCY)";
IF "Source Currency Code" = GLSetup."Additional Reporting Currency" THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr(GLEntry."VAT Amount");
…
//new code
…
BEGIN
IF "VAT Difference" <> 0 THEN BEGIN
GLEntry."VAT Amount" := "VAT Amount (LCY)";
IF ("Source Currency Code" = GLSetup."Additional Reporting Currency") AND
("Currency Factor" = "VAT Currency Factor") THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr(GLEntry."VAT Amount");
…
//old code
…
GLEntry.Amount := 0;
GLEntry."Additional-Currency Amount" := 0;
GLEntry."VAT Amount" := "Amount (LCY)";
IF "Source Currency Code" = GLSetup."Additional Reporting Currency" THEN
AddCurrGLEntryVATAmt := "Source Currency Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr("Amount (LCY)");
…
//new code
…
GLEntry.Amount := 0;
GLEntry."Additional-Currency Amount" := 0;
GLEntry."VAT Amount" := "Amount (LCY)";
IF ("Source Currency Code" = GLSetup."Additional Reporting Currency") AND
("Currency Factor" = "VAT Currency Factor") THEN
AddCurrGLEntryVATAmt := "Source Currency Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr("Amount (LCY)");
…
//old code
…
GLEntry."VAT Amount" := "Amount (LCY)" - GLEntry.Amount;
END;
GLEntry."Additional-Currency Amount" := "Source Curr. VAT Base Amount";
IF "Source Currency Code" = GLSetup."Additional Reporting Currency" THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr(GLEntry."VAT Amount");
…
//new code
…
GLEntry."VAT Amount" := "Amount (LCY)" - GLEntry.Amount;
END;
GLEntry."Additional-Currency Amount" := "Source Curr. VAT Base Amount";
IF ("Source Currency Code" = GLSetup."Additional Reporting Currency") AND
("Currency Factor" = "VAT Currency Factor") THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr(GLEntry."VAT Amount");
//old code
…
ROUND(GLEntry."VAT Amount" * "Currency Factor" / "VAT Currency Factor");
END;
END;
IF "Source Currency Code" = GLSetup."Additional Reporting Currency" THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr("VAT Amount (LCY)");
…
//new code
…
ROUND(GLEntry."VAT Amount" * "Currency Factor" / "VAT Currency Factor");
END;
END;
IF ("Source Currency Code" = GLSetup."Additional Reporting Currency") AND
("Currency Factor" = "VAT Currency Factor") THEN
AddCurrGLEntryVATAmt := "Source Curr. VAT Amount"
ELSE
AddCurrGLEntryVATAmt := CalcLCYToAddCurr("VAT Amount (LCY)");
…
Function GLCalcAddCurrency
========================
//old code
…
(GenJnlLine."Additional-Currency Posting" = GenJnlLine."Additional-Currency Posting"::None)
THEN BEGIN
IF (GenJnlLine."Source Currency Code" = GLSetup."Additional Reporting Currency") AND
UseAddCurrAmount
THEN
GLEntry."Additional-Currency Amount" := AddCurrAmount
…
//new code
…
(GenJnlLine."Additional-Currency Posting" = GenJnlLine."Additional-Currency Posting"::None)
THEN BEGIN
IF (GenJnlLine."Source Currency Code" = GLSetup."Additional Reporting Currency") AND
(GenJnlLine."Currency Factor" = GenJnlLine."VAT Currency Factor") AND
UseAddCurrAmount
THEN
GLEntry."Additional-Currency Amount" := AddCurrAmount
…0 -
Is it possible to upload the entire codeUnits instead of bits and pieces? Thank you for your help.0
-
The code above is only a fix to some BUG to a certain version.
I would ignore it.0 -
Do you have a better one that's fixes the problem?0
-
asembereng wrote:Do you have a better one that's fixes the problem?
Tell us where is the consistent error is originating.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
No, I'm using v4.0 ! The MS support is get this code above from 5.01! Because they are solved this in that version.0
-
Hi,
In Navision when you do any transaction that related to accounts then system it self will take care that what ever entry generated due to that transaction must have Total Dr. and Total Cr. same, and if this is not same then it generate INCONSISTENCY Error in code unit no. 12 go to Line GLEntry.INSERT and put Message box below it and see what amout hits to which account by then you should atleast come to know which amount is wrong and then you can track that by debuging.
Pranav
Intech Systems Pvt. Ltd.
Pranav Joshi
MS Dynamics NAV Consultant
SBS Group Desert Mountain (Formerly Silverware Inc.)0 -
It's funny the other day I used this at a client, and the problem was the order. Tax was set to be taxable on the header, but the some of the lines were not checked. By unchecking and checking the flag, it solved the problem but the inconsistency gl entries shows why it was the case.0
-
Its been awhile since i last visited this post but i am still having this problem. The client is not willing to upgrade to NAV 5 but wants this issue to be fixed. Anymore ideas??0
-
Get a copy of the db. Get the PO that causes the inconsistency and start debugging.0
-
what is PO?
thank you0 -
by PO I meant the transaction that is causing the inconsistency. Basically what the user does that allows him to get the error.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions