-
Notifications
You must be signed in to change notification settings - Fork 356
Description
BC Idea Link
microsoft/ALAppExtensions#29824
Description
Why do you need this change?
We would like to cover 2 case by this request:
The event is required to comply with PEPPOL requirements. Situations where a credit note is posted without being applied to a specific sales invoice are common, so we cannot populate Applies-to Doc. No. As a result, the UBL PEPPOL InvoiceDocumentReference tag remains empty, which causes a validation error on our providers. Therefore, we need the ability to populate this tag with the value dummy value NA.
The event is required to comply with PEPPOL requirements. Situations exist where special payment conditions are determined by business rules not directly related to the standard Payment Terms setup. For example, customer-specific payment arrangements, contractual agreements, or regulatory requirements may mandate specific payment notes that cannot be derived from the Payment Terms Code alone. As a result, the PaymentTerms field may need to contain custom text that differs from the standard Payment Terms.
Describe the request
Dear team,
On behalf of 4PS, I would like to implement the following integration events:
- in the codeunit
37201 "PEPPOL30 Impl.":OnAfterGetCrMemoBillingReferenceInfo - in the codeunit
37201 "PEPPOL30 Impl.":OnAfterGetPaymentTermsInfo
It's part of PEPPOL app:
"id": "e1966889-b5fb-4fda-a84c-ea71b590e1a9",
"publisher": "Microsoft",
"version": "28.0.46665.47420",
"name": "PEPPOL"
Codeunit 37201 "PEPPOL30 Impl.": OnAfterGetCrMemoBillingReferenceInfo
Current code
procedure GetCrMemoBillingReferenceInfo(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var InvoiceDocRefID: Text; var InvoiceDocRefIssueDate: Text)
var
SalesInvoiceHeader: Record "Sales Invoice Header";
begin
if (SalesCrMemoHeader."Applies-to Doc. Type" = SalesCrMemoHeader."Applies-to Doc. Type"::Invoice) and
SalesInvoiceHeader.Get(SalesCrMemoHeader."Applies-to Doc. No.")
then begin
InvoiceDocRefID := SalesInvoiceHeader."No.";
InvoiceDocRefIssueDate := Format(SalesInvoiceHeader."Posting Date", 0, 9);
end;
end;
Suggested code
procedure GetCrMemoBillingReferenceInfo(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var InvoiceDocRefID: Text; var InvoiceDocRefIssueDate: Text)
var
SalesInvoiceHeader: Record "Sales Invoice Header";
begin
if (SalesCrMemoHeader."Applies-to Doc. Type" = SalesCrMemoHeader."Applies-to Doc. Type"::Invoice) and
SalesInvoiceHeader.Get(SalesCrMemoHeader."Applies-to Doc. No.")
then begin
InvoiceDocRefID := SalesInvoiceHeader."No.";
InvoiceDocRefIssueDate := Format(SalesInvoiceHeader."Posting Date", 0, 9);
end;
OnAfterGetCrMemoBillingReferenceInfo(SalesCrMemoHeader, InvoiceDocRefID, InvoiceDocRefIssueDate); // <-- New event
end;
[IntegrationEvent(false, false)]
local procedure OnAfterGetCrMemoBillingReferenceInfo(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var InvoiceDocRefID: Text; var InvoiceDocRefIssueDate: Text)
begin
end;
Codeunit 37201 "PEPPOL30 Impl.": OnAfterGetPaymentTermsInfo
Current code
procedure GetPaymentTermsInfo(SalesHeader: Record "Sales Header"; var PaymentTermsNote: Text)
var
PmtTerms: Record "Payment Terms";
begin
if SalesHeader."Payment Terms Code" = '' then
PmtTerms.Init()
else begin
PmtTerms.Get(SalesHeader."Payment Terms Code");
PmtTerms.TranslateDescription(PmtTerms, SalesHeader."Language Code");
end;
PaymentTermsNote := PmtTerms.Description;
end;
Suggested code
procedure GetPaymentTermsInfo(SalesHeader: Record "Sales Header"; var PaymentTermsNote: Text)
var
PmtTerms: Record "Payment Terms";
begin
if SalesHeader."Payment Terms Code" = '' then
PmtTerms.Init()
else begin
PmtTerms.Get(SalesHeader."Payment Terms Code");
PmtTerms.TranslateDescription(PmtTerms, SalesHeader."Language Code");
end;
PaymentTermsNote := PmtTerms.Description;
OnAfterGetPaymentTermsInfo(SalesHeader, PaymentTermsNote); // <-- New event
end;
[IntegrationEvent(false, false)]
local procedure OnAfterGetPaymentTermsInfo(SalesHeader: Record "Sales Header"; var PaymentTermsNote: Text)
begin
end;
I will provide the implementation for this BC Idea
- I will provide the implementation for this BC Idea