この資料は、ポルトガル語 (pt) の言語のロケールには、Microsoft Dynamics NAV に適用されます。
現象
計算済の定期支払額のディスクをに支払の割引の種類の値を設定することを想定しています。行Microsoft Dynamics NAV 2009 年のポルトガル語版の総勘定元帳設定] ダイアログ ボックスでします。小数点以下の桁数を 1 つ以上の行がある購買の請求書の請求書の割引を設定するとします。仕入請求書の統計情報を計算すると、請求書の割引金額が正しく計算されません。
この問題は、次の製品で発生します。
-
Microsoft Dynamics NAV 2009 の R2 のポルトガル語版
-
ポルトガル語バージョンの Microsoft Dynamics NAV 2009 サービス パック 1 (SP1)
解決策
修正プログラムの情報
サポートされている修正プログラムはマイクロソフトから現在入手可能です。ただし、この資料に記載されている問題を解決するためのものはのみ。この特定の問題が発生したシステムにのみ適用してください。この修正プログラムは、今後さらにテストを行うことがあります。この問題で深刻な影響を受けていない場合は、次の Microsoft Dynamics NAV 2009 サービス パックまたは修正プログラムを含む次の Microsoft Dynamics NAV バージョン待つことを勧めします。
注: かかる料金が免除されるテクニカル サポート担当者 Microsoft Dynamics および関連製品のことは、通常は特別な場合は、特定の更新プログラムは、問題を解決するにを決定します。追加の質問および問題の特定のアップデートの対象にはなりませんが、通常のサポート料金が適用されます。
インストール情報
マイクロソフトでは解説することのみを目的としてプログラミング例を提供しています。暗示あるいは明示していることに対しての保証はしておりません。ここで言う保証とは、特定の目的に対する商品性や適合性の暗示的保証を含んでいますが、それに限定されるわけではありません。この資料では、例示されているプログラミング言語およびプロシージャの作成やデバッグに使用するツールにお客様が精通していることを前提としています。マイクロソフトのサポート エンジニアは、特定のプロシージャの機能について説明することができます。ただし、お客様固有の要件を満たすために、追加機能の提供またはプロシージャの作成のために、これらの例に変更を加えたりはしません。
注: この修正プログラムをインストールする前に、Microsoft Dynamics NAV のすべてのクライアント ユーザーがシステムの電源を記録することを確認します。これには、Microsoft Dynamics NAV アプリケーション サーバー (NAS) のサービスが含まれます。この修正プログラムを実装すると、ログオンしている唯一のクライアント ユーザーが必要です。
この修正プログラムを実装するには、開発者用のライセンスが必要です。
ユーザー アカウントまたはデータベース ログイン ウィンドウに Windows のログイン ウィンドウにある「スーパー」ロール id を割り当てられていることをお勧めします。ユーザー アカウントには、「スーパー」ロール ID を割り当てることができません、する場合は、ユーザー アカウントが次のアクセス許可を持っているを確認する必要があります。
-
変更するオブジェクトの変更のアクセス許可。
-
実行のアクセス許可、システム オブジェクトの ID 5210オブジェクトおよびシステム オブジェクトの ID 9015
オブジェクトです。
注: データの修復を実行する必要があるない限り、データ ストアへの権限を持っている必要はありません。
コードの変更
注: 常にテスト コードを修正、管理された環境で適用する前に、運用コンピューターに修正プログラムします。
この問題を解決するには、次の手順を実行します。
-
計算済の販売割引 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;
... -
計算済の販売割引 Codeunit (60) で次のように関数を作成します。
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; -
購買の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;
... -
購買の関数を作成する-次のように Calc.Discount Codeunit (70)。
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; -
サービスの計算済の割引 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.
BEGIN
TempServLineRemainder."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.":
BEGIN
TempServLineRemainder."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;
... -
サービスの計算済の割引 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;
必要条件
この修正プログラムを適用するのにはインストールされている製品は次のいずれかが必要です。
-
Microsoft Dynamics NAV 2009 の R2 のポルトガル語版
-
ポルトガル語バージョンの Microsoft Dynamics NAV 2009 サービス パック 1
アンインストール情報
この修正プログラムを削除することはできません。
状況
マイクロソフトは、この問題を「対象製品」セクションに記載されているマイクロソフト製品の問題として認識しています。
注: これは、マイクロソフト サポートの組織内から直接作成した「高速公開」の資料です。ここに含まれる情報は、新たに発生している問題に応じて現状のまま提供されています。速やかに利用できるようにした結果として、内容には誤植が含まれている可能性があり、事前告知なしで改訂する場合があります。その他の考慮事項については、使用条件を参照してください。