イタリア語バージョンの Microsoft Dynamics NAV 5.0 Service Pack 1 でイントラステータス 仕訳帳を生成すると、エントリで国コードが予期せず使用されます。

この記事は、イタリア語 (it) 言語ロケールの Microsoft Dynamics NAV に適用されます。

イタリア語バージョンの Microsoft Dynamics NAV 5.0 Service Pack 1 (SP1) でイントラ統計仕訳帳を生成する場合、エントリでイントラステータス コードは使用されません。 代わりに、国コードが使用されます。

現象

修正プログラムの情報

サポートされている修正プログラムが Microsoft から入手できるようになりました。 ただし、この記事で説明されている問題を修正することのみを目的としています。 この特定の問題が発生しているシステムにのみ適用します。 この修正プログラムは、追加のテストを受け取る場合があります。 したがって、この問題の影響を大きく受けない場合は、次の Microsoft Dynamics NAV Service Pack またはこの修正プログラムを含む次の Microsoft Dynamics NAV バージョンを待機することをお勧めします。

注 特別なケースでは、Microsoft Dynamics および関連製品のテクニカル サポート プロフェッショナルが特定の更新プログラムによって問題が解決されると判断した場合、通常はサポート呼び出しに対して発生する料金が取り消されることがあります。 ただし、特定の更新プログラムの対象とならない追加の質問および問題については、通常のサポート料金が適用されます。

解決策

インストール情報

Microsoft は、明示または黙示の保証なしで、説明のみを目的としてプログラミング例を提供しています。 これには、商品性または特定の目的への適合性に関する暗黙の保証が含まれますが、これらに限定されません。 この記事では、デモンストレーションされているプログラミング言語と、プロシージャの作成とデバッグに使用されるツールについてよく理解していることを前提としています。 マイクロソフト サポート窓口では、特定のプロシージャの機能説明に関するご質問に対して支援いたしますが、本例を特定の目的を満たすために機能を追加したり、プロシージャを構築することは行いません。

注 この修正プログラムをインストールする前に、すべての Microsoft Navision クライアント ユーザーがシステムからログオフされていることを確認します。 これには、Microsoft Navision Application Services (NAS) クライアント ユーザーが含まれます。 この修正プログラムを実装するときにログオンする唯一のクライアント ユーザーである必要があります。

この修正プログラムを実装するには、開発者ライセンスが必要です。

[Windows ログイン] ウィンドウまたは [データベース ログイン] ウィンドウのユーザー アカウントに "SUPER" ロール ID を割り当てることをお勧めします。 ユーザー アカウントに "SUPER" ロール ID を割り当てることができない場合は、ユーザー アカウントに次のアクセス許可があることを確認する必要があります。

  • 変更するオブジェクトの [変更] アクセス許可。
  • システム オブジェクト ID 5210 オブジェクトとシステム オブジェクト ID 9015 オブジェクトの Execute アクセス許可。

            
メモ データ修復を実行する必要がない限り、データ ストアに対する権限は必要ありません。

コードの変更

