Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

NAV2015 - CU 15/16 - Problem with Report 20 Calc. and Post VAT Settlement (IT Loc.)

Posted on by Microsoft Employee

Hallo, I think there' s problem in Report 20 of IT Localization:

The posting function for some reason don't compile "Vat Period" field in Vat Entry. 

As temporary solution we have change the code as above:


//>> -BUG
// Close current VAT entries
//IF PostSettlement THEN BEGIN
// VATEntry.MODIFYALL("Closed by Entry No.",NextVATEntryNo);
// VATEntry.MODIFYALL(Closed,TRUE);
// VATEntry.MODIFYALL("VAT Period",VATPeriod);
//END;
//<< - BUG

//>> - OLD CORRECT CODE
// Close current VAT entries
IF PostSettlement THEN
IF VATEntry.FIND('-') THEN
REPEAT
VATEntry2 := VATEntry;
VATEntry2."Closed by Entry No." := NextVATEntryNo;
VATEntry2.Closed := TRUE;
VATEntry2."VAT Period" := VATPeriod;
VATEntry2.MODIFY;
UNTIL VATEntry.NEXT = 0;
//<<OLD CORRECT CODE - BUG

Is there someone with the same problem?

Thanks

MArco

*This post is locked for comments

  • Lorentz Profile Picture
    Lorentz 75 on at
    RE: NAV2015 - CU 15/16 - Problem with Report 20 Calc. and Post VAT Settlement (IT Loc.)

    There is also the filter in to the onaftergetrecord

    VATEntry.SETRANGE("VAT Period",'');

    I suggest this:

    IF PostSettlement THEN BEGIN

     VATEntry.MODIFYALL("Closed by Entry No.",NextVATEntryNo);

     VATEntry.MODIFYALL("VAT Period",VATPeriod);

     VATEntry.SETRANGE("VAT Period",VATPeriod);      

     VATEntry.MODIFYALL(Closed,TRUE);

     VATEntry.SETRANGE("VAT Period",'');

    END;

  • Roberto Stefanetti Profile Picture
    Roberto Stefanetti 12,998 on at
    RE: NAV2015 - CU 15/16 - Problem with Report 20 Calc. and Post VAT Settlement (IT Loc.)

    hi,

    this bug exists since 2013RTM.. and also on NAV 2016 CU4.

    I report it to the development team with the indicated suggestions.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: NAV2015 - CU 15/16 - Problem with Report 20 Calc. and Post VAT Settlement (IT Loc.)

    Correct Jens!

    Modify istructions on fields that are parts of filters are always dangerous!

    I'm sure that someone of IT localization read this ;-)

    Thank's

    Marco

  • Verified answer
    Jens Glathe Profile Picture
    Jens Glathe 6,092 on at
    RE: NAV2015 - CU 15/16 - Problem with Report 20 Calc. and Post VAT Settlement (IT Loc.)

    Hi Marco,

    that's a nice one, fortunately not in W1 and DE.

    [quote user="Marco Rodriquez"]

    //>> -BUG

    // Close current VAT entries
    //IF PostSettlement THEN BEGIN
    // VATEntry.MODIFYALL("Closed by Entry No.",NextVATEntryNo);
    // VATEntry.MODIFYALL(Closed,TRUE);
    // VATEntry.MODIFYALL("VAT Period",VATPeriod);
    //END;
    //<< - BUG

    [/quote]


    The issue here is that all ModifyAll() commands are separate SQL statements. And since the filter on VATEntry is on Closed = false, the last ModifyAll() doesn't have much to modify.

    A working solution would be:

    // Close current VAT entries
    IF PostSettlement THEN BEGIN
     VATEntry.MODIFYALL("Closed by Entry No.",NextVATEntryNo);
     VATEntry.MODIFYALL("VAT Period",VATPeriod);
     VATEntry.MODIFYALL(Closed,TRUE);
    END;

    Thank you for the hint, though, these things can ruin your day.

    with best regards


    Jens

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: NAV2015 - CU 15/16 - Problem with Report 20 Calc. and Post VAT Settlement (IT Loc.)

    Hi Jonathan, unfortunately there's no error message, the "Vat Period" field (IT Localization) is not correctly compiled with the period string (typically year/month). This can cause problem for future Settlement

  • Suggested answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: NAV2015 - CU 15/16 - Problem with Report 20 Calc. and Post VAT Settlement (IT Loc.)

    what is the exact error message?

    remove object metadata of that report.

    export the report as text fule, reimport the report, compile.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans