[IT][Event Request][Codeunit][12173] "Vendor Bill List - Post" - Function PostVendorBillLine() & Function PostBalanceAccount()
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 66/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- backend
調査の方向性
Codeunit 12173 "Vendor Bill List - Post" を開き、手続き PostVendorBillLine() と PostBalanceAccount() を特定してください。issue に記載されているとおりに 2 つの [IntegrationEvent(false, false)] 宣言を正確に追加し、変数 IsHandled を導入した上で、Gen. Journal Line の初期化ブロックを if not IsHandled then begin ... end; で囲ってください。既存の OnBefore* イベントと GenJnlPostLine.RunWithCheck の呼び出しはガードの外に配置したままにしてください。完了条件は、AL パッケージがコンパイルでき、新しいイベントが拡張機能から呼び出せることです。なお、これは Microsoft 所有のリポジトリであり、拡張性の要求はトリアージされるため、時間を投資する前にメンテナンス担当者が変更を受け入れるかどうかを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Why do you need this change?
Hello,
We would need new events in the "PostVendorBillLine" and "PostBalanceAccount" procedures of Codeunit 12173 "Vendor Bill List - Post", in order to manage custom fields.
New Events and Code:
procedure PostVendorBillLine(var GenJnlLine: Record "Gen. Journal Line"; VendorBillHeader: Record "Vendor Bill Header"; VendorBillLine: Record "Vendor Bill Line"; VendLedgEntry: Record "Vendor Ledger Entry"; Bill: Record Bill; var AmountLCY: Decimal)
var
Tax: Option " ",Withhold,"Free Lance",Company;
//New Variable
IsHandled: Boolean;
begin
GenJnlLine.Init();
//New Code
IsHandled:=False;
OnAfterInitGenJnlLineOnPostVendorBillLine(GenJnlLine,VendorBillHeader,VendorBillLine,VendLedgEntry,Bill,AmountLCY,IsHandled);
if not IsHandled then begin
//
GenJnlLine.Validate("Posting Date", VendorBillHeader."Posting Date");
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;
GenJnlLine."Document No." := VendorBillHeader."Vendor Bill List No.";
GenJnlLine."Document Date" := VendorBillHeader."List Date";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::Vendor;
GenJnlLine.Validate("Account No.", VendorBillLine."Vendor No.");
GenJnlLine."Due Date" := VendorBillLine."Due Date";
GenJnlLine."External Document No." := VendorBillLine."Vendor Bill List No.";
GenJnlLine.Validate(Amount, VendorBillLine."Amount to Pay");
GenJnlLine.Validate("Currency Code", VendorBillHeader."Currency Code");
if not VendorBillLine."Manual Line" then begin
GenJnlLine.Validate("Salespers./Purch. Code", VendLedgEntry."Purchaser Code");
ApplyInvAndUpdateLedgEntry(GenJnlLine, VendorBillLine, Tax::" ");
end else
GenJnlLine."Applies-to Occurrence No." := VendorBillLine."Document Occurrence";
GenJnlLine.Description := Bill.Description;
GenJnlLine."Source Code" := Bill."Vend. Bill Source Code";
GenJnlLine."System-Created Entry" := true;
GenJnlLine."Reason Code" := VendorBillHeader."Reason Code";
GenJnlLine."Shortcut Dimension 1 Code" := VendLedgEntry."Global Dimension 1 Code";
GenJnlLine."Shortcut Dimension 2 Code" := VendLedgEntry."Global Dimension 2 Code";
if not VendorBillLine."Manual Line" then
GenJnlLine."Dimension Set ID" := VendLedgEntry."Dimension Set ID"
else
GenJnlLine."Dimension Set ID" := VendorBillLine."Dimension Set ID";
GenJnlLine."Payment Method Code" := VendorBillHeader."Payment Method Code";
AmountLCY := GenJnlLine."Amount (LCY)";
//New Code
end;
//
OnBeforePostVendorBillLine(GenJnlLine, VendorBillHeader, VendorBillLine, VendLedgEntry);
GenJnlPostLine.RunWithCheck(GenJnlLine);
end;
procedure PostBalanceAccount(GenJnlLine: Record "Gen. Journal Line"; VendorBillHeader: Record "Vendor Bill Header"; VendorBillLine: Record "Vendor Bill Line"; VendLedgEntry: Record "Vendor Ledger Entry"; Bill: Record Bill)
var
IsHandled:Boolean;
begin
GenJnlLine.Init();
//New Code
IsHandled:=False; OnAfterInitGenJnlLineOnPostBalanceAccount(GenJnlLine,VendorBillHeader,VendorBillLine,VendLedgEntry,Bill,IsHandled);
if not IsHandled then begin
//
GenJnlLine.Validate("Posting Date", VendorBillHeader."Posting Date");
GenJnlLine."Document Type" := GenJnlLine."Document Type"::Payment;
GenJnlLine."Document No." := VendorBillHeader."Vendor Bill List No.";
GenJnlLine."Document Date" := VendorBillHeader."List Date";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::"Bank Account";
GenJnlLine.Validate("Account No.", VendorBillHeader."Bank Account No.");
GenJnlLine."Currency Code" := VendorBillHeader."Currency Code";
GenJnlLine.Validate(Amount, -BalanceAmount);
GenJnlLine.Validate("Amount (LCY)", -BalanceAmountLCY);
GenJnlLine.Description := Bill.Description;
GenJnlLine."Source Code" := Bill."Vend. Bill Source Code";
GenJnlLine."System-Created Entry" := true;
GenJnlLine."Reason Code" := VendorBillHeader."Reason Code";
if not VendorBillLine."Manual Line" then
GenJnlLine.Validate("Salespers./Purch. Code", VendLedgEntry."Purchaser Code");
GenJnlLine."Shortcut Dimension 1 Code" := VendLedgEntry."Global Dimension 1 Code";
GenJnlLine."Shortcut Dimension 2 Code" := VendLedgEntry."Global Dimension 2 Code";
if not VendorBillLine."Manual Line" then
GenJnlLine."Dimension Set ID" := VendLedgEntry."Dimension Set ID"
else
GenJnlLine."Dimension Set ID" := VendorBillLine."Dimension Set ID";
//New Code
end;
//
GenJnlLine.CreateDimFromDefaultDim(GenJnlLine.FieldNo("Account No."));
OnBeforePostBalanceAccount(GenJnlLine, VendorBillHeader, VendorBillLine, VendLedgEntry);
GenJnlPostLine.RunWithCheck(GenJnlLine);
end;
Signature:
[IntegrationEvent(false, false)]
OnAfterInitGenJnlLineOnPostVendorBillLine(var GenJnlLine: Record "Gen. Journal Line"; VendorBillHeader: Record "Vendor Bill Header"; VendorBillLine: Record "Vendor Bill Line"; VendLedgEntry: Record "Vendor Ledger Entry"; Bill: Record Bill; var AmountLCY: Decimal;var IsHandled:Boolean)
begin
end;
[IntegrationEvent(false, false)]
OnAfterInitGenJnlLineOnPostBalanceAccount(GenJnlLine: Record "Gen. Journal Line"; VendorBillHeader: Record "Vendor Bill Header"; VendorBillLine: Record "Vendor Bill Line"; VendLedgEntry: Record "Vendor Ledger Entry"; Bill: Record Bill;var IsHandled:Boolean)
begin
end;
Thank You,
Luca
Describe the request
We need this events to be able to manage custom fields on the Line Insert procedures, and we need to manage the validate triggers of the fields.
This request is a follow-up to an issue opened about a year ago. The requested change has not yet been implemented in the Business Central Base Application.
For reference, please see the previous discussion: https://github.com/microsoft/ALAppExtensions/issues/29093#issuecomment-3883244614
Provide an implementation (optional)
- I will provide the implementation for this extensibility request
- 主要言語
- AL
- スター
- 714
- フォーク
- 482
- 平均マージ
- 3日 1時間
- マージ済み PR(30日)
- 541
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/BCApps のほかの issue
-
Team: SCM
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
microsoft/BCApps#13250 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Deliv.-Rem. Ext. Text Transfer: OnAfterReadLines will never be reached due to exit(true)オープンTeam: Finance
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/BCApps#13205 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: FI reference payment matching scans Cust. Ledger Entry because "Reference No." has no key対応中かも @AndersLarsenMicrosoft が 4 日前に担当しました。 オープンApproved Team: Finance
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/BCApps#13101 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Team: Finance
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/BCApps#13082 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Imported Subscription Line processing misses two fields対応中かも @AndersLarsenMicrosoft が 4 日前に担当しました。 オープンApproved Team: Finance
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
microsoft/BCApps#13004 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
microsoft/BCApps の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug P1
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Toloka/tolokaforge#1947 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
-
area:io kernel-paused needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bherbruck/solvecraft#7854 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信