メモ 運用環境のコンピューターに修正プログラムを適用する前に、制御された環境でコード修正を常にテストします。
この問題を解決するには、次の手順を実行します。

  1. 項目番号のコードを変更します。- 次のように、Intrastat Jnl の OnValidate トリガー。Line テーブル (263)
    既存のコード

    …
    
    "Tariff No." := Item."Tariff No.";
    
    //Delete the following line.
    "Country/Region of Origin Code" := Item."Country/Region of Origin Code";
    
    GetItemDescription;
    

    置換コード

    ...
    
    "Tariff No." := Item."Tariff No.";
    
    //Add the following line.
    "Country/Region of Origin Code" := GetIntrastatCountryCode(Item."Country/Region of Origin Code");
    
    GetItemDescription;
    
  2. 次のように、Intrastat Jnl の ValidateSourceEntryNo 関数のコードを変更します。 Line テーブル (263)
    既存のコード

    ...
    
    Date := VATEntry."Document Date"; 
    
    //Delete the following line.
    "Country/Region Code" := VATEntry."Country/Region Code"; 
    
    "VAT Registration No." := VATEntry."VAT Registration No.";
    ...
    

    置換コード

    ...
    
    Date := VATEntry."Document Date"; 
    
    //Add the following line.
    "Country/Region Code" := GetIntrastatCountryCode(VATEntry."Country/Region Code");
    
    "VAT Registration No." := VATEntry."VAT Registration No.";
    ...
    
  3. Intrastat Jnl の戻り値にコード型と 10 の長さを使用する新しい GetIntrastatCountryCode 関数を作成します。Line テーブル (263)。 この関数を作成するには、次の手順に従います。

    1. 新しいローカル パラメーターを追加し、次のようにパラメーターを指定します。

      • Var:No
      • 名前:CountryRegionCode
      • DataType:Code
      • サブタイプ:国/地域コード
      • 長さ:10
    2. 新しいローカル変数を追加し、次のように変数を指定します。

      • 名前: CountryRegion
      • DataType:Record
      • サブタイプ: 国/地域
    3. 次のようにコードを追加します。

      IF CountryRegion.GET(CountryRegionCode) THEN
      EXIT(CountryRegion."Intrastat Code");
      
  4. 項目台帳エントリの取得レポート (594) の InsertItemJnlLine 関数のコードを次のように変更します。
    既存のコード 1

    ...
    
    WITH IntrastatJnlLine DO BEGIN
    INIT;
    "Line No." := "Line No." + 10000;
    Date := "Item Ledger Entry"."Last Invoice Date";
    
    //Delete the following line.
    "Country/Region Code" := "Item Ledger Entry"."Country/Region Code";
    
    "Transaction Type" := "Item Ledger Entry"."Transaction Type";
    ...
    

    置換コード 1

    ...
    
    WITH IntrastatJnlLine DO BEGIN
    INIT;
    "Line No." := "Line No." + 10000;
    Date := "Item Ledger Entry"."Last Invoice Date";
    
    //Add the following line.
    "Country/Region Code" := GetIntrastatCountryCode("Item Ledger Entry"."Country/Region Code");
    
    "Transaction Type" := "Item Ledger Entry"."Transaction Type";
    ...
    

    既存のコード 2

    ...
    
    IF SalesShipHeader.GET("Item Ledger Entry"."Document No.") THEN BEGIN
    IF Customer.GET(SalesShipHeader."Bill-to Customer No.") THEN BEGIN 
    "VAT Registration No." := Customer."VAT Registration No.";
    
    //Delete the following line.
    "Country/Region Code" := Customer."Country/Region Code"; 
    
    END;
    END ELSE BEGIN
    SalesSetup.GET;
    IF NOT SalesSetup."Shipment on Invoice" THEN BEGIN
    IF SalesInvHeader.GET("Item Ledger Entry"."Document No.") THEN
    IF Customer.GET(SalesInvHeader."Bill-to Customer No.") THEN BEGIN 
    "VAT Registration No." := Customer."VAT Registration No.";
    
    //Delete the following line.
    "Country/Region Code" := Customer."Country/Region Code";
    
    END;
    END ELSE
    IF SalesCrMemoHeader.GET(ValueEntry."Document No.") THEN
    IF Customer.GET(SalesCrMemoHeader."Bill-to Customer No.") THEN BEGIN
    "VAT Registration No." := Customer."VAT Registration No.";
    
    //Delete the following line.
    "Country/Region Code" := Customer."Country/Region Code";
    
    END;
    END; 
    ...
    

    置換コード 2

    ...
    
    IF SalesShipHeader.GET("Item Ledger Entry"."Document No.") THEN BEGIN
    IF Customer.GET(SalesShipHeader."Bill-to Customer No.") THEN BEGIN 
    "VAT Registration No." := Customer."VAT Registration No.";
    
    //Add the following line.
    "Country/Region Code" := GetIntrastatCountryCode(Customer."Country/Region Code"); 
    
    END;
    END ELSE BEGIN
    SalesSetup.GET;
    IF NOT SalesSetup."Shipment on Invoice" THEN BEGIN
    IF SalesInvHeader.GET("Item Ledger Entry"."Document No.") THEN
    IF Customer.GET(SalesInvHeader."Bill-to Customer No.") THEN BEGIN 
    "VAT Registration No." := Customer."VAT Registration No.";
    
    //Add the following line.
    "Country/Region Code" := GetIntrastatCountryCode(Customer."Country/Region Code"); 
    
    END;
    END ELSE
    IF SalesCrMemoHeader.GET(ValueEntry."Document No.") THEN
    IF Customer.GET(SalesCrMemoHeader."Bill-to Customer No.") THEN BEGIN
    "VAT Registration No." := Customer."VAT Registration No.";
    
    //Add the following line.
    "Country/Region Code" := GetIntrastatCountryCode(Customer."Country/Region Code"); 
    
    END;
    END; 
    ...
    

    既存のコード 3

    ...
    
    IF IntrastatJnlBatch.Type = IntrastatJnlBatch.Type :: Purchases THEN BEGIN
    IF (ItemVendor.GET("Item Ledger Entry"."Source No.","Item Ledger Entry"."Item No.","Item Ledger Entry"."Variant Code")) AND
    (ItemVendor."Country/Region of Origin Code" <> '') THEN
    
    //Delete the following line.
    "Country/Region of Origin Code" := ItemVendor."Country/Region of Origin Code"
    
    ELSE
    
    //Delete the following line.
    "Country/Region of Origin Code" := Item."Country/Region of Origin Code";
    
    FindSourceCurrency(
    "Item Ledger Entry"."Source No.","Item Ledger Entry"."Document Date","Item Ledger Entry"."Posting Date");
    END ELSE
    
    //Delete the following line.
    "Country/Region of Origin Code" := Item."Country/Region of Origin Code";
    
    
    "Source Type" := "Source Type"::"Item entry";
    ...
    

    置換コード 3

    ...
    
    IF IntrastatJnlBatch.Type = IntrastatJnlBatch.Type :: Purchases THEN BEGIN
    IF (ItemVendor.GET("Item Ledger Entry"."Source No.","Item Ledger Entry"."Item No.","Item Ledger Entry"."Variant Code")) AND
    (ItemVendor."Country/Region of Origin Code" <> '') THEN
    
    //Add the following lin.
    "Country/Region of Origin Code" := GetIntrastatCountryCode(ItemVendor."Country/Region of Origin Code")
    
    ELSE
    
    //Add the following line.
    "Country/Region of Origin Code" := GetIntrastatCountryCode(Item."Country/Region of Origin Code");
    
    FindSourceCurrency(
    "Item Ledger Entry"."Source No.","Item Ledger Entry"."Document Date","Item Ledger Entry"."Posting Date");
    END ELSE
    
    //Add the following line.
    "Country/Region of Origin Code" := GetIntrastatCountryCode(Item."Country/Region of Origin Code");
    
    "Source Type" := "Source Type"::"Item entry";
    ...
    
  5. 項目台帳エントリの取得レポート (594) の InsertJobLedgerLine 関数のコードを次のように変更します。
    既存のコード

    ...
    
    Date := "Job Ledger Entry"."Posting Date";
    
    //Delete the following line.
    "Country/Region Code" := "Job Ledger Entry"."Country/Region Code";
    
    "Transaction Type" := "Job Ledger Entry"."Transaction Type";
    ...
    

    置換コード

    ...
    
    Date := "Job Ledger Entry"."Posting Date";
    
    //Add the following line.
    "Country/Region Code" := GetIntrastatCountryCode("Job Ledger Entry"."Country/Region Code");
    
    "Transaction Type" := "Job Ledger Entry"."Transaction Type";
    ...
    

前提条件

この修正プログラムを適用するには、イタリア語バージョンの Microsoft Dynamics NAV 5.0 Service Pack 1 がインストールされている必要があります。

アンインストール情報

この修正プログラムを削除することはできません。

Microsoft は、これが "適用対象" セクションに記載されている Microsoft 製品の問題であることを確認しました。

状態

注: この資料は、"迅速な公開" を目的としてマイクロソフト サポート組織により直接作成されたものです。 ここに含まれる情報は、新しい問題に対応するため、そのままの状態で提供されます。 情報を迅速に公開するため、この資料には誤植などが含まれる可能性があり、また、予告なく改訂される場合があります。 その他の注意事項については、使用条件を参照してください。