本文適用於東歐 (EE) 語言地區的Microsoft Dynamics NAV。
症狀
假設你在東歐版的 Microsoft Dynamics NAV 2009 R2 中套用了熱修補2672643。 你寄出一封包含預付款的銷售訂單預付款信。 在這種情況下,當您出貨並開立銷售訂單發票時,會收到以下錯誤訊息:
注意
船隻數量不能超過0.9。 在銷售線文件類型=「訂單」,文件號碼=「編號」,行號=「號碼」。
因此,你無法直接出貨銷售訂單。
欲了解更多關於熱修正2672643的資訊,請點擊以下文章編號以瀏覽Microsoft知識庫中的文章:
2672643 在東歐版 Microsoft Dynamics NAV 2009 R2 中,當您為銷售訂單登記部分出貨時,「訂單 [號碼] 上有未過帳的預付款金額」錯誤訊息
解決方式
Hotfix 資訊
Microsoft 現在已經支援熱修補程式。 然而,這僅是為了修正本文所描述的問題。 只應用在遇到這個特定問題的系統上。 此熱修補可能會進行額外測試。 因此,如果您未受到此問題嚴重影響,我們建議您等待下一個 Microsoft Dynamics NAV 2009 服務包或包含此熱修補的 Microsoft Dynamics NAV 版本。
注意:在特殊情況下,若 Microsoft Dynamics 及相關產品的技術支援專業人員判斷特定更新能解決您的問題,通常因支援電話而產生的費用可能會被取消。 一般來說,如果有所描述之特定更新無法解決的其他支援問題,才會收取支援費用。
安裝資訊
Microsoft 僅提供圖例的程式設計範例,不含明示或暗示的擔保。 這包括 (但不限於) 適用于特定目的之可操作性或適用性的暗示擔保。 本文假設您熟悉正在示範的程式設計語言,以及用來建立和進行程式偵錯工具的工具。 Microsoft 支援工程師可以協助說明特定程式的功能。 不過,他們將不會修改這些範例以提供新增功能或建構符合您特定需求的程式。
注意:安裝此熱修補程式前,請確認所有 Microsoft Dynamics NAV 用戶端使用者皆已登出系統。 這包括Microsoft Dynamics NAV應用伺服器 (NAS) 服務。 當你實施這個熱修補時,應該只有你一個登入的客戶端使用者。
要實作這個熱修補,你必須擁有開發者授權。
我們建議在 Windows 登入視窗或資料庫登入視窗中,將使用者帳號分配「SUPER」角色 ID。 若使用者帳號無法被指派「SUPER」角色 ID,您必須驗證該帳號擁有以下權限:
- 你要更改的物件的修改權限。
- 系統物件 ID 5210 的執行權限,以及系統物件 ID 9015 的執行權限。
注意:除非你必須進行資料修復,否則你不必擁有資料儲存的權利。
法規變更
注意:在將修正程式套用到生產電腦之前,務必在受控環境中測試修正。
如果要解決這個問題,請依照下列步驟執行。
將Prepmt Amt中的代碼改為「銷售行」表格中37) (扣除-OnValidate觸發,如下:
現有程式碼... "Prepmt Amt to Deduct", STRSUBSTNO(Text045,"Prepmt. Amt. Inv." - "Prepmt Amt Deducted")); IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN // Delete the following line. TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted"); ...替換代碼
... "Prepmt Amt to Deduct", STRSUBSTNO(Text045,"Prepmt. Amt. Inv." - "Prepmt Amt Deducted")); IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN // Add the following lines. TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted"); GetSalesHeader; IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); VATPostingSetup.TESTFIELD("Adv. Invoice Correction Type",VATPostingSetup."Adv. Invoice Correction Type"::Percentage); END; // End of the added lines. ...將「銷售線」表中 37) (CalcPrepaymentToDeduct 函式中的代碼更改如下:
刪除以下的本地變數:
PrepmtPct: Decimal; AbsoluteAdvCorrection : Boolean;更改代碼如下:
現有程式碼... IF (Quantity - "Quantity Invoiced") <> 0 THEN BEGIN GetSalesHeader; IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); // Delete the following lines. AbsoluteAdvCorrection := VATPostingSetup."Adv. Invoice Correction Type" = VATPostingSetup."Adv. Invoice Correction Type"::Absolute; IF AbsoluteAdvCorrection THEN BEGIN PrepmtPct := "Prepayment %"; "Prepayment %" := 100; END; END; IF SalesHeader."Prices Including VAT" THEN "Prepmt Amt to Deduct" := ROUND( ROUND( ROUND( ROUND("Unit Price" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * ("Prepayment %" / 100) / (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") * (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") ELSE "Prepmt Amt to Deduct" := ROUND( ROUND( ROUND("Unit Price" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * "Prepayment %" / 100 ,Currency."Amount Rounding Precision"); IF AbsoluteAdvCorrection THEN BEGIN "Prepayment %" := PrepmtPct; IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"; END; END ELSE "Prepmt Amt to Deduct" := 0 // End of the deleted lines. ...替換代碼
... IF (Quantity - "Quantity Invoiced") <> 0 THEN BEGIN GetSalesHeader; IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); // Add the following lines. CASE VATPostingSetup."Adv. Invoice Correction Type" OF VATPostingSetup."Adv. Invoice Correction Type"::Percentage: "Prepmt Amt to Deduct" := ROUND("Qty. to Invoice" / (Quantity - "Quantity Invoiced") * ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted"),Currency."Amount Rounding Precision"); VATPostingSetup."Adv. Invoice Correction Type"::Absolute: BEGIN "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(SalesHeader."Prices Including VAT",100); IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"; END; VATPostingSetup."Adv. Invoice Correction Type"::"Fully Invoiced": IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted" ELSE "Prepmt Amt to Deduct" := 0; END; END ELSE "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(SalesHeader."Prices Including VAT","Prepayment %"); END ELSE "Prepmt Amt to Deduct" := 0 // End of the added lines. ...
在「銷售線」表 (37) 建立一個新的預付費用扣除函數,如下:
PROCEDURE PrepmtAmtToDeduct@1470002(PricesIncludingVAT@1470000 : Boolean;PrepaymentPct@1470001 : Decimal) : Decimal; VAR VATPct@1470002 : Decimal; BEGIN IF PricesIncludingVAT THEN VATPct := "VAT %" ELSE VATPct := 0; EXIT( ROUND( ROUND( ROUND( ROUND("Unit Price" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * (PrepaymentPct / 100) / (1 + (VATPct / 100)),Currency."Amount Rounding Precision") * (1 + (VATPct / 100)),Currency."Amount Rounding Precision")); END;將Prepmt Amt的代碼改為「購買行」表格中39) (扣除-OnValidate觸發,如下:
現有程式碼... FIELDERROR( "Prepmt Amt to Deduct", STRSUBSTNO(Text039,"Prepmt. Amt. Inv." - "Prepmt Amt Deducted")); IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN // Delete the following line. TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted"); ...替換代碼
... FIELDERROR( "Prepmt Amt to Deduct", STRSUBSTNO(Text039,"Prepmt. Amt. Inv." - "Prepmt Amt Deducted")); IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN // Add the following lines. TESTFIELD("Prepmt Amt to Deduct","Prepmt. Amt. Inv." - "Prepmt Amt Deducted"); GetPurchHeader; IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); VATPostingSetup.TESTFIELD("Adv. Invoice Correction Type",VATPostingSetup."Adv. Invoice Correction Type"::Percentage); END; // End of the added lines. ...將「購買行」表格中計算預付扣除函數中的代碼改 (39) 。 若要這麼做,請按照下列步驟進行:
刪除以下的本地變數:
PrepmtPct@ : Decimal; AbsoluteAdvCorrection@ : Boolean;更改代碼如下:
現有程式碼... IF (Quantity - "Quantity Invoiced") <> 0 THEN BEGIN GetPurchHeader; IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); // Delete the following lines. AbsoluteAdvCorrection := VATPostingSetup."Adv. Invoice Correction Type" = VATPostingSetup."Adv. Invoice Correction Type"::Absolute; IF AbsoluteAdvCorrection THEN BEGIN PrepmtPct := "Prepayment %"; "Prepayment %" := 100; END; END; IF PurchHeader."Prices Including VAT" THEN "Prepmt Amt to Deduct" := ROUND( ROUND( ROUND( ROUND("Direct Unit Cost" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * ("Prepayment %" / 100) / (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") * (1 + ("VAT %" / 100)),Currency."Amount Rounding Precision") ELSE "Prepmt Amt to Deduct" := ROUND( ROUND( ROUND("Direct Unit Cost" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * "Prepayment %" / 100,Currency."Amount Rounding Precision"); IF AbsoluteAdvCorrection THEN BEGIN "Prepayment %" := PrepmtPct; IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"; END; END ELSE "Prepmt Amt to Deduct" := 0 // End of the deleted lines. ...替換代碼
... IF (Quantity - "Quantity Invoiced") <> 0 THEN BEGIN GetPurchHeader; IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN BEGIN VATPostingSetup.GET("VAT Bus. Posting Group","VAT Prod. Posting Group"); // Add the following lines. CASE VATPostingSetup."Adv. Invoice Correction Type" OF VATPostingSetup."Adv. Invoice Correction Type"::Percentage: "Prepmt Amt to Deduct" := ROUND("Qty. to Invoice" / (Quantity - "Quantity Invoiced") * ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted"),Currency."Amount Rounding Precision"); VATPostingSetup."Adv. Invoice Correction Type"::Absolute: BEGIN "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(PurchHeader."Prices Including VAT",100); IF "Prepmt Amt to Deduct" > ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"; END; VATPostingSetup."Adv. Invoice Correction Type"::"Fully Invoiced": IF "Qty. to Invoice" = Quantity - "Quantity Invoiced" THEN "Prepmt Amt to Deduct" := "Prepmt. Amt. Inv." - "Prepmt Amt Deducted" ELSE "Prepmt Amt to Deduct" := 0; END; END ELSE "Prepmt Amt to Deduct" := PrepmtAmtToDeduct(PurchHeader."Prices Including VAT","Prepayment %"); END ELSE "Prepmt Amt to Deduct" := 0 // End of the added lines. ...
在「購買行」表 (39) 建立一個新的預付扣款功能,如下:
PROCEDURE PrepmtAmtToDeduct@1470002(PricesIncludingVAT@1470000 : Boolean;PrepaymentPct@1470001 : Decimal) : Decimal; VAR VATPct@1470002 : Decimal; BEGIN IF PricesIncludingVAT THEN VATPct := "VAT %" ELSE VATPct := 0; EXIT( ROUND( ROUND( ROUND( ROUND("Direct Unit Cost" * "Qty. to Invoice",Currency."Amount Rounding Precision") * (1 - ("Line Discount %" / 100)),Currency."Amount Rounding Precision") * (PrepaymentPct / 100) / (1 + (VATPct / 100)),Currency."Amount Rounding Precision") * (1 + (VATPct / 100)),Currency."Amount Rounding Precision")); END;在「銷售-貼文」代碼單元 (80) 中,將 OnRun 觸發器的代碼變更如下:
現有程式碼... ItemJnlRollRndg := FALSE; LineCount := LineCount + 1; Window.UPDATE(2,LineCount); IF Invoice AND (NOT GLSetup."Allow VAT Date Change in Lines") THEN SalesLine."VAT Date" := "VAT Date"; IF SalesLine.Type = SalesLine.Type::"Charge (Item)" THEN BEGIN SalesLine.TESTFIELD(Amount); SalesLine.TESTFIELD("Job No.",''); SalesLine.TESTFIELD("Job Contract Entry No.",0); END; ...替換代碼
... ItemJnlRollRndg := FALSE; LineCount := LineCount + 1; Window.UPDATE(2,LineCount); IF Invoice AND (NOT GLSetup."Allow VAT Date Change in Lines") THEN SalesLine."VAT Date" := "VAT Date"; // Add the following lines. IF Invoice THEN IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN TestPrepmtAmount; // End of the added lines. IF SalesLine.Type = SalesLine.Type::"Charge (Item)" THEN BEGIN SalesLine.TESTFIELD(Amount); SalesLine.TESTFIELD("Job No.",''); SalesLine.TESTFIELD("Job Contract Entry No.",0); END; ...在「銷售-發佈」碼單元 (80) 建立一個新的 TestPrepmtAmount 函式,內容如下:
PROCEDURE TestPrepmtAmount@1470003(); VAR AllowedQtyToShip@1470000 : Decimal; SalesAdvLetterHeader@1470001 : Record 26585; BEGIN WITH SalesLine DO BEGIN IF ("Prepmt. Line Amount" = 0) OR (Quantity = 0) THEN EXIT; SalesAdvLetterHeader.SETRANGE("Order No.","Document No."); IF NOT SalesAdvLetterHeader.ISEMPTY THEN BEGIN AllowedQtyToShip := ROUND( ("Line Amount" - "Prepmt. Line Amount" + "Prepmt. Amt. Inv.") / "Line Amount" * Quantity - "Quantity Invoiced",0.00001); IF "Qty. to Ship" > AllowedQtyToShip THEN FIELDERROR("Qty. to Ship",STRSUBSTNO(Text047,AllowedQtyToShip)); END; END; END;在「Purch.-Post」碼單元中, (90) 的 OnRun 觸發器中更改代碼如下:
現有程式碼... IF GUIALLOWED THEN Window.UPDATE(2,LineCount); IF Invoice AND (NOT GLSetup."Allow VAT Date Change in Lines") THEN PurchLine."VAT Date" := "VAT Date"; IF Invoice THEN TestPrepmtAmount; IF PurchLine.Type = PurchLine.Type::"Charge (Item)" THEN BEGIN PurchLine.TESTFIELD(Amount); PurchLine.TESTFIELD("Job No.",''); END; ...替換代碼
... IF GUIALLOWED THEN Window.UPDATE(2,LineCount); IF Invoice AND (NOT GLSetup."Allow VAT Date Change in Lines") THEN PurchLine."VAT Date" := "VAT Date"; IF Invoice THEN // Add the following line. IF PurchHeader."Prepayment Type" = PurchHeader."Prepayment Type"::Advance THEN TestPrepmtAmount; IF PurchLine.Type = PurchLine.Type::"Charge (Item)" THEN BEGIN PurchLine.TESTFIELD(Amount); PurchLine.TESTFIELD("Job No.",''); END; ...刪除 TestPrepmtAmount 函式,並在「Sales-Post」碼單元 (80) 重新建立,如下:
LOCAL PROCEDURE TestPrepmtAmount@55(); VAR AllowedQtyToReceive@1470000 : Decimal; PurchAdvLetterHeader@147001 : Record 26587; BEGIN WITH PurchLine DO BEGIN IF ("Prepmt. Line Amount" = 0) OR (Quantity = 0) THEN EXIT; PurchAdvLetterHeader.SETRANGE("Order No.","Document No."); IF NOT PurchAdvLetterHeader.ISEMPTY THEN BEGIN AllowedQtyToReceive := ROUND( ("Line Amount" - "Prepmt. Line Amount" + "Prepmt. Amt. Inv.") / "Line Amount" * Quantity - "Quantity Invoiced",0.00001); IF "Qty. to Receive" > AllowedQtyToReceive THEN FIELDERROR("Qty. to Receive",STRSUBSTNO(Text047,AllowedQtyToReceive)); END; END; END;在「核准管理」代碼單元 (439) 中,將 TestSalesPrepayment 函式中的代碼變更如下:
現有程式碼... SalesLines.SETRANGE("Document Type",SalesHeader."Document Type"); SalesLines.SETRANGE("Document No.",SalesHeader."No."); SalesLines.SETFILTER("Prepmt. Line Amount",'<>%1',0); IF SalesLines.FIND('-') THEN BEGIN REPEAT ...替換代碼
... // Add the following lines. IF SalesHeader."Prepayment Type" = SalesHeader."Prepayment Type"::Advance THEN EXIT(IsNotInvoicedSalesAdvLetter(SalesHeader."No.")); // End of the added lines. SalesLines.SETRANGE("Document Type",SalesHeader."Document Type"); SalesLines.SETRANGE("Document No.",SalesHeader."No."); SalesLines.SETFILTER("Prepmt. Line Amount",'<>%1',0); IF SalesLines.FIND('-') THEN BEGIN REPEAT ...在「核准管理」代碼單元 (439) 中,在 TestPurchasePrepayment 功能中更改代碼如下:
現有程式碼... PurchaseLines.SETRANGE("Document Type",PurchaseHeader."Document Type"); PurchaseLines.SETRANGE("Document No.",PurchaseHeader."No."); PurchaseLines.SETFILTER("Prepmt. Line Amount",'<>%1',0); IF PurchaseLines.FIND('-') THEN BEGIN REPEAT ...替換代碼
... // Add the following lines. IF PurchaseHeader."Prepayment Type" = PurchaseHeader."Prepayment Type"::Advance THEN EXIT(IsNotInvoicedPurchAdvLetter(PurchaseHeader."No.")); // End of the added lines. PurchaseLines.SETRANGE("Document Type",PurchaseHeader."Document Type"); PurchaseLines.SETRANGE("Document No.",PurchaseHeader."No."); PurchaseLines.SETFILTER("Prepmt. Line Amount",'<>%1',0); IF PurchaseLines.FIND('-') THEN BEGIN REPEAT ...請在「核准管理」代碼單元 (439) 建立一個新的 IsNotInvoicedSalesAdvLetter 本地函式,內容如下:
LOCAL PROCEDURE IsNotInvoicedSalesAdvLetter@38(SalesOrderNo@1170000000 : Code[30]) : Boolean; VAR SalesAdvLetterHeader@1001 : Record 26585; SalesAdvLetterLine@1002 : Record 26586; BEGIN WITH SalesAdvLetterHeader DO BEGIN SETRANGE("Order No.",SalesOrderNo); IF FIND('-') THEN REPEAT SalesAdvLetterLine.SETRANGE("Letter No.","No."); IF SalesAdvLetterLine.FIND('-') THEN REPEAT IF SalesAdvLetterLine."Amount Including VAT" <> SalesAdvLetterLine."Amount Invoiced" THEN EXIT(TRUE); UNTIL SalesAdvLetterLine.NEXT = 0; UNTIL NEXT = 0; END; END;請在「Approvals Management」代碼單元 (439) 建立一個新的 IsNotInvoicedPurchAdvLetter 本地函式,內容如下:
LOCAL PROCEDURE IsNotInvoicedPurchAdvLetter@39(PurchOrderNo@1170000000 : Code[30]) : Boolean; VAR PurchAdvLetterHeader@1001 : Record 26587; PurchAdvLetterLine@1002 : Record 26588; BEGIN WITH PurchAdvLetterHeader DO BEGIN SETRANGE("Order No.",PurchOrderNo); IF FIND('-') THEN REPEAT PurchAdvLetterLine.SETRANGE("Letter No.","No."); IF PurchAdvLetterLine.FIND('-') THEN REPEAT IF PurchAdvLetterLine."Amount Including VAT" <> PurchAdvLetterLine."Amount Invoiced" THEN EXIT(TRUE); UNTIL PurchAdvLetterLine.NEXT = 0; UNTIL NEXT = 0; END; END;
先決條件
你必須安裝東歐版的 Microsoft Dynamics NAV 2009 R2 才能套用這個熱修正。
移除資訊
你無法移除這個熱修正。
狀態
Microsoft 已確認這是「適用對象」一節中列出的 Microsoft 產品中的問題。
注意本文為 Microsoft 支援單位內部直接建立的「快速發佈」文章。 此處包含的資訊是以其現況提供,用於回應新產生的問題。 由於快速發佈,資料可能包含拼字錯誤,並可能會隨時修訂,不另行通知。 請參閱使用條款以瞭解其他相關考量。