Report test for general journals - wrong total in RTC

ecriss15ecriss15 Member Posts: 14
edited 2011-02-11 in NAV Three Tier
Hello! I have the following problem on a standard Romanian NAV 2009 R2 database :
In general journals I have two lines in LCY, one with Debit Amount = 1000 and one with Credit Amonut = 2000. Total amount (LCY) will be 3000. In RTC , if I run test report without Show Dimensions checkbox Total amount is ok. If I run it with checkbox Show Dimension Total amount is 4000 (it adds twice the amount of the first line). In classic client everythink is fine.
Is this a bug ? I don't think it's a localized object because it's version is NAVW16.00.01.

I tried to fix the report but I don't understand the logic of the RDLC. In Gen. Journal Line - OnAfterGetRecord the amount is put in a variable AmountLCY which is shown in RDLC with SUM. In dataitem ErrorLoop - OnPreDataitem (intended below Gen. Journal Line) the variable AmountLCY is initialized to zero and I don't understand why.
Maybe the solution is simple but I don't understand how it's calculated the sum of AmountLCY and why it adds twice the first amount. I have read documentation about reports for RTC but this is the first report that I'm actually modifying.

Answers

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Old Code :
    DimensionLoop - OnAfterGetRecord()
    IF Number = 1 THEN BEGIN
    IF NOT JnlLineDim.FIND('-') THEN
    CurrReport.BREAK;
    END ELSE
    IF NOT Continue THEN
    CurrReport.BREAK;
    END;

    New Code :
    DimensionLoop - OnAfterGetRecord()
    IF Number = 1 THEN BEGIN
    IF NOT JnlLineDim.FIND('-') THEN
    CurrReport.BREAK;
    END ELSE BEGIN
    IF NOT Continue THEN
    CurrReport.BREAK;
    IF ISSERVICETIER THEN
    AmountLCY := 0;
    END;

    Please try and Let me know... :thumbsup:
  • ecriss15ecriss15 Member Posts: 14
    Thank you very much, it worked.
Sign In or Register to comment.