Applies ToDynamics NAV 2009

本文適用於 Microsoft 動態航行點的葡萄牙文 (pt) 語言地區設定。

狀況

假設您設定calc Pmt 光碟的付款折扣類型值。在線條上葡萄牙文版本的 Microsoft 動態航行點 2009年中的 [一般分類帳安裝] 對話方塊中。您會設定為有一個以上的線條與小數位數的採購發票發票折扣。當您計算的採購發票的統計資料時,發票的折扣金額計算不正確。下列產品中,就會發生這個問題︰

  • 葡萄牙文版本的 Microsoft 動態航行點 2009 R2

  • Microsoft 動態航行點 2009 Service Pack 1 (SP1) 的葡萄牙文版本

解決方案

Hotfix 資訊

已經可以從 Microsoft 取得支援的 hotfix。不過,它只被用來修正本文所述的問題。它只適用於發生此特定問題的系統上。此 hotfix 可能會接受其他測試。因此,如果此問題不會嚴重影響,我們建議您等候下一步的 Microsoft 動態航行點 2009 service pack 或包含此 hotfix 的下一個 Microsoft 動態航行點版本。注意 在特殊的情況下,通常會支援呼叫可能已被取消如果技術支援專業人員的 Microsoft 動態及相關的產品所產生的費用會決定某特定更新程式可以解決您的問題。收取支援費用會套用,如果有其他支援問題是,不能限定的特定更新程式。

安裝資訊

Microsoft 會提供程式設計範例僅供說明,而不做任何明示或默示的保證。這包括,但不限於適售性或適合某特定用途之默示擔保責任。本文假設您已相當熟悉使用的我們所示範的程式設計語言以及建立和偵錯程序所使用的工具。Microsoft 技術支援工程師可以協助解釋特定程序的功能。不過,它們不會修改這些範例以提供附加功能或建構程序來滿足您特定需求。注意套用此 hotfix 之前,請確認所有的 Microsoft 動態航行點用戶端使用者會登出系統。這包括 Microsoft 動態航行點應用程式伺服器 (NAS) 服務。您應該是唯一的用戶端使用者已登入,當您實作此 hotfix。若要實作此 hotfix,您必須有開發人員授權。我們建議您在 Windows 登入] 視窗中的色彩,或資料庫登入] 視窗中的使用者帳戶被指派 「 進階 」 的角色識別碼。如果使用者帳戶不能指派為 「 超級 」 的角色識別碼,您必須確認使用者帳戶具有下列權限︰

  • 您將會變更物件的 [修改] 權限。

  • 執行權限的系統物件 ID 5210物件和系統物件 ID 9015物件。

注意您沒有擁有資料存放區的權限,除非您需要執行資料修復。

程式碼變更

