Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

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

Symptoms

In the Italian version of Microsoft Dynamics NAV 2009, the system does not calculate the "Amount to pay" value and the withholding tax amount as expected. 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

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 2009 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. However, 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 CreateVendBillWithhTax function in the Vendor Bill Line table (12182) as follows:
    Existing code

    ...
    VendBillWithhTax."Currency Code" := VendorBillHeader."Currency Code";
    VendBillWithhTax."External Document No." := "External Document No.";
    VendBillWithhTax."Related Date" := VendorBillHeader."Posting Date";
    VendBillWithhTax."Withholding Tax Code" := WithholdCode;
    VendBillWithhTax."Social Security Code" := SocialSecurityCode;

    // Delete the following line.
    VendBillWithhTax.VALIDATE("Total Amount","Remaining Amount");

    VendBillWithhTax."Old Withholding Amount" := VendBillWithhTax."Withholding Tax Amount";
    VendBillWithhTax."Old Free-Lance Amount" := VendBillWithhTax."Free-Lance Amount";
    END;
    // IT0007.begin
    IF VendBillWithhTax."Withholding Tax Code" <> '' THEN
    ...

    Replacement code

    ...
    VendBillWithhTax."Currency Code" := VendorBillHeader."Currency Code";
    VendBillWithhTax."External Document No." := "External Document No.";
    VendBillWithhTax."Related Date" := VendorBillHeader."Posting Date";
    VendBillWithhTax."Withholding Tax Code" := WithholdCode;
    VendBillWithhTax."Social Security Code" := SocialSecurityCode;

    // Add the following line.
    VendBillWithhTax.VALIDATE("Total Amount","Amount to Pay");

    VendBillWithhTax."Old Withholding Amount" := VendBillWithhTax."Withholding Tax Amount";
    VendBillWithhTax."Old Free-Lance Amount" := VendBillWithhTax."Free-Lance Amount";
    END;
    // IT0007.begin
    IF VendBillWithhTax."Withholding Tax Code" <> '' THEN
    ...
  2. Change the code in the Controls in the Manual vendor Payment Line form (12188) as follows:
    Existing code 1

    ...
    InPage=0;
    CaptionML=ENU=Withholding Tax Code;
    SourceExpr=WithholdingTaxCode;
    TableRelation="Withhold Code" }
    { 1130006;Label ;440 ;2090 ;3300 ;440 ;ParentControl=1130005 }

    // Delete the following line.
    { 1130007;TextBox ;13090;3190 ;1700 ;440 ;ParentControl=1130000;

    InPage=0;
    CaptionML=ENU=Vendor Bank Account;
    SourceExpr=VendorBankAccount;
    TableRelation="Vendor Bank Account";
    OnLookup=VAR
    ...

    Replacement code 1

    ...
    InPage=0;
    CaptionML=ENU=Withholding Tax Code;
    SourceExpr=WithholdingTaxCode;
    TableRelation="Withhold Code" }
    { 1130006;Label ;440 ;2090 ;3300 ;440 ;ParentControl=1130005 }

    // Add the following line.
    { 1130007;TextBox ;13090;3740 ;1700 ;440 ;ParentControl=1130000;

    InPage=0;
    CaptionML=ENU=Vendor Bank Account;
    SourceExpr=VendorBankAccount;
    TableRelation="Vendor Bank Account";
    OnLookup=VAR
    ...

    Existing code 2

    ...
    IF FORM.RUNMODAL(FORM::"Vendor Bank Account List",VendBankAcc,VendBankAcc.Code) = ACTION::LookupOK THEN
    VendorBankAccount := VendBankAcc.Code;
    // IT0001.end
    END;
    }

    // Delete the following line.
    { 1130008;Label ;9680 ;3190 ;3300 ;440 ;ParentControl=1130007 }

    { 1130009;TextBox ;3850 ;3190 ;5500 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Description;
    SourceExpr=Desc }
    { 1130010;Label ;440 ;3190 ;3300 ;440 ;ParentControl=1130009 }
    ...

    Replacement code 2

    ...
    IF FORM.RUNMODAL(FORM::"Vendor Bank Account List",VendBankAcc,VendBankAcc.Code) = ACTION::LookupOK THEN
    VendorBankAccount := VendBankAcc.Code;
    // IT0001.end
    END;
    }

    // Add the following line.
    { 1130008;Label ;9680 ;3740 ;3300 ;440 ;ParentControl=1130007 }

    { 1130009;TextBox ;3850 ;3190 ;5500 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Description;
    SourceExpr=Desc }
    { 1130010;Label ;440 ;3190 ;3300 ;440 ;ParentControl=1130009 }
    ...

    Existing code 3

    ...
    { 1130013;TextBox ;13090;990 ;1700 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Total Amount;
    SourceExpr=TotalAmount }
    { 1130014;Label ;9680 ;990 ;3300 ;440 ;ParentControl=1130013 }

    // Delete the following line.
    { 1130015;TextBox ;13090;1540 ;2200 ;440 ;ParentControl=1130000;

    InPage=0;
    CaptionML=ENU=Document Type;
    OptionCaptionML=ENU=" ,Payment,Invoice,Credit Memo,Finance Charge Memo,Reminder,Refund";
    OptionString=[ ,Payment,Invoice,Credit Memo,Finance Charge Memo,Reminder,Refund];
    SourceExpr=DocumentType }
    ...

    Replacement code 3

    ...
    { 1130013;TextBox ;13090;990 ;1700 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Total Amount;
    SourceExpr=TotalAmount }
    { 1130014;Label ;9680 ;990 ;3300 ;440 ;ParentControl=1130013 }

    // Add the following line.
    { 1130015;TextBox ;13090;2090 ;2200 ;440 ;ParentControl=1130000;

    InPage=0;
    CaptionML=ENU=Document Type;
    OptionCaptionML=ENU=" ,Payment,Invoice,Credit Memo,Finance Charge Memo,Reminder,Refund";
    OptionString=[ ,Payment,Invoice,Credit Memo,Finance Charge Memo,Reminder,Refund];
    SourceExpr=DocumentType }
    ...

    Existing code 4

    ...
    InPage=0;
    CaptionML=ENU=Document Type;
    OptionCaptionML=ENU=" ,Payment,Invoice,Credit Memo,Finance Charge Memo,Reminder,Refund";
    OptionString=[ ,Payment,Invoice,Credit Memo,Finance Charge Memo,Reminder,Refund];
    SourceExpr=DocumentType }

    // Delete the following lines.
    { 1130016;Label ;9680 ;1540 ;3300 ;440 ;ParentControl=1130015 }
    { 1130017;TextBox ;13090;2090 ;1700 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Document No.;
    SourceExpr=DocumentNo }
    { 1130018;Label ;9680 ;2090 ;3300 ;440 ;ParentControl=1130017 }
    { 1130019;TextBox ;13090;2640 ;1700 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Document Date;
    SourceExpr=DocumentDate }
    { 1130020;Label ;9680 ;2640 ;3300 ;440 ;ParentControl=1130019 }
    // End of the lines.

    { 1130024;TextBox ;3850 ;2640 ;2750 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Social Security Code;
    SourceExpr=SocialSecurityCode;
    TableRelation="Contribution Code" }
    ...

    Replacement code 4

    ...
    InPage=0;
    CaptionML=ENU=Document Type;
    OptionCaptionML=ENU=" ,Payment,Invoice,Credit Memo,Finance Charge Memo,Reminder,Refund";
    OptionString=[ ,Payment,Invoice,Credit Memo,Finance Charge Memo,Reminder,Refund];
    SourceExpr=DocumentType }

    // Add the following lines.
    { 1130016;Label ;9680 ;2090 ;3300 ;440 ;ParentControl=1130015 }
    { 1130017;TextBox ;13090;2640 ;1700 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Document No.;
    SourceExpr=DocumentNo }
    { 1130018;Label ;9680 ;2640 ;3300 ;440 ;ParentControl=1130017 }
    { 1130019;TextBox ;13090;3190 ;1700 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Document Date;
    SourceExpr=DocumentDate }
    { 1130020;Label ;9680 ;3190 ;3300 ;440 ;ParentControl=1130019 }
    // End of the lines.

    { 1130024;TextBox ;3850 ;2640 ;2750 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Social Security Code;
    SourceExpr=SocialSecurityCode;
    TableRelation="Contribution Code" }
    ...

    Existing code 5

    ...
    InPage=0;
    CaptionML=ENU=Social Security Code;
    SourceExpr=SocialSecurityCode;
    TableRelation="Contribution Code" }
    { 1130025;Label ;440 ;2640 ;3300 ;440 ;ParentControl=1130024 }
    { 1130021;CommandButton;14410;5720;2200;550 ;HorzGlue=Right;
    VertGlue=Bottom;
    PushAction=FormHelp }
    { 1130022;CommandButton;11990;5720;2200;550 ;HorzGlue=Right;
    VertGlue=Bottom;
    ...

    Replacement code 5

    ...
    InPage=0;
    CaptionML=ENU=Social Security Code;
    SourceExpr=SocialSecurityCode;
    TableRelation="Contribution Code" }
    { 1130025;Label ;440 ;2640 ;3300 ;440 ;ParentControl=1130024 }

    // Add the following lines.
    { 1130026;TextBox ;13090;1540 ;1700 ;440 ;ParentControl=1130000;
    InPage=0;
    CaptionML=ENU=Tax Base Amount;
    SourceExpr=TaxBaseAmount }
    { 1130027;Label ;9680 ;1540 ;3300 ;440 ;ParentControl=1130026 }
    // End of the lines.

    { 1130021;CommandButton;14410;5720;2200;550 ;HorzGlue=Right;
    VertGlue=Bottom;
    PushAction=FormHelp }
    { 1130022;CommandButton;11990;5720;2200;550 ;HorzGlue=Right;
    VertGlue=Bottom;
    ...

    Existing code 6

    ...
    "Due Date" := PostingDate;
    "External Document No." := ExternalDocNo;
    "Instalment Amount" := TotalAmount;
    "Remaining Amount" := TotalAmount;
    "Gross Amount to Pay" := TotalAmount;

    // Delete the following line.
    "Amount to Pay" := TotalAmount;

    "Manual Line" := TRUE;
    "Cumulative Transfers" := TRUE;
    SetWithholdCode(WithholdingTaxCode);
    SetSocialSecurityCode(SocialSecurityCode);
    INSERT(TRUE)
    ...

    Replacement code 6

    ...
    "Due Date" := PostingDate;
    "External Document No." := ExternalDocNo;
    "Instalment Amount" := TotalAmount;
    "Remaining Amount" := TotalAmount;
    "Gross Amount to Pay" := TotalAmount;

    // Add the following line.
    "Amount to Pay" := TaxBaseAmount;

    "Manual Line" := TRUE;
    "Cumulative Transfers" := TRUE;
    SetWithholdCode(WithholdingTaxCode);
    SetSocialSecurityCode(SocialSecurityCode);
    INSERT(TRUE)
    ...
  3. Add the following global variable in the Manual vendor Payment Line form (12188):

    TaxBaseAmount@1130000 : Decimal;
  4. Change the code in the CalculateWithholdingTax function in the Withholding - Contribution codeunit (12101) as follows:
    Existing code 1

    ...
    PROCEDURE CalculateWithholdingTax@1130001(VAR PurchHeader@1130000 : Record 38;Recalculate@1130001 : Boolean);
    VAR
    PurchWithSoc@1130002 : Record 12137;
    PurchLine@1130003 : Record 39;

    // Delete the following line.
    TotalAmount@1130004 : Decimal;

    BEGIN
    PurchLine.RESET;
    PurchLine.SETRANGE("Document Type",PurchHeader."Document Type");
    PurchLine.SETRANGE("Document No.",PurchHeader."No.");
    PurchLine.SETRANGE(Type,PurchLine.Type::"G/L Account");
    ...

    Replacement code 1

    ...
    PROCEDURE CalculateWithholdingTax@1130001(VAR PurchHeader@1130000 : Record 38;Recalculate@1130001 : Boolean);
    VAR
    PurchWithSoc@1130002 : Record 12137;
    PurchLine@1130003 : Record 39;

    // Add the following lines.
    TempPurchLine@1130005 : TEMPORARY Record 39;
    TotalAmount@1130004 : Decimal;
    VATAmount@1130006 : Decimal;
    // End of the lines.

    BEGIN
    PurchLine.RESET;
    PurchLine.SETRANGE("Document Type",PurchHeader."Document Type");
    PurchLine.SETRANGE("Document No.",PurchHeader."No.");
    PurchLine.SETRANGE(Type,PurchLine.Type::"G/L Account");
    ...

    Existing code 2

    ...
    PurchLine.SETRANGE(Type,PurchLine.Type::"G/L Account");

    TotalAmount := 0;
    IF PurchLine.FIND('-') THEN
    REPEAT

    // Delete the following lines.
    TotalAmount := TotalAmount + PurchLine."Line Amount";
    UNTIL PurchLine.NEXT = 0;

    // End of the lines.

    IF PurchWithSoc.GET(PurchHeader."Document Type", PurchHeader."No.") THEN
    IF (PurchWithSoc."Total Amount" = 0) OR
    Recalculate
    THEN BEGIN
    PurchWithSoc."Currency Code" := PurchHeader."Currency Code";
    ...

    Replacement code 2

    ...
    PurchLine.SETRANGE(Type,PurchLine.Type::"G/L Account");

    TotalAmount := 0;
    IF PurchLine.FIND('-') THEN
    REPEAT

    // Add the following lines.
    IF PurchHeader."Prices Including VAT" THEN BEGIN
    TempPurchLine := PurchLine;
    TempPurchLine.VALIDATE("Amount Including VAT",PurchLine."Line Amount");
    TotalAmount += TempPurchLine."VAT Base Amount"
    END ELSE
    TotalAmount += PurchLine."Line Amount";
    UNTIL PurchLine.NEXT = 0;
    // End of the lines.

    IF PurchWithSoc.GET(PurchHeader."Document Type", PurchHeader."No.") THEN
    IF (PurchWithSoc."Total Amount" = 0) OR
    Recalculate
    THEN BEGIN
    PurchWithSoc."Currency Code" := PurchHeader."Currency Code";
    ...

Prerequisites

You must have 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

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.

Need more help?

Want more options?

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.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×