This article applies to Microsoft Dynamics NAV for the Italian (it) language locale.

Symptoms

Assume that you have a fixed asset in the Italian version of Microsoft Dynamics NAV. The value-added tax (VAT) amount for the purchasing of the fixed asset is partly deducted. In this situation, if you sell the fixed asset, the transaction for the corresponding sales invoice creates two gain or loss transactions instead of one transaction. This problem occurs in the following products:

  • The Italian version of Microsoft Dynamics NAV 2009 R2

  • The Italian version of Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)

  • The Italian version of Microsoft Dynamics NAV 5.0 Service Pack 1 (SP1)

Resolution

Hotfix information

A supported hotfix is now available from Microsoft. However, it is only intended to correct the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Dynamics NAV service pack or the next Microsoft Dynamics NAV version that contains this hotfix. Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Technical Support Professional for Microsoft Dynamics and related products determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Installation information

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.Note Before you install this hotfix, verify that all Microsoft Navision client users are logged off the system. This includes Microsoft Navision Application Services (NAS) client users. You should be the only client user who is logged on when you implement this hotfix.To implement this hotfix, you must have a developer license.We recommend that the user account in the Windows Logins window or in the Database Logins window be assigned the "SUPER" role ID. If the user account cannot be assigned the "SUPER" role ID, you must verify that the user account has the following permissions:

  • The Modify permission for the object that you will be changing.

  • The Execute permission for the System Object ID 5210 object and for the System Object ID 9015 object.

Note You do not have to have rights to the data stores unless you have to perform data repair.

Code changes

