使用 Microsoft 登录
登录或创建帐户。
你好,
使用其他帐户。
你有多个帐户
选择要登录的帐户。
英文
很抱歉。本文没有你的语言版本。

This article applies to Microsoft Dynamics NAV for the following countries and language locales.

  • English (Canada) (en-ca)

  • English (United States) (en-us)

  • Spanish (Mexico) (es-mx)

  • French (Canada) (fr-ca)

Symptoms

Assume that you post a sales invoice that has a tax area code specified in the North American version of Microsoft Dynamics 2009. You add a new tax jurisdiction to the tax area code. In this situation, when you print the posted sales invoice, you receive the following error message:

A Tax Detail record could not be found within the following parameters:/Tax Jurisdiction Code:code, Tax GroupCode:group code, Effective Date: <=date.

This problem occurs in the following products:

  • The North American version of Microsoft Dynamics NAV 2009 R2

  • The North American version of Microsoft Dynamics NAV 2009 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 AddSalesInvoiceLines function in the Sales Tax Calculate codeunit (398) as follows:
    Existing code

        PROCEDURE AddSalesInvoiceLines@1020003(DocNo@1020004 : Code[20]);
    VAR
    SalesInvoiceHeader@1020000 : Record 112;
    SalesInvoiceLine@1020001 : Record 113;
    InsertRec@1020002 : Boolean;
    BEGIN
    SalesInvoiceHeader.GET(DocNo);
    SalesInvoiceHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(SalesInvoiceHeader."Tax Area Code") THEN
    EXIT;
    SetUpCurrency(SalesInvoiceHeader."Currency Code");
    ...

    Replacement code

        PROCEDURE AddSalesInvoiceLines@1020003(DocNo@1020004 : Code[20]);
    VAR
    SalesInvoiceHeader@1020000 : Record 112;
    SalesInvoiceLine@1020001 : Record 113;
    InsertRec@1020002 : Boolean;
    BEGIN

    // Add the following line.
    Posted := TRUE;

    SalesInvoiceHeader.GET(DocNo);
    SalesInvoiceHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(SalesInvoiceHeader."Tax Area Code") THEN
    EXIT;
    SetUpCurrency(SalesInvoiceHeader."Currency Code");
    ...
  2. Change the code in the AddSalesCrMemoLines function in the Sales Tax Calculate codeunit (398) as follows:
    Existing code

        PROCEDURE AddSalesCrMemoLines@1020006(DocNo@1020000 : Code[20]);
    VAR
    SalesCrMemoHeader@1020001 : Record 114;
    SalesCrMemoLine@1020002 : Record 115;
    InsertRec@1020003 : Boolean;
    BEGIN
    SalesCrMemoHeader.GET(DocNo);
    SalesCrMemoHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(SalesCrMemoHeader."Tax Area Code") THEN
    EXIT;
    ...

    Replacement code

        PROCEDURE AddSalesCrMemoLines@1020006(DocNo@1020000 : Code[20]);
    VAR
    SalesCrMemoHeader@1020001 : Record 114;
    SalesCrMemoLine@1020002 : Record 115;
    InsertRec@1020003 : Boolean;
    BEGIN

    // Add the following line.
    Posted := TRUE;

    SalesCrMemoHeader.GET(DocNo);
    SalesCrMemoHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(SalesCrMemoHeader."Tax Area Code") THEN
    EXIT;
    ...
  3. Change the code in the AddPurchInvoiceLines function in the Sales Tax Calculate codeunit (398) as follows:
    Existing code

        PROCEDURE AddPurchInvoiceLines@1020008(DocNo@1020000 : Code[20]);
    VAR
    PurchInvHeader@1020001 : Record 122;
    PurchInvLine@1020002 : Record 123;
    InsertRec@1020003 : Boolean;
    BEGIN
    PurchInvHeader.GET(DocNo);
    PurchInvHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(PurchInvHeader."Tax Area Code") THEN
    EXIT;
    ...

    Replacement code

        PROCEDURE AddPurchInvoiceLines@1020008(DocNo@1020000 : Code[20]);
    VAR
    PurchInvHeader@1020001 : Record 122;
    PurchInvLine@1020002 : Record 123;
    InsertRec@1020003 : Boolean;
    BEGIN

    // Add the following line.
    Posted := TRUE;

    PurchInvHeader.GET(DocNo);
    PurchInvHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(PurchInvHeader."Tax Area Code") THEN
    EXIT;
    ...
  4. Change the code in the AddPurchCrMemoLines function in the Sales Tax Calculate codeunit (398) as follows:
    Existing code

        PROCEDURE AddPurchCrMemoLines@1020004(DocNo@1020000 : Code[20]);
    VAR
    PurchCrMemoHeader@1020001 : Record 124;
    PurchCrMemoLine@1020002 : Record 125;
    InsertRec@1020003 : Boolean;
    BEGIN
    PurchCrMemoHeader.GET(DocNo);
    PurchCrMemoHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(PurchCrMemoHeader."Tax Area Code") THEN
    EXIT;
    ...

    Replacement code

        PROCEDURE AddPurchCrMemoLines@1020004(DocNo@1020000 : Code[20]);
    VAR
    PurchCrMemoHeader@1020001 : Record 124;
    PurchCrMemoLine@1020002 : Record 125;
    InsertRec@1020003 : Boolean;
    BEGIN

    // Add the following line.
    Posted := TRUE;

    PurchCrMemoHeader.GET(DocNo);
    PurchCrMemoHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(PurchCrMemoHeader."Tax Area Code") THEN
    EXIT;
    ...
  5. Change the code in the AddServInvoiceLines function in the Sales Tax Calculate codeunit (398) as follows:
    Existing code

        PROCEDURE AddServInvoiceLines@1480008(DocNo@1020000 : Code[20]);
    VAR
    ServInvHeader@1020001 : Record 5992;
    ServInvLine@1020002 : Record 5993;
    InsertRec@1020003 : Boolean;
    BEGIN
    ServInvHeader.GET(DocNo);
    ServInvHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(ServInvHeader."Tax Area Code") THEN
    EXIT;
    ...

    Replacement code

        PROCEDURE AddServInvoiceLines@1480008(DocNo@1020000 : Code[20]);
    VAR
    ServInvHeader@1020001 : Record 5992;
    ServInvLine@1020002 : Record 5993;
    InsertRec@1020003 : Boolean;
    BEGIN

    // Add the following line.
    Posted := TRUE;

    ServInvHeader.GET(DocNo);
    ServInvHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(ServInvHeader."Tax Area Code") THEN
    EXIT;
    ...
  6. Change the code in the AddServCrMemoLines function in the Sales Tax Calculate codeunit (398) as follows:
    Existing code

        PROCEDURE AddServCrMemoLines@1480004(DocNo@1020000 : Code[20]);
    VAR
    ServCrMemoHeader@1020001 : Record 5994;
    ServCrMemoLine@1020002 : Record 5995;
    InsertRec@1020003 : Boolean;
    BEGIN
    ServCrMemoHeader.GET(DocNo);
    ServCrMemoHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(ServCrMemoHeader."Tax Area Code") THEN
    EXIT;
    ...

    Replacement code

        PROCEDURE AddServCrMemoLines@1480004(DocNo@1020000 : Code[20]);
    VAR
    ServCrMemoHeader@1020001 : Record 5994;
    ServCrMemoLine@1020002 : Record 5995;
    InsertRec@1020003 : Boolean;
    BEGIN

    // Add the following line.
    Posted := TRUE;

    ServCrMemoHeader.GET(DocNo);
    ServCrMemoHeader.TESTFIELD("Prices Including VAT",FALSE);
    IF NOT GetSalesTaxCountry(ServCrMemoHeader."Tax Area Code") THEN
    EXIT;
    ...
  7. Change the code in the EndSalesTaxCalculation function in the Sales Tax Calculate codeunit (398) as follows:
    Existing code

    ...
    TaxDetail.SETRANGE("Tax Type",TaxDetail."Tax Type"::"Excise Tax");
    IF TaxDetail.FIND('+') THEN BEGIN
    TaxDetailFound := TRUE;
    "Tax Type" := "Tax Type"::"Excise Tax";
    INSERT;
    "Tax Type" := "Tax Type"::"Sales and Use Tax";
    END;

    // Delete the following line.
    IF NOT TaxDetailFound THEN

    ERROR(
    Text1020002,
    TaxDetail.TABLECAPTION,
    FIELDCAPTION("Tax Jurisdiction Code"),"Tax Jurisdiction Code",
    FIELDCAPTION("Tax Group Code"),"Tax Group Code",
    TaxDetail.FIELDCAPTION("Effective Date"),TaxDetail.GETFILTER("Effective Date"));
    UNTIL NEXT = 0;
    RESET;
    ...

    Replacement code

    ...
    TaxDetail.SETRANGE("Tax Type",TaxDetail."Tax Type"::"Excise Tax");
    IF TaxDetail.FIND('+') THEN BEGIN
    TaxDetailFound := TRUE;
    "Tax Type" := "Tax Type"::"Excise Tax";
    INSERT;
    "Tax Type" := "Tax Type"::"Sales and Use Tax"; // NA0012
    END;

    // Add the following line.
    IF NOT TaxDetailFound AND NOT Posted THEN

    ERROR(
    Text1020002,
    TaxDetail.TABLECAPTION,
    FIELDCAPTION("Tax Jurisdiction Code"),"Tax Jurisdiction Code",
    FIELDCAPTION("Tax Group Code"),"Tax Group Code",
    TaxDetail.FIELDCAPTION("Effective Date"),TaxDetail.GETFILTER("Effective Date"));
    UNTIL NEXT = 0;
    RESET;
    ...

Prerequisites

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

  • The North American version of Microsoft Dynamics NAV 2009 R2

  • The North American 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.

需要更多帮助?

需要更多选项?

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.

此信息是否有帮助?

哪些因素影响了你的体验?
按“提交”即表示你的反馈将用于改进 Microsoft 产品和服务。 你的 IT 管理员将能够收集此数据。 隐私声明。

谢谢您的反馈!

×