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
…
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.)
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.
Ahmed Rashed Amini
Independent Consultant/Developer
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??
Comments
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
…
I would ignore it.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Tell us where is the consistent error is originating.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
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.)
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
thank you
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n