Sending Extensibility

The LS Central connector generates PEPPOL BIS 3.0 XML from LS Retail POS transactions — not from Sales Invoices or Sales Credit Memos. The source records are LSC Transaction Header and LSC Trans. Sales Entry. Two XMLports handle the export:

XMLportObject IDDocument type
CTALSC Transaction Invoice72676624POS transaction invoice (type code 380)
CTALSC Transaction Credit Memo72676625POS transaction credit memo (type code 381)

Both XMLports delegate to Codeunit “CTALSC PEPPOL Helper” (72676627) for LS-specific data retrieval, and to the standard Codeunit “PEPPOL Management” (1605) for shared PEPPOL logic. This means extension points exist at two levels: CTALSC PEPPOL Helper events for LS-specific fields, and standard PEPPOL Management events for shared XML sections.

These XMLports operate on POS transaction data. Standard BC Sales Invoice events (such as those on RSMSTA SalesInvPEPPOLBIS3.0) do not apply here. Subscribe to the events listed on this page instead.


Public procedures

Call these on the XMLport instance before running it.

Both XMLports

ProcedurePurpose
SetGeneratePDF(GeneratePDFValue: Boolean)Controls whether a PDF is generated alongside the XML

Invoice only

ProcedurePurpose
SetDueDate(DueDate: Date)Overrides the due date on the invoice
GetDueDate(): DateRetrieves the currently set due date

CTALSC PEPPOL Helper events

All events below are published by Codeunit “CTALSC PEPPOL Helper” (72676627). Each field has a Before/After pair — use OnBefore with IsHandled := true to fully replace the default logic, or OnAfter to modify the value after default logic runs.

Document header

AccountingCost

EventParameters
OnBeforeGetAccountingCostHeaderTransHeader: Record "LSC Transaction Header"; var returnVar: Text; var IsHandled: Boolean
OnAfterGetAccountingCostHeaderTransHeader: Record "LSC Transaction Header"; var returnVar: Text

Note — member info

EventParameters
OnBeforeGetMemberInfoTransHeader: Record "LSC Transaction Header"; var returnVar: Text; var IsHandled: Boolean
OnAfterOnBeforeGetMemberInfoTransHeader: Record "LSC Transaction Header"; var returnVar: Text

ContractDocumentReference/ID (Invoice only)

EventParameters
OnBeforeGetContractDocumentReferenceInfoTransHeader: Record "LSC Transaction Header"; var ContractDocumentReferenceID: Text; var IsHandled: Boolean
OnAfterGetContractDocumentReferenceInfoTransHeader: Record "LSC Transaction Header"; var ContractDocumentReferenceID: Text

PEPPOL Management events

Because both XMLports call PEPPOL Management (codeunit 1605) for shared XML sections, standard PEPPOL Management integration events also fire during LS Central document generation. Subscribe to these to override the relevant XML sections.

The subscriber receives a SalesHeader record that has been populated by transferring fields from the LSC Transaction Header. You are modifying output text values — do not attempt to re-read the transaction from the SalesHeader record directly.

Document header

OnAfterGetGeneralInfo — Note, TaxPointDate, AccountingCost, InvoiceTypeCode

[EventSubscriber(ObjectType::Codeunit, Codeunit::"PEPPOL Management",
    'OnAfterGetGeneralInfo', '', false, false)]
local procedure SetTransactionNote(
    SalesHeader: Record "Sales Header";
    var ID: Text; var IssueDate: Text; var InvoiceTypeCode: Text;
    var Note: Text; var TaxPointDate: Text;
    var DocumentCurrencyCode: Text; var AccountingCost: Text)
begin
    // Note and AccountingCost for POS transaction documents
    TaxPointDate := Format(SalesHeader."Posting Date", 0, 9);
end;

OnAfterGetOrderReferenceInfo

Override OrderReference/ID — by default set from External Document No. on the transaction header.

OnAfterGetContractDocRefInfo

Override ContractDocumentReference/ID and related fields.

OnAfterGetAdditionalDocRefInfo

Add or modify AdditionalDocumentReference entries (attachments, URIs).


Supplier party

OnAfterGetAccountingSupplierPartyInfoByFormat — EndpointID, SchemeID

[EventSubscriber(ObjectType::Codeunit, Codeunit::"PEPPOL Management",
    'OnAfterGetAccountingSupplierPartyInfoByFormat', '', false, false)]
local procedure SetSupplierEndpoint(
    var SupplierEndpointID: Text; var SupplierSchemeID: Text;
    var SupplierName: Text; IsBISBilling: Boolean)
begin
    if IsBISBilling and (SupplierSchemeID = '') then begin
        SupplierEndpointID := '5012345678901';
        SupplierSchemeID := '0088';
    end;
end;

OnAfterGetAccountingSupplierPartyLegalEntityByFormat

Override RegistrationName, CompanyID, and schemeID in PartyLegalEntity.

OnAfterGetAccountingSupplierPartyContact

Override contact name, telephone, fax, and email for the supplier.


Customer party

OnAfterGetAccountingCustomerPartyInfoByFormat — EndpointID, SchemeID

[EventSubscriber(ObjectType::Codeunit, Codeunit::"PEPPOL Management",
    'OnAfterGetAccountingCustomerPartyInfoByFormat', '', false, false)]
local procedure OverrideCustomerEndpoint(
    SalesHeader: Record "Sales Header";
    var CustomerEndpointID: Text; var CustomerSchemeID: Text;
    var CustomerPartyIdentificationID: Text;
    var CustomerPartyIDSchemeID: Text; var CustomerName: Text;
    IsBISBilling: Boolean)
