義大利版 Microsoft Dynamics NAV 5.0 Service Pack 1 的 intrastat 日誌行中,國家代碼並不總是正確

本文適用於義大利語 (Microsoft Dynamics NAV,) 語言地點。

在義大利版的 Microsoft Dynamics NAV 5.0 Service Pack 1 (SP1) 套用熱修正2275869後,intrastat 日誌行的國家代碼並不總是正確。 

欲了解更多關於熱修補程式2275869的資訊,請點擊以下文章編號,在Microsoft知識庫中查看該文章:
2275869 「增值稅註冊號碼」欄位的值被錯誤匯出到義大利版 Microsoft Dynamics NAV 5.0 服務包 1 中的 Scambi.cee 檔案

症狀

此問題是因為國家代碼取自項目分類帳。 在特定情況下,國家代碼應從帳單至(bill-to)欄位或付費欄位取用。

原因

Hotfix 資訊

Microsoft 現在已經支援熱修補程式。 然而,這僅是為了修正本文所描述的問題。 只應用在遇到這個特定問題的系統上。 此熱修補可能會進行額外測試。 因此,如果你沒有受到這個問題嚴重影響,我們建議你等待下一個包含此熱修補的 Microsoft Dynamics NAV 服務包或下一個 Microsoft Dynamics NAV 版本。

注意:在特殊情況下,若 Microsoft Dynamics 及相關產品的技術支援專業人員判斷特定更新能解決您的問題,通常因支援電話而產生的費用可能會被取消。 一般來說,如果有所描述之特定更新無法解決的其他支援問題,才會收取支援費用。

解決方式

安裝資訊

Microsoft 僅提供圖例的程式設計範例,不含明示或暗示的擔保。 這包括 (但不限於) 適用于特定目的之可操作性或適用性的暗示擔保。 本文假設您熟悉正在示範的程式設計語言,以及用來建立和進行程式偵錯工具的工具。 Microsoft 技術支援工程師可以協助說明特定程序的功能,但不會修改這些範例以提供附加功能或建構程序來滿足您的特定需求。

注意:安裝此熱修補程式前,請確認所有 Microsoft Navision 用戶端使用者都已登出系統。 這包括Microsoft Navision 應用服務 (NAS) 用戶端使用者。 當你實施這個熱修補時,應該只有你一個登入的客戶端使用者。

要實作這個熱修補,你必須擁有開發者授權。

我們建議在 Windows 登入視窗或資料庫登入視窗中,將使用者帳號分配「SUPER」角色 ID。 若使用者帳號無法被指派「SUPER」角色 ID,您必須驗證該帳號擁有以下權限:

  • 你要更改的物件的修改權限。
  • 系統物件 ID 5210 的執行權限,以及系統物件 ID 9015 的執行權限。

            
注意:除非你必須進行資料修復,否則你不必擁有資料儲存的權利。

法規變更

注意:在將修正程式套用到生產電腦之前,務必在受控環境中測試修正。
如果要解決這個問題,請依照下列步驟執行。

  1. 更改商品編號中的代碼。- Intrastat Jnl. 線表 (263) 中的 OnValidate 觸發條件如下:
    現有程式碼

    ...
    
    "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. 行表 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. 建立一個新的 GetIntrastatCountryCode 函式,使用代碼類型和 10 作為 Intrastat Jnl. 行表 (263) 的回傳值。 要建立此函式,請依照以下步驟操作:

    1. 新增一個局部參數,然後指定該參數如下:

      • Var沒有
      • 名稱:CountryRegionCode
      • 資料型態程式碼
      • 長度:10
    2. 新增一個本地變數,然後指定該變數如下:

      • 名稱:CountryRegion
      • 資料型態: 記錄
      • 子類型國家/地區
    3. 程式碼加入如下:

      IF CountryRegion.GET(CountryRegionCode) THEN
      EXIT(CountryRegion."Intrastat Code");
      
  4. 在取得項目帳帳條目表中,將 InsertItemJnlLine 函式 (594) 變更如下:
    現行法規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";
    ...
    

    現有的第二號法規

    ...
    
    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 line.
    "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 產品中的問題。

狀態

注意本文為 Microsoft 支援單位內部直接建立的「快速發佈」文章。 此處包含的資訊是以其現況提供,用於回應新產生的問題。 由於快速發佈,資料可能包含拼字錯誤,並可能會隨時修訂,不另行通知。 請參閱使用條款以瞭解其他相關考量。