I'm trying to find out how the single-line Journal Entry is being distributed into 2 GL Entry in NAV.
Is there a specific Codeunit that is handling this logic? Or is it some function within a Codeunit?
Thank you so much for your respnse.
I looked in the CU12, and couldn't find the SplitJnlLine() that you mentioned.
I'm currently looking at my demo database in NAV2009R2 NA.
Let me know if localized version has different logic. (which is less likely for G/L...)
Thank you for the clarification.
I took a look a the code, and understood how the lines are getting split.
And now I have another question with regards to this, do you know how the 2nd line is inheriting the Dimensions that were assigned to the 1st line.
As an example, I took a look at the "PostGLAcc()", and couldn't find where it is defined.
WITH GenJnlLine DO BEGIN
// Post G/L entry
InitGLEntry(
"Account No.","Amount (LCY)",
"Source Currency Amount",TRUE,"System-Created Entry");
IF NOT "System-Created Entry" THEN
IF "Posting Date" = NORMALDATE("Posting Date") THEN
GLAcc.TESTFIELD("Direct Posting",TRUE);
GLEntry."Gen. Posting Type" := "Gen. Posting Type";
GLEntry."Bal. Account Type" := "Bal. Account Type";
GLEntry."Bal. Account No." := "Bal. Account No.";
GLEntry."No. Series" := "Posting No. Series";
IF "Additional-Currency Posting" =
"Additional-Currency Posting"::"Additional-Currency Amount Only"
THEN BEGIN
GLEntry."Additional-Currency Amount" := Amount;
GLEntry.Amount := 0;
END;
InitVat;
IF (GLEntry.Amount <> 0) OR (GLEntry."Additional-Currency Amount" <> 0) OR
("VAT Calculation Type" <> "VAT Calculation Type"::"Sales Tax")
THEN
InsertGLEntry(TRUE);
PostJob;
PostVAT;
END;
I didn't remember correctly When you take a look in CU366 Exchange Acc. G/L Journal Line, you'll see that all operations are done on the same record. The associated dimensions for this record are already copied into TempJnlLineDims and don't get changed, they are valid for the whole line.
Comments
SplitJnlLine() in CU 12 does this. It gets called in the Code() function AFAIR.
with best regards
Jens
---
I am here: http://maps.google.com/maps?ll=52.523624,13.376079
Thank you so much for your respnse.
I looked in the CU12, and couldn't find the SplitJnlLine() that you mentioned.
I'm currently looking at my demo database in NAV2009R2 NA.
Let me know if localized version has different logic. (which is less likely for G/L...)
Thank you.
Kenji
the SplitJnlLine function is part of codunit 22 Item Jnl. Post Line
Steve
Thank you for the clarification.
I took a look a the code, and understood how the lines are getting split.
And now I have another question with regards to this, do you know how the 2nd line is inheriting the Dimensions that were assigned to the 1st line.
As an example, I took a look at the "PostGLAcc()", and couldn't find where it is defined.
Thank you!
Kenji
I didn't remember correctly When you take a look in CU366 Exchange Acc. G/L Journal Line, you'll see that all operations are done on the same record. The associated dimensions for this record are already copied into TempJnlLineDims and don't get changed, they are valid for the whole line.
with best regards
Jens