begin
    // CustomerEndpointID is populated from the LSC Transaction customer
end;

OnAfterGetAccountingCustomerPartyLegalEntityByFormat

Override RegistrationName, CompanyID, and schemeID in the customer PartyLegalEntity.

OnAfterGetAccountingCustomerPartyContact

Override customer contact name, telephone, fax, and email.


Credit note lines

OnAfterGetLineGeneralInfo — Note, quantity, extension amount, AccountingCost

The primary hook for writing <cbc:Note> on each CreditNoteLine. The source record is LSC Trans. Sales Entry transferred into a Sales Line.

[EventSubscriber(ObjectType::Codeunit, Codeunit::"PEPPOL Management",
    'OnAfterGetLineGeneralInfo', '', false, false)]
local procedure SetCreditNoteLineNote(
    SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header";
    var InvoiceLineID: Text; var InvoiceLineNote: Text;
    var InvoicedQuantity: Text; var InvoiceLineExtensionAmount: Text;
    var InvoiceLineAccountingCost: Text)
begin
    InvoiceLineNote := '';  // suppress default line-type value
    InvoiceLineAccountingCost := SalesLine."Job No.";
end;

OnAfterGetLineItemInfo — Description, Name, item identifiers

[EventSubscriber(ObjectType::Codeunit, Codeunit::"PEPPOL Management",
    'OnAfterGetLineItemInfo', '', false, false)]
local procedure EnrichLineItemInfo(
    SalesLine: Record "Sales Line";
    var Description: Text; var Name: Text;
    var SellersItemIdentificationID: Text;
    var StandardItemIdentificationID: Text; var StdItemIdIDSchemeID: Text;
    var OriginCountryIdCode: Text; var OriginCountryIdCodeListID: Text)
begin
    // SellersItemIdentificationID is set to the POS item number by default
end;

OnAfterGetLinePriceInfo — Unit price, unit code

[EventSubscriber(ObjectType::Codeunit, Codeunit::"PEPPOL Management",
    'OnAfterGetLinePriceInfo', '', false, false)]
local procedure AdjustLineUnitCode(
    SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header";
    var InvoiceLinePriceAmount: Text;
    var BaseQuantity: Text; var UnitCode: Text)
begin
    if UnitCode = '' then
        UnitCode := 'EA';
end;

Tax

OnAfterGetTaxTotalInfo

Modify the aggregate <cbc:TaxAmount> after it is calculated from the POS transaction VAT lines.

OnAfterGetTaxSubtotalInfo

Modify individual TaxSubtotal fields: taxable amount, tax amount, category ID, percent, scheme ID.

OnGetTotalsOnBeforeInsertVATAmtLine

Intercept each VAT amount line before it is inserted into the aggregation table. Set IsHandled := true to replace the standard insert entirely.

[EventSubscriber(ObjectType::Codeunit, Codeunit::"PEPPOL Management",
    'OnGetTotalsOnBeforeInsertVATAmtLine', '', false, false)]
local procedure OverrideTaxCategory(
    SalesLine: Record "Sales Line";
    var VATAmtLine: Record "VAT Amount Line";
    VATPostingSetup: Record "VAT Posting Setup";
    var IsHandled: Boolean)
begin
    if SalesLine."VAT Bus. Posting Group" = 'EU' then
        VATAmtLine."Tax Category" := 'AE';
end;

OnAfterGetLegalMonetaryInfoWithInvRounding

Modify the LegalMonetaryTotal block fields: LineExtensionAmount, TaxExclusiveAmount, TaxInclusiveAmount, AllowanceTotalAmount, PrepaidAmount, PayableRoundingAmount, PayableAmount.


XMLport extension objects

Both XMLports can be extended with xmlportextension objects to add new XML elements.

XMLport extensions can only add new elements — they cannot modify values of existing elements. To modify existing element values, use the integration events above.


Coverage summary

XML sectionExtension mechanism
Header: Note, TaxPointDate, AccountingCostPEPPOL Management · OnAfterGetGeneralInfo or CTALSC Helper · OnAfterGetAccountingCostHeader / OnAfterOnBeforeGetMemberInfo
ContractDocumentReferenceCTALSC Helper · OnAfterGetContractDocumentReferenceInfo
AdditionalDocumentReferencePEPPOL Management · OnAfterGetAdditionalDocRefInfo
Supplier partyPEPPOL Management · OnAfterGetAccountingSupplierPartyInfoByFormat / LegalEntityByFormat / Contact
Customer partyPEPPOL Management · OnAfterGetAccountingCustomerPartyInfoByFormat / LegalEntityByFormat / Contact
PaymentMeans (Invoice only)SetDueDate() procedure
TaxTotal / TaxSubtotalPEPPOL Management · OnAfterGetTaxTotalInfo / OnAfterGetTaxSubtotalInfo / OnGetTotalsOnBeforeInsertVATAmtLine
LegalMonetaryTotalPEPPOL Management · OnAfterGetLegalMonetaryInfoWithInvRounding
Line: Note, quantity, AccountingCostPEPPOL Management · OnAfterGetLineGeneralInfo
Line: Item name, descriptionPEPPOL Management · OnAfterGetLineItemInfo
Line: Price, unit codePEPPOL Management · OnAfterGetLinePriceInfo
Additional XML elementsXMLport extension objects