注意永遠測試程式碼修正在受控制的環境中才能套用到實際執行電腦的修正程式。若要解決這個問題,請依照下列步驟執行:

  1. 變更銷售 calc 折扣 Codeunit (60) 的CalculateInvoiceDiscount函式中的程式碼如下所示︰現有的程式碼 1

    ...GLAcc@1110002 : Record 15;      BEGIN...

    取代程式碼 1

    ...GLAcc@1110002 : Record 15;// Add the following lines.       TempSalesLineRemainder@1110000 : Record 37;       TotRoundedInvDiscAmt@1110001 : Decimal;       TotRoundedPmtDiscAmt@1110003 : Decimal;// End of the added lines.      BEGIN...

    現有的程式碼 2

    ...GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":// Delete the following lines.SalesLine2."Inv. Discount Amount" :=  ROUND(SalesLine2."Line Amount" * CustInvDisc."Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.",GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":  SalesLine2."Inv. Discount Amount" :=    ROUND(      (SalesLine2."Line Amount" + SalesLine2."Line Discount Amount" ) *      CustInvDisc."Discount %" / 100,0.01);    END;// End of the deleted lines.                  IF GLSetup."Payment Discount Type" =...

    取代程式碼 2

    ...GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":// Add the following lines.BEGIN  TempSalesLineRemainder."Inv. Discount Amount" +=    SalesLine2."Line Amount" * CustInvDisc."Discount %" / 100;  SalesLine2."Inv. Discount Amount" :=    CalcRoundedAmt(TempSalesLineRemainder."Inv. Discount Amount",TotRoundedInvDiscAmt,0.01);END;GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.",GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":BEGIN  TempSalesLineRemainder."Inv. Discount Amount" +=      (SalesLine2."Line Amount" + SalesLine2."Line Discount Amount" ) *      CustInvDisc."Discount %" / 100;  SalesLine2."Inv. Discount Amount" :=    CalcRoundedAmt(TempSalesLineRemainder."Inv. Discount Amount",TotRoundedInvDiscAmt,0.01);END;END;// End of the added lines.                  IF GLSetup."Payment Discount Type" =...

    現有的程式碼 3

    ...GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.":// Delete the following lines.  SalesLine2."Pmt. Disc. Given Amount" :=    ROUND(      (SalesLine2."Line Amount" + SalesLine2."Line Discount Amount")      * SalesHeader."Payment Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":  SalesLine2."Pmt. Disc. Given Amount" :=    ROUND(      (SalesLine2."Line Amount" - SalesLine2."Inv. Discount Amount") *      SalesHeader."Payment Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. + Payment Disc.":  SalesLine2."Pmt. Disc. Given Amount" :=    ROUND(      (SalesLine2."Line Amount" + SalesLine2."Line Discount Amount") *      SalesHeader."Payment Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":  SalesLine2."Pmt. Disc. Given Amount" :=    ROUND(      (SalesLine2."Line Amount" - SalesLine2."Inv. Discount Amount") *      SalesHeader."Payment Discount %" / 100,0.01);// End of the deleted lines.                    END;...

    取代程式碼 3

    ...GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.":// Add the following lines.   BEGIN    TempSalesLineRemainder."Pmt. Disc. Given Amount" +=        (SalesLine2."Line Amount" + SalesLine2."Line Discount Amount" ) *        SalesHeader."Payment Discount %" / 100;    SalesLine2."Pmt. Disc. Given Amount" :=      CalcRoundedAmt(TempSalesLineRemainder."Pmt. Disc. Given Amount",TotRoundedPmtDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":  BEGIN    TempSalesLineRemainder."Pmt. Disc. Given Amount" +=        (SalesLine2."Line Amount" - SalesLine2."Line Discount Amount" ) *        SalesHeader."Payment Discount %" / 100;    SalesLine2."Pmt. Disc. Given Amount" :=      CalcRoundedAmt(TempSalesLineRemainder."Pmt. Disc. Given Amount",TotRoundedPmtDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. + Payment Disc.":  BEGIN    TempSalesLineRemainder."Pmt. Disc. Given Amount" +=        (SalesLine2."Line Amount" + SalesLine2."Line Discount Amount" ) *        SalesHeader."Payment Discount %" / 100;    SalesLine2."Pmt. Disc. Given Amount" :=      CalcRoundedAmt(TempSalesLineRemainder."Pmt. Disc. Given Amount",TotRoundedPmtDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":  BEGIN    TempSalesLineRemainder."Pmt. Disc. Given Amount" +=        (SalesLine2."Line Amount" - SalesLine2."Line Discount Amount" ) *        SalesHeader."Payment Discount %" / 100;    SalesLine2."Pmt. Disc. Given Amount" :=      CalcRoundedAmt(TempSalesLineRemainder."Pmt. Disc. Given Amount",TotRoundedPmtDiscAmt,0.01);  END;// End of the added lines.                    END;...
  2. 建立函式中銷售 calc 折扣 Codeunit (60) 如下所示︰

    PROCEDURE CalcRoundedAmt@1110000(TotAmt@1110000 : Decimal;VAR TotAmtRnded@1110001 : Decimal;AmountRoundingPrecision@1110002 : Decimal) RndAmt : Decimal;BEGINRndAmt := ROUND(TotAmt,AmountRoundingPrecision) - TotAmtRnded;TotAmtRnded := TotAmtRnded + RndAmt;END;
  3. 變更在 [Purch 的CalculateInvoiceDiscount函式中的程式碼-Calc.Discount Codeunit (70),如下所示︰現有的程式碼 1

    ...GLAcc@1110002 : Record 15;      BEGIN...

    取代程式碼 1

    ...GLAcc@1110002 : Record 15;// Add the following lines.TempPurchLineRemainder@1110000 : Record 39;TotRoundedInvDiscAmt@1110001 : Decimal;TotRoundedPmtDiscAmt@1110004 : Decimal;// End of the added lines.      BEGIN...

    現有的程式碼 2

    ...GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":// Delete the following lines.  PurchLine2."Inv. Discount Amount" :=    ROUND(PurchLine2."Line Amount" * VendInvDisc."Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.",GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":    PurchLine2."Inv. Discount Amount" :=      ROUND(        (PurchLine2."Line Amount" + PurchLine2."Line Discount Amount" ) *        VendInvDisc."Discount %" / 100,0.01);// End of the deleted lines.              END;...

    取代程式碼 2

    ...GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":// Add the following lines.  BEGIN    TempPurchLineRemainder."Inv. Discount Amount" +=      PurchLine2."Line Amount" * VendInvDisc."Discount %" / 100;    PurchLine2."Inv. Discount Amount" :=      CalcRoundedAmt(TempPurchLineRemainder."Inv. Discount Amount",TotRoundedInvDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.",GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":  BEGIN    TempPurchLineRemainder."Inv. Discount Amount" +=        (PurchLine2."Line Amount" + PurchLine2."Line Discount Amount" ) *        VendInvDisc."Discount %" / 100;    PurchLine2."Inv. Discount Amount" :=      CalcRoundedAmt(TempPurchLineRemainder."Inv. Discount Amount",TotRoundedInvDiscAmt,0.01);  END;// End of the added lines.              END;...

    現有的程式碼 3

    ...GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.":// Delete the following lines.  PurchLine2."Pmt. Disc. Rcd. Amount" :=    ROUND(      (PurchLine2."Line Amount" + PurchLine2."Line Discount Amount") *      PurchHeader."Payment Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":   PurchLine2."Pmt. Disc. Rcd. Amount" :=     ROUND(       (PurchLine2."Line Amount" - PurchLine2."Inv. Discount Amount") *       PurchHeader."Payment Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. + Payment Disc.":   PurchLine2."Pmt. Disc. Rcd. Amount" :=       ROUND(       (PurchLine2."Line Amount" + PurchLine2."Line Discount Amount") *       PurchHeader."Payment Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":   PurchLine2."Pmt. Disc. Rcd. Amount" :=     ROUND(       (PurchLine2."Line Amount" - PurchLine2."Inv. Discount Amount") *       PurchHeader."Payment Discount %" / 100,0.01);// End of the deleted lines.                     END;...

    取代程式碼 3

    ...GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.":// Add the following lines.  BEGIN    TempPurchLineRemainder."Pmt. Disc. Rcd. Amount" +=        (PurchLine2."Line Amount" + PurchLine2."Line Discount Amount" ) *        PurchHeader."Payment Discount %" / 100;    PurchLine2."Pmt. Disc. Rcd. Amount" :=      CalcRoundedAmt(TempPurchLineRemainder."Pmt. Disc. Rcd. Amount",TotRoundedPmtDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":  BEGIN    TempPurchLineRemainder."Pmt. Disc. Rcd. Amount" +=        (PurchLine2."Line Amount" - PurchLine2."Line Discount Amount" ) *        PurchHeader."Payment Discount %" / 100;    PurchLine2."Pmt. Disc. Rcd. Amount" :=      CalcRoundedAmt(TempPurchLineRemainder."Pmt. Disc. Rcd. Amount",TotRoundedPmtDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. + Payment Disc.":  BEGIN    TempPurchLineRemainder."Pmt. Disc. Rcd. Amount" +=        (PurchLine2."Line Amount" + PurchLine2."Line Discount Amount" ) *        PurchHeader."Payment Discount %" / 100;    PurchLine2."Pmt. Disc. Rcd. Amount" :=      CalcRoundedAmt(TempPurchLineRemainder."Pmt. Disc. Rcd. Amount",TotRoundedPmtDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":  BEGIN    TempPurchLineRemainder."Pmt. Disc. Rcd. Amount" +=        (PurchLine2."Line Amount" - PurchLine2."Line Discount Amount" ) *        PurchHeader."Payment Discount %" / 100;    PurchLine2."Pmt. Disc. Rcd. Amount" :=      CalcRoundedAmt(TempPurchLineRemainder."Pmt. Disc. Rcd. Amount",TotRoundedPmtDiscAmt,0.01);  END;// End of the added lines.                     END;...
  4. 在 [Purch 建立的函式-Calc.Discount Codeunit (70),如下所示︰

    PROCEDURE CalcRoundedAmt@1110000(TotAmt@1110000 : Decimal;VAR TotAmtRnded@1110001 : Decimal;AmountRoundingPrecision@1110002 : Decimal) RndAmt : Decimal;BEGINRndAmt := ROUND(TotAmt,AmountRoundingPrecision) - TotAmtRnded;TotAmtRnded := TotAmtRnded + RndAmt;END;
  5. 變更服務 calc 折扣 Codeunit (5950) 的CalculateInvoiceDiscount函式中的程式碼如下所示︰現有的程式碼 1

    ...GLAcc@1110002 : Record 15;      BEGIN...

    取代程式碼 1

    ...GLAcc@1110002 : Record 15;// Add the following lines.TempServLineRemainder@1110000 : Record 5902;TotRoundedInvDiscAmt@1110001 : Decimal;TotRoundedPmtDiscAmt@1110003 : Decimal;// End of the added lines.      BEGIN...

    現有的程式碼 2

    ...GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":// Delete the following lines.ServiceLine2."Inv. Discount Amount" :=  ROUND(ServiceLine2."Line Amount" * CustInvDisc."Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.",GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":  ServiceLine2."Inv. Discount Amount" :=    ROUND(      (ServiceLine2."Line Amount" + ServiceLine2."Line Discount Amount" ) *      CustInvDisc."Discount %" / 100,0.01);    END;// End of the deleted lines.                  IF GLSetup."Payment Discount Type" =...

    取代程式碼 2

    ...GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":// Add the following lines.BEGINTempServLineRemainder."Inv. Discount Amount" +=ServiceLine2."Line Amount" * CustInvDisc."Discount %" / 100;ServiceLine2."Inv. Discount Amount" :=CalcRoundedAmt(TempServLineRemainder."Inv. Discount Amount",TotRoundedInvDiscAmt,0.01);END;GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.",GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":BEGINTempServLineRemainder."Inv. Discount Amount" +=(ServiceLine2."Line Amount" + ServiceLine2."Line Discount Amount" ) *CustInvDisc."Discount %" / 100;ServiceLine2."Inv. Discount Amount" :=CalcRoundedAmt(TempServLineRemainder."Inv. Discount Amount",TotRoundedInvDiscAmt,0.01);END;END;// End of the added lines.IF GLSetup."Payment Discount Type" =...

    現有的程式碼 3

    ...GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.":// Delete the following lines.  ServiceLine2."Pmt. Disc. Given Amount" :=    ROUND(      (ServiceLine2."Line Amount" + ServiceLine2."Line Discount Amount")      * ServHeader."Payment Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":  ServiceLine2."Pmt. Disc. Given Amount" :=    ROUND(      (ServiceLine2."Line Amount" - ServiceLine2."Inv. Discount Amount") *      ServHeader."Payment Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. + Payment Disc.":  ServiceLine2."Pmt. Disc. Given Amount" :=    ROUND(      (ServiceLine2."Line Amount" + ServiceLine2."Line Discount Amount") *      ServHeader."Payment Discount %" / 100,0.01);GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":  ServiceLine2."Pmt. Disc. Given Amount" :=    ROUND(      (ServiceLine2."Line Amount" - ServiceLine2."Inv. Discount Amount") *      ServHeader."Payment Discount %" / 100,0.01);// End of the deleted lines.                    END;

    取代程式碼 3

    ...GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. + Payment Disc.":// Add the following lines.  BEGIN    TempServLineRemainder."Pmt. Disc. Given Amount" +=        (ServiceLine2."Line Amount" + ServiceLine2."Line Discount Amount" ) *        ServHeader."Payment Discount %" / 100;    ServiceLine2."Pmt. Disc. Given Amount" :=      CalcRoundedAmt(TempServLineRemainder."Pmt. Disc. Given Amount",TotRoundedPmtDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. + Inv. Disc. * Payment Disc.":  BEGIN    TempServLineRemainder."Pmt. Disc. Given Amount" +=        (ServiceLine2."Line Amount" - ServiceLine2."Line Discount Amount" ) *        ServHeader."Payment Discount %" / 100;    ServiceLine2."Pmt. Disc. Given Amount" :=      CalcRoundedAmt(TempServLineRemainder."Pmt. Disc. Given Amount",TotRoundedPmtDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. + Payment Disc.":  BEGIN    TempServLineRemainder."Pmt. Disc. Given Amount" +=        (ServiceLine2."Line Amount" + ServiceLine2."Line Discount Amount" ) *        ServHeader."Payment Discount %" / 100;    ServiceLine2."Pmt. Disc. Given Amount" :=      CalcRoundedAmt(TempServLineRemainder."Pmt. Disc. Given Amount",TotRoundedPmtDiscAmt,0.01);  END;GLSetup."Discount Calculation"::"Line Disc. * Inv. Disc. * Payment Disc.":  BEGIN    TempServLineRemainder."Pmt. Disc. Given Amount" +=        (ServiceLine2."Line Amount" - ServiceLine2."Line Discount Amount" ) *        ServHeader."Payment Discount %" / 100;    ServiceLine2."Pmt. Disc. Given Amount" :=      CalcRoundedAmt(TempServLineRemainder."Pmt. Disc. Given Amount",TotRoundedPmtDiscAmt,0.01);  END;// End of the added lines.                    END;...
  6. 建立函式中服務 calc 折扣 Codeunit (5950) 如下所示︰

    PROCEDURE CalcRoundedAmt@1110000(TotAmt@1110000 : Decimal;VAR TotAmtRnded@1110001 : Decimal;AmountRoundingPrecision@1110002 : Decimal) RndAmt : Decimal;BEGIN  RndAmt := ROUND(TotAmt,AmountRoundingPrecision) - TotAmtRnded;  TotAmtRnded := TotAmtRnded + RndAmt;END;

先決條件

您必須具備套用此 hotfix 之後安裝下列產品的其中一個︰

  • 葡萄牙文版本的 Microsoft 動態航行點 2009 R2

  • 葡萄牙文版本的 Microsoft 動態航行點 2009 Service Pack 1

移除資訊

您無法移除此 hotfix。

狀態

Microsoft 已確認這是<套用>一節所列出的 Microsoft 產品的問題。

注意這是直接從 Microsoft 支援組織內建立的「快速發行」文件。本文件所包含的現狀資訊是針對新興問題的回應。為縮短使其可用的時程,資料可能會包含印刷錯誤,且可能會隨時進行修改而不另行通知。如其他考量,請參閱 「使用規定」。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。