-
Notifications
You must be signed in to change notification settings - Fork 387
[E-Documents Core] [Peppol] - Enabling EDI capabilities with E-Documents. PEPPOL Order Response Message Handling #8698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,6 +68,10 @@ | |
| { | ||
| "from": 6401, | ||
| "to": 6410 | ||
| }, | ||
| { | ||
| "from": 6427, | ||
| "to": 6436 | ||
| } | ||
| ], | ||
| "resourceExposurePolicy": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,13 +10,16 @@ using Microsoft.eServices.EDocument.OrderMatch; | |||||||||||||||||||
| using Microsoft.EServices.EDocument.Processing; | ||||||||||||||||||||
| using Microsoft.eServices.EDocument.Processing.Import; | ||||||||||||||||||||
| using Microsoft.eServices.EDocument.Processing.Import.Purchase; | ||||||||||||||||||||
| using Microsoft.eServices.EDocument.Processing.Interfaces; | ||||||||||||||||||||
| using Microsoft.eServices.EDocument.Processing.Message; | ||||||||||||||||||||
| using Microsoft.eServices.EDocument.Service.Participant; | ||||||||||||||||||||
| using Microsoft.Finance.GeneralLedger.Journal; | ||||||||||||||||||||
| using Microsoft.Finance.GeneralLedger.Ledger; | ||||||||||||||||||||
| using Microsoft.Finance.GeneralLedger.Posting; | ||||||||||||||||||||
| using Microsoft.Finance.VAT.Setup; | ||||||||||||||||||||
| using Microsoft.Foundation.Reporting; | ||||||||||||||||||||
| using Microsoft.Inventory.Transfer; | ||||||||||||||||||||
| using Microsoft.Peppol.Response; | ||||||||||||||||||||
| using Microsoft.Purchases.Document; | ||||||||||||||||||||
| using Microsoft.Purchases.History; | ||||||||||||||||||||
| using Microsoft.Purchases.Posting; | ||||||||||||||||||||
|
|
@@ -744,4 +747,27 @@ codeunit 6103 "E-Document Subscribers" | |||||||||||||||||||
| local procedure OnAfterUpdateToPostedPurchaseEDocument(var EDocument: Record "E-Document"; PostedRecord: Variant; PostedDocumentNo: Code[20]; DocumentType: Enum "E-Document Type") | ||||||||||||||||||||
| begin | ||||||||||||||||||||
| end; | ||||||||||||||||||||
|
|
||||||||||||||||||||
| [EventSubscriber(ObjectType::Codeunit, Codeunit::"Release Sales Document", 'OnAfterReleaseSalesDoc', '', false, false)] | ||||||||||||||||||||
| local procedure OnAfterReleaseSalesDoc(var SalesHeader: Record "Sales Header"; PreviewMode: Boolean; var LinesWereModified: Boolean; SkipWhseRequestOperations: Boolean) | ||||||||||||||||||||
| var | ||||||||||||||||||||
| EDocument: Record "E-Document"; | ||||||||||||||||||||
| EDocMessageMgt: Codeunit "E-Doc. Message Mgt."; | ||||||||||||||||||||
| ResponseBlob: Codeunit "Temp Blob"; | ||||||||||||||||||||
| SalesHeaderRef: RecordRef; | ||||||||||||||||||||
| IResponseBuilder: Interface IOrderResponseBuilder; | ||||||||||||||||||||
| begin | ||||||||||||||||||||
| if PreviewMode then | ||||||||||||||||||||
| exit; | ||||||||||||||||||||
| SalesHeaderRef.GetTable(SalesHeader); | ||||||||||||||||||||
| EDocument.SetRange("Document Record ID", SalesHeaderRef.RecordId); | ||||||||||||||||||||
| EDocument.SetRange(Direction, EDocument.Direction::Incoming); | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FindLast() skips all but last linked EDocument
Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||||||||||||||
| if not EDocument.FindLast() then | ||||||||||||||||||||
| exit; | ||||||||||||||||||||
| IResponseBuilder := EDocument."Read into Draft Impl."; | ||||||||||||||||||||
| if not IResponseBuilder.SupportsOrderResponse(EDocument) then | ||||||||||||||||||||
| exit; | ||||||||||||||||||||
| IResponseBuilder.BuildOrderResponse(EDocument, "E-Doc. Response Type"::Accepted, ResponseBlob); | ||||||||||||||||||||
| EDocMessageMgt.CreateMessage(EDocument, "E-Document Message Type"::"PEPPOL Order Response", "E-Document Direction"::Outgoing, "E-Doc. Response Type"::Accepted, ResponseBlob); | ||||||||||||||||||||
| end; | ||||||||||||||||||||
| } | ||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,4 +51,5 @@ codeunit 6193 "E-Doc. Empty Draft" implements IStructureReceivedEDocument, IStru | |
| begin | ||
| Error(NoDataErr); | ||
| end; | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,6 +5,7 @@ | |||||||||||||||||||||||||||
| namespace Microsoft.eServices.EDocument.Processing.Import; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| using Microsoft.eServices.EDocument.Processing.Interfaces; | ||||||||||||||||||||||||||||
| using Microsoft.eServices.EDocument.Processing.Message; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| /// <summary> | ||||||||||||||||||||||||||||
| /// Enum for E-Document Processing | ||||||||||||||||||||||||||||
|
|
@@ -33,4 +34,14 @@ enum 6107 "E-Doc. Process Draft" implements IProcessStructuredData | |||||||||||||||||||||||||||
| Caption = 'Purchase Credit Memo'; | ||||||||||||||||||||||||||||
| Implementation = IProcessStructuredData = "EDoc Prepare Cr. Memo Draft"; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| value(3; "Sales Order") | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| Caption = 'Sales Order'; | ||||||||||||||||||||||||||||
| Implementation = IProcessStructuredData = "Prepare Sales E-Doc. Draft"; | ||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing implementation codeunit breaks compileThe Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| value(4; "E-Document Message") | ||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets no do messages as drafts. Drafts are for users to be able to edit before documents are created. |
||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| Caption = 'E-Document Message'; | ||||||||||||||||||||||||||||
| Implementation = IProcessStructuredData = "E-Doc. Message Draft Handler"; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sales release subscriber queries DB unconditionally
OnAfterReleaseSalesDocfires on every Sales Document release and immediately executes twoSetRangecalls plus aFindLast()against the E-Document table, even when the E-Document feature is not in use. This adds measurable overhead to every Sales Order release across all companies.Recommendation:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why