Note Always test code fixes in a controlled environment before you apply the fixes to your production computers. To resolve this problem, follow these steps:

  1. Change the code in the Data Item Number 3 in the Account Book Sheet - Print report (12109) as follows: Existing code

    ...CurrReport.CREATETOTALS(Amount,IcreasesAmnt,DecreasesAmnt,"Additional-Currency Amount");END;// Delete the following lines.OnAfterGetRecord=BEGINCALCFIELDS(Amount,"Debit Amount","Credit Amount","Additional-Currency Amount");IF NOT UseAmtsInAddCurr THEN BEGINAmnt := Amnt + Amount;IF Amount > 0 THENIcreasesAmnt := AmountELSEDecreasesAmnt := ABS(Amount);END ELSE BEGINAmnt := Amnt + "Additional-Currency Amount";IF "Additional-Currency Amount" > 0 THENIcreasesAmnt := "Additional-Currency Amount"ELSEDecreasesAmnt := ABS("Additional-Currency Amount");END;// End of the lines.END;DataItemLinkReference=G/L Account;...

    Replacement code

    ...CurrReport.CREATETOTALS(Amount,IcreasesAmnt,DecreasesAmnt,"Additional-Currency Amount");END;// Add the following lines.OnAfterGetRecord=VARGroupAmount@1130001 : Decimal;BEGINCALCFIELDS(Amount,"Debit Amount","Credit Amount","Additional-Currency Amount");IF TempGLBookEntry.GET("Entry No.") THENCurrReport.SKIPELSE BEGINGroupAmount := GroupBookEntry("GL Book Entry",UseAmtsInAddCurr);Amnt += GroupAmount;IF GroupAmount > 0 THEN BEGINIcreasesAmnt := ABS(GroupAmount);DecreasesAmnt := 0;END ELSE BEGINIcreasesAmnt := 0;DecreasesAmnt := ABS(GroupAmount);END;END;// End of the lines.END;DataItemLinkReference=G/L Account;...
  2. Change the code in the Data Item Number 3 sections in the Account Book Sheet - Print report (12109) as follows: Existing code

    ...{ 1130104;TextBox ;18000;423 ;1800 ;423 ;SourceExpr=Amnt;AutoFormatType=1;DataSetFieldName=Amnt_Control1130104 }// Delete the following line.{ 1130105;TextBox ;18000;846 ;1800 ;423 ;SourceExpr=StartOnHand + Amount;AutoFormatType=1;DataSetFieldName=StartOnHand___Amount_Control1130105 }...

    Replacement code

    ...{ 1130104;TextBox ;18000;423 ;1800 ;423 ;SourceExpr=Amnt;AutoFormatType=1;DataSetFieldName=Amnt_Control1130104 }// Add the following line.{ 1130105;TextBox ;18000;846 ;1800 ;423 ;SourceExpr=StartOnHand + IcreasesAmnt - DecreasesAmnt;AutoFormatType=1;DataSetFieldName=StartOnHand___Amount_Control1130105 }{ 1130111;TextBox ;0 ;846 ;150 ;423 ;Name=TotalAmount;...
  3. Add a new global variable in the Account Book Sheet - Print report (12109), and then specify the variable as follows:

    • Name: TempGLBookEntry

    • DataType: TEMPORARY Record

    • Subtype: GL Book Entry (12144)

  4. Add a local function in the Account Book Sheet - Print report (12109) as follows:

    LOCAL PROCEDURE GroupBookEntry@1130001(GLBookEntry@1130001 : Record 12144;UseAmtsInAddCurr@1130002 : Boolean) GroupAmount@1130003 : Decimal;VARGLBookEntry1@1130004 : Record 12144;BEGINGLBookEntry1.SETRANGE("G/L Account No.",GLBookEntry."G/L Account No.");GLBookEntry1.SETRANGE("Transaction No.",GLBookEntry."Transaction No.");IF GLBookEntry1.FINDSET THENREPEATTempGLBookEntry."Entry No." := GLBookEntry1."Entry No.";TempGLBookEntry.INSERT;GLBookEntry1.CALCFIELDS(Amount,"Additional-Currency Amount");IF UseAmtsInAddCurr THENGroupAmount := GroupAmount + GLBookEntry1."Additional-Currency Amount"ELSEGroupAmount := GroupAmount + GLBookEntry1.Amount;UNTIL GLBookEntry1.NEXT = 0;EXIT(GroupAmount);END;
  5. Change the code in the Data Item Number 2 in the G/L Book - Print report (12121) as follows: Existing code 1

    ...END;END;// Delete the following lines.OnAfterGetRecord=BEGINIF ReportType = ReportType::Reprint THENLastNo := "Progressive No."ELSELastNo := LastNo + 1;// End of the lines.TotalDebit := TotalDebit + "Debit Amount";TotalCredit := TotalCredit + "Credit Amount";...

    Replacement code 1

    ...END;END;// Add the following lines.OnAfterGetRecord=VARGroupAmount@1130001 : Decimal;BEGIN// End of the lines.TotalDebit := TotalDebit + "Debit Amount";TotalCredit := TotalCredit + "Credit Amount";...

    Existing code 2

    ...END;"Source Type" :: "Fixed Asset":BEGINFA.GET("Source No.");Descr := FA.Description;END;...

    Replacement code 2

    ...END;"Source Type" :: "Fixed Asset":BEGIN// Add the following lines.IF TempGLBookEntry.GET("Entry No.") THENCurrReport.SKIPELSE BEGINGroupAmount := GroupBookEntry("GL Book Entry");IF GroupAmount > 0 THEN BEGIN"Debit Amount" := GroupAmount;"Credit Amount" := 0;END ELSE BEGIN"Debit Amount" := 0;"Credit Amount" := GroupAmount;END;END;// End of the lines.FA.GET("Source No.");Descr := FA.Description;END;...

    Existing code 3

    ...ELSEDescr := '';END;IF (NOT CurrReport.PREVIEW) AND(ReportType = ReportType::"Final Print")THEN BEGIN...

    Replacement code 3

    ...ELSEDescr := '';END;// Add the following lines.IF ReportType = ReportType::Reprint THENLastNo := "Progressive No."ELSELastNo := LastNo + 1;// End of the lines.IF (NOT CurrReport.PREVIEW) AND(ReportType = ReportType::"Final Print")THEN BEGIN...
  6. Add a new global variable in the the G/L Book - Print report (12121), and then specify the variable as follows:

    • Name: TempGLBookEntry

    • DataType: TEMPORARY Record

    • Subtype: GL Book Entry (12144)

  7. Change the code in the Documentation in the G/L Book - Print report (12121) as follows: Existing code

    ...EndDate := Date."Period Start" - 1;END;...

    Replacement code

    ...EndDate := Date."Period Start" - 1;END;// Add the following lines.LOCAL PROCEDURE GroupBookEntry@1130002(GLBookEntry@1130001 : Record 12144) GroupAmount@1130002 : Decimal;VARGLBookEntry1@1130003 : Record 12144;BEGINGLBookEntry1.SETRANGE("G/L Account No.",GLBookEntry."G/L Account No.");GLBookEntry1.SETRANGE("Transaction No.",GLBookEntry."Transaction No.");IF GLBookEntry1.FINDSET THENREPEATTempGLBookEntry."Entry No." := GLBookEntry1."Entry No.";TempGLBookEntry.INSERT;GLBookEntry1.CALCFIELDS(Amount);GroupAmount := GroupAmount + GLBookEntry1.Amount;UNTIL GLBookEntry1.NEXT = 0;EXIT(GroupAmount);END;// End of the lines....

Prerequisites

You must have the one of the following products installed to apply this hotfix:

  • The Italian version of Microsoft Dynamics NAV 2009 R2

  • The Italian version of Microsoft Dynamics NAV 2009 Service Pack 1 (SP1)

  • The Italian version of Microsoft Dynamics NAV 5.0 Service Pack 1 (SP1)

Removal information

You cannot remove this hotfix.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

¿Necesita más ayuda?

¿Quiere más opciones?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.